edit: animation se modifie avec le statut d'ouverture + bug css import dans main.css

This commit is contained in:
2026-07-31 06:23:50 +02:00
parent 384e8494e7
commit 32a14714ec
6 changed files with 99 additions and 45 deletions
+59 -38
View File
@@ -2,27 +2,46 @@ import { loadEvents } from './events.js'
import { loadStatus } from './status.js'
import { scanlinesAnimation } from './cuteTexture.js'
import { noiseAnimation } from './cuteTexture.js'
import { loadCanvas } from './cuteTexture.js'
// =================================== background texture
loadCanvas();
let backgroundVideo = document.querySelector('main > #background');
let proxyTarget = {};
let proxyHandler = {
};
export let statusProxy = new Proxy(proxyTarget, {
set(obj, prop, value){
if(prop === 'lolStatus'){
if (value){
backgroundVideo.style.visibility = 'visible';
scanlinesAnimation();
return true
} else {
backgroundVideo.style.visibility = 'collapse';
noiseAnimation();
return true
}
}
}
})
statusProxy.lolStatus = false;
//console.log(proxyTarget.lolStatus);
// ======================================== events & statut d'ouverture
loadEvents();
loadStatus();
// =================================== background texture
let textureVideo = document.querySelectorAll('main > #texture');
for (let video of textureVideo){
video.style.visibility = 'collapse';
}
let textureCanvas = document.querySelector('main > canvas');
textureCanvas.style.visibility = 'visible';
console.log(textureCanvas);
//console.log(textureVideo)
scanlinesAnimation();
// ======================================== stops here !
// ======================================== floating event window
let target = document.querySelector('#posterWindow');
@@ -40,13 +59,6 @@ startTarget.addEventListener('mousedown', (event) => {
console.log('clicking...')
})
startTarget.addEventListener('touchstart', (event) => {
startX = event.pageX;
startY = event.pageY;
clicked = true;
console.log('touching...')
})
document.addEventListener('mousemove', (event) => {
if(clicked){
console.log('moving...')
@@ -61,25 +73,34 @@ document.addEventListener('mousemove', (event) => {
}
});
document.addEventListener('touchmove', (event) => {
if(clicked){
console.log('moving...')
let currentX = event.pageX;
let currentY = event.pageY;
let moveX = target.offsetLeft + currentX - startX;
target.style.left = moveX + 'px';
let moveY = target.offsetTop + currentY - startY;
target.style.top = moveY + 'px';
startX = currentX;
startY = currentY;
}
});
document.addEventListener('mouseup', () => {
console.log('STOP !')
clicked = false;
})
//================================ tentative de gestion des écran tactiles
startTarget.addEventListener('touchstart', (event) => {
startX = event.pageX;
startY = event.pageY;
clicked = true;
console.log('touching...')
})
document.addEventListener('touchmove', (event) => {
if(clicked){
console.log('moving...')
let currentX = event.pageX;
let currentY = event.pageY;
let moveX = target.offsetLeft + currentX - startX;
target.style.left = moveX + 'px';
let moveY = target.offsetTop + currentY - startY;
target.style.top = moveY + 'px';
startX = currentX;
startY = currentY;
}
});
document.addEventListener('touchend', () => {
console.log('STOP !')
clicked = false;