From 2a7a895e1105775d69f381a8c0b8985e252ee9cd Mon Sep 17 00:00:00 2001 From: ehab-hassan Date: Sun, 19 Jan 2025 14:48:34 +0200 Subject: [PATCH] update dark --- content/footer/_index.md | 2 +- css/index.css | 12 +++++++-- static/js/custom.js | 44 +++++++++++++++++++------------ templates/partials/header.html | 27 ++++++++++++++----- templates/partials/home/hero.html | 2 +- 5 files changed, 59 insertions(+), 28 deletions(-) diff --git a/content/footer/_index.md b/content/footer/_index.md index 5712cbc2a..1d46061db 100644 --- a/content/footer/_index.md +++ b/content/footer/_index.md @@ -4,7 +4,7 @@ description: "" insert_anchor_links: "left" template: "partials/footer.html" extra: - logoPath: "images/new_logo_tft.png" + logoPath: "images/new_logo_tft_light.png" socialLinks: { Twitter: "https://twitter.com/threefold_io", Telegram: "https://t.me/threefoldnews", Github: "https://github.com/threefoldfoundation", Github2: "https://github.com/threefoldtech"} --- diff --git a/css/index.css b/css/index.css index f6442d24a..3ac2d4596 100644 --- a/css/index.css +++ b/css/index.css @@ -18,12 +18,20 @@ body { color: #000000; } +body .semigray { + color: #424242 !important; +} + /* Dark Mode */ body.dark-mode { background-color: #121212; color: #ffffff; } +body.dark-mode .semigray { + color: #bbbbbb !important; +} + .dashboard:hover { @@ -109,10 +117,10 @@ img[src*="#absolute"] { top: 0; } -a img:hover{ +/* a img:hover{ opacity: 0.5 !important; cursor: pointer; -} +} */ /* new theme */ diff --git a/static/js/custom.js b/static/js/custom.js index 40627ccb9..481a7d2b7 100644 --- a/static/js/custom.js +++ b/static/js/custom.js @@ -194,26 +194,36 @@ document.getElementById("year").innerHTML = new Date().getFullYear(); -// Get the toggle switch -const toggleSwitch = document.getElementById('darkModeSwitch'); - -// Apply the saved theme on load document.addEventListener('DOMContentLoaded', () => { + const toggleSwitch = document.getElementById('darkModeSwitch'); + const logo = document.getElementById('logo'); + + // Log the current state for debugging + console.log('Light logo:', logo.getAttribute('data-light-logo')); + console.log('Dark logo:', logo.getAttribute('data-dark-logo')); + const savedTheme = localStorage.getItem('theme'); if (savedTheme === 'dark') { - document.body.classList.add('dark-mode'); - toggleSwitch.checked = true; - } -}); - -// Toggle dark mode -toggleSwitch.addEventListener('change', () => { - if (toggleSwitch.checked) { - document.body.classList.add('dark-mode'); - localStorage.setItem('theme', 'dark'); + document.body.classList.add('dark-mode'); + toggleSwitch.checked = true; + logo.src = logo.getAttribute('data-dark-logo'); + console.log('Loaded dark mode with dark logo.'); } else { - document.body.classList.remove('dark-mode'); - localStorage.setItem('theme', 'light'); + logo.src = logo.getAttribute('data-light-logo'); + console.log('Loaded light mode with light logo.'); } -}); + toggleSwitch.addEventListener('change', () => { + if (toggleSwitch.checked) { + document.body.classList.add('dark-mode'); + localStorage.setItem('theme', 'dark'); + logo.src = logo.getAttribute('data-dark-logo'); + console.log('Switched to dark mode. Updated logo to dark.'); + } else { + document.body.classList.remove('dark-mode'); + localStorage.setItem('theme', 'light'); + logo.src = logo.getAttribute('data-light-logo'); + console.log('Switched to light mode. Updated logo to light.'); + } + }); +}); diff --git a/templates/partials/header.html b/templates/partials/header.html index 039df8676..2dced2bcf 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -5,11 +5,23 @@
-
- - ThreeFold Logo - -
+ + + + + + + + +
+ + Join the Web4 Revolution
diff --git a/templates/partials/home/hero.html b/templates/partials/home/hero.html index 7d3ae31e5..c18767bda 100644 --- a/templates/partials/home/hero.html +++ b/templates/partials/home/hero.html @@ -2,7 +2,7 @@

We are Building
a New Internet

-

A system built to scale to a planetary level, compatible with AI, Cloud, Web2, and Web3. Capable to provide 100% uptime, it enables any machine and human to communicate over the shortest path.

+

A system built to scale to a planetary level, compatible with AI, Cloud, Web2, and Web3. Capable to provide 100% uptime, it enables any machine and human to communicate over the shortest path.

That's ThreeFold's


Web4