Add dark theme and secret key creation script

This commit is contained in:
2026-09-18 23:03:05 +03:00
parent d1d594674f
commit d048ef82b7
8 changed files with 252 additions and 10 deletions
+15
View File
@@ -9,6 +9,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/site.css') }}">
<script>(function(){var t=localStorage.getItem('ep-theme');if(t==='dark'){document.documentElement.setAttribute('data-theme','dark');}})();</script>
</head>
<body>
<header class="site-header">
@@ -30,6 +31,7 @@
<a href="{{ url_for('login') }}">Sign in</a>
<a class="button compact" href="{{ url_for('register') }}">Create account</a>
{% endif %}
<button type="button" class="theme-toggle" id="theme-toggle" aria-label="Toggle dark theme">WASTELAND</button>
</nav>
</header>
@@ -47,5 +49,18 @@
<span>CODE / CIRCUITS / CONTINUITY</span>
<span>HELSINKI, FI</span>
</footer>
<script>
(function(){
var root=document.documentElement,btn=document.getElementById('theme-toggle');
function label(){btn.textContent=root.getAttribute('data-theme')==='dark'?'DAYLIGHT':'WASTELAND';}
label();
btn.addEventListener('click', function(){
var dark=root.getAttribute('data-theme')==='dark';
if (dark) { root.removeAttribute('data-theme'); localStorage.setItem('ep-theme','light'); }
else { root.setAttribute('data-theme','dark'); localStorage.setItem('ep-theme','dark'); }
label();
});
})();
</script>
</body>
</html>