Last active
August 29, 2015 14:06
-
-
Save hilukasz/6c15b3c20919e8e1dea6 to your computer and use it in GitHub Desktop.
afterEffectsTimer.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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