From 8abd4748bb0eaeda82a58d0264bf22f6ff68da3b Mon Sep 17 00:00:00 2001 From: Varsani2520 Date: Thu, 1 Aug 2024 10:44:06 +0530 Subject: [PATCH 1/4] theme added --- Css-files/content.css | 64 ++++++++++++++++++++++++++++++++++------- Css-files/navbar.css | 16 ++++++----- Css-files/offers.css | 52 +++++++++++++++++++++++++++++---- Html-files/contact.html | 1 + Html-files/menu.html | 7 +++-- Html-files/offers.html | 2 ++ index.html | 3 +- script.js | 26 +++++++++++++++++ 8 files changed, 144 insertions(+), 27 deletions(-) diff --git a/Css-files/content.css b/Css-files/content.css index 041be70e..ba3ed02a 100644 --- a/Css-files/content.css +++ b/Css-files/content.css @@ -2,11 +2,53 @@ margin: 0px; padding: 0px; } - -body { - background-color: black; +:root { + --background-color: white; + --text-color: black; + --primary-color: rgb(204, 12, 12); + --secondary-color: rgb(177, 0, 0); + --tertiary-color: orangered; + --container-bg: rgb(224, 224, 252); + --filter-bg: transparent; + --contact-bg: rgb(208, 50, 50); + --button-bg: #ec0f25e3; + --button-hover-bg: rgba(208, 50, 50, 0.9); + --card-border: rgb(186, 186, 201); + --card-shadow: rgba(224, 224, 252, 0.678); + --link-color: rgb(177, 0, 0); + --pagination-bg: white; + --pagination-active-bg: rgb(177, 0, 0); + --pagination-btn-color: rgb(177, 0, 0); + --pagination-prev-next-bg: rgb(204, 12, 12); + --filter-text-color: black; + --filter-border-color: #dc3545; +} + +.dark-theme { + --background-color: black; + --text-color: white; + --primary-color: rgb(204, 12, 12); + --secondary-color: rgb(177, 0, 0); + --tertiary-color: orangered; + --container-bg: rgb(35, 35, 35); + --filter-bg: rgba(0, 0, 0, 0.6); + --contact-bg: rgb(208, 50, 50); + --button-bg: #ec0f25e3; + --button-hover-bg: rgba(208, 50, 50, 0.9); + --card-border: rgb(100, 100, 100); + --card-shadow: rgba(0, 0, 0, 0.5); + --link-color: rgb(177, 0, 0); + --pagination-bg: #2e2e2e; + --pagination-active-bg: rgb(177, 0, 0); + --pagination-btn-color: rgb(177, 0, 0); + --pagination-prev-next-bg: rgb(204, 12, 12); + --filter-text-color: white; + --filter-border-color: #dc3545; +} +/* body { + background-color: var(--background-color); overflow-x: hidden; -} +} */ /* MENU + LOGIN + SIGNUP + CONTACT PAGE */ .head_container { @@ -42,7 +84,7 @@ body { /* MENU PAGE SPECIFICS */ .menu-container { padding: 55px 10px 30px 10px; - background-color: rgb(224, 224, 252); + background-color: var(--background-color) } .menu-container .container-fluid { @@ -77,7 +119,7 @@ body { .menu-container .nav-pills .nav-link.active { background-color: rgb(204, 12, 12); - color: white; + /* color: white; */ } .menu-items .row { @@ -287,7 +329,7 @@ body { .contact-wrapper .text{ font-size: 1rem; line-height: 1.5; - color: #080808; + color: var(--text-color); margin-bottom: 2rem; } @@ -322,7 +364,7 @@ body { align-items: center; /* Center items vertically */ margin-bottom: 20px; padding: 15px; - background-color: #fff; + background-color: var(--background-color); border-radius: 20px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); transition: transform 0.4s, box-shadow 0.4s, background-color 0.4s; @@ -421,7 +463,7 @@ body { } */ .contact-form-wrapper { - background-color: white; + background-color:var(--container-bg); padding: 30px 0; } @@ -668,7 +710,9 @@ body { .testimonal__container { display: flex; } - +.nav-link { + color:var(--a) +} .testimonal__card { text-align: center; padding: 2rem 3rem 2.5rem; diff --git a/Css-files/navbar.css b/Css-files/navbar.css index 945ca29c..6156be3f 100644 --- a/Css-files/navbar.css +++ b/Css-files/navbar.css @@ -21,7 +21,7 @@ /* Additional Colors */ --container-bg: black; --drop-bg: #212123; - --a: white; + --a: black; --nav: black; --invert: invert(1); } @@ -52,15 +52,14 @@ /* Additional Colors */ --container-bg: rgb(224, 224, 252); --drop-bg: #ffffff; - --a: black; --nav: white; --invert: invert(0); } /* Navbar */ .navbar { - --bs-navbar-color: var(--a); - background-color: var(--nav); + /* --bs-navbar-color: var(--a); */ + background-color: var(--background-color); gap: 10px; } @@ -83,7 +82,7 @@ /* Navbar Links */ .nav-link { - transition: color 0.3s, background-color 0.3s; + color:var(--a) } .nav-link:hover { @@ -102,6 +101,8 @@ ul { display: flex; justify-content: center; align-items: center; + color:var(--a) + } @@ -140,6 +141,7 @@ ul { #theme-toggle-icon { width: 30px; cursor: pointer; + color:var(--drop-bg) } .center-links .nav-item .dropdown-menu { @@ -165,7 +167,7 @@ ul { background-color: #dc3545; } -:root { +/* :root { --background-color: #fff; --text-color: #000; --button-bg: #D0EEB0; @@ -177,7 +179,7 @@ ul { body { background-color: var(--background-color); color: var(--text-color); -} +} */ .section { background-color: var(--background-color); diff --git a/Css-files/offers.css b/Css-files/offers.css index e526f01a..458e8203 100644 --- a/Css-files/offers.css +++ b/Css-files/offers.css @@ -43,7 +43,49 @@ ol { --primary-font: 'Roboto', sans-serif; --secondry-font: 'Quicksand', sans-serif; } - +:root { + --background-color: white; + --text-color: black; + --primary-color: rgb(204, 12, 12); + --secondary-color: rgb(177, 0, 0); + --tertiary-color: orangered; + --container-bg: rgb(224, 224, 252); + --filter-bg: transparent; + --contact-bg: rgb(208, 50, 50); + --button-bg: #ec0f25e3; + --button-hover-bg: rgba(208, 50, 50, 0.9); + --card-border: rgb(186, 186, 201); + --card-shadow: rgba(224, 224, 252, 0.678); + --link-color: rgb(177, 0, 0); + --pagination-bg: white; + --pagination-active-bg: rgb(177, 0, 0); + --pagination-btn-color: rgb(177, 0, 0); + --pagination-prev-next-bg: rgb(204, 12, 12); + --filter-text-color: black; + --filter-border-color: #dc3545; +} + +.dark-theme { + --background-color: black; + --text-color: white; + --primary-color: rgb(204, 12, 12); + --secondary-color: rgb(177, 0, 0); + --tertiary-color: orangered; + --container-bg: rgb(35, 35, 35); + --filter-bg: rgba(0, 0, 0, 0.6); + --contact-bg: rgb(208, 50, 50); + --button-bg: #ec0f25e3; + --button-hover-bg: rgba(208, 50, 50, 0.9); + --card-border: rgb(100, 100, 100); + --card-shadow: rgba(0, 0, 0, 0.5); + --link-color: rgb(177, 0, 0); + --pagination-bg: #2e2e2e; + --pagination-active-bg: rgb(177, 0, 0); + --pagination-btn-color: rgb(177, 0, 0); + --pagination-prev-next-bg: rgb(204, 12, 12); + --filter-text-color: white; + --filter-border-color: #dc3545; +} html { scroll-behavior: smooth; } @@ -137,7 +179,7 @@ h5 { p { font-size: 1rem; - color: var(--text-color); + color: var(--bs-heading-color); font-weight: 400; line-height: 1.75rem; letter-spacing: 1px; @@ -430,11 +472,11 @@ nav { ========================================== */ .testimonial-section { - background: lavender; + background: var(--background-color); } .testimonial-section h2 { - color: red; + color:var(--bs-heading-color); } .testimonial-section .carousel-item { @@ -484,7 +526,7 @@ button.prev, button.next { top: 50%; margin: 20px; transform: translateY(-50%); - background-color: brown; + background-color: var(--pagination-btn-color); color: white; border: 1px white solid; padding: 10px; diff --git a/Html-files/contact.html b/Html-files/contact.html index 6f52b3c7..e1873a30 100644 --- a/Html-files/contact.html +++ b/Html-files/contact.html @@ -41,6 +41,7 @@ + From 7c91fdc20de9b355556fe7435ed6aaf4d75b5c15 Mon Sep 17 00:00:00 2001 From: VijaySamant4368 Date: Sun, 4 Aug 2024 20:07:41 +0530 Subject: [PATCH 4/4] Changed button --- Css-files/mode-toggler.css | 89 ++++++++++++++++++++++++++++++++++++++ Html-files/navbar.js | 13 +----- Images/moon.svg | 17 ++++++++ Images/sun.svg | 23 ++++++++++ index.html | 19 +++++--- 5 files changed, 144 insertions(+), 17 deletions(-) create mode 100644 Css-files/mode-toggler.css create mode 100644 Images/moon.svg create mode 100644 Images/sun.svg diff --git a/Css-files/mode-toggler.css b/Css-files/mode-toggler.css new file mode 100644 index 00000000..24ba661f --- /dev/null +++ b/Css-files/mode-toggler.css @@ -0,0 +1,89 @@ +.toggle-container { + transform: translate(-50%, -50%); + display: flex; + align-items: center; + justify-content: center; + right: -4px; + top: 15px; + /* position: fixed; */ + top: 40px; + right: 20%; + z-index: 100; + display: flex; + align-items: center; + border: none; + background-color: transparent; + width: 40px; + height: 20px; + margin-top: 10px; +} + + +/* Hidden Checkbox */ +.switch-checkbox { + display: none; +} + +.theme-switch { + position: relative; + width: 45px; + height: 30px; + background-color: #ccc; + border-radius: 20px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + padding: 0 5px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + transition: background-color 0.5s ease; +} + +.theme-switch .light-mode-icon, +.theme-switch .dark-mode-icon { + font-size: 19px; + position: absolute; + cursor: pointer; + top: 50%; + transform: translateY(-50%); + transition: opacity 0.5s ease, color 0.5s ease; +} + +.theme-switch .light-mode-icon { + color: #f39c12; +} + +.theme-switch .dark-mode-icon { + color: #bdc3c7; + opacity: 0; +} + +.toggle-button { + position: absolute; + top: 3px; + left: 3px; + width: 25px; + height: 25px; + background-color: #fff; + border-radius: 50%; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); + transition: transform 0.5s ease, background-color 0.5s ease; +} + +/* Checkbox Checked State */ +.switch-checkbox:checked + .theme-switch { + background-color: #34495e; +} + +.switch-checkbox:checked + .theme-switch .light-mode-icon { + opacity: 0; +} + +.switch-checkbox:checked + .theme-switch .dark-mode-icon { + opacity: 1; +} + +.switch-checkbox:checked + .theme-switch .toggle-button { + transform: translateX(13px); + /* background-color: #34495e; */ +} diff --git a/Html-files/navbar.js b/Html-files/navbar.js index 745bc203..3d02f678 100644 --- a/Html-files/navbar.js +++ b/Html-files/navbar.js @@ -1,17 +1,8 @@ //Themechange icon toggling behaviour -let themeToggleIcon = document.getElementById("theme-toggle-icon"); -let themeToggleLogo = document.getElementById("theme-toggle-logo"); -themeToggleIcon.addEventListener("click", function () { +function toggleTheme() { document.body.classList.toggle("dark-theme"); document.body.classList.toggle(":root") - if (document.body.classList.contains("dark-theme")) { - themeToggleIcon.src = "../Images/navbar/sun.png"; - themeToggleLogo.src = "Images/logo/Logo-Dark.png"; - } else { - themeToggleIcon.src = "../Images/navbar/moon.png"; - themeToggleLogo.src="Images/logo/Logo-Light.png"; - } -}); +} //Services dropdown diff --git a/Images/moon.svg b/Images/moon.svg new file mode 100644 index 00000000..27b75366 --- /dev/null +++ b/Images/moon.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/Images/sun.svg b/Images/sun.svg new file mode 100644 index 00000000..8619f787 --- /dev/null +++ b/Images/sun.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index b1637f61..66ee29f3 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,7 @@ + @@ -164,12 +165,18 @@ -
- - theme toggler button - -
- + + +
+ + +
+