edit: animation se modifie avec le statut d'ouverture + bug css import dans main.css
This commit is contained in:
@@ -69,3 +69,19 @@ export function noiseAnimation(){
|
|||||||
analogLikeNoise();
|
analogLikeNoise();
|
||||||
requestAnimationFrame(noiseAnimation);
|
requestAnimationFrame(noiseAnimation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function loadCanvas(){
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|||||||
+59
-38
@@ -2,27 +2,46 @@ import { loadEvents } from './events.js'
|
|||||||
import { loadStatus } from './status.js'
|
import { loadStatus } from './status.js'
|
||||||
import { scanlinesAnimation } from './cuteTexture.js'
|
import { scanlinesAnimation } from './cuteTexture.js'
|
||||||
import { noiseAnimation } 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();
|
loadEvents();
|
||||||
loadStatus();
|
loadStatus();
|
||||||
|
|
||||||
// =================================== background texture
|
// ======================================== floating event window
|
||||||
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 !
|
|
||||||
|
|
||||||
|
|
||||||
let target = document.querySelector('#posterWindow');
|
let target = document.querySelector('#posterWindow');
|
||||||
|
|
||||||
@@ -40,13 +59,6 @@ startTarget.addEventListener('mousedown', (event) => {
|
|||||||
console.log('clicking...')
|
console.log('clicking...')
|
||||||
})
|
})
|
||||||
|
|
||||||
startTarget.addEventListener('touchstart', (event) => {
|
|
||||||
startX = event.pageX;
|
|
||||||
startY = event.pageY;
|
|
||||||
clicked = true;
|
|
||||||
console.log('touching...')
|
|
||||||
})
|
|
||||||
|
|
||||||
document.addEventListener('mousemove', (event) => {
|
document.addEventListener('mousemove', (event) => {
|
||||||
if(clicked){
|
if(clicked){
|
||||||
console.log('moving...')
|
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', () => {
|
document.addEventListener('mouseup', () => {
|
||||||
console.log('STOP !')
|
console.log('STOP !')
|
||||||
clicked = false;
|
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', () => {
|
document.addEventListener('touchend', () => {
|
||||||
console.log('STOP !')
|
console.log('STOP !')
|
||||||
clicked = false;
|
clicked = false;
|
||||||
|
|||||||
+13
-1
@@ -1,3 +1,5 @@
|
|||||||
|
import { statusProxy } from './main.js'
|
||||||
|
|
||||||
export async function loadStatus(){
|
export async function loadStatus(){
|
||||||
let res = await fetch('/status/index.ouvert.html');
|
let res = await fetch('/status/index.ouvert.html');
|
||||||
|
|
||||||
@@ -11,9 +13,19 @@ export async function loadStatus(){
|
|||||||
hiddenBtn.style.visibility = 'collapse';
|
hiddenBtn.style.visibility = 'collapse';
|
||||||
|
|
||||||
let status = html.querySelector('#lolStatus');
|
let status = html.querySelector('#lolStatus');
|
||||||
|
console.log('current status:', status.innerText);
|
||||||
|
|
||||||
|
|
||||||
|
if (status.innerText.includes('ouvert')){
|
||||||
|
statusProxy.lolStatus = true;
|
||||||
|
}else{
|
||||||
|
statusProxy.lolStatus = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let icon = html.querySelector('link[rel="icon"]');
|
let icon = html.querySelector('link[rel="icon"]');
|
||||||
let style = html.querySelectorAll('link[rel="stylesheet"]')[0];
|
let style = html.querySelectorAll('link[rel="stylesheet"]')[0];
|
||||||
//console.log("selected style : ", style);
|
//console.log("selected script: ", script);
|
||||||
|
|
||||||
document.head.append(icon);
|
document.head.append(icon);
|
||||||
document.head.append(style);
|
document.head.append(style);
|
||||||
|
|||||||
@@ -15,3 +15,5 @@ Ce document sert à échanger et partager des idées et trucs à faire pour cont
|
|||||||
changer le fetch dans status.js
|
changer le fetch dans status.js
|
||||||
|
|
||||||
> problème de gestion des évènement tactiles, rien ne marche ...
|
> problème de gestion des évènement tactiles, rien ne marche ...
|
||||||
|
|
||||||
|
> problème import css directement dans main.css
|
||||||
|
|||||||
@@ -8,22 +8,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.openBackground{
|
.openBackground{
|
||||||
|
position: absolute;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
opacity: .333;
|
opacity: 1;
|
||||||
|
z-index: -20
|
||||||
}
|
}
|
||||||
|
|
||||||
.openBackground#texture{
|
.openBackground#texture{
|
||||||
z-index: -31;
|
z-index: -30;
|
||||||
}
|
}
|
||||||
|
|
||||||
.openBackground#background{
|
.openBackground#background{
|
||||||
mix-blend-mode: difference;
|
mix-blend-mode: difference;
|
||||||
z-index: -30;
|
|
||||||
filter: brightness(133%) saturate(33%) grayscale();
|
filter: brightness(133%) saturate(33%) grayscale();
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: -9%;
|
margin-top: -9%;
|
||||||
height: 120%;
|
height: 120%;
|
||||||
|
opacity: .777;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================= Page Statut LOL ouvert ===*/
|
/*======================= Page Statut LOL ouvert ===*/
|
||||||
|
|||||||
+4
-3
@@ -5,10 +5,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*================ ANIMATION ======================*/
|
/*================ ANIMATION ======================*/
|
||||||
@import url("/animation.css");
|
|
||||||
|
|
||||||
/*================ DESACT DEFAULT ======================*/
|
/*================ DESACT DEFAULT ======================*/
|
||||||
@import url("/default.css");
|
|
||||||
|
|
||||||
/*================ BODY ======================*/
|
/*================ BODY ======================*/
|
||||||
html, body{
|
html, body{
|
||||||
@@ -24,7 +24,7 @@ html, body{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*================ CLASSES COMMUNES ======================*/
|
/*================ CLASSES COMMUNES ======================*/
|
||||||
@import url("/common.css");
|
|
||||||
|
|
||||||
/*================ STRUCTURE ======================*/
|
/*================ STRUCTURE ======================*/
|
||||||
|
|
||||||
@@ -548,4 +548,5 @@ canvas{
|
|||||||
|
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
filter: hue-rotate(13.12deg);
|
filter: hue-rotate(13.12deg);
|
||||||
|
mix-blend-mode: multiply;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user