Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Last active December 12, 2015 01:58
Show Gist options
  • Save themorgantown/4694970 to your computer and use it in GitHub Desktop.
Save themorgantown/4694970 to your computer and use it in GitHub Desktop.
// This Javascript gets the current hour of day,
// and sets a timeline based on that hour.
var d = new Date();
var time = d.getHours();
if (time < 12)
{
hypeDocument.startTimelineNamed('Nine');
}
if (time >= 12 && time < 3)
{
hypeDocument.startTimelineNamed('Noon');
}
if (time >= 3)
{
hypeDocument.startTimelineNamed('Three');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment