From a3b5ec81e60a3185d6426c2b33b5dae2b5866b45 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 25 Dec 2025 18:14:17 +0200 Subject: feat(snow): Improve implementation - Simplify css - Remove erronious semicolumns (which aren't a problem in firefox, but are in chrome) - Fix bad button functionality of no storage property is set --- src/scripts/snow.js | 10 +++++----- src/styles.css | 16 +++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/scripts/snow.js b/src/scripts/snow.js index a7eca9a..54d581b 100644 --- a/src/scripts/snow.js +++ b/src/scripts/snow.js @@ -24,13 +24,13 @@ if (enableSnow) { snowBtn.onclick = function() { snowCont.classList.toggle('noSnow'); - if (localStorage.getItem('snow') !== 'on') { - localStorage.setItem('snow', 'on'); - snowEnabledLabel.innerText = 'Remove'; + if (localStorage.getItem('snow') !== 'off') { + localStorage.setItem('snow', 'off'); + snowEnabledLabel.innerText = 'Add'; } else { - snowEnabledLabel.innerText = 'Add'; - localStorage.setItem('snow', 'off'); + localStorage.setItem('snow', 'on'); + snowEnabledLabel.innerText = 'Remove'; } } } diff --git a/src/styles.css b/src/styles.css index ea758c6..01772ae 100644 --- a/src/styles.css +++ b/src/styles.css @@ -551,15 +551,15 @@ td:empty { height: 1em; } .snowflake { pointer-events: none; - position: fixed; - border: 1px solid white; + + width: 2px; + height: 2px; + background-color: white; box-shadow: 1px 1px 2px black; - width: 0; - height: 0; + top: -3vh; - top: -20vh; animation: 70s linear 0s infinite snowfall, 10s ease-in-out 0s infinite alternate snowsway; @@ -567,13 +567,11 @@ td:empty { height: 1em; } @keyframes snowfall { from { - display: initial; top: -3vh; - }; + } to { - display: initial; top: 101vh; - }; + } } @keyframes snowsway { -- cgit v1.3.1-23-gd82d