js-promotion-timer

1.0.5 • Public • Published

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

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

Package Sidebar

Install

npm i js-promotion-timer

Weekly Downloads

6

Version

1.0.5

License

MIT

Unpacked Size

6.34 kB

Total Files

3

Last publish

Collaborators

  • crawfish666