diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-12-13 17:03:24 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-12-13 17:03:24 -0800 |
| commit | 93f80150a1d07cf3ce51447636c7f8cd510832f1 (patch) | |
| tree | eaa4c7cf4d40e8a2dc86b2119894d9e0de10d7f3 /static/js | |
| parent | eb14a9b6263a3dd65fc62e1611c6da067a80ca00 (diff) | |
| download | adelie-93f80150a1d07cf3ce51447636c7f8cd510832f1.tar.gz adelie-93f80150a1d07cf3ce51447636c7f8cd510832f1.zip | |
Syntax highlighting and a real repo struct
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/script.js | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/static/js/script.js b/static/js/script.js deleted file mode 100644 index d04c09d..0000000 --- a/static/js/script.js +++ /dev/null @@ -1,76 +0,0 @@ -(() => { - const toggleButton = document.getElementById("theme-toggle"); - const html = document.documentElement; - - const sessionTheme = sessionStorage.getItem("theme"); - const systemPrefersDark = window.matchMedia( - "(prefers-color-scheme: dark)", - ).matches; - - const initialTheme = sessionTheme || (systemPrefersDark ? "dark" : "light"); - - if (initialTheme === "dark") { - html.setAttribute("data-theme", "dark"); - toggleButton.checked = true; - } - - toggleButton.addEventListener("change", () => { - const theme = html.getAttribute("data-theme"); - - if (theme === "dark") { - html.removeAttribute("data-theme"); - sessionStorage.setItem("theme", "light"); - toggleButton.checked = false; - } else { - html.setAttribute("data-theme", "dark"); - sessionStorage.setItem("theme", "dark"); - toggleButton.checked = true; - } - }); -})(); - -(() => { - const colors = [ - "#ff69b4", - "#b19cd9", - "#8b6f47", - "#ff85c0", - "#c4b5fd", - "#d4a574", - ]; - const shapes = ["❀", "✿", "✽", "✾", "✻", "❊", "❋", "✼"]; - - document.addEventListener("mousemove", (e) => { - createParticle(e.clientX, e.clientY); - }); - - const createParticle = (x, y) => { - const particle = document.createElement("div"); - particle.className = "fairy-dust"; - - const shape = shapes[Math.floor(Math.random() * shapes.length)]; - const size = Math.random() * 8 + 6; - const color = colors[Math.floor(Math.random() * colors.length)]; - const offsetX = (Math.random() - 0.5) * 20; - const offsetY = (Math.random() - 0.5) * 20; - const rotation = Math.random() * 360; - - particle.textContent = shape; - particle.style.cssText = ` - position: fixed; - left: ${x + offsetX}px; - top: ${y + offsetY}px; - font-size: ${size}px; - color: ${color}; - opacity: 0.4; - pointer-events: none; - z-index: 9001; /* it's over 9000 */ - line-height: 1; - transform: rotate(${rotation}deg); - animation: fairy-float 0.8s ease-out forwards; - `; - - document.body.appendChild(particle); - setTimeout(() => particle.remove(), 800); - }; -})(); |
