/Countdown-Timer

simple countdown timer in .js

Primary LanguageJavaScript

Countdown Timer

Countdown Timer is a simple javascript timer. Set the target date in the your container and you are good to go.

Version

1.0

Configuration

  1. Set a timer container. It must have id="countdown_timer" for the timer to work.
  2. Set end month, day and year. All must be filled. You should do the following at the same element where the id is:
    • data-cdt-month = countdown end month,
    • data-cdt-day = countdown end day,
    • data-cdt-year = countdown end year, must be a 4 digit format.
  3. Set the display format. There is two options for now:
    • data-cdt-format="d:H:M:S", for it to display the full countdown format,
    • data-cdt-format="d", for it to display only the days left 'till inputted end. (default, if no options are given).
  4. Put the countdown-timer.min.js at the end of the html file.

Todo's

A lot!

  • More css flexibility, now the elements are kind of fixed,
  • More display formats, maybe,
  • Web component. (maybe)

License

MIT