If You Start Playing...

naitian.holiday

I discovered early December 2018 that there existed .christmas and .holiday TLDs. Naturally, I had to purchase one, so I sprung for the non-denominational (and, more importantly, cheaper) naitian.holiday domain.

The next question, of course, was what I should do with it. I ended up using it for two projects, so I definitely got my money's worth. One of the projects was if you start playing.

if you start playing...

Inspired by this meme format, I decided to make a New Year's countdown that would automatically start playing these videos at the correct time.

Here are the specs for the project:

specs

  1. client side: it really doesn't need a backend, and I wanted to host on S3, serve through CloudFront, etc.
  2. customizable: I want to be able to share links to custom videos / timestamps.
  3. dark theme: for the nighttime countdown, of course.

tech

Building out the application was actually pretty straightforward, thanks to the Youtube iframe API.

To make it customizable and all on the client side, I used window.location to get URL parameters.

let url = new URL(window.location.href);
if (url.searchParams.get('custom')) {
   const id = url.searchParams.get('id');
   const timestamp = url.searchParams.get('timestamp');
   vid = {
       id,
       timestamp
   }
} else {
    // Get from list of presets
}

You can check it out at naitian.holiday/iysp/?preset=umich.

The Github Repo.