blob: 7143b259cfc6d1ed80b38a192c61dc92d10b05a1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
function createSnowFlake() {
const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg");
const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use");
snowFlakeInner.setAttribute("href", "/symbols.svg#icon-asterisk");
snowFlake.classList.add("o-icon");
snowFlake.classList.add("o-icon--snow");
snowFlake.ariaHidden = true;
snowFlake.style.width = Math.random() * 10 + 10 + 'px';
snowFlake.style.left = Math.random() * window.innerWidth + 'px';
snowFlake.style.animationDuration = Math.random() * 3 + 2 + 's';
snowFlake.style.opacity = Math.random();
snowFlake.appendChild(snowFlakeInner);
document.body.appendChild(snowFlake);
setTimeout(() => { snowFlake.remove(); }, 5000);
}
setInterval(createSnowFlake, 100);
|