choubari / choubari.com

Personal Website & Blog || Next.js 13, TypeScript, TailwindCSS and ContentLayer.
https://choubari.com
MIT License
13 stars 1 forks source link

confetti.js Running Based on Build Date Instead of Current Date #9

Open choubari opened 11 months ago

choubari commented 11 months ago

The confetti.js script is designed to run only on my birthday (if todayDate === birthdayDate).

However, it currently checks against the date when the page was last built (todayDate = buildDate).

This means that if the site is built on my birthday, the script runs continuously until the next build.

Conversely, if built before my birthday, the script might not run at all on the day. We need a way to make it check against the actual current date.

choubari commented 11 months ago

While triggering a rebuild/redeploy via GitHub Actions (or manually 🫠) is a valid approach, it might not be the most efficient.

Using client-side JavaScript to check the current date directly might be a more resource-saving and consistent solution.