(() => { function createSnowFlake() { setTimeout(() => createSnowFlake(), 50 / Math.log10(window.innerWidth / 1000 + 1)); if (document.hidden) { return; } const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg"); const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use"); const aniDuration = (Math.random() * 3 + 2) * 1000; snowFlakeInner.setAttribute("href", "/icons.svg#asterisk"); snowFlake.classList.add("o-icon", "o-icon--snow"); snowFlake.setAttribute("aria-hidden", "true"); snowFlake.style.fontSize = Math.random() * 0.5 + 0.7 + 'em'; snowFlake.style.left = Math.random() * 100 + '%'; snowFlake.style.animationDuration = aniDuration + 'ms'; snowFlake.style.opacity = Math.random(); setTimeout(() => snowFlake.remove(), aniDuration); snowFlake.appendChild(snowFlakeInner); document.body.appendChild(snowFlake); } createSnowFlake(); })();