Use Dylan's DM logo, switch accent to brand blue, add dark mode
Recreate the DM monogram and wordmark as SVG and type so they stay sharp in both themes, move the accent from violet to the logo's blue, and add a small theme toggle in the nav that follows the system until the visitor picks one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,31 @@
|
||||
var root = document.documentElement;
|
||||
var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
// Theme toggle: remembers the visitor's choice; otherwise follows the system.
|
||||
var themeBtn = document.getElementById('theme-btn');
|
||||
var mq = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;
|
||||
var current = function () { return root.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'; };
|
||||
var paint = function () {
|
||||
if (!themeBtn) return;
|
||||
var dark = current() === 'dark';
|
||||
themeBtn.setAttribute('aria-label', dark ? 'Switch to light mode' : 'Switch to dark mode');
|
||||
themeBtn.setAttribute('aria-pressed', String(dark));
|
||||
};
|
||||
var apply = function (t, save) {
|
||||
root.setAttribute('data-theme', t);
|
||||
if (save) { try { localStorage.setItem('theme', t); } catch (e) {} }
|
||||
paint();
|
||||
};
|
||||
paint();
|
||||
if (themeBtn) themeBtn.addEventListener('click', function () { apply(current() === 'dark' ? 'light' : 'dark', true); });
|
||||
if (mq && mq.addEventListener) {
|
||||
mq.addEventListener('change', function (e) {
|
||||
var saved = null;
|
||||
try { saved = localStorage.getItem('theme'); } catch (err) {}
|
||||
if (!saved) apply(e.matches ? 'dark' : 'light', false);
|
||||
});
|
||||
}
|
||||
|
||||
// Nav border on scroll
|
||||
var nav = document.getElementById('nav');
|
||||
var onScroll = function () { nav && nav.classList.toggle('is-scrolled', window.scrollY > 8); };
|
||||
|
||||
Reference in New Issue
Block a user