50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
/* AUTEUR: Stan
|
|
DATE : 2025-12-03
|
|
DESC: Ajout de glitch comme certains evenement dans Warframe
|
|
*/
|
|
// https://www.geeksforgeeks.org/html/difference-between-domcontentloaded-and-load-events/
|
|
|
|
// 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)";
|
|
|
|
}
|
|
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);
|
|
}
|
|
|
|
window.onload = function () {
|
|
timerGlitch();
|
|
// NOTE: Change Current Page based on url in <NAV>
|
|
// NOTE Track mouse mouvement and show after a percentage of ?
|
|
// NOTE une page sur deux, ...
|
|
}; |