52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import { loadEvents } from './events.js'
|
|
import { loadStatus } from './status.js'
|
|
import { initCuteTexture } from './cuteTexture.js'
|
|
import { makeItFloat } from './floating.js';
|
|
|
|
// ======================================== events & statut d'ouverture
|
|
loadEvents();
|
|
loadStatus()
|
|
.then((status) => {
|
|
console.log("Status actuel du LOL", status);
|
|
|
|
let cuteTexture = initCuteTexture({
|
|
shaderSource: status.shaderSource
|
|
});
|
|
|
|
cuteTexture.target.style.visibility = "visible"
|
|
});
|
|
|
|
// ======================================== floating message window
|
|
|
|
makeItFloat(document.querySelector('#msgWindow'));
|
|
makeItFloat(document.querySelector('#addUserWindow'));
|
|
|
|
/*
|
|
//================================ 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;
|
|
})
|
|
*/
|