Skip to content

Instantly share code, notes, and snippets.

@danaabs
Created October 14, 2015 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danaabs/656c504b1bbc0a37ae05 to your computer and use it in GitHub Desktop.
Save danaabs/656c504b1bbc0a37ae05 to your computer and use it in GitHub Desktop.
Blue_Dan
var circles = [];
var paragraphs = [];
//create DOM P's
var slider;
var rwords;
var gwords;
var l;
var m;
var n;
var o;
var p;
var q;
var img2;
var feeling;
var index = 0;
var bleu;
var capture;
var button;
var clearButton;
var n = 0;
function setup() {
canvas = createCanvas(600, 600);
var a = 600;
// for (var i = 0; i < 6; i++) {
// circles[i] = new Circle();
// };
for (var i = 0; i < 6; i++) {
circles[i] = {
x: width/2,
y: height/2,
dia: a - i * 100,
col: 25 + 50 * i,
display: function(col1, col2) {
fill(col1, col2, this.col);
ellipse(this.x, this.y, this.dia, this.dia);
},
move: function() {
this.y += random(-1,1);
// this.x += random(-1, 1);
}
}
};
button = createButton("Add Feels");
button.mousePressed(buttonAdd);
clearButton = createButton("No Feels");
clearButton.mousePressed(clearAll);
noStroke();
feeling = ["intelligence", "trust", "duty", "coldness", "logic", "calm"];
rwords = createP("r value");
gwords = createP("g words");
bwords = createP("b words");
slider1 = createSlider(0, 255, 10);
slider1.position(250, 615);
slider2 = createSlider(0, 255, 10);
slider2.position(250, 650);
slider3 = createSlider(0, 255, 10);
slider3.position(250, 685);
rwords.style("font-family", "monospace");
rwords.style("font-size", "12pt");
gwords.style("font-family", "monospace");
gwords.style("font-size", "12pt");
bwords.style("font-family", "monospace");
bwords.style("font-size", "12pt");
// feeling = createP("words");
// feeling.position (700, 100);
// feeling.mousePressed(uniHide);
// bleu = createVideo('https://vimeo.com/43886906');
// bleu.position(700, 0);
// bleu.loop();
// capture = createCapture(VIDEO);
// capture.position(600, 0);
}
function mousePressed() {
index++;
if (index == 6) {
index = 0;
}
};
function draw() {
push();
var b = slider3.value();
background(b);
rwords.html("The r Value: " + slider1.value());
gwords.html("The g Value: " + slider2.value());
bwords.html("The background Value: " + slider3.value());
// feeling.html("yo you");
var val1 = slider1.value();
var val2 = slider2.value();
for (var i = 0; i < circles.length; i++) {
circles[i].display(val1, val2);
circles[i].move();
}
fill(190);
for (var i = 0; i < 6; i++) {
text((25 + i * 50), (270 - i * 50), 300, 10, 10);
}
// text("25", 20, 300, 10, 10);
// text("75", 70, 300, 10, 10);
// text("125", 120, 300, 10, 10);
// text("175", 170, 300, 10, 10);
// text("225", 220, 300, 10, 10);
// text("250+", 270, 300, 10, 10);
textSize(50);
var m = map(b, 0, 255, 255, 0);
fill(0, 0, m);
textStyle(BOLD);
text("B", 0, 0, 100, 100);
textSize(16);
text(feeling[index], 500, 570, 100, 100);
}
function buttonAdd() {
l = createP("intelligence");
m = createP("trust");
n = createP("duty");
o = createP("coldness");
p = createP("logic");
q = createP("calm");
l.position(random(600, windowWidth), random(windowHeight));
m.position(random(600, windowWidth), random(windowHeight));
n.position(random(600, windowWidth), random(windowHeight));
o.position(random(600, windowWidth), random(windowHeight));
p.position(random(600, windowWidth), random(windowHeight));
q.position(random(600, windowWidth), random(windowHeight));
paragraphs.push(l);
paragraphs.push(m);
paragraphs.push(n);
paragraphs.push(o);
paragraphs.push(p);
paragraphs.push(q);
}
function clearAll() {
// for (var i = 0; i < paragraphs.length; i++) {
// paragraphs[i].remove();
// }
paragraphs[0].remove();
paragraphs.splice(0, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment