add: PASSAGE V1 COM OFFICIELLE

préparation du template
intégration du fond animé
fusion du style background et style pcp
This commit is contained in:
2026-03-18 20:15:01 +01:00
parent ade729bc58
commit 13c91b464f
45 changed files with 10987 additions and 106 deletions
@@ -0,0 +1,79 @@
// Toggle play/pause
function togglePlayPause() {
if (isPlaying) {
cancelAnimationFrame(animationID);
isPlaying = false;
} else {
isPlaying = true;
animationID = requestAnimationFrame(render);
}
}
// Function to refresh the pattern with a new random seed
const selectedSeeds = [53, 118, 506];
var seedCount = 2;
function refreshPattern() {
timeOffset = performance.now();
//randomSeed = Math.floor(Math.random() * 1000,0);
randomSeed = selectedSeeds[seedCount];
gl.uniform1f(seedLocation, randomSeed);
if(!isPlaying){
isPlaying = true;
animationID = requestAnimationFrame(render);
}
console.log('seed:', randomSeed);
}
function startFromZeroTime(){
console.log("Restarting animation from time = 0");
// Cancel current animation if running
if (animationID) {
cancelAnimationFrame(animationID);
}
// Set the time offset to the current time
// This will be subtracted in the render function
timeOffset = performance.now();
// Reset frame counter for FPS calculation
frameCount = 0;
lastTime = performance.now();
// Make sure all other uniforms are updated
updateUniforms();
// Ensure animation is playing
isPlaying = true;
// Start the animation loop from the beginning
animationID = requestAnimationFrame(render);
}
// Add this function to handle canvas resizing
function updateCanvasSize() {
// Update canvas dimensions to window size
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Update the WebGL viewport to match
gl.viewport(0, 0, canvas.width, canvas.height);
// Re-render if not already playing
if (!isPlaying) {
drawScene();
}
// If recording is active, we need to handle that
if (recordVideoState) {
stopRecording();
startRecording();
}
}
//intro overlay info screen
let musicPlaying = false;
let isZenMode = false;