Skip to main content
Creative Coding Projects

Happy Anniversary Card with Confetti & Candle Blowout — HTML/CSS/JS

Build an interactive anniversary card with colorful confetti on launch, personalized decorative messages, and a virtual candle that users can blow out to reveal a surprise.

G

gs_admin

Author & Reviewer

Published

Jul 16, 2026

Read Time

15 min read

love.html
💝
Creative Coding Projects

🎯 What You'll Build

An interactive anniversary card with three magical features: confetti celebration on page load, a virtual candle you can blow out (or tap), and a hidden surprise that reveals after the candle goes out! 🎉

---

🔗 Live Demo

👉 Try the Live Demo →

---

📦 Premium Version

> ☕ Download Premium (5 themes + mic-powered candle) →

---

🛠️ The Candle Blowout Animation

CSS Flame with Flicker

css
123456789101112131415161718
.flame {
    width: 18px;
    height: 35px;
    background: radial-gradient(
        ellipse at bottom, 
        #ffd93d 0%, 
        #ff6b35 50%, 
        transparent 100%
    );
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.3s ease-in-out infinite alternate;
    filter: blur(1px);
}

@keyframes flicker {
    0%   { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.05, 0.95) rotate(2deg); }
}

The Blow-Out Effect

css
123456789
.flame.blown-out {
    animation: blowOut 0.5s forwards;
}

@keyframes blowOut {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.5, 0.3) skewX(30deg); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

JavaScript — Tap to Blow Out

javascript
12345678910111213141516171819
let candleBlown = false;

function blowCandle() {
    if (candleBlown) return;
    candleBlown = true;
    
    // Blow out the flame
    document.getElementById('flame').classList.add('blown-out');
    document.getElementById('flameGlow').classList.add('blown-out');
    
    // Update hint text
    document.getElementById('candleHint').textContent = '✨ You made a wish!';
    
    // Reveal surprise after delay
    setTimeout(() => {
        document.getElementById('surprise').classList.add('visible');
        burstConfetti(); // Another celebration!
    }, 1200);
}

Confetti on Page Load

javascript
123456789
setTimeout(() => {
    for (let i = 0; i < 150; i++) {
        particles.push(new Particle(
            canvas.width * (0.2 + Math.random() * 0.6),
            canvas.height * 0.3
        ));
    }
    animateConfetti();
}, 800); // Small delay for dramatic effect

---

🎨 Customization

FeatureHow to Change
Anniversary numberEdit "3rd" in the HTML
Surprise messageEdit the #surprise section
Candle colorChange gradient in .candle-body
Theme colorsModify CSS color variables

---

G

About the Author: gs_admin

A senior technical contributor specializing in architectural designs, software optimization, database structures, and developer education. Passionate about writing clean code and sharing engineering knowledge.