Created
December 19, 2013 06:42
-
-
Save leemark/8035297 to your computer and use it in GitHub Desktop.
A Pen by Mark Lee.
This file contains hidden or 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 fibonacci(n) { | |
var fib = []; | |
for(var a=0, b=1, c=0, i=0; i<n; a=b, b=c, i++){ | |
fib.push(a); | |
c = a+b; | |
} | |
return fib; | |
} | |
function makeDivs(arr){ | |
arr.forEach(function(val){ | |
var div = document.createElement('div'); | |
document.body.appendChild(div); | |
div.style.width = val + 'px'; | |
div.style.height = val + 'px'; | |
}); | |
} | |
makeDivs(fibonacci(18)); |
This file contains hidden or 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
body{background: #000;margin:0;padding:0;overflow:hidden} | |
div{ | |
background: rgba(255,255,255, .6); | |
position: absolute; | |
border-radius: 50%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment