Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaxgeller/counter.js
https://github.com/jaxgeller/counter.js
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jaxgeller/counter.js
- Owner: jaxgeller
- License: mit
- Created: 2015-09-20T21:59:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-20T15:29:50.000Z (about 9 years ago)
- Last Synced: 2024-12-12T04:36:03.804Z (24 days ago)
- Language: JavaScript
- Homepage: https://jaxgeller.com/projects/counter.js/
- Size: 164 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Counter.js
Counter.js is a slim (less than 1kb gzipped), performant, ES6 module, that counts numbers. It uses RAF and easing functions to provide a buttery-smooth, 60-fps counter.You can check out the [demo here.](https://jaxgeller.com/projects/counter.js/)
### Install
`npm install counter.js` or include `dist.min.js` above.
### Example
```javascript
// if you’re not using a module bundler, include dist.min.js instead
import Counter from "counter.js";// set your desired options
const opts = {
start: 0,
end: 100,
selector: document.getElementById('count'),
done: () => {
// callback...
}
};// create an instance
const instance = new Counter(opts);// run the counter
instance.run();
```