Festival Filter Generator
const canvas = document.getElementById("canvas") const ctx = canvas.getContext("2d")
let userImage = null
// Overlay laden const overlay = new Image() overlay.src = "overlay.png" // hier dein Rahmen
// Bild hochladen document.getElementById("upload").addEventListener("change", function(e){
const file = e.target.files[0]
if(!file) return
const img = new Image() img.src = URL.createObjectURL(file)
img.onload = function(){
userImage = img
canvas.width = img.width canvas.height = img.height
draw()
}
})
function draw(){
if(!userImage) return
ctx.clearRect(0,0,canvas.width,canvas.height)
ctx.drawImage(userImage,0,0)
if(overlay.complete){
ctx.drawImage(overlay,0,0,canvas.width,canvas.height)
}
}
// Download document.getElementById("download").onclick = function(){
const link = document.createElement("a")
link.download = "festival.png"
link.href = canvas.toDataURL("image/png")
link.click()
}
