Playing with bubbles.js on codecademy.com, thought it would be fun to use the whole rainbow.
Created
May 17, 2014 07:51
-
-
Save kenwilcox/bbdda9fa1f78ea590841 to your computer and use it in GitHub Desktop.
A Pen by kenwilcox.
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
<html> | |
<head> | |
<script type="text/javascript" src="http://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> | |
<div id="canvas"> | |
<canvas id="myCanvas"></canvas> | |
</div> | |
<script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script> | |
</body> | |
</html> |
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
function updateCanvasDimensions() { | |
canvas.attr({ | |
height: 200, | |
width: 1000 | |
}); | |
canvasWidth = canvas.width(); | |
canvasHeight = canvas.height(); | |
draw(); | |
} | |
var myName = "Roy G Biv"; | |
// Colors are in HSL not RGB | |
var red = [0, 100, 63]; | |
var orange = [40, 100, 60]; | |
var yellow = [55, 100, 50]; | |
var green = [75, 100, 40]; | |
var blue = [196, 77, 55]; | |
var indigo = [255, 100, 63]; | |
var violet = [280, 50, 60]; | |
var letterColors = [red, orange, yellow, green, blue, indigo, violet]; | |
drawName(myName, letterColors); | |
bubbleShape = 'square'; | |
//bubbleShape = 'circle'; | |
//bounceName(); | |
bounceBubbles(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment