fractalkitty looking for math? fractalkitty.com

Genuary 2026

Genuary Day 6

#trig#interactive#animation#spiral#genuary

switch1


let switch1 = false;
let t1 = 0;

function setup() {
  createCanvas(600, 600);
  background(255);
  fill(80, 160, 180, 50);
  describe(
    "a closed eye drawn with an arc and lines for lashes are in a white circle. When clicked spiraling particles come into the canvas that are white on a teal transparent background creating a blur effect with the center eye rotating in a blur. when the canvas is clicked it will toggle on and off, but time will continue, so particles will seem to skip locations if it is off and then appear back when on. the blurred paths remain. "
  );
  background(80, 160, 180);
}

function draw() {
  t1 += 0.0001;
  t = 2 * PI * sin(t1);
  background(80, 160, 180, 2);
  translate(width / 2, height / 2);
  if (switch1) {
    stroke(60, 140, 160, 2);
    fill(255, 255, 255, 2);
    circle(0, 0, 100);
    push();
    rotate(t * 10);
    arc(0, 0, 50, 30, 0, 2 * PI);

    for (let i = 0; i <= 20; i++) {
      push();

      line(
        25 * cos((i * PI) / 20),
        -15 * sin((i * PI) / 20),
        35 * cos((i * PI) / 20),
        -30 * sin((i * PI) / 20)
      );
      line(
        25 * cos((i * PI) / 20),
        15 * sin((i * PI) / 20),
        35 * cos((i * PI) / 20),
        20 * sin((i * PI) / 20)
      );
      pop();
    }
    pop();
    noStroke();
    fill(255, 255, 255, 200);
    for (let i = 1; i < 100; i++) {
      push();
      rotate(t + (i * t) / 10);
      circle(
        (width / 2) * cos(t / i) * sin(t / i),
        (height / 2) * sin(t) * cos(i + t),
        2
      );
      pop();
    }
    fill(60, 140, 160, 20);
    circle(0, 0, 20);
  } else {
    background(80, 160, 180, 5);
    stroke(60, 140, 160);
    fill(255);
    circle(0, 0, 100);
    arc(0, 0, 50, 30, 0, PI);
    for (let i = 0; i <= 20; i++) {
      push();

      line(
        25 * cos((i * PI) / 20),
        15 * sin((i * PI) / 20),
        35 * cos((i * PI) / 20),
        30 * sin((i * PI) / 20)
      );
      pop();
    }
  }
}

function mousePressed() {
  switch1 = !switch1;
}