diff --git a/www/js/script.js b/www/js/script.js index 1536cb0..a3b65b6 100644 --- a/www/js/script.js +++ b/www/js/script.js @@ -6,49 +6,45 @@ // https://www.w3schools.com/js/js_timing.asp // https://stackoverflow.com/questions/62039703/blur-an-image-with-javascript -function timerBlur(){ - var count = 3; - var timer2 = setInterval(function(){ - - if (count == 3) { - document.getElementById('logoAccueil').style.filter = "blur(3px)"; +function timerBlur() { + var count = 3; + var timer2 = setInterval(function () { - } - else if (count == 2) - { - document.getElementById('logoAccueil').style.filter = "blur(2px)"; - } - else if (count == 1) - { - document.getElementById('logoAccueil').style.filter = "blur(1px)"; - } - else if (count == 0) - { - document.getElementById('logoAccueil').style.filter = ""; - clearInterval(timer2); - } - count--; - }, 350); + if (count == 3) { + document.getElementById('logoAccueil').style.filter = "blur(3px)"; + + } + else if (count == 2) { + document.getElementById('logoAccueil').style.filter = "blur(2px)"; + } + else if (count == 1) { + document.getElementById('logoAccueil').style.filter = "blur(1px)"; + } + else if (count == 0) { + document.getElementById('logoAccueil').style.filter = ""; + clearInterval(timer2); + } + count--; + }, 350); } -function timerGlitch(){ - var timer = setInterval(function(){ - curSrc = document.getElementById('logoAccueil').getAttribute('src'); - if (curSrc == 'images/LogoALT-F4_Nav.svg') { - timerBlur(); - document.getElementById('logoAccueil').setAttribute('src', 'images/LogoAlt-F4_NavGlitch.svg') - } - else - { - document.getElementById('logoAccueil').setAttribute('src', 'images/LogoALT-F4_Nav.svg') - } - }, 2500); +function timerGlitch() { + var timer = setInterval(function () { + curSrc = document.getElementById('logoAccueil').getAttribute('src'); + if (curSrc == 'images/logoALT-F4_Nav.svg') { + timerBlur(); + document.getElementById('logoAccueil').setAttribute('src', 'images/LogoAlt-F4_NavGlitch.svg') + } + else { + document.getElementById('logoAccueil').setAttribute('src', 'images/LogoALT-F4_Nav.svg') + } + }, 2500); } window.onload = function () { - timerGlitch(); - // NOTE: Change Current Page based on url in