Chocolate Day 🍫
Sweet Chocolate Day page with chocolate rain, unwrap letter & love note.
Create a romantic heart trail effect that follows your mouse. Move the cursor and hearts appear at your pointer, then float upward with a smooth hue-rotate animation. Simple HTML, CSS, and JavaScript — perfect for Valentine's Day, love pages, or any romantic surprise!
This Heart Animation project uses a single HTML page with linked CSS and JavaScript. On
mousemove, a heart element is created at the cursor position with a random size. The CSS
animates each heart moving upward with a hue-rotate effect, then it is removed after a few seconds.
The heart image is loaded from an external icon URL; you can replace it with your own image.
All files sit in one folder: heart/ — index.html, style.css, and
index.js.
Copy the HTML, CSS, and JavaScript from the code blocks below. Keep the same folder structure so paths work.
⬇️ Full code below
Copy this into index.html in your heart/ folder.
Loading code...
Copy this into style.css. It styles the full-screen black background and the heart animation.
Loading code...
Copy this into index.js. Listens for mousemove and creates heart elements at the cursor.
Loading code...
Keep the assets in this structure so all paths work:
pages/ ├── assets/ │ └── heart/ │ ├── index.html │ ├── style.css │ └── index.js
heart/url(...) in style.css to your own imagetranslate(-50%, -5000%) and 6s in the CSS animationMath.random() * 100 in index.js for heart size range