count-helper
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

count-helper

Count helper with vanilla JavaScript.

Here is an example of use. README will be updated on next patch.

import {Counter} from 'count-helper';

const counter = new Counter(new Date(2021, 3, 26), {
  fullYearDOM: document.querySelector('.js-full-year'),
  fullDayDOM: document.querySelector('.js-full-day'),
  fullHourDOM: document.querySelector('.js-full-hour'),
  fullMinuteDOM: document.querySelector('.js-full-minute'),
  fullSecondDOM: document.querySelector('.js-full-second'),
  yearDOM: document.querySelector('.js-year'),
  dayDOM: document.querySelector('.js-day'),
  hourDOM: document.querySelector('.js-hour'),
  minuteDOM: document.querySelector('.js-minute'),
  secondDOM: document.querySelector('.js-second'),
  type: 'countup'
});

document.querySelector('.js-second')
  .addEventListener('countdown.negative', () => {
    console.log('negative counting stopped the counter');
  });

const time = document.timeline.currentTime;

counter.initialize(time);

/count-helper/

    Package Sidebar

    Install

    npm i count-helper

    Weekly Downloads

    1

    Version

    2.1.0

    License

    MIT

    Unpacked Size

    15.7 kB

    Total Files

    15

    Last publish

    Collaborators

    • estharian