how to animate ur name in javascript ??
Answers
Answered by
1
You do it like this(I tried it on Visual Studio Express; so it should work anywhere on the web)
Create a "HTML" script and a "JavaScript" script and then do the following:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http:// ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http:// s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/alphabet.js"></script>
</head>
<body>
<canvas id="myCanvas"></canvas>
<script type="text/javascript" src="http:// s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script>
<script type="text/javascript" src="JavaScript.js"></script> //<Script type="text/javascript" src="yourdocumentname.js"></script>
// document name is differenton different software or dependent upon the name in which you provide
</body>
</html>
Once completed add the javascript file as following:
var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];
var myName = "Aakash Sharma"; //"Aakash Sharma used as example
// variables can be changed accordingly
letterColors = [red, orange, green, blue, purple];
if (10 > 3
) { bubbleShape = "circle";
} else {
bubbleShape = "square";
} drawName(myName, letterColors);
bounceBubbles();
Create a "HTML" script and a "JavaScript" script and then do the following:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http:// ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http:// s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/alphabet.js"></script>
</head>
<body>
<canvas id="myCanvas"></canvas>
<script type="text/javascript" src="http:// s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script>
<script type="text/javascript" src="JavaScript.js"></script> //<Script type="text/javascript" src="yourdocumentname.js"></script>
// document name is differenton different software or dependent upon the name in which you provide
</body>
</html>
Once completed add the javascript file as following:
var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];
var myName = "Aakash Sharma"; //"Aakash Sharma used as example
// variables can be changed accordingly
letterColors = [red, orange, green, blue, purple];
if (10 > 3
) { bubbleShape = "circle";
} else {
bubbleShape = "square";
} drawName(myName, letterColors);
bounceBubbles();
vishakha:
thanks... :)
Similar questions