NewYear Countdown with Javascript
course from Brad Traversy
Features:
dynamic new year
with 1 second loader
cal the difference between new year and current
HTML
the year is a dynamic new year displaythe countdown includes the days, minutes, hours, and seconds
loader image shows when page loads
CSS
add the background overlay with ::afterand all the other upper layer
newYearTime is current year +1 with date and time
new year show in the year section
calculate the difference between new year's time and the current time.
calculate the days, hours, minutes, and seconds of difference
seconds total=diff/1000 and the %60 is extra seconds
minutes total=diff/1000/60
days total=diff/1000/60/60/24
hours total=diff/1000/60/60
and with ?...:... to make sure every time is two numbers
After page loaded one second, the loading hide, and show the countdown
More about countdown projects demo: