Skip to content
Simple slot machine-like counter, inspired by Google Plus.
JavaScript CSS
Find file
Latest commit d298ede @auchenberg Merge pull request #4 from airportyh/patch-1
Corrected repo field to match github repo url.
Failed to load latest commit information.
test Updated unit tests.
.gitignore Updated unit tests.
History.md added component.json
LICENSE
Makefile added component.json
README.md Fixed bad reference to component.io
bower.json Added bower.json
component.json Corrected repo field to match github repo url.
package.json added component.json
slotCount.css Initial commit.
slotCount.js Removed hard-coded reference to window

README.md

slotCount.js

Demo

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:

<script src="/path_to_http_invoke/slotcount.js"></script>

with Bower

bower install slotcount

with Component

component install auchenberg/slotcount.js

Usage

var counter = new slotCount(container, initialCount);

counter.set(newCount);
counter.dispose();

Examples

Random number every 2000ms

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

License

The MIT License (MIT)
Something went wrong with that request. Please try again.