https://github.com/auchenberg/slotcount.js
Simple slot machine-like counter, inspired by Google Plus.
https://github.com/auchenberg/slotcount.js
Last synced: 6 months ago
JSON representation
Simple slot machine-like counter, inspired by Google Plus.
- Host: GitHub
- URL: https://github.com/auchenberg/slotcount.js
- Owner: auchenberg
- License: mit
- Created: 2013-09-25T21:47:07.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-24T17:13:11.000Z (over 11 years ago)
- Last Synced: 2024-11-09T16:59:24.087Z (11 months ago)
- Language: JavaScript
- Size: 211 KB
- Stars: 63
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
## slotCount.js
### [Demo](http://auchenberg.github.com/slotCount.js)
Simple slot machine-like counter, inspired by Google Plus.
No dependencies. AMD and CJS compatible.
Works in modern browsers. Chrome, Firefox, Safari 6+, IE10+.
## Installation
#### Manually
Adding to your HTML file:
#### with [Bower](http://bower.io)
bower install slotcount
#### with [Component](https://github.com/component/component)
component install auchenberg/slotcount.js
## Usage
```javascript
var counter = new slotCount(container, initialCount);counter.set(newCount);
counter.dispose();
```## Examples
### Random number every 2000ms
```javascript
var counter = new slotCount(document.querySelector('.counter-box'), 10);setInterval(function() {
var random = Math.floor(Math.random() * 50);
counter.set(random);
}, 2000);
```## Test
You can test the component implementation of slotCount.js with Mocha in your browser.
Make sure you run ```component build``` and then point your browser locally to ```test/index.html```.
## Credits
slotCount.js is a project by [Kenneth Auchenberg](http://kenneth.io)## License
The MIT License (MIT)