An open API service indexing awesome lists of open source software.

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.

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)