From 758afd5feefbf3a76f5c6abe8bff8c08f39dd7cc Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 28 Jan 2021 19:05:24 +0200 Subject: restructuring stuff --- arrows.js | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 arrows.js (limited to 'arrows.js') diff --git a/arrows.js b/arrows.js deleted file mode 100644 index ec7352c..0000000 --- a/arrows.js +++ /dev/null @@ -1,37 +0,0 @@ - -arrows = []; - -const minSpeed = 3; -const maxSpeed = 8; -const delay = 1500; -const lifetime = 20000; - -function make_arrow() { - const svg = document.getElementById("protoarrow").cloneNode(); - svg.style.left = Math.random() * 100 + '%'; - svg.style.display = 'block'; - document.getElementById('arrows').append(svg); - const ob = { - y: -800, - svg: svg, - speed: Math.random() * (maxSpeed - minSpeed) + minSpeed - }; - arrows.push(ob); - setTimeout(make_arrow, delay); - setTimeout(() => { - svg.remove(); - arrows.remove(ob); - }, lifetime); -} - -function update() { - for (const arrow of arrows) { - arrow.y += arrow.speed; - arrow.svg.style.bottom = arrow.y + 'px'; - } - - window.requestAnimationFrame(update); -} - -make_arrow(); -update(); -- cgit v1.2.3