Download the PHP package levmyshkin/flipdown without Composer
On this page you can find all versions of the php package levmyshkin/flipdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download levmyshkin/flipdown
More information about levmyshkin/flipdown
Files in levmyshkin/flipdown
Package flipdown
Short Description FlipDown is a lightweight and performant flip styled countdown clock.
License MIT
Informations about the package flipdown
FlipDown
⏰ A lightweight and performant flip styled countdown clock.
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.
Include the CSS and JS in <head>
and include the following line in your HTML.
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:
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:
For example, to instantiate FlipDown using the light theme instead:
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:
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:
theme
headings
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
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.