Ajout du noise

This commit is contained in:
2026-04-21 01:08:11 +02:00
parent 3d5bef4153
commit 4a1c77121b
6 changed files with 121 additions and 13 deletions
+9 -3
View File
@@ -14,7 +14,7 @@ async function updateFromForm(){
} else {
UI_GLITCHER.clearImage()
}
UI_GLITCHER.render()
}
@@ -46,7 +46,7 @@ CANVAS.addEventListener("pointerdown", e => {
let now = Date.now()
if(lastCommit === null || now - lastCommit > 100){
let width = 20;
let width = 50;
if(e.pointerType == "touch"){
width *= 2
}
@@ -55,8 +55,8 @@ CANVAS.addEventListener("pointerdown", e => {
let deltaY = lastY !== undefined ? y - lastY : 0
width += Math.max(Math.abs(deltaX), Math.abs(deltaY))
width += Math.random()*2
//UI_GLITCHER.addGlitch(x + (Math.random() * width) - width/2, y + (Math.random() * width) - width/2, width)
UI_GLITCHER.addGlitch(x, y, width)
UI_GLITCHER.render()
@@ -82,5 +82,11 @@ CANVAS.addEventListener("pointerdown", e => {
applyGlitch(e)
})
/*function startRendering(){
UI_GLITCHER.render()
requestAnimationFrame(startRendering)
}
startRendering()*/
setInterval(() => UI_GLITCHER.render(), 500)
updateFromForm()