Valentine's Card
RepositoryI created this interactive Valentine's Day card to push the boundaries of creative CSS and micro-interactions. The project features a custom-styled heart, a procedurally drawn arrow, and a synchronized animation sequence that reveals a hidden letter. It served as a practical exercise in managing complex animation states and leveraging modern CSS properties like clip-path and pseudo-elements for asset-free graphics.
Procedural Heart Styling
The heart is constructed entirely through CSS, avoiding external images for maximum performance and scalability. It uses the :before and :after pseudo-elements to create two overlapping circles atop a rotated square base. By applying a heavy box-shadow with a deep pink hue (#f20044), I achieved a soft glow effect that adds depth and a "lit from within" appearance to the UI.
Synchronized Animation Sequence
The interaction is driven by a carefully timed sequence of CSS Keyframes. When the user clicks the heart, the arrow shoots from the edge of the screen, hitting the heart and triggering a scaling animation. I used animation-delay and forwards fill modes to ensure each stage of the reveal—from the arrow impact to the letter fading in—feels intentional and fluid.
Interactive Logic
The JavaScript layer acts as the orchestrator for the visual timeline. It listens for the initial user interaction and applies CSS classes to trigger the animations in a specific order. To prevent the sequence from being interrupted or replayed incorrectly, the event listener is automatically removed after the first trigger, ensuring a polished, one-time "reveal" experience.
Creative Design Choices
To enhance the emotional impact, I selected the Pacifico cursive font from Google Fonts, which complements the hand-drawn aesthetic of the clip-path arrow. The background uses a soft pink (#ff94bf) to maintain high contrast with the vibrant heart, while the responsive layout ensures the animations look consistent across mobile and desktop viewports. This project taught me the value of "motion as storytelling" in UI design.
Live Demo
Live DemoYou can experience the surprise yourself by clicking the button below. Once redirected, interact with the heart to trigger the reveal sequence.