all-the-clocks
v2.1.0
Published
A package for adding simple javascript/SVG digital clocks and stopwatches into a website. Future functionality is planned!
Downloads
4
Maintainers
Readme
A simple EcmaScript 6 module that allows for simple clocks to be added (with one line!) to a web page. Current capabilities include:
- Digital Clock
- Digital Clock With Date
- Stopwatch*
Future Functionality planned includes:
- Analogue Clocks
- Timers
Usage
Install using 'npm i all-the-clocks'. Import into your website using 'import {[wanted clock]} from "./node_modules/all-the-clocks/index.js" or the path that it leads to where you are in your folder. The import statement and such should be within a '' tag, otherwise it will not work. Types of clocks you can import include: -'clock': a normal digital clock.
- 'clockWithDate': a digital clock with date.
- 'stopWatch': a stopwatch. To initialise these clocks have a Javascript line of 'new "type of clock"()'. E.g. if a new stopwatch is wanted, do 'new stopWatch()'. Variable assignment isn't required and clocks will function independently. Note that for the base clock (plain digital) it must be initialised with 'new clock().init()' as it provides the templates for the others.
Additionally, the clocks (being contained in a viewbox) can be resized to your heart's content.
*Accurate to within a few milliseconds.