feat: Add inital dark/light mode switching
All checks were successful
Build Docker / Build Image (push) Successful in 2m10s

This commit is contained in:
2025-08-07 00:26:22 +10:00
parent 6ebeb1b5bc
commit 0761d9d707
26 changed files with 2297 additions and 94 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-bs-theme="light" lang="en-au">
<html data-bs-theme="auto" lang="en-au">
<head>
<meta charset="utf-8">
@@ -25,6 +25,87 @@
"url": "https://hns.au"
}
</script>
<script>
(function() {
// JavaScript snippet handling Dark/Light mode switching
const getStoredTheme = () => localStorage.getItem('theme');
const setStoredTheme = theme => localStorage.setItem('theme', theme);
const forcedTheme = document.documentElement.getAttribute('data-bss-forced-theme');
const getPreferredTheme = () => {
if (forcedTheme) return forcedTheme;
const storedTheme = getStoredTheme();
if (storedTheme) {
return storedTheme;
}
const pageTheme = document.documentElement.getAttribute('data-bs-theme');
if (pageTheme) {
return pageTheme;
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark');
} else {
document.documentElement.setAttribute('data-bs-theme', theme);
}
}
setTheme(getPreferredTheme());
const showActiveTheme = (theme, focus = false) => {
const themeSwitchers = [].slice.call(document.querySelectorAll('.theme-switcher'));
if (!themeSwitchers.length) return;
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
element.classList.remove('active');
element.setAttribute('aria-pressed', 'false');
});
for (const themeSwitcher of themeSwitchers) {
const btnToActivate = themeSwitcher.querySelector('[data-bs-theme-value="' + theme + '"]');
if (btnToActivate) {
btnToActivate.classList.add('active');
btnToActivate.setAttribute('aria-pressed', 'true');
}
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme();
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme());
}
});
window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme());
document.querySelectorAll('[data-bs-theme-value]')
.forEach(toggle => {
toggle.addEventListener('click', (e) => {
e.preventDefault();
const theme = toggle.getAttribute('data-bs-theme-value');
setStoredTheme(theme);
setTheme(theme);
showActiveTheme(theme);
})
})
});
})();
</script>
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon-light.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="600x627" href="/assets/img/favicon.png">
@@ -41,14 +122,15 @@
<link rel="stylesheet" href="/assets/css/bss-overrides.css">
<link rel="stylesheet" href="/assets/css/Hero-Features-icons.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css">
<link rel="stylesheet" href="/assets/css/theme.css">
<link rel="stylesheet" href="/assets/css/vanilla-zoom.min.css">
<script async src="https://umami.woodburn.au/script.js" data-website-id="15852010-8d3c-4553-92fc-2d6ac31098e8"></script>
{{handshake_scripts | safe}}
</head>
<body>
<nav class="navbar navbar-expand-lg fixed-top bg-light clean-navbar navbar-light">
<div class="container-fluid"><a class="navbar-brand logo" href="/" style="width: 50%;"><img src="/assets/img/HandshakeAustraliaT.webp" style="margin-right: 10px;height: 50px;"></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<nav class="navbar navbar-expand-lg fixed-top bg-secondary-subtle clean-navbar navbar-light">
<div class="container-fluid"><a class="navbar-brand logo" href="/" style="width: 50%;"><img class="light-only" src="/assets/img/HandshakeAustraliaT.webp" style="margin-right: 10px;height: 50px;"><img class="dark-only" src="/assets/img/HandshakeAustraliaTW.webp" style="margin-right: 10px;height: 50px;"></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link active" href="/" style="color: var(--bs-primary);">Home</a></li>
@@ -56,23 +138,37 @@
<li class="nav-item"><a class="nav-link" href="/links" style="color: var(--bs-primary);">Links</a></li>
<li class="nav-item"><a class="nav-link active" href="/#about" style="color: var(--bs-primary);">About</a></li>
<li class="nav-item"><a class="nav-link" href="https://domains.hns.au" style="color: var(--bs-primary);">Domains</a></li>
<li class="nav-item"><a class="nav-link" href="/pins" style="color: var(--bs-primary);">Pins</a></li>
<li class="nav-item"><a class="nav-link active" href="/#contact" style="color: var(--bs-primary);">Contact</a></li>
</ul>
<div><button class="btn btn-primary btn-sm" type="button" onclick="toggle();"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-sun light-only" style="font-size: 20px;margin: auto;">
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6m0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8M8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0m0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13m8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5M3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8m10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0m-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707M4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"></path>
</svg><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-moon-fill dark-only" style="font-size: 20px;margin: auto;">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278"></path>
</svg></button></div>
</div>
</div>
</nav>
<main class="page landing-page" style="margin-top: 50px;">
<div style="max-width: 800px;margin: auto;"><img src="/assets/img/HandshakeAustraliaT.webp" width="50%" style="max-width: 400px;margin-left: 20px;"></div>
<section class="text-start clean-block clean-hero" style="color: rgba(255,255,255,0.75);background: url(&quot;/assets/img/backgrounds/blocksaug.svg&quot;) center / contain no-repeat;">
<div class="text" style="max-width: 700px;">
<p style="color: black;font-size: 20px;">Welcome to the premier destination for Australians embracing the decentralized web, powered by Handshake. Handshake offers a revolutionary alternative to centralized DNS root authorities, delivering a transparent and equitable root zone. Operated without ownership or control by any single entity, Handshake ensures a truly decentralized internet experience.</p>
</div>
</section>
<div class="light-only" style="margin-bottom: 3em;">
<div style="max-width: 800px;margin: auto;"><img src="/assets/img/HandshakeAustraliaT.webp" width="50%" style="max-width: 400px;margin-left: 20px;"></div>
<section class="text-start clean-block clean-hero">
<div class="text" style="max-width: 700px;">
<p style="color: black;font-size: 20px;">Welcome to the premier destination for Australians embracing the decentralized web, powered by Handshake. Handshake offers a revolutionary alternative to centralized DNS root authorities, delivering a transparent and equitable root zone. Operated without ownership or control by any single entity, Handshake ensures a truly decentralized internet experience.</p>
</div>
</section>
</div>
<div class="dark-only" style="margin-bottom: 3em;">
<div style="max-width: 800px;margin: auto;"><img src="/assets/img/HandshakeAustraliaTW.webp" width="50%" style="max-width: 400px;margin-left: 20px;"></div>
<section class="text-start clean-block clean-hero" style="background: url(&quot;/assets/img/backgrounds/blocksaugw.svg&quot;) center / contain no-repeat;color: rgba(0,0,0,0);">
<div class="text" style="max-width: 700px;">
<p style="font-size: 20px;">Welcome to the premier destination for Australians embracing the decentralized web, powered by Handshake. Handshake offers a revolutionary alternative to centralized DNS root authorities, delivering a transparent and equitable root zone. Operated without ownership or control by any single entity, Handshake ensures a truly decentralized internet experience.</p>
</div>
</section>
</div>
<section class="clean-block clean-info dark">
<div class="container">
<div class="block-heading">
<h2 class="text-info">Info</h2>
<h2 class="text-primary">Info</h2>
<p style="max-width: 600px;">Handshake is a naming protocol designed to integrate seamlessly with the existing DNS system. Rather than replacing DNS, it decentralizes the root zone file, which stores TLD ownership data, by utilizing a distributed, blockchain-based system that operates without centralized control and is accessible to all. This creates a root zone that is uncensorable, permissionless, and independent of gatekeepers like ICANN. Additionally, Handshake offers a cost-effective alternative to other blockchain domain systems, as it operates without profit-driven entities.</p>
</div>
<div class="row align-items-center">
@@ -88,11 +184,11 @@
<section id="about" class="clean-block about-us">
<div class="container">
<div class="block-heading">
<h2 class="text-info">Directors of Handshake Australia</h2>
<h2 class="text-primary">Directors of Handshake Australia</h2>
</div>
<div class="row justify-content-center">
<div class="col-sm-6 col-lg-4">
<div class="card text-center clean-card" style="background: transparent;"><img class="card-img-top w-100 d-block" src="/assets/img/avatars/nathan.woodburn.jpg">
<div class="card text-center clean-card"><img class="card-img-top w-100 d-block" src="/assets/img/avatars/nathan.woodburn.jpg">
<div class="card-body info" style="height: min-content;">
<h4 class="card-title">Nathan Woodburn</h4>
<h6 class="card-title">Nathan.Woodburn/</h6>
@@ -112,7 +208,7 @@
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="card text-center clean-card" style="background: transparent;"><img class="card-img-top w-100 d-block" src="/assets/img/avatars/timaxal.jpg">
<div class="card text-center clean-card"><img class="card-img-top w-100 d-block" src="/assets/img/avatars/timaxal.jpg">
<div class="card-body info" style="height: min-content;">
<h4 class="card-title">Tim Maskall</h4>
<h6 class="card-title">tiMaxal/</h6>
@@ -123,11 +219,11 @@
</div>
</div>
<div id="contact" class="block-heading">
<h2 class="text-info">Contact Us</h2>
<h2 class="text-primary">Contact Us</h2>
<div class="social-icons" style="font-size: 50px;"><a href="mailto:hns@hns.au" target="_blank" style="padding-right: 10px;padding-left: 10px;"><i class="icon ion-email" style="font-size: 50px;"></i></a><a href="https://discord.gg/WJ6vpjuQv5" target="_blank" style="padding-right: 10px;padding-left: 10px;"><i class="fab fa-discord" style="font-size: 50px;"></i></a></div>
</div>
<div class="text-center block-heading">
<h2 class="text-info">Support Us</h2><span style="font-size: 20px;">You can support us by donating HNS to&nbsp;</span><code style="font-size: 20px;"><br>hs1qjdsz8u2ftm93jmczq8x36zqmfh3pqagq0hkkaf</code><span style="font-size: 20px;"><br>Or by using our alias</span><code style="font-size: 20px;"><br>@donate.hnsau<br><br></code><span style="font-size: 20px;">You can also support us by buying an SLD from&nbsp;<a href="https://domains.hnsau" target="_blank">https://domains.hns.au</a></span>
<h2 class="text-primary">Support Us</h2><span style="font-size: 20px;">You can support us by donating HNS to&nbsp;</span><code style="font-size: 20px;"><br>hs1qjdsz8u2ftm93jmczq8x36zqmfh3pqagq0hkkaf</code><span style="font-size: 20px;"><br>Or by using our alias</span><code style="font-size: 20px;"><br>@donate.hnsau<br><br></code><span style="font-size: 20px;">You can also support us by buying an SLD from&nbsp;<a href="https://domains.hnsau" target="_blank">https://domains.hns.au</a></span>
</div>
</div>
</section>