❤️ Description
This Valentine project is a playful interactive UI where users are asked a simple question:
"Will you be my Valentine?"
- Clicking No makes the button dodge the cursor 🏃♂️
- Clicking Yes fills the screen with love 💖
Perfect for:
- Instagram / YouTube Shorts
- Beginner JavaScript practice
- Fun portfolio additions
🧠 Core Concept
This project demonstrates:
- DOM manipulation
- Mouse events
- Button positioning logic
- Simple animations using CSS
No libraries. Pure HTML + CSS + JavaScript.
🧩 Complete Code (HTML + CSS + JS)
CSS Code
Javascript Code
Yes_Page.html Code
Yes_style.css code
🧱 HTML & CSS Breakdown
HTML
.card→ main UI container- Two buttons: Yes and No
.hearts→ container for floating hearts
CSS
- Gradient background for romantic feel
- Rounded card with soft shadow
position:absoluteon No button for movement- Floating hearts animation using
@keyframes
⚙️ JavaScript Logic Explained
🏃 No Button Movement
- Triggered on
mouseover - Random X and Y position calculated
- Button jumps to a new location instantly
💖 Yes Button Effect
- On click, multiple heart elements are created
- Random position + animation duration
- Hearts float upward and disappear
🎯 Why This Project Works
- High engagement (user interaction)
- Funny + emotional
- Perfect for short-form content
- Very beginner-friendly
🚀 Ideas to Extend
- Add sound effect on Yes
- Replace text with emojis
- Convert to React component
- Add confetti instead of hearts
Happy Coding ❤️
