js-promotion-timer
v1.0.5
Published
Countdown timer until the end of the promotion
Downloads
1
Maintainers
Readme
js-promotion-timer
Countdown timer until the end of the promotion
Installation
npm i js-promotion-timer
Usage
ES6
import promoTimer from "js-promotion-timer";
promoTimer({
timePromotionEnd: string,
timerSelector: selectorTimerContainer,
clockSelectors: {
days: selector,
hours: selector,
minutes: selector,
seconds: selector,
}
})
Example
watch example
import promoTimer from "js-promotion-timer";
promoTimer({
timePromotionEnd: '2023-12-25',
timerSelector: '.promotion__timer',
clockSelectors: {
days: '#days',
hours: '#hours',
minutes: '#minutes',
seconds: '#seconds',
}
})
Customazing styles
You can customaze what ever you want. You have you're HTML markup and you're css style's
Params
| ParametersName | Type | Detail | Example | Optional? | ------ | ------ | ------ | ------ | ------ | | timePromotionEnd | String | selector of timer container | '2023-12-25' | | timerSelector | String | selector of timer container | '.promotion__timer' | | clockSelectors | Object {} | object with dd:hh:mm:ss selectors | - | | days | String | selector where insert remaining days | '#days' | | hours | String | selector where insert remaining hours | '#hours' | | minutes | String | selector where insert remaining minutes | '#minutes' | | seconds | String | selector where insert remaining seconds | '#seconds' |
License
Copyright (c) 2023 CrawFish666 Released under the MIT license