Last active
May 23, 2023 08:08
-
-
Save animoplex/07b103270ad3248320f700b7ab1d46e1 to your computer and use it in GitHub Desktop.
Countdown Clock - After Effects Expression by Animoplex
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
// Countdown Clock | |
// Original: http://www.motionscript.com/design-guide/up-down-clock.html | |
rate = -1; | |
clockStart = 3.00; | |
sign = ""; | |
function padZero(n) { | |
if (n < 10) { | |
return "0" + n | |
} | |
else { | |
return "" + n | |
} | |
} | |
clockTime = clockStart + rate * (time - inPoint); | |
if (clockTime < 0) { | |
sign = "-"; clockTime = -clockTime; | |
} | |
t = Math.floor(clockTime); | |
min = Math.floor((t % 3600) / 60); | |
sec = Math.floor(t % 60); | |
ms = clockTime.toFixed(3).substr(-3); | |
sign + ":" + padZero(min) + ":" + padZero(sec) + "." + ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment