Skip to content

Instantly share code, notes, and snippets.

@JonCooperWorks
Created October 29, 2012 16:09
Show Gist options
  • Save JonCooperWorks/3974503 to your computer and use it in GitHub Desktop.
Save JonCooperWorks/3974503 to your computer and use it in GitHub Desktop.
var index = 0;
var myVar;
var intervalTime = 250;
function changeAnimation(){
if ($("animation").value == "blank")
{
$("textBox").value = BLANK;
}
else if ($("animation").value == "custom")
{
$("textBox").value = CUSTOM;
}
else if ($("animation").value == "exercise")
{
$("textBox").value = EXERCISE;
}
else if ($("animation").value == "juggler")
{
$("textBox").value = JUGGLER;
}
else if ($("animation").value == "bike")
{
$("textBox").value = BIKE;
}
else if ($("animation").value == "dive")
{
$("textBox").value = DIVE;
}
}
function viewFrame(frames){
if(index < frames.length){
$("textBox").value = frames[index];
index++;
}
else if(index == frames.length){
index = 0;
}
}
function startAnimation(){
var ani = $("textBox").value;
var frames = ani.split("=====\n");
$("start").disabled = true;
if($("turbo").checked){
intervalTime = 50;
myVar = setInterval(function(){viewFrame(frames)},intervalTime);
}
else
{
intervalTime = 250;
myVar = setInterval(function(){viewFrame(frames)},intervalTime);
}
}
function stopAnimation(){
clearInterval(myVar);
changeAnimation();
$("start").disabled = false;
}
function setSize(){
if ($("size").value == "tiny")
{
$("textBox").style.fontSize = "7pt";
}
if ($("size").value == "small")
{
$("textBox").style.fontSize = "10pt";
}
if ($("size").value == "medium")
{
$("textBox").style.fontSize = "12pt";
}
if ($("size").value == "large")
{
$("textBox").style.fontSize = "16pt";
}
if ($("size").value == "extraLarge")
{
$("textBox").style.fontSize = "24pt";
}
if ($("size").value == "xxl")
{
$("textBox").style.fontSize = "32pt";
}
}
@JSkally
Copy link

JSkally commented Oct 30, 2012

wht dis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment