diff options
author | Alex Vitkov <alexvitkov98@gmail.com> | 2021-01-29 15:07:18 +0200 |
---|---|---|
committer | Alex Vitkov <alexvitkov98@gmail.com> | 2021-01-29 15:07:18 +0200 |
commit | 9f0a624ea66aa329a78c464f08d99f63c7282ee8 (patch) | |
tree | f645f99ac9b9fb503d98df782525b75c7bae45f7 /js | |
parent | d14f3109973c7d95a15174db1a1346887765988d (diff) | |
parent | 8ba2c35a306719932307ec5f99701101637e1fd2 (diff) | |
download | fileup-9f0a624ea66aa329a78c464f08d99f63c7282ee8.tar.gz |
Merge branch 'live'
Diffstat (limited to 'js')
-rw-r--r-- | js/arrows.js | 37 | ||||
-rw-r--r-- | js/validate_hero.js | 58 |
2 files changed, 0 insertions, 95 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(); diff --git a/js/validate_hero.js b/js/validate_hero.js deleted file mode 100644 index ecd5195..0000000 --- a/js/validate_hero.js +++ /dev/null @@ -1,58 +0,0 @@ - -function clear_hero_errors() -{ - let errors = document.getElementsByClassName("hero_form_error"); - let i; - for (i = 0; i < errors.length; i++) - { - errors[i].hidden = true; - } -} -function validate_hero_login_form() -{ - let username=document.forms["hero_form"]["username"].value; - let flag=true; - clear_hero_errors(); - - if(username.length==0) - { - document.getElementById("username-length-error").hidden=false; - flag=false; - } - document.activeElement.blur(); - return flag; -} -function validate_hero_form() -{ - let username=document.forms["hero_form"]["username"].value; - let email=document.forms["hero_form"]["email"].value; - let password=document.forms["hero_form"]["password"].value; - let password2=document.forms["hero_form"]["password2"].value; - - let flag=true; - clear_hero_errors(); - - if(username.length==0) - { - document.getElementById("username-length-error").hidden=false; - flag=false; - } - if(!email.match(/\S+@\S+/)) - { - document.getElementById("email-error").hidden=false; - flag=false; - } - if(password.length==0) - { - document.getElementById("password-length-error").hidden=false; - flag=false; - } - if(password !== password2) - { - document.getElementById("password-match-error").hidden=false; - flag=false; - } - document.activeElement.blur(); - return flag; - -} |