diff options
author | adam <adam@> | 2021-02-11 19:43:06 +0200 |
---|---|---|
committer | adam <adam@> | 2021-02-11 19:43:06 +0200 |
commit | d538c3041c6c7d05a9328ace960838aa194879d9 (patch) | |
tree | 0b070027c9e758ed1783012c43c58070b39595f5 /js/arrows.js | |
parent | d35678c131d4547cea8b3d9fcc1978dec0d2d903 (diff) | |
parent | f1cd0085cd8dba8b25818fc998d315b28e6c13a5 (diff) | |
download | fileup-d538c3041c6c7d05a9328ace960838aa194879d9.tar.gz |
setting up
Diffstat (limited to 'js/arrows.js')
-rw-r--r-- | js/arrows.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/js/arrows.js b/js/arrows.js deleted file mode 100644 index 10ad416..0000000 --- a/js/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.shift(); - }, 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(); |