Add dark theme and secret key creation script
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user