From a88cccc651006c4de2fcedb2e1d35eb5787e879b Mon Sep 17 00:00:00 2001 From: Mayukh-Mandal2005 <135952646+Mayukh-Mandal2005@users.noreply.github.com> Date: Thu, 17 Oct 2024 23:26:31 +0530 Subject: [PATCH 1/2] dark-mode-toggle-button improved --- index.html | 58 +++++++++++++++++++++++++++++++++-- style.css | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 145 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 650f7c40..9eaf75d4 100644 --- a/index.html +++ b/index.html @@ -50,10 +50,45 @@
  • Others
  • Login
  • -
  • + + +
  • + Cart Icon @@ -759,9 +794,28 @@

    Feedback Form

    + - \ No newline at end of file + diff --git a/style.css b/style.css index 8890a47c..ed9f69cf 100644 --- a/style.css +++ b/style.css @@ -46,6 +46,94 @@ html::-webkit-scrollbar-thumb:window-inactive { background: rgb(156, 156, 156); } +/*dark and light mode toggle button*/ +label { + width: 75px; + height: 30px; + position: relative; + display: block; + background: #ebebeb; + border-radius: 30px; + box-shadow: inset 0px 3.75px 11.25px rgba(0, 0, 0, 0.4), inset 0px -3.75px 11.25px rgba(255, 255, 255, 0.4); + cursor: pointer; + transform: 0.3s; + border: 1px solid rgba(0, 0, 0, 0.2); + margin: 0 auto; /* Center align the toggle switch */ +} + +label:after { + content: ""; + width: 27px; + height: 27px; + position: absolute; + top: 1.5px; + left: 2.25px; + background: linear-gradient(180deg, #ffcc89, #d88606); + border-radius: 135px; + box-shadow: 0px 3.75px 7.5px rgba(0, 0, 0, 0.2); + transform: 0.3s; +} + +input { + width: 0; + height: 0; + visibility: hidden; +} + +input:checked+label { + background: #d3d3d3; +} + +input:checked+label:after { + left: 73px; + transform: translateX(-100%); + background: linear-gradient(180deg, #777, #3a3a3a); +} + +label:active:after { + width: 37.5px; +} + +.background { + width: 100vw; + height: 100vh; + background: #fff; + z-index: -1; + position: absolute; + transition: 0.3s; +} + +input:checked+label+.background { + background: #242424; +} + +label svg { + position: absolute; + width: 22.5px; + top: 3.75px; + z-index: 100; +} + +label svg.sun { + left: 3.75px; + fill: #fff; + transition: 0.3s; +} + +label svg.moon { + left: 48.75px; + fill: #7e7e7e; + transition: 0.3s; +} + +input:checked+label svg.sun { + fill: #7e7e7e; +} + +input:checked+label svg.moon { + fill: #fff; +} + .card { width: 50%; /* Set a specific width */ margin: 10px auto; /* Center horizontally with automatic margins */ @@ -137,7 +225,7 @@ html::-webkit-scrollbar-thumb:window-inactive { label { display: block; - margin-bottom: 10px; + margin-bottom: 15px; } input, From 8fdee3a1649d72550f3112de5ee20454be4cbb7d Mon Sep 17 00:00:00 2001 From: Mayukh-Mandal2005 <135952646+Mayukh-Mandal2005@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:26:45 +0530 Subject: [PATCH 2/2] made necessary changes as asked --- index.html | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++---- style.css | 31 +++++++++++--------- 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index 9eaf75d4..f4afcd81 100644 --- a/index.html +++ b/index.html @@ -33,6 +33,19 @@
    + +