Polymer Stop Watch
This project is maintained by stonelasley
A stopwatch custom element using Polymer
Install the component using Bower:
$ bower install polymer-stop-watch --save
Or download as ZIP.
Import Web Components' polyfill:
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
Import Custom Element:
<link rel="import" href="bower_components/stonelasley/dist/stop-watch.html">
Start using it!
<stop-watch></stop-watch>
Attribute | Options | Default | Description |
---|---|---|---|
mode |
string | 'stopwatch' | Sets the mode 'stopwatch' or 'timer' |
autoStart |
bool | false | Starts counting as soon as the element has loaded. |
offset |
number | 0 | Starts counting at this number. In Milliseconds. |
Method | Parameters | Returns | Description |
---|---|---|---|
unicorn() |
None. | Nothing. | Magic stuff appears. |
Event | Description |
---|---|
onWatchStart |
Triggers when stopwatch is started |
onWatchStop |
Triggers when stopwatch is stopped; |
onTimerStart |
Triggers when timer is started |
onTimerStop |
Triggers when timer is stopped |
onReset |
Triggers when timer or stopwatch are reset; |
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
$ [sudo] npm install -g bower grunt-cli
Install local dependencies:
$ bower install && npm install
To test your project, start the development server and open http://localhost:8000
.
$ grunt server
To build the distribution files before releasing a new version.
$ grunt build
To provide a live demo, send everything to gh-pages
branch.
$ grunt deploy
git checkout -b my-new-feature
git commit -m 'Add some feature'
git push origin my-new-feature
For detailed changelog, check Releases.