Skip to content

giacomette/ticktack.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ticktack.js

requestanimationframe based watch.

Demos

Installation

  bower install ticktack.js

Usage

  ticktack.on('second', function(digits){
    console.log(digits.getSecond().progress);
    // digits and 'this' contain all the getter functions
  });

  ticktack.on('tick', function(digits){
    // will be called on requestAnimationFrame
  });

ticktack.on(event, handler)

event Type: String event type: hour, minute, second, millisecond or tick

handler Type: Function( PlainObject digits )

  • digits object containng getter functions for every digit.
  {
    'getDay': function(){ ... }, // {value: 0, progress: 0}
    'getHour': function(){ ... }, // {value: 0, progress: 0}
    'getMinute': function(){ ... }, // {value: 0, progress: 0}
    'getSecond': function(){ ... }, // {value: 0, progress: 0}
    'getMillisecond': function(){ ... }, // {value: 0, progress: 0}
    'getDate': function(){ ... }  // js Date
  }

Contributors

About

requestanimationframe based watch.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 86.2%
  • JavaScript 13.8%