From f952e90363f26c2a722e199b2f6bc720604af847 Mon Sep 17 00:00:00 2001 From: Pranav Date: Sun, 29 Sep 2024 15:33:29 -0400 Subject: [PATCH 1/4] light-dark-theme --- backend/static/css/app.css | 97 +++++++++++++++++++++++++ backend/static/img/light-bulb-2-16.png | Bin 0 -> 374 bytes backend/static/img/moon-4-16.png | Bin 0 -> 295 bytes backend/templates/base.html | 66 +++++++++++++++-- 4 files changed, 156 insertions(+), 7 deletions(-) create mode 100644 backend/static/css/app.css create mode 100644 backend/static/img/light-bulb-2-16.png create mode 100644 backend/static/img/moon-4-16.png diff --git a/backend/static/css/app.css b/backend/static/css/app.css new file mode 100644 index 0000000..d248f8f --- /dev/null +++ b/backend/static/css/app.css @@ -0,0 +1,97 @@ +.page { + background-color: #f4f6fc; +} + +.page-dark { + background-color: #000000de; +} + +.page-dark .card { + background-color: #00000005; + color: white; + border-color: white; +} + +.page-dark [data-bs-toggle="tooltip"] { + color: white; + border: none !important; +} + +.switch { + position: relative; + display: inline-block; + width: 30px; + height: 19px; + margin-right: 3px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 15px; + width: 15px; + left: 2px; + bottom: 2px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked + .slider { + background-color: black; +} + +input:focus + .slider { + box-shadow: 0 0 1px black; +} + +input:checked + .slider:before { + -webkit-transform: translateX(10px); + -ms-transform: translateX(10px); + transform: translateX(10px); +} + +/* Rounded sliders */ +.slider.round { + border-radius: 15px; +} + +.slider.round:before { + border-radius: 50%; +} + +.toggle-btn { + margin-right: 10px; + width: 90px; +} + +.toggle-btn img { + vertical-align: baseline; + height: 20px; +} + + + + + + + + diff --git a/backend/static/img/light-bulb-2-16.png b/backend/static/img/light-bulb-2-16.png new file mode 100644 index 0000000000000000000000000000000000000000..6bd48a6845203d0f25bfef2f4950959350f7d169 GIT binary patch literal 374 zcmV-+0g3*JP)*(SY z-*`tGb6CbjN**XFkYNlX$?Iq6;0>QCc`)&J<5GrgtfGlKEJZ8}&Q4he<56%6x0uEW zuH)4vHgSM2JQp?SU?SR|!X93NEVP)$6CSEG*uW)ju#(K1;W)Zj!jU9V)MO^QsN*Bz zz3=5Uw7nlzk65EfE?XpW zvDWYy=iV6iMPgCJ9v(63cf`@M%ly?K#kqV>YB;ST{a4_+!tX=X2;|GuP5e^)01CS~ Uo=8iWb^rhX07*qoM6N<$g1i)-%>V!Z literal 0 HcmV?d00001 diff --git a/backend/static/img/moon-4-16.png b/backend/static/img/moon-4-16.png new file mode 100644 index 0000000000000000000000000000000000000000..e83915b97f72e933415bbab132c266828be07a9d GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAQ1GUw zi(`mI@7zo4y_y4Mj(y~RFT)eob10#QwLRht+hGF^v-|@|8@m$CH#{-zn4VxF!Q*zY z^&#t?gBuKZjCk5MZzx~z_;2~Q=3u^>{rjI6%xn99`4BJP2fd=I8A=ay#O^uII>_k0 zv1z$|!GS`anoW%CF;`oKW1iiae_Z9q3C|DRe|I&lmvKD6UG|D2jkT$vdUg7=bJ?8= z4q;+w3~HKQn{|j2LZkxYpaQKV?!|u8b|vlMJ4&elF{r5}E*T=Xg2* literal 0 HcmV?d00001 diff --git a/backend/templates/base.html b/backend/templates/base.html index 316be10..d6259cb 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -11,6 +11,7 @@ + - + {% block extra_css %}{% endblock extra_css %} - {% block content %} +
+
+ +
- {% endblock content %} + + {% block content %} {% endblock content %} + + {% block extra_js %}{% endblock extra_js %} From 27a246957276100b42931d821a722a9bd9d1d1dc Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 1 Oct 2024 23:00:42 -0400 Subject: [PATCH 2/4] fix pre-commit issues --- backend/static/css/app.css | 8 ---- backend/templates/base.html | 95 +++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/backend/static/css/app.css b/backend/static/css/app.css index d248f8f..f130de3 100644 --- a/backend/static/css/app.css +++ b/backend/static/css/app.css @@ -87,11 +87,3 @@ input:checked + .slider:before { vertical-align: baseline; height: 20px; } - - - - - - - - diff --git a/backend/templates/base.html b/backend/templates/base.html index d6259cb..31972bc 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -11,7 +11,7 @@ - + - {% block extra_css %}{% endblock extra_css %} + {% block extra_css %} + {% endblock extra_css %} -
+
-
- {% block content %} {% endblock content %} - - {% block extra_js %}{% endblock extra_js %} + themeToggleApp.mount('#theme-toggle-app') + + {% block extra_js %} + {% endblock extra_js %} From 3a0e50145568dbb8ee85a2c0e94c96fd05a3b482 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 2 Oct 2024 00:08:17 -0400 Subject: [PATCH 3/4] Revert "fix pre-commit issues" This reverts commit 27a246957276100b42931d821a722a9bd9d1d1dc. --- backend/static/css/app.css | 8 ++++ backend/templates/base.html | 95 ++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/backend/static/css/app.css b/backend/static/css/app.css index f130de3..d248f8f 100644 --- a/backend/static/css/app.css +++ b/backend/static/css/app.css @@ -87,3 +87,11 @@ input:checked + .slider:before { vertical-align: baseline; height: 20px; } + + + + + + + + diff --git a/backend/templates/base.html b/backend/templates/base.html index 31972bc..d6259cb 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -11,7 +11,7 @@ - + - {% block extra_css %} - {% endblock extra_css %} + {% block extra_css %}{% endblock extra_css %} -
+
-
- {% block content %} - {% endblock content %} - - {% block extra_js %} - {% endblock extra_js %} + themeToggleApp.mount('#theme-toggle-app') + + {% block extra_js %}{% endblock extra_js %} From 671b093f1ccf1821a41d5f730ea7c6a6a7a01cc5 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 2 Oct 2024 13:14:34 -0400 Subject: [PATCH 4/4] Fixed the pre-commit issues got Pass on all checks in pre-commit --- backend/static/css/app.css | 8 ---- backend/templates/base.html | 95 +++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/backend/static/css/app.css b/backend/static/css/app.css index d248f8f..f130de3 100644 --- a/backend/static/css/app.css +++ b/backend/static/css/app.css @@ -87,11 +87,3 @@ input:checked + .slider:before { vertical-align: baseline; height: 20px; } - - - - - - - - diff --git a/backend/templates/base.html b/backend/templates/base.html index d6259cb..31972bc 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -11,7 +11,7 @@ - + - {% block extra_css %}{% endblock extra_css %} + {% block extra_css %} + {% endblock extra_css %} -
+
-
- {% block content %} {% endblock content %} - - {% block extra_js %}{% endblock extra_js %} + themeToggleApp.mount('#theme-toggle-app') + + {% block extra_js %} + {% endblock extra_js %}