All Projects → PButcher → Flipdown

PButcher / Flipdown

Licence: mit
⏰ A lightweight and performant flip styled countdown clock

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Flipdown

Flip Clock
A flip clock, timer and countdown made with Polymer
Stars: ✭ 69 (-49.26%)
Mutual labels:  timer, clock, countdown
Use Timer
A timer hook for React
Stars: ✭ 113 (-16.91%)
Mutual labels:  timer, clock, countdown
React Countdown
React Component showing a countdown to certain date and time.
Stars: ✭ 58 (-57.35%)
Mutual labels:  timer, clock, countdown
React Timer Hook
React timer hook
Stars: ✭ 118 (-13.24%)
Mutual labels:  timer, clock, countdown
timer.cljs
Scheduling async operations in Clojurescript
Stars: ✭ 22 (-83.82%)
Mutual labels:  clock, timer
react-component-countdown-timer
This is a simple count down timer react component.
Stars: ✭ 18 (-86.76%)
Mutual labels:  countdown, timer
Web-Time-Tracker
Plugin named Timetracker is a time counter that works in both increase and decrease directions.
Stars: ✭ 21 (-84.56%)
Mutual labels:  countdown, timer
Peaclock
A responsive and customizable clock, timer, and stopwatch for the terminal.
Stars: ✭ 314 (+130.88%)
Mutual labels:  timer, clock
alfred-timer-workflow
Alfred workflow to start a timer, which blinks when the time is up.
Stars: ✭ 39 (-71.32%)
Mutual labels:  countdown, timer
new-clock
The best clock app there is
Stars: ✭ 24 (-82.35%)
Mutual labels:  clock, timer
Easytimer.js
Easy to use Timer/Stopwatch/Countdown library compatible with AMD, ES6 and Typescript
Stars: ✭ 562 (+313.24%)
Mutual labels:  timer, countdown
Aospdeskclock
Fork of aosp deskclock: alarm,clock, timer,stopwatch
Stars: ✭ 28 (-79.41%)
Mutual labels:  clock, timer
vue-circular-count-down-timer
a count down timer library for vue.js
Stars: ✭ 45 (-66.91%)
Mutual labels:  clock, timer
tm
timers and timeline
Stars: ✭ 31 (-77.21%)
Mutual labels:  clock, timer
Termdown
Countdown timer and stopwatch in your terminal
Stars: ✭ 749 (+450.74%)
Mutual labels:  timer, countdown
Uicircularprogressring
A circular progress bar for iOS written in Swift
Stars: ✭ 1,658 (+1119.12%)
Mutual labels:  timer, clock
Simple Clock
Combination of a beautiful clock with widget, alarm, stopwatch & timer, no ads
Stars: ✭ 257 (+88.97%)
Mutual labels:  timer, clock
Clock
一个简单的计时器程序💡/A sample clock⏰
Stars: ✭ 15 (-88.97%)
Mutual labels:  clock, timer
vue-flip-down
vue 翻页倒计时组件 妙啊
Stars: ✭ 90 (-33.82%)
Mutual labels:  clock, countdown
Countdownlabel
Simple countdown UILabel with morphing animation, and some useful function.
Stars: ✭ 714 (+425%)
Mutual labels:  timer, countdown

FlipDown

⏰ A lightweight and performant flip styled countdown clock.

NPM Version NPM Downloads

Features

  • 💡 Lightweight - No jQuery! <11KB minified bundle
  • ⚡ Performant - Animations powered by CSS transitions
  • 📱 Responsive - Works great on screens of all sizes
  • 🎨 Themeable - Choose from built-in themes, or add your own
  • 🌍 i18n - Customisable headings for your language

Example

Example live at: https://pbutcher.uk/flipdown/

Remix FlipDown on CodePen: https://codepen.io/PButcher/pen/dzvMzZ

Basic Usage

To get started, either clone this repo or install with npm install flipdown or yarn add flipdown.

For basic usage, FlipDown takes a unix timestamp (in seconds) as an argument.

new FlipDown(1538137672).start();

Include the CSS and JS in <head> and include the following line in your HTML.

<div id="flipdown" class="flipdown"></div>

See a full example here.

Multiple Instances

To use multiple instances of FlipDown on the same page, specify a DOM element ID as the second argument in FlipDown's constructor:

new FlipDown(1588017373, "registerBy").start();
new FlipDown(1593561600, "eventStart").start();
<div id="registerBy" class="flipdown"></div>
<div id="eventStart" class="flipdown"></div>

Themes

FlipDown comes with 2 themes as standard:

  • dark [default]
  • light

To change the theme, you can supply the theme property in the opt object in the constructor with the theme name as a string:

{
  theme: "light";
}

For example, to instantiate FlipDown using the light theme instead:

new FlipDown(1538137672, {
  theme: "light",
}).start();

Custom Themes

Custom themes can be added by adding a new stylesheet using the FlipDown theme template.

FlipDown themes must have the class name prefix of: .flipdown__theme- followed by the name of your theme. For example, the standard theme class names are:

  • .flipdown__theme-dark
  • .flipdown__theme-light

You can then load your theme by specifying the theme property in the opt object of the constructor (see Themes).

Headings

You can add your own rotor group headings by passing an array as part of the opt object. Bear in mind this won't change the functionality of the rotors (eg: the 'days' rotor won't magically start counting months because you passed it 'Months' as a heading).

Suggested use is for i18n. Usage as follows:

new FlipDown(1538137672, {
  headings: ["Nap", "Óra", "Perc", "Másodperc"],
}).start();

Note that headings will default to English if not provided: ["Days", "Hours", "Minutes", "Seconds"]

API

FlipDown.prototype.constructor(uts, [el], [opts])

Create a new FlipDown instance.

Parameters

uts

Type: number

The unix timestamp to count down to (in seconds).

[el]

Optional
Type: string (default: flipdown)

The DOM element ID to attach this FlipDown instance to. Defaults to flipdown.

[opts]

Optional
Type: object (default: {})

Optionally specify additional configuration settings. Currently supported settings include:

FlipDown.prototype.start()

Start the countdown.

FlipDown.prototype.ifEnded(callback)

Call a function once the countdown has ended.

Parameters

callback

Type: function

Function to execute once the countdown has ended.

Example

var flipdown = new FlipDown(1538137672)

  // Start the countdown
  .start()

  // Do something when the countdown ends
  .ifEnded(() => {
    console.log("The countdown has ended!");
  });

Acknowledgements

Thanks to the following people for their suggestions/fixes:

  • @chuckbergeron for his help with making FlipDown responsive.
  • @vasiliki-b for spotting and fixing the Safari backface-visibility issue.
  • @joeinnes for adding i18n to rotor group headings.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].