Very often, a club or organization will have a big event (a tournament, a show, a lecture, you name it) that it will want to feature prominently on its website. In fact, as the event gets closer, the club might want to feature it more prominently. Of course, once the event is past, it should fade into the background.
For this demonstration, we will assume that you are interested in how many days remain until the polls open at 7am on the day of the 2016 election, namely November 8th, 2016.
What will we do with this information? The page will tell you how many days remain, and it will adjust the font size based on how far away the election is. (This will stand in for whatever adjustments you might make for your own event.)
Just so you know, election day is
insert days here
There are several ways this could be done. Here's how we did the computation:
.getTime()method on Date objects to determine the number of milliseconds since the
beginning of time(January 1st, 1970). The difference between these values is the number of milliseconds from now until the election.
view source on this page to see exactly how we did