Current File : /home/jeshor13/11bsouth.com/DearMelanie/sketch.js
var angle = 0;
var radius = 25
var k = 3;
var threeCount = 1
var timer = 0
var xLoc = 0
var yLoc = 0
var cycles = 0
var widthWiggle = 0
var colorz = 0
var font

function preload() {
  font = loadFont("Bellerose.ttf")
}


function setup() {
  createCanvas(windowWidth, windowHeight);
  // rectMode(CENTER);
  colorz = 200
  xLoc = width / 2
  yLoc = height / 2
  textFont(font);
  textAlign(CENTER);
  textSize(height / 20)
  text("Will you be my valentine?", width / 2, height / 18);
}

function draw() {
  angle += .005
  var x = 100 * (cos(k * (threeCount) * angle + cycles) * cos(angle)) + 30 * (noise(angle + 500) - .5) + xLoc;
  var y = 100 * (cos(k * (threeCount) * angle + cycles) * sin(angle)) + 30 * (noise(angle) - .5) + yLoc;

  colorMode(HSB);

  if (threeCount == 1) {
    fill(colorz, 100, 100, .8)
  };
  if (threeCount == 2) {
    fill((colorz + 30), 100, 100, .8)
  };
  if (threeCount == 3) {
    fill((colorz - 30), 100, 100, .8)
  };
  noStroke()
  ellipse(x, y, 5, 5)
  threeCount++
  if (threeCount > 3) {
    threeCount = 1
  };
  if (millis() / 1000 >= 30+(millis()/60000) && millis() - timer > 30000+(millis()/60000)) {
    fill(0)
    textAlign(CENTER);
    textSize(height / 20)
    text("Will you be my valentine?", width / 2, height / 18);
    timer = millis()
    colorMode(RGB)
    background(255, 255, 255, 80)
    cycles = cycles + random(QUARTER_PI, HALF_PI)
    colorz = round(random(31, 329))
    xLoc = randomGaussian(width / 2, width / 5)
    yLoc = randomGaussian(height / 2, height / 5) + 20
  }

}