Menu

I Built a Candle That Burns Down in Real-Time as the Year Passes
πŸ“°

I Built a Candle That Burns Down in Real-Time as the Year Passes

DEV Community: cssΒ·Marcos VargasΒ·4 days ago
#r6CNJREs
#devtocss#devto#dev#candle#independent
Reading 0:00
15s threshold

Hi everyone! I'm Marcos, an independent digital creator from Venezuela. Today I want to share a small project I built entirely from scratch: a web page where a candle slowly consumes itself second by second, showing exactly how much time is left until the New Year.

The Idea

I wanted to create something visual, calming, and slightly philosophical β€” a way to feel the year passing by instead of just reading a countdown. So I built The Year Candle : a single web page where a green candle with a golden holder burns down mathematically, in perfect sync with the calendar.

How It Works

The math is simple but elegant. The script calculates the percentage of the year that has already passed (from January 1st to December 31st) and applies that percentage to the height of the candle. Every second, the candle shrinks a tiny bit. By the time December 31st at 11:59:59 PM arrives, the candle is completely gone.

The best part? It works automatically for every visitor in their own local timezone.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.