Skip to content

Instantly share code, notes, and snippets.

@hilukasz
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hilukasz/6c15b3c20919e8e1dea6 to your computer and use it in GitHub Desktop.
Save hilukasz/6c15b3c20919e8e1dea6 to your computer and use it in GitHub Desktop.
afterEffectsTimer.js
Heavily modified code from: http://forums.creativecow.net/thread/227/12722
timeToStart = 4;
text.sourceText = "4:59";
if (time >= timeToStart){
clockStart = 300;
function padZero(n){
if (n < 10) return "0" + n else return "" + n
}
clockTime = Math.max(clockStart -1 *(time - inPoint),0);
t = Math.floor(clockTime)+timeToStart;
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
min + ":" + padZero(sec)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment