Last active
August 29, 2015 14:05
-
-
Save aaizemberg/43733cd4543379c7e610 to your computer and use it in GitHub Desktop.
input range slider (html5 & p5js)
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>input range slider (html5 & p5js)</title> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.2.8/p5.min.js"></script> | |
<script src="sketch.js"></script> | |
</head> | |
<body> | |
<input type="range" id="slider" name="slider" min="0" max="100"> | |
</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
var slider; | |
function setup() { | |
createCanvas(960, 480); | |
background(0); | |
slider = document.getElementById("slider"); | |
} | |
function draw() { | |
for (var i=0; i < slider.value; i++) { | |
fill(Math.random() * 255, Math.random() * 255, Math.random() * 255); | |
ellipse(Math.random() * 960, Math.random() * 500, Math.random() * 50, Math.random() * 50); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment