Login Register






JavaScript - Interactive Name Animation filter_list
Author
Message
JavaScript - Interactive Name Animation #1
(From CodeCademy)

This is really simple, you just need to know how to use JavaScript. If you don't I'll be explaining to help you along the way.

We need to define the text we want to animate. In this case, I will use "Sinisterly" and make it black and red.

Code:
var text = 'Sinisterly';

We've defined "text" to say "Sinisterly", now we define our colours. This is fairly easy.

Code:
var colours = [black,red];

We only have two colours, black and red, they will invert each letter.

Now we user drawName, but we need to use our colours and text. It's simple, put them in parentheses.

Code:
drawName(text,colours);

Lastly, we set our desired shape. I will use square for a pixel effect, but you can use circles and such.

Code:
bubbleShape = 'square';

We're done, now we set bounceBubbles, then we're done.

Code:
bounceBubbles();

Now, we're done. Here's the full code if you want it, you can make so much more though.
Spoiler:
Code:
var text = "Sinisterly"; var colours = [black,red]; drawName(text,colours); bubbleShape = 'square'; bounceBubbles();


Hope this fun little JavaScript code was useful. ~Dub
[Image: BXqGARG.png]


RE: JavaScript - Interactive Name Animation #2
You C&P'd this from CodeAcademy.com
This will not work without importing necessary imports.

For this to work. Create an index.html file and paste the following:
Code:
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.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="main.js"></script> </body> </html>

Then paste the code he posted in a file called main.js
Then your done.
#MakeSinisterlySexyAgain


RE: JavaScript - Interactive Name Animation #3
So this is basically using JavaScript plugins? I guess I could check out the source code for those plugins.
Also, JQuery.

No to say that this isn't interesting. It really is.
(This post was last modified: 04-11-2014, 09:13 AM by cr33pyguy.)
[Image: TeusoI9.png]
BACK UNDER YOUR BEDS
TRY TO GET A GOOD NIGHT'S SLEEP NOW



RE: JavaScript - Interactive Name Animation #4
(03-18-2014, 10:13 PM)Adorapuff Wrote: You C&P'd this from CodeAcademy.com
This will not work without importing necessary imports.

For this to work. Create an index.html file and paste the following:
Code:
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.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="main.js"></script> </body> </html>

Then paste the code he posted in a file called main.js
Then your done.

Damn @Duubz I think you just got roasted


RE: JavaScript - Interactive Name Animation #5
(04-11-2014, 12:02 PM)Undiscovered Wrote: Damn @Duubz I think you just got roasted
Going to break that shovel I'm telling you.
[Image: BXqGARG.png]