diff --git a/build.sh b/build.sh index 8f7469227..2910b187c 100755 --- a/build.sh +++ b/build.sh @@ -26,7 +26,7 @@ elif [[ "$(uname -m)" == "arm64"* ]]; then ASSET="$ASSET-arm64" fi -curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/${ASSET}" +curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/${ASSET}" chmod +x $ASSET mv $ASSET tailwindcss diff --git a/css/index.css b/css/index.css index 28b64ec2f..e84ee21b9 100644 --- a/css/index.css +++ b/css/index.css @@ -55,6 +55,10 @@ body.light-mode .icon { background-color: rgb(100 100 100 / 0.2); } + + + + .dashboard:hover { background: #74ddc3 !important; diff --git a/static/js/custom.js b/static/js/custom.js index 9bc222791..8461b1623 100644 --- a/static/js/custom.js +++ b/static/js/custom.js @@ -214,7 +214,9 @@ document.addEventListener('DOMContentLoaded', () => { // Toggle light mode toggleSwitch.addEventListener('change', () => { + console.log('Hellon'); if (toggleSwitch.checked) { + document.body.classList.add('light-mode'); localStorage.setItem('theme', 'light'); siteLogo.src = siteLogo.getAttribute('data-dark'); // Switch to light mode logo diff --git a/templates/partials/header.html b/templates/partials/header.html index 8c61602d8..2024d0c27 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -5,24 +5,24 @@
- {# - - #} + data-dark="{{ get_url(path=section.extra.logoPathDark) }}" + src="{{ get_url(path=section.extra.logoPathLight) }}" + alt="ThreeFold Logo" /> + {# + + #}
@@ -244,4 +248,68 @@ color: #c7c7c7 !important; } + +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 34px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + transition: .4s; + border-radius: 34px; +} + +.slider:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + border-radius: 50%; + transition: .4s; +} + +input:checked + .slider { + background-color: #2196F3; +} + +input:checked + .slider:before { + transform: translateX(26px); +} + +/* Icons */ +#lightIcon, #darkIcon { + position: absolute; + top: 50%; + transform: translateY(-50%); + font-size: 16px; + color: white; +} + +#lightIcon { + left: 10px; + display: none; /* Hide by default */ +} + +#darkIcon { + right: 10px; +} + \ No newline at end of file