diff options
Diffstat (limited to 'content/script.js')
| -rw-r--r-- | content/script.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/content/script.js b/content/script.js deleted file mode 100644 index fd275b6..0000000 --- a/content/script.js +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | function createSnowFlake() { | ||
| 2 | setTimeout(() => createSnowFlake(), 50 / Math.log10(window.innerWidth / 1000 + 1)); | ||
| 3 | |||
| 4 | if (document.hidden) { | ||
| 5 | return; | ||
| 6 | } | ||
| 7 | |||
| 8 | const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | ||
| 9 | const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use"); | ||
| 10 | const aniDuration = (Math.random() * 3 + 2) * 1000; | ||
| 11 | |||
| 12 | snowFlakeInner.setAttribute("href", "/symbols.svg#icon-asterisk"); | ||
| 13 | |||
| 14 | snowFlake.classList.add("o-icon", "o-icon--snow"); | ||
| 15 | snowFlake.setAttribute("aria-hidden", "true"); | ||
| 16 | |||
| 17 | snowFlake.style.fontSize = Math.random() * 0.5 + 0.7 + 'em'; | ||
| 18 | snowFlake.style.left = Math.random() * 100 + '%'; | ||
| 19 | snowFlake.style.animationDuration = aniDuration + 'ms'; | ||
| 20 | snowFlake.style.opacity = Math.random(); | ||
| 21 | |||
| 22 | setTimeout(() => snowFlake.remove(), aniDuration); | ||
| 23 | |||
| 24 | snowFlake.appendChild(snowFlakeInner); | ||
| 25 | document.body.appendChild(snowFlake); | ||
| 26 | } | ||
| 27 | |||
| 28 | createSnowFlake(); | ||
