summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-12-25 07:35:00 +0100
committerVolpeon <git@volpeon.ink>2021-12-25 07:35:00 +0100
commitb059ff5d4f73158dbcd955567a63f825fcdef01a (patch)
tree6e0c0e0d35ca407f78fe80a5a93dc72a4983e381
parentMake snow click-through (diff)
downloadvolpeon.ink-b059ff5d4f73158dbcd955567a63f825fcdef01a.tar.gz
volpeon.ink-b059ff5d4f73158dbcd955567a63f825fcdef01a.tar.bz2
volpeon.ink-b059ff5d4f73158dbcd955567a63f825fcdef01a.zip
Reduced snowfall on smaller viewports
-rw-r--r--content/script.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/content/script.js b/content/script.js
index 7143b25..df5a9c0 100644
--- a/content/script.js
+++ b/content/script.js
@@ -1,4 +1,14 @@
1let i = 0;
2
1function createSnowFlake() { 3function createSnowFlake() {
4 const threshold = -10 * Math.log10(window.innerWidth / 1000);
5
6 if (++i < threshold) {
7 return;
8 }
9
10 i = 0;
11
2 const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 12 const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3 const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use"); 13 const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use");
4 14