Skip to content

Instantly share code, notes, and snippets.

@felipeblazing
Last active August 11, 2020 06:08
Show Gist options
  • Save felipeblazing/aa4ac252a7d62ac15820559883318da1 to your computer and use it in GitHub Desktop.
Save felipeblazing/aa4ac252a7d62ac15820559883318da1 to your computer and use it in GitHub Desktop.
function set_image(time){{
document.getElementById("time").innerHTML = "From " + time.toString() + " to " + (time+{duration}).toString() + "ms";
document.getElementById("image-show").src = "{home_dir}/" + time.toString() + "_" + (time+{duration}).toString() + ".png";
}}
i = 0;
tick = {duration};
function prev_image(){{
i = i - (tick * 2);
next_image(0);
}}
function next_image(play){{
set_image(i);
i = i + tick;
if ( i < {duration} && play == 1){{
window.setTimeout(function(){{
next_image(1);
}},1000);
}}
}}
next_image(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment