Created
October 29, 2012 16:09
-
-
Save JonCooperWorks/3974503 to your computer and use it in GitHub Desktop.
This file contains 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
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"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wht dis?