My Submission for the DEV CSS Art Challenge: "The Gift That Sparked the Dream"
Eztosin

Eztosin @eztosin

About: I'm a passionate student studying Mathematics Education at Lagos State University and a proud graduate of the ALX Africa Software Engineering Program. I have a deep love for technology and writing!

Location:
Lagos, Nigeria
Joined:
Jul 29, 2023

My Submission for the DEV CSS Art Challenge: "The Gift That Sparked the Dream"

Publish Date: Jun 15
6 0

This is a submission for Frontend Challenge - June Celebrations, CSS Art: June Celebrations.

For this year's Frontend Challenge: June Celebrations, I chose the "CSS Art" prompt to create something deeply personal. While June is full of vibrant public celebrations, I wanted to honor a quiet, personal one that shaped my entire life: the day my father gave me my first computer. This entry is my tribute to Father's Day.

The theme of my piece is "The Gift That Sparked the Dream." It’s a story, told in three acts, about how a single act of generosity from a parent can ignite a lifelong passion and career.

The Live Demo
First, I invite you to experience the project live. Click through the scenes to see the story unfold.

➡️ View Live Demo

💡 The Concept: A Story in Three Acts
This isn't just a static piece of art. It’s an interactive narrative that progresses through three stages of my journey, each triggered by a click.

  1. 🎁The Gift: The opening scene shows the foundational moment—my father giving me the glowing laptop. It's full of potential and quiet excitement.

  2. 📚The Learning: The scene shifts to focus on the child, engrossed in the laptop. The father fades into the background, symbolizing his supportive but non-intrusive presence during the long nights of learning and practice.

  3. 🎓The Career: The child is now grown, dressed in professional attire. The father is gone from the scene, but his gift's legacy is clear. To celebrate this achievement, the scene comes alive with looping, celebratory fireworks, representing the dream realized.

🛠️ The Technical Approach: How It Was Built
My goal was to create a rich, animated world using modern, efficient, and accessible techniques.

Pure CSS Characters & Clothing
The father and child figures are built from simple <div> elements and styled with CSS. Their clothes aren't extra HTML elements; they are created using a layered linear-gradient trick. The top layer is the shirt, and the bottom layer is the pants, all applied to the single background property of the main body div. This keeps the HTML clean while adding visual detail.

Interactive Storytelling with JavaScript
While the art is primarily CSS, a small amount of JavaScript acts as the "storyteller." It listens for clicks on the scene-toggle buttons (The Gift, Learning, Career) and updates a data-active-scene attribute on the main container. CSS attribute selectors then apply the correct styles, animations, and character positions for each "act" of the story.

A World of Animation

  • Subtle Life: The characters have a gentle, looping sway and bounce feature to bring them to life.
  • Looping Fireworks: To create a gentle celebratory effect on the career page, I used a fun box-shadow trick. Instead of adding dozens of HTML elements, each firework "burst" is generated by a single ::after pseudo-element. Its box-shadow property has over 20 comma-separated values, and each shadow is animated outwards to create a multi-particle explosion. The entire sequence loops to keep the celebration going!
  • The Final Message: The "Thank you, Dad." message uses a classic typing animation, created by animating the width of the element with the steps() timing function.

A Focus on Accessibility
A project isn't truly complete if it isn't accessible.

  • Screen Reader Support: The entire scene has a role="img" attribute and a detailed aria-label that describes the artwork, allowing visually impaired users to understand the story. All interactive elements also have ARIA labels.

  • Respecting User Preferences: The entire project uses a prefers-reduced-motion media query. If a user has motion sensitivity enabled in their operating system, all animations are automatically disabled.

Challenges & Learnings
The most interesting challenge was a visual bug where the child's arm would look "disconnected" during its bouncing animation. I learned that the best fix wasn't to complicate the animation, but to improve the physical "connection" by adjusting the CSS to make the arm overlap the body by a few more pixels. It was a great reminder that sometimes the simplest solution is the most effective.

Conclusion
This project was a joy to create. It was a technical challenge, but more importantly, it was an opportunity to express gratitude. That single gift from my dad didn't just open doors; it booted up a whole new world.

Thank you for this wonderful challenge, DEV team, and a very happy Father's Day to all the dads out there who inspire and support our dreams.

View the Code: You can find the complete source code for this project on my GitHub.

➡️ Github Repo

Comments 0 total

    Add comment