[
  {
    "visibility": "Public",
    "_id": "AY4MiU80w",
    "name": "additive wave",
    "updatedAt": "2024-02-26T20:58:43.673Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dcc4308e82ebe7311738ea",
          "65dcc4308e82ebe7311738e9",
          "65dcc4308e82ebe7311738eb",
          "65dcc43f8e82ebe7311738ed"
        ],
        "fileType": "folder",
        "_id": "65dcc4308e82ebe7311738ec",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T20:58:43.673Z",
        "updatedAt": "2024-02-26T20:58:43.673Z",
        "id": "65dcc4308e82ebe7311738ec"
      },
      {
        "name": "sketch.js",
        "content": "let waves = [];\nlet step;\nlet freqSlider, perSlider\nfunction setup() {\n  colorMode(HSL);\n  createCanvas(600, 400);\n  step = 1;\n\n  for (let i = 0; i < 8; i++) {\n    let a = random(20, 80);\n    let p = random(50, 600);\n    let ph = random(TWO_PI);\n    waves.push(new Wave(a, p, ph));\n  }\n  \n  freqSlider = createSlider(0.1, 2, 0.5, 0.01)\n  perSlider = createSlider(-100, 100, 0, 1)\n}\n\nfunction draw() {\n  background(200, 100, 50);\n  let periodShift = perSlider.value()\n  let freqShift = freqSlider.value()\n  loadPixels();\n  for (let r = 0; r < height; r++) {\n    for (let c = 0; c < width; c++) {\n      let l = 0;\n      for (let wave of waves) {\n        l += wave.eval(c);\n      }\n      const h = map(l, -100, 100, 100, 200);\n      let hue = color(h, 80, 60);\n\n      set(c, r, hue);\n    }\n  }\n  updatePixels();\n\n  push();\n  beginShape();\n  for (let x = 0; x < width; x += step) {\n    let y = 0;\n    for (let wave of waves) {\n      y += wave.eval(x);\n    }\n    strokeWeight(6);\n    stroke(40, 100, 50);\n    noFill();\n    vertex(x, y + 200);\n  }\n  endShape();\n  pop();\n\n  for (let wave of waves) {\n    wave.update(freqShift);\n    // wave.updatePeriod(periodShift)\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dcc4308e82ebe7311738e9",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T20:58:43.673Z",
        "updatedAt": "2024-02-26T20:58:43.673Z",
        "id": "65dcc4308e82ebe7311738e9"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"wave.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dcc4308e82ebe7311738ea",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T20:58:43.673Z",
        "updatedAt": "2024-02-26T20:58:43.673Z",
        "id": "65dcc4308e82ebe7311738ea"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dcc4308e82ebe7311738eb",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T20:58:43.673Z",
        "updatedAt": "2024-02-26T20:58:43.673Z",
        "id": "65dcc4308e82ebe7311738eb"
      },
      {
        "name": "wave.js",
        "content": "class Wave {\n  constructor (amp, period, phase) {\n    this.amp = amp\n    this.period = period\n    this.phase = phase\n  }\n  \n  updatePeriod(s) {\n    this.period += s\n  }\n  \n  update(s = 0.01) {\n    this.phase += s\n  }\n  \n  eval(x) {\n    let y = sin(this.phase + TWO_PI * x / this.period) * this.amp\n    return y\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "65dcc43f8e82ebe7311738ed",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T20:58:43.673Z",
        "updatedAt": "2024-02-26T20:58:43.673Z",
        "id": "65dcc43f8e82ebe7311738ed"
      }
    ],
    "createdAt": "2024-02-26T17:11:49.520Z",
    "id": "AY4MiU80w"
  },
  {
    "visibility": "Public",
    "_id": "RFNzdG29M",
    "name": "angular motion",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "678857b3b5cc5cbf515b46b4",
          "678857b3b5cc5cbf515b46b3",
          "678857b3b5cc5cbf515b46b5"
        ],
        "fileType": "folder",
        "_id": "678857b3b5cc5cbf515b46b6",
        "createdAt": "2025-01-16T02:30:30.812Z",
        "updatedAt": "2025-01-16T02:30:30.812Z",
        "id": "678857b3b5cc5cbf515b46b6"
      },
      {
        "name": "sketch.js",
        "content": "let comet \nlet planet\nlet angle = 0\nlet angleV \nlet angleA =0\nlet r = 100\nlet g \nfunction setup() {\n  createCanvas(400, 400);\n  g = createGraphics(width,height)\n  g.colorMode(HSL)\n  colorMode(HSL)\n  angleV = TWO_PI/12\n}\n\nfunction draw() {\n  background(100,80,10);\n  g.blendMode(BLEND)\n  g.background(200,20,10)\n  g.push()\n  g.translate(width/2,height/2)\n\n \n  let x = cos(angle) * r;\n  let y = sin(angle) * r*0.8\n  \n  let x1 = cos(angle-PI) * r;\n  let y1 = sin(angle-PI) * r*0.8\n\n  g.stroke(200,100,80)\n  g.fill(200,100,80)\n  let off = sin(angle/4) *20\n  g.blendMode(DIFFERENCE)\n  g.circle(x+off,y,50)\n  \n  g.line(0,0,x,y)\n   g.circle(x1+off,y1,50)\n  g.line(0,0,x1,y1)\n  g.circle(0,0,20)\n  g.pop()\n  image(g,0,0)\n  \n  if (frameCount % 10 == 0) {\n    angleV += angleA;\n  angle+= angleV\n  }\n  // if (frameCount % 10 == 0) {\n  //   angleV += angleA;\n  // angle+= angleV\n  //  g.background(100,80,10,0.4)\n  // }\n}\n\n\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "678857b3b5cc5cbf515b46b3",
        "createdAt": "2025-01-16T02:30:30.812Z",
        "updatedAt": "2025-01-16T02:30:30.812Z",
        "id": "678857b3b5cc5cbf515b46b3"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "678857b3b5cc5cbf515b46b4",
        "createdAt": "2025-01-16T02:30:30.812Z",
        "updatedAt": "2025-01-16T02:30:30.812Z",
        "id": "678857b3b5cc5cbf515b46b4"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "678857b3b5cc5cbf515b46b5",
        "createdAt": "2025-01-16T02:30:30.812Z",
        "updatedAt": "2025-01-16T02:30:30.812Z",
        "id": "678857b3b5cc5cbf515b46b5"
      }
    ],
    "updatedAt": "2025-01-16T02:30:30.812Z",
    "createdAt": "2025-01-16T01:17:59.693Z",
    "id": "RFNzdG29M"
  },
  {
    "visibility": "Public",
    "_id": "PghaipbMH",
    "name": "animation stuff",
    "updatedAt": "2024-04-08T21:12:00.905Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "661223a161183d9a56b20960",
          "66122ecf61183d9a56b20963",
          "661223a161183d9a56b2095f",
          "661223a161183d9a56b20961"
        ],
        "fileType": "folder",
        "_id": "661223a161183d9a56b20962",
        "isSelectedFile": false,
        "createdAt": "2024-04-08T21:12:00.905Z",
        "updatedAt": "2024-04-08T21:12:00.905Z",
        "id": "661223a161183d9a56b20962"
      },
      {
        "name": "sketch.js",
        "content": "let shape, x, y, h, w, c\nlet shapeSelect, wSlider, hSlider\nlet play = false\nlet playButton\nlet currentShape\n\nfunction setup() {\n  createCanvas(400, 400);\n  rectMode(CENTER)\n  angleMode(DEGREES)\n  hSlider = createSlider(3,400/3,100,0.1)\n  wSlider = createSlider(3,400/3,100,0.1)\n  \n  shapeSelect = createSelect()\n  shapeSelect.option('square')\n  shapeSelect.option('ellipse')\n  shapeSelect.option('triangle')\n  shapeSelect.selected('square')\n  currentShape = shapeSelect.value()\n  \n  playButton = createButton('play')\n  playButton.style('backgroundColor:green')\n  playButton.mousePressed(() => {\n    if (!play) {\n      play = true\n      playButton.style('backgroundColor:red')\n    } else {\n      play = false\n      playButton.style('backgroundColor:green')\n    }\n  })\n  \n  w = wSlider.value()\n  h = hSlider.value()\n  x = 0\n  // x = width/2\n  y = height/2\n  c = color(0,220,120)\n  updateShape()\n}\n\nfunction updateShape() {\n  if (shapeSelect.value() == 'square') {\n    shape = new Square(x,y,w,c,1,0)\n  } else if (shapeSelect.value() == 'ellipse') {\n    shape = new Ellipse(x,y,w,h,c,1,0)\n  } else {\n    shape = new Triangle(x,y,w,h,c,1,0)\n  }\n  currentShape = shapeSelect.value()\n}\n\nfunction draw() {\n  background(255,200,0,10)\n  if (currentShape != shapeSelect.value()) {\n    updateShape()\n  }\n  if (play) {\n  shape.update()\n  shape.show()\n  }\n    \n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661223a161183d9a56b2095f",
        "isSelectedFile": true,
        "createdAt": "2024-04-08T21:12:00.905Z",
        "updatedAt": "2024-04-08T21:12:00.905Z",
        "id": "661223a161183d9a56b2095f"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"shapes.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "661223a161183d9a56b20960",
        "isSelectedFile": false,
        "createdAt": "2024-04-08T21:12:00.905Z",
        "updatedAt": "2024-04-08T21:12:00.905Z",
        "id": "661223a161183d9a56b20960"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\n\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661223a161183d9a56b20961",
        "isSelectedFile": false,
        "createdAt": "2024-04-08T21:12:00.905Z",
        "updatedAt": "2024-04-08T21:12:00.905Z",
        "id": "661223a161183d9a56b20961"
      },
      {
        "name": "shapes.js",
        "content": "class Shape {\n//   x, y, width, height, color, trans speed x, trans speed y,\n  constructor(x,y,w,h,c,tsx,tsy) {\n    this.x = x\n    this.y = y\n    this.w = w\n    this.h = h\n    this.c = c\n    this.tspeedx = tsx\n    this.tspeedy = tsy\n  }\n  \n  update(amt=0, amt2=0) {\n    if (amt > 0) {\n      this.w = amt\n    }\n    if (amt2 > 0) {\n       this.h = amt2\n    }\n    this.x += this.tspeedx\n    this.y += this.tspeedy\n    \n    if (this.x > width + this.w) {\n      this.x = -this.w\n    } else if (this.x < -this.w) {\n      this.x = width + this.w\n    }\n     if (this.y > height + this.h) {\n      this.y = -this.h\n    } else if (this.y < -this.h) {\n      this.y = height + this.h\n    }\n  }\n}\n\nclass Square extends Shape {\n  constructor(x,y,d,c,tsx,tsy) {\n    super(x,y,d,d,c,tsx,tsy)\n  }\n  \n  show() {\n    push()\n    translate(this.x, this.y)\n    noStroke()\n    fill(this.c)\n    square(0, 0, this.w)\n    pop()\n  }\n}\n\nclass Ellipse extends Shape {\n  constructor(x,y,w,h,c,tsx,tsy) {\n    super(x,y,w,h,c,tsx,tsy)\n  }\n  \n   show() {\n    push()\n    translate(this.x, this.y)\n    noStroke()\n    fill(this.c)\n    ellipse(0, 0, this.w, this.h)\n    pop()\n  }\n}\n\nclass Triangle extends Shape {\n  constructor(x,y,w,h,c,tsx,tsy) {\n    super(x,y,w,h,c,tsx,tsy)\n  }\n  \n  show() {\n    push()\n    translate(this.x, this.y)\n    noStroke()\n    fill(this.c)\n    triangle(-this.h/2, -this.y/2, -this.h/2, this.y/2, this.h/2, 0)\n    pop()\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "66122ecf61183d9a56b20963",
        "isSelectedFile": false,
        "createdAt": "2024-04-08T21:12:00.905Z",
        "updatedAt": "2024-04-08T21:12:00.905Z",
        "id": "66122ecf61183d9a56b20963"
      }
    ],
    "createdAt": "2024-04-07T06:25:45.085Z",
    "id": "PghaipbMH"
  },
  {
    "_id": "tfjrvCESl",
    "name": "applications experiment",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69221c493128b21c2b680389",
          "692011d0454e355453bab5b8",
          "692011d0454e355453bab5b7",
          "692011d0454e355453bab5b9"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "692011d0454e355453bab5ba",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "692011d0454e355453bab5ba"
      },
      {
        "name": "sketch.js",
        "content": "let addTrees, addCloud, addSun, addFlowers, makeStandard,makeModern, makeFancy;\nlet house, nicerHouse, modernHouse, cistern;\nlet grass, sky, sun, clouds, trees, flowers;\nlet settings = {\n  speed: 10,\n  level: 100,\n  tintMix: 0,\n  suns: [],\n  trees: 0,\n  flowers: 0,\n  clouds: [],\n  houses: []\n};\n\nfunction preload() {\n  house = loadImage(\"images/house.png\");\n  niceHouse = loadImage(\"images/nicer_house.png\");\n  modernHouse = loadImage(\"images/modern_house.png\");\n  sky = loadImage(\"images/sky.jpeg\");\n  sun = loadImage(\"images/sun.png\");\n  cloud = loadImage(\"images/cloud.png\");\n  grass = loadImage(\"images/grass.png\");\n  cistern = loadImage(\"images/cistern.png\");\n  trees = loadImage(\"images/many_trees.png\");\n  flowers = loadImage(\"images/many_flowers.png\");\n}\n\nfunction setup() {\n  createCanvas(windowWidth, windowHeight * 0.9);\n  cistern.resize(width * 0.3, 0);\n  cloud.resize(width * 0.3, 0);\n  trees.resize(width * 0.4, 0);\n  // deadTown.resize(width, 0);\n  sun.resize(width * 0.1, 0);\n  flowers.resize(width * 0.4, height * 0.3);\n\n  makeStandard = createButton(\"add house\");\n  makeModern = createButton(\"add modern house\");\n  makeFancy = createButton(\"add fancy house\");\n  addSun = createButton(\"add sun\");\n  addClouds = createButton(\"add clouds\");\n  addTrees = createButton(\"add trees\");\n  addFlowers = createButton(\"add flowers\");\n\n  makeStandard.mousePressed(() => causeAndEffect(\"add house\"));\n  makeModern.mousePressed(() => causeAndEffect(\"add modern house\"));\n  makeFancy.mousePressed(() => causeAndEffect(\"add fancy house\"));\n  addSun.mousePressed(() => causeAndEffect(\"add sun\"));\n  addClouds.mousePressed(() => causeAndEffect(\"add clouds\"));\n  addTrees.mousePressed(() => causeAndEffect(\"add trees\"));\n  addFlowers.mousePressed(() => causeAndEffect(\"add flowers\"));\n}\n\nfunction causeAndEffect(text) {\n  if (settings.level > 0) {\n    switch (text) {\n      case \"add sun\":\n        let sunX = random(width * 0.2, width * 0.8);\n        let sunY = random(0, height * 0.2);\n        settings.suns.push([sunX, sunY]);\n        break;\n      case \"add clouds\":\n        let x = random(width * 0.2, width * 0.8);\n        let y = height * random(0, 0.3);\n        settings.clouds.push([x, y]);\n        break;\n      case \"add trees\":\n        settings.trees += 1;\n        break;\n      case \"add flowers\":\n        settings.flowers += 1;\n        break;\n         case \"add house\":\n        settings.houses.push(\"standard\");\n        break;\n      case \"add modern house\":\n        settings.houses.push(\"modern\");\n        break;\n      case \"add fancy house\":\n        settings.houses.push(\"nice\")\n        break;\n      default:\n        break;\n    }\n\n    settings.level -= settings.speed;\n    settings.tintMix += settings.speed;\n  }\n}\n\nfunction draw() {\n  drawSky();\n  drawSuns();\n  drawClouds();\n  drawTrees();\n  drawGrass();\n  waterTower();\n  drawFlowers();\n  town();\n}\n\nfunction keyPressed() {\n    saveCanvas('applications_experiment.png')\n}\n\nfunction drawSky() {\n  image(sky, 0, 0, width, height);\n\n  push();\n  let a = map(settings.tintMix, 0, 100, 0, 255);\n  tint(128, 20, 8, a);\n  image(sky, 0, 0, width, height);\n  pop();\n}\n\nfunction drawSuns() {\n  for (let i = 0; i < settings.suns.length; i++) {\n    let s = settings.suns[i];\n    image(sun, s[0], s[1]);\n  }\n}\n\nfunction drawClouds() {\n  for (let i = 0; i < settings.clouds.length; i++) {\n    let c = settings.clouds[i];\n    image(cloud, c[0], c[1]);\n  }\n}\n\nfunction drawGrass() {\n  horizon();\n  push();\n  let a1 = map(settings.tintMix, 0, 100, 0, 255);\n  tint(245, 132, 66, a1);\n  horizon();\n  pop();\n}\n\nfunction drawTrees() {\n  for (let i = 0; i < settings.trees; i++) {\n    let x = 0;\n    image(trees, x + i * trees.width, height * 0.3);\n  }\n}\n\nfunction drawFlowers() {\n  for (let i = 0; i < settings.flowers; i++) {\n    let x = width * 0.05;\n    image(flowers, x + i * flowers.width, height * 0.6);\n  }\n}\n\nfunction horizon() {\n  image(grass, 0, height * 0.12, width, height);\n}\n\nfunction town() {\n  let w = width * 0.1;\n  let h = width * 0.1;\n  for (let x = 0; x < settings.houses.length; x++) {\n    let style = settings.houses[x]\n    drawHouse(w * x * 1.1, height * 0.45, w, h,style);\n  }\n}\n\nfunction drawHouse(x, y, w, h,style) {\n  switch (style) {\n    case \"standard\":\n      image(house, x, y, w, h);\n      break;\n    case \"nice\":\n      image(niceHouse, x, y , w * 1.4, h * 1.4);\n      break;\n    case \"modern\":\n      image(modernHouse, x, y, w * 1.2, h * 1.2);\n      break;\n    default:\n      image(house, x, y, w, h);\n      break;\n  }\n}\n\nfunction waterTower() {\n  image(cistern, width * 0.7, height * 0.3);\n  fill(100);\n  rectMode(CORNER);\n  let w = cistern.width * 0.1;\n  let h = cistern.height * 0.5;\n  let x = width * 0.87;\n  let y = height * 0.42;\n  rect(x, y, w, h);\n\n  fill(10, 110, 200);\n\n  rectMode(CORNERS); // CORNERS mode allows you to pass the coordinates of one of the corners followed by the opposite corner, allowing us to reduce the height from the top down\n\n  let percent = (100 - settings.level) / 100;\n  rect(x + w, y + h, x, y + h * percent); // water\n}\n\nfunction prompt(input) {}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "692011d0454e355453bab5b7",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "692011d0454e355453bab5b7"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "692011d0454e355453bab5b8",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "692011d0454e355453bab5b8"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "692011d0454e355453bab5b9",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "692011d0454e355453bab5b9"
      },
      {
        "name": "images",
        "content": "",
        "children": [
          "692226b5ca230c7f53027051",
          "69221c59b4048579e0e6db65",
          "69221e3b1d0c1f4a268a0db5",
          "69221e3c4cba5b47f366b45a",
          "692227b91d0c1f4a268c3223",
          "69221e3c4cba5b47f366b46a",
          "69221e3db4048579e0e71760",
          "69221e3dbc12dc13fb73c7f0",
          "69221e3d1d0c1f4a268a0dd8",
          "69221e3d1d0c1f4a268a0dc4",
          "69221c58b4048579e0e6db5a",
          "69221c58ca230c7f5300708a",
          "69221c593128b21c2b6803d8"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "69221c493128b21c2b680389",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221c493128b21c2b680389"
      },
      {
        "name": "sky.jpeg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/7894d115-881a-48e0-bd8e-5318605df216.jpeg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221c58b4048579e0e6db5a",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221c58b4048579e0e6db5a"
      },
      {
        "name": "sun.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/5388e7e8-9b62-45f0-84d3-b9a7ce545bc2.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221c58ca230c7f5300708a",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221c58ca230c7f5300708a"
      },
      {
        "name": "yellow_flowers.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/8dac5034-27e0-4054-8754-dbd9e490eb6f.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221c593128b21c2b6803d8",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221c593128b21c2b6803d8"
      },
      {
        "name": "cloud.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/87a174b6-1fbb-4dfc-8139-9362de2604c5.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221c59b4048579e0e6db65",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221c59b4048579e0e6db65"
      },
      {
        "name": "dead_town.jpeg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/42e4cd48-ce17-43f2-98a0-7befa60e91c1.jpeg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3b1d0c1f4a268a0db5",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3b1d0c1f4a268a0db5"
      },
      {
        "name": "flowers.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/bff139bb-f7fb-4e70-af39-8abd4e468c80.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3c4cba5b47f366b45a",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3c4cba5b47f366b45a"
      },
      {
        "name": "house.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/c813aa05-e961-497b-aa08-0016fe9166ff.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3c4cba5b47f366b46a",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3c4cba5b47f366b46a"
      },
      {
        "name": "many_trees.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/f91daae8-fdd5-43ce-b1a3-ae768c1fdf4e.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3dbc12dc13fb73c7f0",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3dbc12dc13fb73c7f0"
      },
      {
        "name": "many_flowers.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/6009a6f5-3b68-4b08-a418-bec5f52396ba.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3db4048579e0e71760",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3db4048579e0e71760"
      },
      {
        "name": "nicer_house.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/f86a6a8e-218f-4992-8489-7dfef752a143.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3d1d0c1f4a268a0dc4",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3d1d0c1f4a268a0dc4"
      },
      {
        "name": "modern_house.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/2370b610-9af0-49f7-bd2f-db958905857c.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69221e3d1d0c1f4a268a0dd8",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "69221e3d1d0c1f4a268a0dd8"
      },
      {
        "name": "cistern.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/4ba9091c-7bc6-4a6a-b946-fca1172b531b.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "692226b5ca230c7f53027051",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "692226b5ca230c7f53027051"
      },
      {
        "name": "grass.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/2823ab3f-66fb-4390-afc4-0a111d00da49.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "692227b91d0c1f4a268c3223",
        "createdAt": "2025-11-23T07:06:51.335Z",
        "updatedAt": "2025-11-23T07:06:51.335Z",
        "id": "692227b91d0c1f4a268c3223"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-23T07:06:51.335Z",
    "createdAt": "2025-11-21T08:00:25.451Z",
    "id": "tfjrvCESl"
  },
  {
    "_id": "03eKJYdyJ",
    "name": "applications experiment v2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6922b291a6c61fe04b5ec2c9",
          "6922b291a6c61fe04b5ec2d7",
          "6922b291a6c61fe04b5ec2d8",
          "6922b291a6c61fe04b5ec2d9"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2c8",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2c8"
      },
      {
        "name": "sketch.js",
        "content": "let addTrees, addCloud, addSun, addFlowers, makeStandard, makeModern, makeFancy;\nlet house, nicerHouse, modernHouse, cistern;\nlet grass, sky, sun, clouds, trees, flowers, deadTown;\nlet settings = {\n  playing: false,\n  dead: false,\n  speed: 10,\n  level: 100,\n  tintMix: 0,\n  suns: [],\n  trees: 0,\n  flowers: 0,\n  clouds: [],\n  houses: [],\n  instructions: [\n    \"This is an image maker game simulating AI image generation.\",\n    \" Use the prompts to create your image.\",\n    \"Each simulated prompt represents 1000 prompts in the real world\",\n    \"and costs about 10L of water.\",\n    \" You can stop whenever you want and hit “enter” to save the image to the desktop.\",\n    \"Press any key to start\",\n  ],\n};\n\nfunction preload() {\n  loadImages();\n}\n\nfunction setup() {\n  createCanvas(windowWidth, windowHeight * 0.9);\n  cistern.resize(width * 0.3, 0);\n  cloud.resize(width * 0.3, 0);\n  trees.resize(width * 0.4, 0);\n  deadTown.resize(width, 0);\n  sun.resize(width * 0.1, 0);\n  flowers.resize(width * 0.4, height * 0.3);\n\n  makeStandard = createButton(\"add house\");\n  makeModern = createButton(\"add modern house\");\n  makeFancy = createButton(\"add fancy house\");\n  addSun = createButton(\"add sun\");\n  addClouds = createButton(\"add clouds\");\n  addTrees = createButton(\"add trees\");\n  addFlowers = createButton(\"add flowers\");\n\n  makeStandard.mousePressed(() => causeAndEffect(\"add house\"));\n  makeModern.mousePressed(() => causeAndEffect(\"add modern house\"));\n  makeFancy.mousePressed(() => causeAndEffect(\"add fancy house\"));\n  addSun.mousePressed(() => causeAndEffect(\"add sun\"));\n  addClouds.mousePressed(() => causeAndEffect(\"add clouds\"));\n  addTrees.mousePressed(() => causeAndEffect(\"add trees\"));\n  addFlowers.mousePressed(() => causeAndEffect(\"add flowers\"));\n}\n\nfunction loadImages() {\n  house = loadImage(\"images/house.png\");\n  niceHouse = loadImage(\"images/nicer_house.png\");\n  modernHouse = loadImage(\"images/modern_house.png\");\n  sky = loadImage(\"images/sky.jpeg\");\n  sun = loadImage(\"images/sun.png\");\n  cloud = loadImage(\"images/cloud.png\");\n  grass = loadImage(\"images/grass.png\");\n  cistern = loadImage(\"images/cistern.png\");\n  trees = loadImage(\"images/many_trees.png\");\n  flowers = loadImage(\"images/many_flowers.png\");\n  deadTown = loadImage(\"images/dead_town.jpeg\");\n}\n\nfunction causeAndEffect(text) {\n  if (settings.level > 0) {\n    switch (text) {\n      case \"add sun\":\n        let sunX = random(width * 0.2, width * 0.8);\n        let sunY = random(0, height * 0.2);\n        settings.suns.push([sunX, sunY]);\n        break;\n      case \"add clouds\":\n        let x = random(width * 0.2, width * 0.8);\n        let y = height * random(0, 0.3);\n        settings.clouds.push([x, y]);\n        break;\n      case \"add trees\":\n        settings.trees += 1;\n        break;\n      case \"add flowers\":\n        settings.flowers += 1;\n        break;\n      case \"add house\":\n        settings.houses.push(\"standard\");\n        break;\n      case \"add modern house\":\n        settings.houses.push(\"modern\");\n        break;\n      case \"add fancy house\":\n        settings.houses.push(\"nice\");\n        break;\n      default:\n        break;\n    }\n\n    settings.level -= settings.speed;\n    settings.tintMix += settings.speed;\n  } else {\n    settings.dead = true;\n  }\n}\n\nlet a = 0;\nfunction draw() {\n  if (!settings.playing) {\n    instructions();\n  } else {\n    drawSky();\n    drawSuns();\n    drawClouds();\n    drawTrees();\n    drawGrassWithTint();\n    town();\n    waterTower();\n    drawFlowers();\n    if (settings.dead) {\n      if (a < 255) {\n        a += 0.5;\n      }\n      push();\n      tint(255, a);\n      image(deadTown, 0, 0);\n      pop();\n    }\n  }\n}\n\nfunction keyPressed() {\n  if (settings.playing && key == \"Enter\") {\n    saveCanvas(\"applications_experiment.png\");\n  } else {\n    settings.playing = true;\n  }\n}\n\nfunction instructions() {\n  background(100, 200, 255);\n  textSize(24);\n  textFont(\"Courier New\");\n  textAlign(CENTER);\n  for (let i = 0; i < settings.instructions.length; i++) {\n    let current = settings.instructions[i];\n    text(current, width / 2, height / 2 + i * textSize());\n  }\n}\n\n// ------ SKY -----\n\nfunction drawSky() {\n  image(sky, 0, 0, width, height);\n\n  push();\n  let a = map(settings.tintMix, 0, 100, 0, 255);\n  tint(128, 20, 8, a);\n  image(sky, 0, 0, width, height);\n  pop();\n}\n\n// ------ SUNS -----\n\nfunction drawSuns() {\n  for (let i = 0; i < settings.suns.length; i++) {\n    let s = settings.suns[i];\n    image(sun, s[0], s[1]);\n  }\n}\n\n//  -----  CLOUDS. -----\n\nfunction drawClouds() {\n  for (let i = 0; i < settings.clouds.length; i++) {\n    let c = settings.clouds[i];\n    image(cloud, c[0], c[1]);\n  }\n}\n//  -----  GRASS TINTED. -----\nfunction drawGrassWithTint() {\n  drawGrass();\n  push();\n  let a1 = map(settings.tintMix, 0, 100, 0, 255);\n  tint(245, 132, 66, a1);\n  drawGrass();\n  pop();\n}\n\n//. ----- TREES ------\n\nfunction drawTrees() {\n  for (let i = 0; i < settings.trees; i++) {\n    let x = 0;\n    image(trees, x + i * trees.width, height * 0.36);\n  }\n}\n\n// ------- FLOWERS ------\n\nfunction drawFlowers() {\n  for (let i = 0; i < settings.flowers; i++) {\n    let x = width * 0.05;\n    image(flowers, x + i * flowers.width, height * 0.6);\n  }\n}\n\n// ----- GRASS NORMAL ----\n\nfunction drawGrass() {\n  image(grass, 0, height * 0.12, width, height);\n}\n\n// ------ HOUSES -------\n\nfunction town() {\n  let w = width * 0.1;\n  let h = width * 0.1;\n  for (let x = 0; x < settings.houses.length; x++) {\n    let style = settings.houses[x];\n    drawHouse(w * x * 1.1, height * 0.45, w, h, style);\n  }\n}\n\n// ----- SINGLE HOUSE\n\nfunction drawHouse(x, y, w, h, style) {\n  switch (style) {\n    case \"standard\":\n      image(house, x, y, w, h);\n      break;\n    case \"nice\":\n      image(niceHouse, x, y, w * 1.4, h * 1.4);\n      break;\n    case \"modern\":\n      image(modernHouse, x, y, w * 1.2, h * 1.2);\n      break;\n    default:\n      image(house, x, y, w, h);\n      break;\n  }\n}\n\n// ------- CISTERN ------\n\nfunction waterTower() {\n  push();\n  imageMode(CENTER);\n  translate(width * 0.5, height * 0.6);\n  stroke(100);\n\n  image(cistern, 0, 0);\n  fill(100);\n\n  // here is the water meter, aligned to the cistern position\n  rectMode(CORNER);\n  let w = cistern.width * 0.38;\n  let h = cistern.height * 0.5;\n  let x = -w / 2;\n  let y = -h / 2;\n  rect(x, y, w, h);\n\n  fill(10, 110, 200);\n\n  rectMode(CORNERS); // CORNERS mode allows you to pass the coordinates of one of the corners followed by the opposite corner, so we can draw from bottom right to top left, allowing us to reduce the height from the top down\n\n  let percent = (100 - settings.level) / 100;\n  rect(x + w, y + h, x, y + h * percent); // water level reduces with percent\n  imageMode(CORNER);\n  pop();\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6922b291a6c61fe04b5ec2d8",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d8"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d7",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d7"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d9",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d9"
      },
      {
        "name": "images",
        "content": "",
        "children": [
          "6922b291a6c61fe04b5ec2ca",
          "6922b291a6c61fe04b5ec2cb",
          "6922b291a6c61fe04b5ec2cc",
          "6922b291a6c61fe04b5ec2cd",
          "6922b291a6c61fe04b5ec2ce",
          "6922b291a6c61fe04b5ec2cf",
          "6922b291a6c61fe04b5ec2d0",
          "6922b291a6c61fe04b5ec2d1",
          "6922b291a6c61fe04b5ec2d2",
          "6922b291a6c61fe04b5ec2d3",
          "6922b291a6c61fe04b5ec2d4",
          "6922b291a6c61fe04b5ec2d5",
          "6922b291a6c61fe04b5ec2d6"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2c9",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2c9"
      },
      {
        "name": "sky.jpeg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/e11bfd49-3b9b-41c1-b92f-c6fb06006a8e.jpeg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d4",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d4"
      },
      {
        "name": "sun.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/495736c8-c671-47dc-bf14-18b42b4d6989.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d5",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d5"
      },
      {
        "name": "yellow_flowers.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/b9cdd2b8-39f8-413a-b47d-2b3d831c1cf4.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d6",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d6"
      },
      {
        "name": "cloud.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/2caf9e8c-1820-4ebe-bc15-9d8900604cfc.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2cb",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2cb"
      },
      {
        "name": "dead_town.jpeg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/a6f57bd3-6548-4656-90e3-d164cbe42812.jpeg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2cc",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2cc"
      },
      {
        "name": "flowers.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/9392cb5a-0b47-445b-98ef-2c2ba7f94c28.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2cd",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2cd"
      },
      {
        "name": "house.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/38eeee10-fbc1-4932-8393-820d6d4ad27a.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2cf",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2cf"
      },
      {
        "name": "many_trees.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/76c2e1cc-5eaa-4e1f-b63a-d3d92c626a52.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d1",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d1"
      },
      {
        "name": "many_flowers.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/aba7e1ed-d8a2-42d6-ba91-99f651e2d56a.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d0",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d0"
      },
      {
        "name": "nicer_house.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/9959a951-5a8f-4d26-a2dd-992c5d705965.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d3",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d3"
      },
      {
        "name": "modern_house.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/638a9dd1-3b35-42b0-bb62-b2e1ed87395f.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2d2",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2d2"
      },
      {
        "name": "cistern.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/74d2d6d5-2010-4b22-9400-8513366cc86a.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2ca",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2ca"
      },
      {
        "name": "grass.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/8224d85e-83f5-45ed-adf6-d177d0ccb4e3.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6922b291a6c61fe04b5ec2ce",
        "createdAt": "2025-11-23T22:25:26.126Z",
        "updatedAt": "2025-11-23T22:25:26.126Z",
        "id": "6922b291a6c61fe04b5ec2ce"
      }
    ],
    "visibility": "Public",
    "createdAt": "2025-11-23T07:06:58.094Z",
    "updatedAt": "2025-11-23T22:25:26.126Z",
    "id": "03eKJYdyJ"
  },
  {
    "visibility": "Public",
    "_id": "PqqxGxKTJ",
    "name": "attractor + mover",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65da86ca2fa997001b3fcd63",
          "65da86b4ed156b6d94131000",
          "65da86b4ed156b6d94131001",
          "65da935e2fa997001b4048fa",
          "65da86b4ed156b6d94131002",
          "65da86b4ed156b6d94131003"
        ],
        "fileType": "folder",
        "_id": "65da86b4ed156b6d94130fff",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T00:52:18.802Z",
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "id": "65da86b4ed156b6d94130fff"
      },
      {
        "name": "sketch.js",
        "content": "let movers = [];\nlet attractor, repeller, repeller2;\nfunction setup() {\n  colorMode(HSL);\n  createCanvas(400, 400);\n  for (let i = 0; i < 20; i++) {\n    const x = random(width);\n    const y = random(height);\n    mover = new Mover(x, y, 20);\n    movers.push(mover);\n  }\n  attractor = new Attractor(width / 2, height / 2, 60);\n  repeller = new Attractor(340, 340, 30);\n  repeller2 = new Attractor(60, 60, 30);\n}\n\nfunction draw() {\n  background(200, 100, 50, 0.2);\n\n  for (let mover of movers) {\n    mover.update();\n    mover.show();\n    repeller.attract(mover);\n    repeller2.attract(mover);\n    attractor.attract(mover);\n  }\n  attractor.show();\n  repeller.show();\n  repeller2.show();\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da86b4ed156b6d94131002",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T00:52:18.802Z",
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "id": "65da86b4ed156b6d94131002"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n    <meta charset=\"utf-8\" />\n  </head>\n  <body>\n    <main></main>\n    <script src=\"attractor.js\"></script>\n    <script src=\"repeller.js\"></script>\n    <script src=\"mover.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65da86b4ed156b6d94131000",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T00:52:18.802Z",
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "id": "65da86b4ed156b6d94131000"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da86b4ed156b6d94131003",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T00:52:18.802Z",
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "id": "65da86b4ed156b6d94131003"
      },
      {
        "name": "mover.js",
        "content": "class Mover {\n  constructor(x, y, m) {\n    this.pos = createVector(x, y);\n    this.vel = p5.Vector.random2D();\n    this.vel.mult(4)\n    this.r = sqrt(m) * 2;\n    this.acc = createVector(0,0);\n    this.mass = m\n    this.reduce = -0.8\n  }\n\n  edges() {\n    if (this.pos.x >= width - this.r) {\n      this.pos.x = width - this.r;\n      this.vel.x *= this.reduce;\n    }\n    if (this.pos.x < this.r) {\n      this.pos.x = this.r;\n      this.vel.x *= this.reduce;\n    }\n    if (this.pos.y > height - this.r) {\n      this.pos.y = height - this.r;\n      this.vel.y *= this.reduce;\n    }\n    if (this.pos.y < this.r) {\n      this.pos.y = this.r;\n      this.vel.y *= this.reduce;\n    }\n  }\n  \n  drag () {\n    const drag = this.vel.copy()\n    drag.normalize().mult(-1)\n    const speedSq = this.vel.magSq()\n    const c = 0.02\n    drag.setMag(c * speedSq * this.r)\n    this.applyForce(drag)\n  }\n  \n  friction () {\n    const d = height - (this.pos.y + this.r)\n    if (d < 1) {\n      \n    const friction = this.vel.copy()\n    friction.normalize().mult(-1)\n    \n    const mu = 0.1\n    const normal = this.mass\n    \n    friction.setMag(mu * normal)\n    \n    this.applyForce(friction)\n    }\n  }\n\n  applyForce(force) {\n    const f = p5.Vector.div(force,this.mass)\n    this.acc.add(f)\n  }\n\n  update() {\n    this.vel.add(this.acc);\n    this.pos.add(this.vel);\n    this.acc.set(0,0)\n  }\n\n  show() {\n    noStroke();\n    fill(100, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da86b4ed156b6d94131001",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T00:52:18.802Z",
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "id": "65da86b4ed156b6d94131001"
      },
      {
        "name": "attractor.js",
        "content": "class Attractor {\n  constructor(x, y, m) {\n    this.pos = createVector(x, y);\n    this.mass = m;\n    this.r = sqrt(this.mass) * 2;\n  }\n  \n  getStrength(mover, force) {\n    const distanceSq = constrain(force.magSq(), 250, 2500);\n    const G = 5;\n    const strength = G * (this.mass * mover.mass) / distanceSq;\n    return strength\n  }\n\n  attract(mover) {\n    const force = p5.Vector.sub(this.pos, mover.pos);\n    const strength = this.getStrength(mover, force)\n    force.setMag(strength)\n    mover.applyForce(force);\n  }\n\n  show() {\n    fill(20, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da86ca2fa997001b3fcd63",
        "isSelectedFile": false,
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "createdAt": "2024-02-26T00:52:18.802Z",
        "id": "65da86ca2fa997001b3fcd63"
      },
      {
        "name": "repeller.js",
        "content": "class Repeller extends Attractor {\n  constructor(x,y,m) {\n    super(x,y,m)\n  }\n  \n  repel(mover) {\n    const force = p5.Vector.sub(this.pos, mover.pos)\n    const strength = this.getStrength(mover, force) * -1\n    force.setMag(strength)\n    mover.applyForce(force)\n  }\n  \n  show() {\n    fill(50, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "65da935e2fa997001b4048fa",
        "isSelectedFile": false,
        "updatedAt": "2024-02-26T00:52:18.802Z",
        "createdAt": "2024-02-26T00:52:18.802Z",
        "id": "65da935e2fa997001b4048fa"
      }
    ],
    "createdAt": "2024-02-25T00:15:48.440Z",
    "updatedAt": "2024-02-26T00:52:18.802Z",
    "id": "PqqxGxKTJ"
  },
  {
    "visibility": "Public",
    "_id": "ataCmPBAV",
    "name": "autonomous agents",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65de4a34b6911f81f525434a",
          "65de4a34b6911f81f525434c",
          "65de4a34b6911f81f525434d",
          "65de4a34b6911f81f525434b"
        ],
        "fileType": "folder",
        "_id": "65de4a34b6911f81f5254348",
        "isSelectedFile": false,
        "createdAt": "2024-02-29T00:21:32.354Z",
        "updatedAt": "2024-02-29T00:21:32.354Z",
        "id": "65de4a34b6911f81f5254348"
      },
      {
        "name": "sketch.js",
        "content": "let vehicle;\nlet target;\nfunction setup() {\n  createCanvas(600, 600);\n  colorMode(HSL);\n  vehicle = new Vehicle(100, 100);\n  target = new Target(400, 400);\n}\n\nfunction draw() {\n  background(240, 60, 40);\n  // target.update();\n  // target.show();\n  vehicle.edges()\n  vehicle.perlinWander();\n  // vehicle.applyForce(steering);\n  vehicle.update();\n  vehicle.show();\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65de4a34b6911f81f525434c",
        "isSelectedFile": false,
        "createdAt": "2024-02-29T00:21:32.354Z",
        "updatedAt": "2024-02-29T00:21:32.354Z",
        "id": "65de4a34b6911f81f525434c"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"vehicle.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65de4a34b6911f81f525434a",
        "isSelectedFile": false,
        "createdAt": "2024-02-29T00:21:32.354Z",
        "updatedAt": "2024-02-29T00:21:32.354Z",
        "id": "65de4a34b6911f81f525434a"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65de4a34b6911f81f525434d",
        "isSelectedFile": false,
        "createdAt": "2024-02-29T00:21:32.354Z",
        "updatedAt": "2024-02-29T00:21:32.354Z",
        "id": "65de4a34b6911f81f525434d"
      },
      {
        "name": "vehicle.js",
        "content": "class Vehicle {\n  constructor(x, y) {\n    this.mass = 1;\n    this.max_speed = 2;\n    this.max_force = 0.1;\n    this.pos = createVector(x, y);\n    this.vel = createVector(1, 0);\n    this.acc = createVector(0, 0);\n    this.size = 12;\n    this.color = color(100, 100, 50);\n    this.thetaOff = 0;\n    this.randomOff = 0.6;\n    this.wanderRadius = 20\n  }\n\n  edges() {\n    const offset = this.size * 2;\n    if (this.pos.x > width + offset) {\n      this.pos.x = -offset;\n    } else if (this.pos.x < 0 - offset) {\n      this.pos.x = width + offset;\n    } else if (this.pos.y > height + offset) {\n      this.pos.y = -offset;\n    } else if (this.pos.y < 0 - offset) {\n      this.pos.y = height + offset;\n    }\n  }\n\n  flee(target) {\n    return this.seek(target).mult(-1);\n  }\n\n  seek(target, mode = \"seek\") {\n    const force = p5.Vector.sub(target, this.pos);\n    let desired_speed = this.max_speed;\n\n    if (mode == \"arrive\") {\n      let slowRadius = 100;\n      let distance = force.mag();\n      if (distance < slowRadius) {\n        desired_speed = map(distance, 0, slowRadius, 0, this.max_speed);\n      }\n    }\n\n    force.setMag(desired_speed);\n    force.sub(this.vel);\n    force.limit(this.max_force);\n    return force;\n  }\n\n  pursue(vehicle) {\n    const target = vehicle.pos.copy();\n    const prediction = vehicle.vel.copy().mult(10);\n    target.add(prediction);\n    return this.seek(target);\n  }\n\n  evade(vehicle) {\n    const evasion = this.pursue(vehicle).mult(-1);\n    return evasion;\n  }\n\n  arrive(target) {\n    const force = this.seek(target.pos, \"arrive\");\n    return force;\n  }\n  \n  perlinWander() {\n    const angle = noise(this.thetaOff) * TWO_PI * 2\n    const steering = p5.Vector.fromAngle(angle)\n    steering.limit(this.maxForce)\n    this.applyForce(steering)\n    this.thetaOff += 0.01\n  }\n\n  wander() {\n    const point = this.vel.copy();\n    point.setMag(100);\n    point.add(this.pos);\n   \n    let theta = this.thetaOff + this.vel.heading();\n    let x = cos(theta) * this.wanderRadius;\n    let y = sin(theta) * this.wanderRadius;\n\n    point.add(x, y);\n    const steering = p5.Vector.sub(point, this.pos);\n    steering.limit(this.max_force);\n    this.applyForce(steering);\n    this.thetaOff += random(-this.randomOff, this.randomOff);\n    noStroke();\n   \n    fill(100,100,50);\n    circle(point.x + x, point.y + y, 10);\n    fill(0, 100, 50);\n    circle(point.x, point.y, 14);\n    noFill();\n    stroke(255);\n    circle(point.x, point.y, this.wanderRadius * 2);\n  }\n\n  applyForce(force) {\n    const f = force.copy();\n    f.div(this.mass);\n    this.acc.add(f);\n  }\n\n  update() {\n    this.vel.add(this.acc);\n    this.vel.limit(this.max_speed);\n    this.pos.add(this.vel);\n    this.acc.mult(0);\n  }\n\n  show() {\n    noStroke();\n    fill(160, 80, 50);\n    push();\n    translate(this.pos.x, this.pos.y);\n    rotate(this.vel.heading());\n    triangle(-this.size, -this.size, -this.size, this.size, this.size * 2, 0);\n    pop();\n  }\n}\n\nclass Target extends Vehicle {\n  constructor(x, y) {\n    super(x, y);\n    this.vel = createVector(0, 0);\n    this.stopping_radius = 320;\n  }\n\n  show() {\n    noStroke();\n    push();\n    fill(0, 80, 50);\n    circle(this.pos.x, this.pos.y, this.size * 2);\n    fill(0, 80, 50, 0.5);\n    circle(this.pos.x, this.pos.y, this.size * 2 + this.stopping_radius / 2);\n    pop();\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65de4a34b6911f81f525434b",
        "isSelectedFile": true,
        "createdAt": "2024-02-29T00:21:32.354Z",
        "updatedAt": "2024-02-29T00:21:32.354Z",
        "id": "65de4a34b6911f81f525434b"
      }
    ],
    "createdAt": "2024-02-27T20:46:45.664Z",
    "updatedAt": "2024-02-29T00:21:32.354Z",
    "id": "ataCmPBAV"
  },
  {
    "visibility": "Public",
    "_id": "1CCtpN5OF",
    "name": "Awesome echinacea",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "677a0bc5669deb17c31b75ee",
          "677a0bc5669deb17c31b75ed",
          "677a0bc5669deb17c31b75ef"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "677a0bc5669deb17c31b75f0",
        "createdAt": "2025-01-05T05:39:31.222Z",
        "updatedAt": "2025-01-05T05:39:31.222Z",
        "id": "677a0bc5669deb17c31b75f0"
      },
      {
        "name": "sketch.js",
        "content": "let g;\nlet t = 0;\n\nfunction setup() {\n  createCanvas(400, 400);\n  g = createGraphics(width, height);\n  g.noFill();\n}\n\nfunction draw() {\n  // background(224,150,240);\n  background(181, 102, 186);\n  g.clear();\n  g.blendMode(BLEND);\n  g.stroke(0, 120, 244);\n\n  let gap = 1;\n  let weight = 2;\n\n  g.strokeCap(SQUARE);\n  lineFillRect(0, 0, width, height, weight,gap, g);\n  let y = sin(t);\n  // g.blendMode(EXCLUSION);\n  g.push();\n\n  g.rotate(y);\n  lineFillRectV(100,100,200,200, gap, weight, g);\n  g.pop();\n  t += 0.004;\n  image(g, 0, 0);\n}\n\nfunction lineFillRect(xOff, yOff, w, h, weight, gap, graphics) {\n  let xAmt = w / (weight + gap);\n  let yAmt = h / (weight + gap);\n\n  for (let j = 0; j < yAmt + 1; j++) {\n    let x = xOff;\n    let y = j * (weight + gap) + yOff;\n    graphics.strokeWeight(weight);\n    graphics.line(x, y, x + w, y);\n  }\n}\n\nfunction lineFillRectV(xOff, yOff, w, h, weight, gap, graphics) {\n  let xAmt = w / (weight + gap);\n  let yAmt = h / (weight + gap);\n\n  for (let j = 0; j < yAmt + 1; j++) {\n    let x = j * (weight + gap) + xOff;\n    let y = yOff;\n    graphics.strokeWeight(weight);\n    graphics.line(x, y, x, y + h);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "677a0bc5669deb17c31b75ed",
        "createdAt": "2025-01-05T05:39:31.222Z",
        "updatedAt": "2025-01-05T05:39:31.222Z",
        "id": "677a0bc5669deb17c31b75ed"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677a0bc5669deb17c31b75ee",
        "createdAt": "2025-01-05T05:39:31.222Z",
        "updatedAt": "2025-01-05T05:39:31.222Z",
        "id": "677a0bc5669deb17c31b75ee"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677a0bc5669deb17c31b75ef",
        "createdAt": "2025-01-05T05:39:31.222Z",
        "updatedAt": "2025-01-05T05:39:31.222Z",
        "id": "677a0bc5669deb17c31b75ef"
      }
    ],
    "updatedAt": "2025-01-05T05:39:31.222Z",
    "createdAt": "2025-01-05T04:36:19.239Z",
    "id": "1CCtpN5OF"
  },
  {
    "visibility": "Public",
    "_id": "WBXrbZ7ia",
    "name": "baile de la plantilla",
    "updatedAt": "2025-01-03T23:40:53.341Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6614bb12dc2910001a6b88ce",
          "6614b404f05968001a3bb52e",
          "6614b0cc88218a75ad226474",
          "6614b0cc88218a75ad226473",
          "6614b0cc88218a75ad226475"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6614b0cc88218a75ad226476",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b0cc88218a75ad226476"
      },
      {
        "name": "sketch.js",
        "content": "let images = [];\nlet img, vid;\nlet index = 0;\nlet right, left, play;\nlet playing = false;\nlet start = 0\nlet end = 2\nlet flip = 1\n\nfunction preload() {\n  for (let i = 0; i < 5; i++) {\n    img = loadImage(`img/frame_000${i}.png`);\n    images.push(img);\n\n  }\n}\n\nfunction setup() {\n  createCanvas(600, 400);\n  frameRate(6)\n\n  colorMode(HSL);\n  imageMode(CENTER);\n\n  left = createButton(\"<\");\n  right = createButton(\">\");\n  play = createButton(\"play\");\n\n  left.mousePressed(() => next());\n  right.mousePressed(() => prev());\n  play.mousePressed(() => {\n    playing = !playing;\n  });\n\n  // vid = createVideo(\"MVI_1091.MP4\");\n  // // vid.showControls();\n  // vid.hide();\n  // vid.loop();\n  // vid.volume(0);\n  // vid.size(600, 400);\n}\n\nfunction next() {\n   index += 1\n    if (index > end ) {\n      index = 0\n    }\n}\nfunction prev() {\n  index -= 1;\n    if (index < 0) {\n      index = end;\n    }\n}\n\nfunction keyPressed() { \n\n  if (key == \"ArrowLeft\") {\n    prev()\n  } else if (key == \"ArrowRight\") {\n    next()\n}}\n\n\nfunction draw() {\n  background(100,100,50)\n  translate(width / 2, height / 2);\n\n  \n  let current = images[index]\n  \n  current.resize(0, 200);\n  if (frameCount % 9 == 0 && playing) {\n   flip *= -1\n  }\n  scale(flip, 1)\n  image(current, -200, 0);\n  image(current, 0, 0);\n  image(current, 200, 0);\n \n\n  if (playing) {\n    index++\n    if (index > end ) {\n      index = start\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6614b0cc88218a75ad226473",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b0cc88218a75ad226473"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b0cc88218a75ad226474",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b0cc88218a75ad226474"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b0cc88218a75ad226475",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b0cc88218a75ad226475"
      },
      {
        "name": "img",
        "content": "",
        "children": [
          "6614b42df05968001a3bb802",
          "6614b42df05968001a3bb808",
          "6614b42df05968001a3bb7fd",
          "6614b42df05968001a3bb80d",
          "6614b42edc2910001a6b138d"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6614b404f05968001a3bb52e",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b404f05968001a3bb52e"
      },
      {
        "name": "frame_0002.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/8edeaf36-c59a-40a9-84fe-661b3dec2d11.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b42df05968001a3bb7fd",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b42df05968001a3bb7fd"
      },
      {
        "name": "frame_0000.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/573c2808-43fb-485e-980d-e326d4d07c4c.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b42df05968001a3bb802",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b42df05968001a3bb802"
      },
      {
        "name": "frame_0001.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/0777d1a4-2d5e-48dc-b72f-4191530c415c.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b42df05968001a3bb808",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b42df05968001a3bb808"
      },
      {
        "name": "frame_0003.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/09c74d32-2371-41a4-8311-485464cebb2b.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b42df05968001a3bb80d",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b42df05968001a3bb80d"
      },
      {
        "name": "frame_0004.png",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/3d0ef170-4d8b-4cdf-9764-15dad9a761c8.png",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614b42edc2910001a6b138d",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614b42edc2910001a6b138d"
      },
      {
        "name": "MVI_1091.MP4",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/6cd84db3-032a-4f85-92a0-da0a87393f38.MP4",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6614bb12dc2910001a6b88ce",
        "createdAt": "2025-01-03T23:40:53.341Z",
        "updatedAt": "2025-01-03T23:40:53.341Z",
        "id": "6614bb12dc2910001a6b88ce"
      }
    ],
    "createdAt": "2024-04-09T03:17:22.293Z",
    "id": "WBXrbZ7ia"
  },
  {
    "visibility": "Public",
    "_id": "oh0MYjlqV",
    "name": "bezier playground",
    "updatedAt": "2023-06-19T02:20:55.050Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "648f9f9d32142f0e4a6f7a26",
          "648f9f9d32142f0e4a6f7a25",
          "648f9f9d32142f0e4a6f7a27"
        ],
        "fileType": "folder",
        "_id": "648f9f9d32142f0e4a6f7a28",
        "isSelectedFile": false,
        "createdAt": "2023-06-19T02:20:55.050Z",
        "updatedAt": "2023-06-19T02:20:55.050Z",
        "id": "648f9f9d32142f0e4a6f7a28"
      },
      {
        "name": "sketch.js",
        "content": "let as = []\nlet cs = []\nlet ps = []\nlet weight = 20\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n  background(290, 100, 90)\n  \n  strokeWeight(weight)\n  strokeCap(ROUND)\n  strokeJoin(ROUND)\n  noFill()\n  \n  as.push([140, 140])\n  as.push([-140, -140])\n  cs.push([160, 0])\n  cs.push([-160, 0])\n  ps.push(new Point(cs[0][0], cs[0][1], 0))\n  ps.push(new Point(cs[1][0], cs[1][1], 1))\n}\n\nfunction draw() {\n  background(290, 100, 90)\n  translate(width/2, height/2) \n  stroke(100, 100, 40)\n  \n  beginShape()\n  vertex(as[0][0], as[0][1])\n  bezierVertex(cs[0][0], cs[0][1], cs[1][0],cs[1][1], as[1][0], as[1][1])\n  endShape()\n  \n  stroke(200, 100, 50)\n  as.forEach(a => point(a[0], a[1]))\n  \n  ps.forEach(p => p.display())\n}\n\n\nfunction mousePressed() {\n    ps.forEach(p => p.checkClicked())\n}\n\nfunction mouseDragged() {\n  ps.forEach(p => p.update())\n}\n\nfunction mouseReleased() {\n  ps.forEach(p => p.release())\n}\n\n\nfunction Point (x,y, id) {\n  this.x = x\n  this.y = y\n  this.id = id\n  this.d = weight\n  this.clicked = false\n  \n  this.display = function () {\n    stroke(0,100,50)\n    point(this.x, this.y)\n  }\n  \n  this.checkClicked = function() {\n \n    let mX = mouseX - width/2\n    let mY = mouseY - height/2\n      if (dist(mX,mY,this.x,this.y) <= this.d/2) {\n        this.clicked = true\n    }\n  }\n  \n  this.update = function() {\n    if (this.clicked) {\n      let mX = mouseX - width/2\n      let mY = mouseY - height/2\n      this.x = mX\n      this.y = mY\n      cs[this.id][0] = mX\n      cs[this.id][1] = mY\n    }\n  }\n  \n  this.release = function() {\n    if (this.clicked) this.clicked = false\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "648f9f9d32142f0e4a6f7a25",
        "isSelectedFile": true,
        "createdAt": "2023-06-19T02:20:55.050Z",
        "updatedAt": "2023-06-19T02:20:55.050Z",
        "id": "648f9f9d32142f0e4a6f7a25"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "648f9f9d32142f0e4a6f7a26",
        "isSelectedFile": false,
        "createdAt": "2023-06-19T02:20:55.050Z",
        "updatedAt": "2023-06-19T02:20:55.050Z",
        "id": "648f9f9d32142f0e4a6f7a26"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "648f9f9d32142f0e4a6f7a27",
        "isSelectedFile": false,
        "createdAt": "2023-06-19T02:20:55.050Z",
        "updatedAt": "2023-06-19T02:20:55.050Z",
        "id": "648f9f9d32142f0e4a6f7a27"
      }
    ],
    "createdAt": "2023-06-19T01:25:41.102Z",
    "id": "oh0MYjlqV"
  },
  {
    "visibility": "Public",
    "_id": "Cxh1h3dXQ",
    "name": "black and black my version",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "677b25fa27655921751ffee3",
          "677b25fa27655921751ffee2",
          "677b25fa27655921751ffee4"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "677b25fa27655921751ffee5",
        "createdAt": "2025-01-06T05:30:55.981Z",
        "updatedAt": "2025-01-06T05:30:55.981Z",
        "id": "677b25fa27655921751ffee5"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(500, 500);\n  background(24);\n  let graphics = createGraphics(50, 50);\n  graphics.pixelDensity(1);\n  graphics.noStroke();\n  graphics.background(24);\n  graphics.fill(34);\n  graphics.rect(0, 0, 50, 50);\n  graphics.fill(44);\n  graphics.beginShape();\n  graphics.vertex(0, 0);\n  graphics.vertex(50, 0);\n  // graphics.vertex(50,30)\n  graphics.vertex(0, 50);\n  graphics.endShape();\n  graphics.fill(14);\n  graphics.rect(0, 25, 25, 25);\n  \n    graphics.filter(BLUR, 1);\n\n  let d = graphics.pixelDensity();\n  graphics.loadPixels();\n\n  for (let i = 0; i < graphics.pixels.length; i += 4) {\n    let granulateAmount = random(-10);\n    graphics.pixels[i] += granulateAmount\n    graphics.pixels[i + 1] += granulateAmount;\n    graphics.pixels[i + 2] += granulateAmount;\n  }\n  graphics.updatePixels();\n\n  let rows = 2;\n  let cols = 2;\n  let w = (width * 0.75) / cols;\n  let h = (height * 0.75) / rows;\n\n  let off = width * 0.125;\n  \n\n\n  for (let i = 0; i < cols; i++) {\n    for (let j = 0; j < rows; j++) {\n      let x = i * w;\n      let y = j * h;\n      image(graphics, x + off, y + off, w, h);\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "677b25fa27655921751ffee2",
        "createdAt": "2025-01-06T05:30:55.982Z",
        "updatedAt": "2025-01-06T05:30:55.982Z",
        "id": "677b25fa27655921751ffee2"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677b25fa27655921751ffee3",
        "createdAt": "2025-01-06T05:30:55.982Z",
        "updatedAt": "2025-01-06T05:30:55.982Z",
        "id": "677b25fa27655921751ffee3"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677b25fa27655921751ffee4",
        "createdAt": "2025-01-06T05:30:55.982Z",
        "updatedAt": "2025-01-06T05:30:55.982Z",
        "id": "677b25fa27655921751ffee4"
      }
    ],
    "updatedAt": "2025-01-06T05:30:55.982Z",
    "createdAt": "2025-01-06T05:30:55.982Z",
    "id": "Cxh1h3dXQ"
  },
  {
    "visibility": "Public",
    "_id": "n1XcCEK17",
    "name": "camera with overlay",
    "updatedAt": "2023-09-14T21:41:43.656Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6503762e6a4c7b5b4a6d5dec",
          "6503762e6a4c7b5b4a6d5deb",
          "6503762e6a4c7b5b4a6d5ded"
        ],
        "fileType": "folder",
        "_id": "6503762e6a4c7b5b4a6d5dee",
        "isSelectedFile": false,
        "createdAt": "2023-09-14T21:41:43.656Z",
        "updatedAt": "2023-09-14T21:41:43.656Z",
        "id": "6503762e6a4c7b5b4a6d5dee"
      },
      {
        "name": "sketch.js",
        "content": "let capture;\nlet pos, y, yDiff\nfunction setup() {\n  createCanvas(800, 600);\n  colorMode(HSL)\n  noStroke()\n  \n    let constraints = {\n\t video:{\n\t  deviceId: 1  \n\t },\n\t\t \n      mandatory: {\n        minWidth: 1280,\n        minHeight: 720\n      },   \n    }\n \n  pos = -400\n  capture=createCapture(constraints);\n  capture.hide();\n\n  \n}\n\nfunction draw() {\n  background(220, 100, 50);\n  translate(width/2, height/2)\n  image(capture, -width/4, -height/4, width/2, height/2 );\n  // filter(ERODE)\n  fill(100,100,50)\n  circle(pos, 0, 100)\n  if (pos < 0) {\n    pos += 10\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6503762e6a4c7b5b4a6d5deb",
        "isSelectedFile": true,
        "createdAt": "2023-09-14T21:41:43.656Z",
        "updatedAt": "2023-09-14T21:41:43.656Z",
        "id": "6503762e6a4c7b5b4a6d5deb"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "6503762e6a4c7b5b4a6d5dec",
        "isSelectedFile": false,
        "createdAt": "2023-09-14T21:41:43.656Z",
        "updatedAt": "2023-09-14T21:41:43.656Z",
        "id": "6503762e6a4c7b5b4a6d5dec"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6503762e6a4c7b5b4a6d5ded",
        "isSelectedFile": false,
        "createdAt": "2023-09-14T21:41:43.656Z",
        "updatedAt": "2023-09-14T21:41:43.656Z",
        "id": "6503762e6a4c7b5b4a6d5ded"
      }
    ],
    "createdAt": "2023-09-14T21:41:43.656Z",
    "id": "n1XcCEK17"
  },
  {
    "_id": "bPrdRF9IH",
    "name": "Carnation bay",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69c30091bc464a22dc6afae6",
          "69c3d9270d92f78abb372944",
          "69c3000d984c4ea3f5572d83",
          "69c3000d984c4ea3f5572d82",
          "69c3000d984c4ea3f5572d84"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "69c3000d984c4ea3f5572d85",
        "createdAt": "2026-03-25T12:46:49.762Z",
        "updatedAt": "2026-03-25T12:46:49.762Z",
        "id": "69c3000d984c4ea3f5572d85"
      },
      {
        "name": "sketch.js",
        "content": "let img\nlet t = 0;\n\nfunction setup() {\n  createCanvas(400, 400,WEBGL);\n  img = loadImage('eye.gif')\n}\n\nfunction draw() {\n  background(220);\n  noStroke()\n  texture(img)\n  rotateY(t)\n  box(width, height)\n  t -= 0.005\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "69c3000d984c4ea3f5572d82",
        "createdAt": "2026-03-25T12:46:49.762Z",
        "updatedAt": "2026-03-25T12:46:49.762Z",
        "id": "69c3000d984c4ea3f5572d82"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69c3000d984c4ea3f5572d83",
        "createdAt": "2026-03-25T12:46:49.762Z",
        "updatedAt": "2026-03-25T12:46:49.762Z",
        "id": "69c3000d984c4ea3f5572d83"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69c3000d984c4ea3f5572d84",
        "createdAt": "2026-03-25T12:46:49.762Z",
        "updatedAt": "2026-03-25T12:46:49.762Z",
        "id": "69c3000d984c4ea3f5572d84"
      },
      {
        "name": "coolfont.jpg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/b61d67a3-0ce8-4fe2-9e33-4b869e142443.jpg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69c30091bc464a22dc6afae6",
        "createdAt": "2026-03-25T12:46:49.762Z",
        "updatedAt": "2026-03-25T12:46:49.762Z",
        "id": "69c30091bc464a22dc6afae6"
      },
      {
        "name": "eye.gif",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/8ed296b4-28e7-4dcd-ae2b-2f6ab15e46ff.gif",
        "children": [],
        "fileType": "file",
        "_id": "69c3d9270d92f78abb372944",
        "createdAt": "2026-03-25T12:46:49.762Z",
        "updatedAt": "2026-03-25T12:46:49.762Z",
        "id": "69c3d9270d92f78abb372944"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2026-03-25T12:46:49.762Z",
    "createdAt": "2026-03-24T21:25:26.255Z",
    "id": "bPrdRF9IH"
  },
  {
    "visibility": "Public",
    "_id": "aHOJkgcFt",
    "name": "circle garden",
    "updatedAt": "2023-01-31T23:36:06.248Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63d99c842831bc1964970810",
          "63d99c842831bc196497080f",
          "63d99c842831bc1964970811"
        ],
        "fileType": "folder",
        "_id": "63d99c842831bc1964970812",
        "isSelectedFile": false,
        "createdAt": "2023-01-31T23:36:06.248Z",
        "updatedAt": "2023-01-31T23:36:06.248Z",
        "id": "63d99c842831bc1964970812"
      },
      {
        "name": "sketch.js",
        "content": "let diam = 0\nlet circles = []\nfunction setup() {\n  createCanvas(400, 400);\n  \n  for (let i = 0; i < 30; i++) {\n    const x = round(Math.random() * 400)\n    const y = round(Math.random() * 400)\n    const velocity = round(Math.random() * (200 - 50) + 50)\n    const sizeMult = round(Math.random() * (100 - 25) + 25)\n    circles.push(new Circle(x, y, color(0, 210, 210), velocity, sizeMult))\n  }\n}\n\nfunction draw() {\n  background(0, 0, 255);\n  \n  circles.forEach((circle) => {\n    circle.oscillate()\n  })\n  \n  diam += 1\n}\n\nclass Circle {\n  constructor(x, y, color, velocity, sizeMult){\n    \n    this.x = x\n    this.y = y\n    this.color = color\n    this.velocity = velocity\n    this.sizeMult = sizeMult\n  }\n \n  reset() {\n    const x = round(Math.random() * 400)\n    const y = round(Math.random() * 400)\n    this.x = x;\n    this.y = y\n  }\n  \n  oscillate() {\n    stroke(0, 0, 255)\n    // noStroke()\n    fill(this.color)\n    let d = this.sizeMult * sin(diam / this.velocity )\n    if (d < 0.5 && d > -0.5) {\n      this.reset()\n    }\n\n    circle(this.x, this.y, d)\n  }\n  \n}",
        "children": [],
        "fileType": "file",
        "_id": "63d99c842831bc196497080f",
        "isSelectedFile": true,
        "createdAt": "2023-01-31T23:36:06.248Z",
        "updatedAt": "2023-01-31T23:36:06.248Z",
        "id": "63d99c842831bc196497080f"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63d99c842831bc1964970810",
        "isSelectedFile": false,
        "createdAt": "2023-01-31T23:36:06.248Z",
        "updatedAt": "2023-01-31T23:36:06.248Z",
        "id": "63d99c842831bc1964970810"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63d99c842831bc1964970811",
        "isSelectedFile": false,
        "createdAt": "2023-01-31T23:36:06.248Z",
        "updatedAt": "2023-01-31T23:36:06.248Z",
        "id": "63d99c842831bc1964970811"
      }
    ],
    "createdAt": "2023-01-31T23:11:42.558Z",
    "id": "aHOJkgcFt"
  },
  {
    "visibility": "Public",
    "_id": "diT40S6Eu",
    "name": "color scheme",
    "updatedAt": "2023-03-19T01:42:52.249Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6410e74c0b7f98fd82d6d1eb",
          "6410e74c0b7f98fd82d6d1ea",
          "6410e74c0b7f98fd82d6d1ec"
        ],
        "fileType": "folder",
        "_id": "6410e74c0b7f98fd82d6d1ed",
        "isSelectedFile": false,
        "createdAt": "2023-03-19T01:42:52.249Z",
        "updatedAt": "2023-03-19T01:42:52.249Z",
        "id": "6410e74c0b7f98fd82d6d1ed"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(450, 600);\n  noStroke()\n  \n  background(240)\n  translate(width / 3, height/1.3)\n  \n  for(let i = 0; i < 10; i++) {\n    fill(6 * i)\n    ellipse(i * width / 15, i * -height / 12, 10 + (i * 10), 20 + (i * 20))\n  }\n  noLoop();\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6410e74c0b7f98fd82d6d1ea",
        "isSelectedFile": true,
        "createdAt": "2023-03-19T01:42:52.249Z",
        "updatedAt": "2023-03-19T01:42:52.249Z",
        "id": "6410e74c0b7f98fd82d6d1ea"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "6410e74c0b7f98fd82d6d1eb",
        "isSelectedFile": false,
        "createdAt": "2023-03-19T01:42:52.249Z",
        "updatedAt": "2023-03-19T01:42:52.249Z",
        "id": "6410e74c0b7f98fd82d6d1eb"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6410e74c0b7f98fd82d6d1ec",
        "isSelectedFile": false,
        "createdAt": "2023-03-19T01:42:52.249Z",
        "updatedAt": "2023-03-19T01:42:52.249Z",
        "id": "6410e74c0b7f98fd82d6d1ec"
      }
    ],
    "createdAt": "2023-03-19T01:18:54.298Z",
    "id": "diT40S6Eu"
  },
  {
    "visibility": "Public",
    "_id": "ZmFtdI7HF",
    "name": "custom_shape_drawer",
    "updatedAt": "2023-03-14T20:31:04.650Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6410d9380a9602315d003b68",
          "6410d9380a9602315d003b67",
          "6410d9380a9602315d003b69"
        ],
        "fileType": "folder",
        "_id": "6410d9380a9602315d003b6a",
        "createdAt": "2023-03-14T20:31:04.650Z",
        "updatedAt": "2023-03-14T20:31:04.650Z",
        "id": "6410d9380a9602315d003b6a"
      },
      {
        "name": "sketch.js",
        "content": "let drawShapeButton, collect\nlet bgColor = '#4287f5'\nlet shapeColor = '#e6f542'\nlet vertexColor = '#ad50fa'\nlet vertices = []\n\nlet drawShape = false\nlet drawCircles = true\nfunction setup() {\n  createCanvas(400, 400);\n  pixelDensity(1)\n  drawShapeButton = createButton('draw shape')\n  collect = createButton('clear vertices')\n  drawShapeButton.mousePressed(() => {\n    drawShape = true;\n    drawCircles = false\n  })\n  collect.mousePressed(collectVertices)\n}\n\nfunction draw() {\n  background(bgColor);\n  noStroke()\n  // console.log(drawCircles)\n   if (drawCircles) {\n     drawVertices()\n   }\n  if (drawShape) {\n     createShape()\n  }\n\n\n}\n\nfunction mousePressed() {\n  if (mouseX < 400 && mouseY < 400) {\n    vertices.push([mouseX, mouseY])  \n  } \n}\n\nfunction mouseDragged() {\n  if (mouseX < 400 && mouseY < 400) {\n    vertices.push([mouseX, mouseY])  \n  } \n}\n\nfunction collectVertices() {\n vertices = []\n  drawShape = false\n  drawCircles = true\n}\n\nfunction createShape() {\n \n  fill(shapeColor)\n    beginShape();\n    for (let i = 0; i < vertices.length; i++) {\n  vertex(vertices[i][0], vertices[i][1])\n  }\n  endShape(CLOSE);\n}\n\nfunction drawVertices() {\n  for (let i = 0; i < vertices.length; i++) {\n     fill(vertexColor)\n  circle(vertices[i][0], vertices[i][1], 10)\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "6410d9380a9602315d003b67",
        "isSelectedFile": true,
        "createdAt": "2023-03-14T20:31:04.650Z",
        "updatedAt": "2023-03-14T20:31:04.650Z",
        "id": "6410d9380a9602315d003b67"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "6410d9380a9602315d003b68",
        "createdAt": "2023-03-14T20:31:04.650Z",
        "updatedAt": "2023-03-14T20:31:04.650Z",
        "id": "6410d9380a9602315d003b68"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6410d9380a9602315d003b69",
        "createdAt": "2023-03-14T20:31:04.650Z",
        "updatedAt": "2023-03-14T20:31:04.650Z",
        "id": "6410d9380a9602315d003b69"
      }
    ],
    "createdAt": "2023-03-14T20:30:00.914Z",
    "id": "ZmFtdI7HF"
  },
  {
    "visibility": "Public",
    "_id": "NaixRkiHf",
    "name": "ellipse sine",
    "updatedAt": "2023-10-21T18:40:21.016Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63d9619f83266210477c3200",
          "63d9619f83266210477c31ff",
          "63d9619f83266210477c3201"
        ],
        "fileType": "folder",
        "_id": "63d9619f83266210477c3202",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T18:40:21.016Z",
        "updatedAt": "2023-10-21T18:40:21.016Z",
        "id": "63d9619f83266210477c3202"
      },
      {
        "name": "sketch.js",
        "content": "let xs = []\nlet points\nlet eSize = 8\nlet spede = 1\nlet dx = 0\nlet amplitude = 124\nlet w \nlet period = 54\nlet xSpacing = 3\n\nlet graphCoords = []\nlet graphSize = 2.5\nlet graphGap = graphSize * 2\n\nlet reverseTime = 5\nlet reverse = false\n\nfunction setup() {\n  createCanvas(720, 400);\n  pixelDensity(1)\n   w = width + 16\n  // period = w / eSize\n  \n  makeXs()\n  makeGraph()\n  noStroke()\n}\n\nfunction draw() {\n   // background(0, 0, 105);\n  background(0, 0, 255)\n  \n //  if (frameCount % (reverseTime * 60) == 0) {\n //  reverse = !reverse\n // }\n  \n  if (reverse) {\n    dx -= spede\n  } else {\n    dx += spede\n  }\n  \n  drawGraph()\n  makePoints()\n  drawPoints( )\n  \n}\n\nfunction mouseDragged () {\n  period = mouseX\n  amplitude = height - mouseY\n}\n\nfunction makeXs() {\n   for (let i = 0; i < w; i+=xSpacing) {\n    xs.push(i)\n  }\n}\n\nfunction makePoints() {\n points = xs.map(x => {\n   let y = height / 2 + amplitude * sin((x + dx) / period)\n   return [x, y]\n })\n \n}\n\nfunction drawPoints() {\n  points.forEach(point => {\n    fill(0, 255, 0)\n    ellipse(point[0], point[1], eSize)\n  })\n}\n\nfunction makeGraph() {\n    for (let i = 0; i <= height; i+= graphGap) {\n    let x = width * 0.5;\n    let y = i\n    graphCoords.push([x, y])\n    x = width * 0.25;\n    graphCoords.push([x, y])\n    x = width * 0.75;\n    graphCoords.push([x, y])\n\n  }\n  \n  for (let i = 0; i <= width; i+= graphGap) {\n    let y = height * 0.5;\n    let x = i\n    graphCoords.push([x, y])\n    y = height * 0.25;\n    graphCoords.push([x, y])\n    y = height * 0.75;\n    graphCoords.push([x, y])\n    \n  }\n  \n}\n\nfunction drawGraph() {\n  fill(0, 255, 0)\n  graphCoords.forEach((coord) => {\n    square(coord[0], coord[1], graphSize)\n  })\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63d9619f83266210477c31ff",
        "isSelectedFile": true,
        "createdAt": "2023-10-21T18:40:21.016Z",
        "updatedAt": "2023-10-21T18:40:21.016Z",
        "id": "63d9619f83266210477c31ff"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63d9619f83266210477c3200",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T18:40:21.016Z",
        "updatedAt": "2023-10-21T18:40:21.016Z",
        "id": "63d9619f83266210477c3200"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63d9619f83266210477c3201",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T18:40:21.016Z",
        "updatedAt": "2023-10-21T18:40:21.016Z",
        "id": "63d9619f83266210477c3201"
      }
    ],
    "createdAt": "2023-01-31T20:24:57.991Z",
    "id": "NaixRkiHf"
  },
  {
    "visibility": "Public",
    "_id": "EkO9IPwFm",
    "name": "eye",
    "updatedAt": "2024-07-10T21:55:27.867Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "643184e6205e2f9dbb0041b8",
          "643184e6205e2f9dbb0041b7",
          "643184e6205e2f9dbb0041b9"
        ],
        "fileType": "folder",
        "_id": "643184e6205e2f9dbb0041ba",
        "createdAt": "2024-07-10T21:55:27.867Z",
        "updatedAt": "2024-07-10T21:55:27.867Z",
        "isSelectedFile": false,
        "id": "643184e6205e2f9dbb0041ba"
      },
      {
        "name": "sketch.js",
        "content": "let heightControl = 50\nlet rightEnd, leftEnd\nlet rightControl\nlet pink, green, darkBlue, lightBlue, yellow\nlet h, w, h2\n\n\n\nfunction setup() {\n  createCanvas(600, 400);\n  h = height\n  w = width\n  // pixelDensity(1)\n  pink = color(245, 112, 250)\n  green = color(93, 212, 38)\n  darkBlue = color(0, 10, 122)\n  lightBlue = color(78, 189, 252)\n  yellow = color(237, 219, 21)\n\n  rightEnd = width - 20\n  leftEnd = 20\n  \n  background(lightBlue);\n  drawCloud()\n  stroke(darkBlue)\n  strokeWeight(1.5)\n    strokeCap(ROUND)\n  drawPupil()\n  drawWhite()\n  drawEye()\n  // drawBezierEye()\n  \n}\n\nfunction drawEye () {\n \n  fill(pink)\n  beginShape()\n  vertex(-1, h+1);\n  vertex(w+1, h+1);\n  vertex(w+1, -1);\n  vertex(-1, -1);\n    beginContour()\n     vertex(leftEnd, h/2 + 20)\n     quadraticVertex(-10, h / 2, leftEnd, h / 2 - 20)\n     quadraticVertex(w/2, -heightControl, rightEnd, h/2 - 20)\n     quadraticVertex(w + 10, h/2, rightEnd, h / 2 + 20)\n     quadraticVertex(w/2, h + heightControl, leftEnd, h/2 + 20)\n     \n    endContour()\n  endShape()\n}\n\nfunction drawBezierEye () {\n  stroke(darkBlue)\n  strokeCap(ROUND)\n  strokeWeight(2)\n  fill(pink)\n  beginShape()\n  vertex(leftEnd, h/2 - 20)\n  bezierVertex(w/6, h/2, w/2, -heightControl, rightEnd, h/2 - 20)\n  bezierVertex(w/1.5, h/2, w+10, h/2, rightEnd, h/2 + 20)\n  // quadraticVertex(w / 2, h + heightControl, leftEnd, h / 2 + 20)\n  endShape()\n \n}\n\nfunction drawWhite () {\n  const amount = 50\n  const ratio = 360 / amount\n  fill(yellow)\n  // fill(255)\n  beginShape()\n  vertex(0, h);\n  vertex(w, h);\n  vertex(w, 0);\n  vertex(0, 0);\n  beginContour()\n  for(let i = 0; i < amount; i++) {\n  const x = cos(radians(i * ratio)) * h/3.25;\n  const y = sin(radians(i * ratio)) * h/3.25;\n  vertex(x+w/2, y+h/2);\n}\n  endContour()\n  endShape()\n\n}\n\nfunction drawPupil () {\n  const amount = 50\n  const ratio = 360 / amount\n  fill(green)\n  beginShape()\n  vertex(0, h);\n  vertex(w, h);\n  vertex(w, 0);\n  vertex(0, 0);\n  beginContour()\n  for(let i = 0; i < amount; i++) {\n  const x = cos(radians(i * ratio)) * h/4;\n  const y = sin(radians(i * ratio)) * h/4;\n  vertex(x+w/2, y+h/2);\n}\n  endContour()\n  endShape()\n\n}\n\nfunction drawCloud() {\n  fill(255)\n  noStroke()\n  push()\n  translate(w*0.5,h*0.5)\n  beginShape()\n  vertex(-40,10)\n  quadraticVertex(-80, 0, -40, -10)\n  quadraticVertex(-40, -30, -18, -25)\n  quadraticVertex(0, -50, 18, -25)\n  quadraticVertex(40, -30, 40, -10)\n  quadraticVertex(80, 0, 40, 10)\n  quadraticVertex(0, 18, -40, 10)\n \n  endShape()\n  pop()\n}\n\n// function draw() {\n//   background(220);\n// }",
        "children": [],
        "fileType": "file",
        "_id": "643184e6205e2f9dbb0041b7",
        "isSelectedFile": true,
        "createdAt": "2024-07-10T21:55:27.867Z",
        "updatedAt": "2024-07-10T21:55:27.867Z",
        "id": "643184e6205e2f9dbb0041b7"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "643184e6205e2f9dbb0041b8",
        "createdAt": "2024-07-10T21:55:27.867Z",
        "updatedAt": "2024-07-10T21:55:27.867Z",
        "isSelectedFile": false,
        "id": "643184e6205e2f9dbb0041b8"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "643184e6205e2f9dbb0041b9",
        "createdAt": "2024-07-10T21:55:27.867Z",
        "updatedAt": "2024-07-10T21:55:27.867Z",
        "isSelectedFile": false,
        "id": "643184e6205e2f9dbb0041b9"
      }
    ],
    "createdAt": "2023-04-08T15:15:10.283Z",
    "id": "EkO9IPwFm"
  },
  {
    "visibility": "Public",
    "_id": "xgABJ4iEe",
    "name": "eye class",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "643737e3205e2f9dbb0041bc",
          "643737e3205e2f9dbb0041bd",
          "643737e3205e2f9dbb0041be"
        ],
        "fileType": "folder",
        "_id": "643737e3205e2f9dbb0041bb",
        "createdAt": "2023-04-13T03:00:24.157Z",
        "updatedAt": "2023-04-13T03:00:24.157Z",
        "isSelectedFile": false,
        "id": "643737e3205e2f9dbb0041bb"
      },
      {
        "name": "sketch.js",
        "content": "let pink, green, darkBlue, lightBlue, yellow\nlet h, w, h2\nlet cloudArray = []\nlet eyes\n\nfunction setup() {\n  createCanvas(600, 400);\n  \n  h = height\n  w = width\n  pink = color(245, 112, 250)\n  green = color(93, 212, 38)\n  darkBlue = color(0, 10, 122)\n  lightBlue = color(78, 189, 252)\n  yellow = color(237, 219, 21)\n\n  stroke(darkBlue)\n  strokeWeight(2)\n  strokeCap(ROUND)\n  \n  for (let i = 0; i < 3; i++) {\n     const y = random(0.2, 0.8)\n      const x = random(-0.6, 0)\n    cloudArray.push(new Cloud(x, y))\n  }\n\n  eyes = new Eye(20, w - 20, 50)\n  \n}\n\nfunction draw() {\n  background(lightBlue);\n  \n  cloudArray.forEach(cloud => {\n    cloud.update()\n    cloud.draw()\n  })\n  \n  stroke(darkBlue)\n  eyes.draw()\n  \n}\n\n\nclass Eye {\n  constructor (l,r,outlineH) {\n\n    this.l = l\n    this.r = r\n    this.outlineH = outlineH\n    this.s = 50\n    this.ratio = 360 / this.s\n    this.pupilDiam = 0.35\n  }\n\n  \n  drawOutline() {\n    fill(pink)\n    beginShape()\n      vertex(-1, h+1);\n      vertex(w+1, h+1);\n      vertex(w+1, -1);\n      vertex(-1,-1);\n        beginContour()\n          vertex(this.l, h/2 + 10)\n          quadraticVertex(10, h * 0.5, this.l, h / 2 - 10)\n          quadraticVertex(w/2, -this.outlineH * 0.6, this.r, h/2 - 10)\n          quadraticVertex(w - 10, h/2, this.r, h / 2 + 10)\n          quadraticVertex(w/2, h + this.outlineH * 1.2, this.l, h/2+10)\n        endContour()\n      endShape()\n  }\n  \n  drawPupil() {\n    fill(yellow)\n    beginShape()\n      vertex(0, h);\n      vertex(w, h);\n      vertex(w, 0);\n      vertex(0, 0);\n      beginContour()\n        for(let i = 0; i < this.s; i++) {\n          const x = cos(radians(i * this.ratio)) * h*this.pupilDiam;\n          const y = sin(radians(i * this.ratio)) * h*this.pupilDiam;\n          vertex(x+w*0.5, y+h*0.5);\n        }\n      endContour()\n    endShape()\n  }\n  \n  draw() {\n    this.drawPupil()\n    this.drawOutline()\n  }\n  \n}\n\n\nclass Cloud {\n  constructor(x,y) {\n    this.x = x\n    this.y = y\n  }\n  \n  \n  draw() {\n  fill(255, 253, 237)\n  noStroke()\n  push()\n    translate(w*this.x,h*this.y)\n    beginShape()\n      vertex(-40,6)\n      quadraticVertex(-140, 4, -40, -6)\n      quadraticVertex(-28, -28, -10, -22)\n      quadraticVertex(0, -50, 18, -42)\n      quadraticVertex(48, -80, 100, -42)\n      quadraticVertex(140, -40, 132, -18)\n      quadraticVertex(268, 2, 118, 6)\n    endShape()\n  pop()\n  }\n  \n   update() {\n    if (frameCount % 2 === 0) {\n      if (this.x < 1) {\n        this.x += 0.002\n      } else {\n        this.y = random(0.2, 0.8)\n        this.x = random(-1, 0)\n      }\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "643737e3205e2f9dbb0041bd",
        "isSelectedFile": true,
        "createdAt": "2023-04-13T03:00:24.157Z",
        "updatedAt": "2023-04-13T03:00:24.157Z",
        "id": "643737e3205e2f9dbb0041bd"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "643737e3205e2f9dbb0041bc",
        "createdAt": "2023-04-13T03:00:24.157Z",
        "updatedAt": "2023-04-13T03:00:24.157Z",
        "isSelectedFile": false,
        "id": "643737e3205e2f9dbb0041bc"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "643737e3205e2f9dbb0041be",
        "createdAt": "2023-04-13T03:00:24.157Z",
        "updatedAt": "2023-04-13T03:00:24.157Z",
        "isSelectedFile": false,
        "id": "643737e3205e2f9dbb0041be"
      }
    ],
    "createdAt": "2023-04-12T22:59:47.240Z",
    "updatedAt": "2023-04-13T03:00:24.157Z",
    "id": "xgABJ4iEe"
  },
  {
    "visibility": "Public",
    "_id": "blKTGRipc",
    "name": "Fine entree",
    "updatedAt": "2023-07-25T18:36:56.042Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "64bffed3b81d5451fe77218a",
          "64bffed3b81d5451fe772189",
          "64bffed3b81d5451fe77218b"
        ],
        "fileType": "folder",
        "_id": "64bffed3b81d5451fe77218c",
        "isSelectedFile": false,
        "createdAt": "2023-07-25T18:36:56.042Z",
        "updatedAt": "2023-07-25T18:36:56.042Z",
        "id": "64bffed3b81d5451fe77218c"
      },
      {
        "name": "sketch.js",
        "content": "let d = 200\nlet h = 30\nlet x = d/2\nlet y = d/2\nlet total \nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n   noStroke()\n  total = width/d \n  \n  for (let i = 0; i < total; i++) {\n   for (let j = 0; j < total; j++) {\n    fill(100,100,h)\n    circle(x,y,d)\n    h+=20\n    x+=d\n\n   }\n    x=d/2\n    y+=d\n  }\n}\n\n",
        "children": [],
        "fileType": "file",
        "_id": "64bffed3b81d5451fe772189",
        "isSelectedFile": true,
        "createdAt": "2023-07-25T18:36:56.042Z",
        "updatedAt": "2023-07-25T18:36:56.042Z",
        "id": "64bffed3b81d5451fe772189"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "64bffed3b81d5451fe77218a",
        "isSelectedFile": false,
        "createdAt": "2023-07-25T18:36:56.042Z",
        "updatedAt": "2023-07-25T18:36:56.042Z",
        "id": "64bffed3b81d5451fe77218a"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64bffed3b81d5451fe77218b",
        "isSelectedFile": false,
        "createdAt": "2023-07-25T18:36:56.042Z",
        "updatedAt": "2023-07-25T18:36:56.042Z",
        "id": "64bffed3b81d5451fe77218b"
      }
    ],
    "createdAt": "2023-07-25T17:00:07.596Z",
    "id": "blKTGRipc"
  },
  {
    "visibility": "Public",
    "_id": "H7GsUYFTb",
    "name": "flower",
    "updatedAt": "2024-06-04T21:39:04.892Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "663940f45a53b25b6b7a6bb1",
          "663940dc5a53b25b6b7a6bae",
          "663940dc5a53b25b6b7a6bad",
          "663940dc5a53b25b6b7a6baf"
        ],
        "fileType": "folder",
        "_id": "663940dc5a53b25b6b7a6bb0",
        "isSelectedFile": false,
        "createdAt": "2024-06-04T21:39:04.892Z",
        "updatedAt": "2024-06-04T21:39:04.892Z",
        "id": "663940dc5a53b25b6b7a6bb0"
      },
      {
        "name": "sketch.js",
        "content": "let flower\nlet r = 2;\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n  flower = new Flower(width/2,width/2,height/2,7)\n  flower.build();\n  noStroke();\n}\n\nfunction draw() {\n  background(200,100,50);\n  flower.render();\n}",
        "children": [],
        "fileType": "file",
        "_id": "663940dc5a53b25b6b7a6bad",
        "isSelectedFile": true,
        "createdAt": "2024-06-04T21:39:04.892Z",
        "updatedAt": "2024-06-04T21:39:04.892Z",
        "id": "663940dc5a53b25b6b7a6bad"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.2/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.2/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"flower.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "663940dc5a53b25b6b7a6bae",
        "isSelectedFile": false,
        "createdAt": "2024-06-04T21:39:04.892Z",
        "updatedAt": "2024-06-04T21:39:04.892Z",
        "id": "663940dc5a53b25b6b7a6bae"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "663940dc5a53b25b6b7a6baf",
        "isSelectedFile": false,
        "createdAt": "2024-06-04T21:39:04.892Z",
        "updatedAt": "2024-06-04T21:39:04.892Z",
        "id": "663940dc5a53b25b6b7a6baf"
      },
      {
        "name": "flower.js",
        "content": "class Flower {\n  constructor(size, posX, posY, petals) {\n    this.anchors = [];\n    this.controls = [];\n    this.centerPoints = [];\n    this.size = size / 2;\n    this.posX = posX;\n    this.posY = posY;\n    this.petals = petals;\n    this.center = 60;\n    this.petalColor = 340;\n    this.rotation = 0;\n  }\n\n  createAnchors() {\n    this.anchors = [];\n    let vertices = this.petals * 2;\n    let spacing = TWO_PI / vertices;\n    let first = [];\n\n    for (let i = 0; i < vertices; i++) {\n      let angle = i * spacing;\n      let r = this.size * 0.6;\n\n      let x = cos(angle) * r;\n      let y = sin(angle) * r;\n      if (i === 1) {\n        first.push(x, y);\n      }\n      if (i % 2) {\n        this.anchors.push([x, y]);\n      }\n    }\n    this.anchors.push([first[0], first[1]]);\n  }\n\n  createControls() {\n    this.controls = [];\n    let vertices = this.petals;\n    let spacing = TWO_PI / vertices;\n\n    for (let i = 0; i < vertices + 1; i++) {\n      let angle = i * spacing;\n      let r = this.size * 1.8;\n\n      const x = cos(angle) * r;\n      const y = sin(angle) * r;\n      this.controls.push([x, y]);\n    }\n  }\n\n  render() {\n    push();\n    let s = 10\n    translate(width / 2, height / 2);\n    beginShape();\n    fill(100, 100, 50);\n    vertex(-s, 0);\n    vertex(s, 0);\n    quadraticVertex(60, height / 2, s, height);\n    vertex(-s, height);\n    quadraticVertex(40, height / 2, -s, 0);\n    endShape();\n\n    fill(this.petalColor, 100, 50);\n    push();\n    rotate(0.7);\n    beginShape();\n    for (let i = 0; i < this.anchors.length; i++) {\n      let a = this.anchors[i];\n      let c = this.controls[i];\n      if (i === 0) {\n        vertex(a[0], a[1]);\n      } else {\n        quadraticVertex(c[0], c[1], a[0], a[1]);\n      }\n    }\n\n    endShape();\n    pop();\n    fill(this.center, 100, 50);\n    noStroke();\n    circle(0, 0, this.size * 0.8);\n\n    pop();\n  }\n\n  build() {\n    this.createAnchors();\n    this.createControls();\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "663940f45a53b25b6b7a6bb1",
        "isSelectedFile": false,
        "createdAt": "2024-06-04T21:39:04.892Z",
        "updatedAt": "2024-06-04T21:39:04.892Z",
        "id": "663940f45a53b25b6b7a6bb1"
      }
    ],
    "createdAt": "2024-05-06T21:43:15.447Z",
    "id": "H7GsUYFTb"
  },
  {
    "visibility": "Public",
    "_id": "nKarR4ykt",
    "name": "flower",
    "updatedAt": "2024-06-23T21:31:14.280Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "643872f44fc40a6d6d36ac7f",
          "643872f44fc40a6d6d36ac7e",
          "643872f44fc40a6d6d36ac80"
        ],
        "fileType": "folder",
        "_id": "643872f44fc40a6d6d36ac81",
        "isSelectedFile": false,
        "createdAt": "2024-06-23T21:31:14.280Z",
        "updatedAt": "2024-06-23T21:31:14.280Z",
        "id": "643872f44fc40a6d6d36ac81"
      },
      {
        "name": "sketch.js",
        "content": "\n// fix flower animation\n// make each flower a tile with the flower as a cutout,\n// make control points and anchors based on tile width\n\nlet flowers = []\n\nfunction setup() {\n  createCanvas(600, 400);\n  colorMode(HSL)\n  background(200, 100, 58)\n  noStroke()\n  \n  let amount = 3\n  \n  for (let i = 0; i < amount; i++) {\n    let w = round(((i + 1 % amount) * 0.3) - 0.1, 2)\n    console.log(w)\n    const petals = 8\n    flowers.push(new Flower(0.8, w, 0.5, petals))}\n\n}\n\nfunction draw() {\n  background(200, 100, 58)\n\n  flowers.forEach(flower => {\n    flower.update()\n    flower.drawFlower()\n  })\n   \n}\n\n\nclass Flower {\n  constructor(mult, posW, posH, petals, ) {\n    this.anchors = []\n    this.controls = []\n    this.centerPoints = []\n    this.mult = mult\n    this.posW = posW\n    this.posH = posH\n    this.petals = petals\n  }\n  \n   createAnchors() {\n  this.anchors = []\n  let vertices = this.petals * 2;\n  let spacing = 360 / vertices\n  let first = []\n  \n  for (let i = 0; i < vertices; i++) {\n    let angle = i * spacing\n    let r = random(52, 54) * this.mult\n    let r2 = sin(frameCount) * 1.2 + width/8 * this.mult\n   \n    let x = cos(radians(angle)) * r2\n    let y = sin(radians(angle)) * r2\n    if (i === 1) {\n      first.push(x,y)\n     \n    }\n      if (i % 2) {\n        this.anchors.push([x,y])\n    } \n    \n  }\n  this.anchors.push([first[0], first[1]])\n  \n}\n\n createControls() {\n  this.controls = []\n  let vertices = this.petals;\n  let spacing = 360 / vertices\n  \n  for (let i = 0; i < vertices + 1; i++) {\n    let angle = i * spacing\n    let r \n    let r2\n    if (i % 2) {\n      r = random(40,44) * this.mult\n      r2 = sin(frameCount) + width * 0.1 * this.mult\n      \n    } else {\n      r = random(78,82) * this.mult\n      r2 = sin(frameCount) + width * 0.2 * this.mult\n    }\n    \n    const x = cos(radians(angle)) * r2\n    const y = sin(radians(angle)) * r2\n    this.controls.push([x,y])\n  }\n}\n\n createCenter() {\n  this.centerPoints = []\n  const vertices = 60\n  const spacing = 360/vertices\n  for(let i = 0; i < vertices; i++) {\n     let r = random(30,30.4) * this.mult\n     let r2 = sin(frameCount) * -1 + 30 * this.mult\n  \n    const angle = spacing * i\n    const x = cos(radians(angle)) * r2\n    const y = sin(radians(angle)) * r2\n    this.centerPoints.push([x,y])\n  }\n}\n\n drawFlower() {\n  push()\n   translate(width*this.posW, height*this.posH)\n   fill(330, 100, 58)\n\n   beginShape()\n   for(let i = 0; i < this.anchors.length; i++) {\n      let anchor = this.anchors[i]\n      let control = this.controls[i]\n      if (i === 0) {\n        vertex(anchor[0], anchor[1])\n      } else {\n        quadraticVertex(control[0], control[1], anchor[0], anchor[1])\n      }\n    }\n    endShape()\n\n    fill(46, 100, 58)\n    beginShape()\n    for(let i = 0; i < this.centerPoints.length; i++) {\n      const centerPoint = this.centerPoints[i]\n      vertex(centerPoint[0],centerPoint[1])\n    }\n    endShape()\n  pop()\n\n}\n  \n  update() {\n    if (frameCount % 24 === 0) {\n      this.createAnchors()\n      this.createControls()\n      this.createCenter()\n      }\n  }\n \n}\n\n",
        "children": [],
        "fileType": "file",
        "_id": "643872f44fc40a6d6d36ac7e",
        "isSelectedFile": true,
        "createdAt": "2024-06-23T21:31:14.280Z",
        "updatedAt": "2024-06-23T21:31:14.280Z",
        "id": "643872f44fc40a6d6d36ac7e"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "643872f44fc40a6d6d36ac7f",
        "isSelectedFile": false,
        "createdAt": "2024-06-23T21:31:14.280Z",
        "updatedAt": "2024-06-23T21:31:14.280Z",
        "id": "643872f44fc40a6d6d36ac7f"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "643872f44fc40a6d6d36ac80",
        "isSelectedFile": false,
        "createdAt": "2024-06-23T21:31:14.280Z",
        "updatedAt": "2024-06-23T21:31:14.280Z",
        "id": "643872f44fc40a6d6d36ac80"
      }
    ],
    "createdAt": "2023-04-13T21:33:20.602Z",
    "id": "nKarR4ykt"
  },
  {
    "visibility": "Public",
    "_id": "aM484096X",
    "name": "flower tile",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "643dd1b95dd9d2f928390bb4",
          "643dd1b95dd9d2f928390bb5",
          "643dd1b95dd9d2f928390bb6"
        ],
        "fileType": "folder",
        "_id": "643dd1b95dd9d2f928390bb3",
        "isSelectedFile": false,
        "createdAt": "2023-06-17T22:06:29.662Z",
        "updatedAt": "2023-06-17T22:06:29.662Z",
        "id": "643dd1b95dd9d2f928390bb3"
      },
      {
        "name": "sketch.js",
        "content": "\n// fix flower animation\n// make each flower a tile with the flower as a cutout,\n// make control points and anchors based on tile width\n\nlet pink, orange, blue, yellow, green, bg\nlet flowers = []\nlet canvasDim = 400\nlet bgL = 38\nlet reverse = false\nlet amount\n\nfunction setup() {\n  createCanvas(canvasDim, canvasDim);\n  colorMode(HSL)\n  pink = color(330, 100, 58)\n  orange = color(14, 100, 58)\n  blue = color(200, 100, 58)\n  yellow = color(46, 100, 58)\n  green = color(100, 100, 44)\n\n  noStroke()\n  \n  bg = color(100, 100, bgL)\n  amount = 2\n  \n  let h = height\n  for (let i = 0; i < amount; i++) {\n     for (let j = 0; j < amount; j++) {\n       const x = i * 2 + 1\n       const y = j * 2 + 1\n       let petals = 8\n       // petals = 8 + j + i\n       let color\n       let innerColor\n       \n       if (j % 2 ) {\n         color = i % 4 ? orange : pink\n       } else {\n         color = i % 4 ? pink : orange\n       }\n       \n       innerColor = color === orange ? green : yellow\n       \n       const newFlower = new Flower(\n         h/amount, \n         x, \n         y, \n         petals, \n         color, \n         innerColor\n       )\n       newFlower.update()\n       flowers.push(newFlower)\n      \n       \n     }\n  }\n\n}\n\nfunction draw() {\n   oscillateBg()\n   background(bg)\n\n\n  flowers.forEach(flower => {\n    flower.update()\n    flower.drawFlower()\n  })\n   \n}\n\nfunction oscillateBg() {\n\n  let speed = 0.25\n  \n  if (bgL > 70 && !reverse) {\n    reverse = true\n  } else if (bgL < 38 && reverse) {\n    reverse = false\n  }\n  \n  if (reverse) {\n    bgL-= speed\n  } else {\n    bgL+= speed\n  }\n  bg = color(300, 100, bgL)\n \n}\n\n\nclass Flower {\n  constructor(size, posX, posY, petals, color, innerColor) {\n    this.anchors = []\n    this.controls = []\n    this.centerPoints = []\n    this.size = size / 2\n    this.posX = posX\n    this.posY = posY\n    this.petals = petals\n    this.color = color\n    this.innerColor = innerColor\n    this.rotation = 0\n  }\n  \n   createAnchors() {\n  this.anchors = []\n  let vertices = this.petals * 2;\n  let spacing = 360 / vertices\n  let first = []\n  \n  for (let i = 0; i < vertices; i++) {\n    let angle = i * spacing\n    let r = this.size / 1.06\n    \n    let x = cos(radians(angle)) * r\n    let y = sin(radians(angle)) * r\n    if (i === 1) {\n      first.push(x,y)\n     \n    }\n      if (i % 2) {\n        this.anchors.push([x,y])\n    } \n    \n  }\n  this.anchors.push([first[0], first[1]])\n  \n}\n\n createControls() {\n  this.controls = []\n  let vertices = this.petals;\n  let spacing = 360 / vertices\n  \n  for (let i = 0; i < vertices + 1; i++) {\n    let angle = i * spacing\n    let r \n    let r2\n    \n    if (i % 2) {\n      r = this.size / 4\n     \n      \n    } else {\n      r = this.size / 8\n    }\n    \n    const x = cos(radians(angle)) * r\n    const y = sin(radians(angle)) * r\n    this.controls.push([x,y])\n  }\n}\n\n createCenter() {\n  this.centerPoints = []\n  const vertices = 60\n  const spacing = 360/vertices\n  for(let i = 0; i < vertices; i++) {\n     let r = this.size / 3\n  \n    const angle = spacing * i\n    const x = cos(radians(angle)) * r\n    const y = sin(radians(angle)) * r\n    this.centerPoints.push([x,y])\n  }\n}\n\n drawFlower() {\n  push()\n   const transX = this.size * this.posX\n   const transY = this.size * this.posY\n   translate(transX, transY)\n   rotate(this.rotation)\n\n   fill(this.color)\n   rect(-this.size, -this.size, this.size * 2)\n   fill(blue)\n   beginShape()\n    vertex(-this.size, this.size);\n      vertex(this.size, this.size);\n      vertex(this.size, -this.size);\n      vertex(-this.size,-this.size);\n      beginContour()\n   \n   for(let i = 0; i < this.anchors.length; i++) {\n      let anchor = this.anchors[i]\n      let control = this.controls[i]\n      if (i === 0) {\n        vertex(anchor[0], anchor[1])\n      } else {\n        quadraticVertex(control[0], control[1], anchor[0], anchor[1])\n      }\n    }\n     endContour()\n    endShape()\n\n    fill(this.innerColor)\n    beginShape()\n    for(let i = 0; i < this.centerPoints.length; i++) {\n      const centerPoint = this.centerPoints[i]\n      vertex(centerPoint[0],centerPoint[1])\n    }\n    endShape()\n  pop()\n\n}\n  \n  update() {\n    if (frameCount % 6 === 0) {\n      this.createAnchors()\n      this.createControls()\n      this.createCenter()\n      // this.rotation += 0.05\n      }\n  }\n \n}\n\n",
        "children": [],
        "fileType": "file",
        "_id": "643dd1b95dd9d2f928390bb5",
        "isSelectedFile": true,
        "createdAt": "2023-06-17T22:06:29.662Z",
        "updatedAt": "2023-06-17T22:06:29.662Z",
        "id": "643dd1b95dd9d2f928390bb5"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "643dd1b95dd9d2f928390bb4",
        "isSelectedFile": false,
        "createdAt": "2023-06-17T22:06:29.662Z",
        "updatedAt": "2023-06-17T22:06:29.662Z",
        "id": "643dd1b95dd9d2f928390bb4"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "643dd1b95dd9d2f928390bb6",
        "isSelectedFile": false,
        "createdAt": "2023-06-17T22:06:29.662Z",
        "updatedAt": "2023-06-17T22:06:29.662Z",
        "id": "643dd1b95dd9d2f928390bb6"
      }
    ],
    "createdAt": "2023-04-17T23:09:46.323Z",
    "updatedAt": "2023-06-17T22:06:29.662Z",
    "id": "aM484096X"
  },
  {
    "visibility": "Public",
    "_id": "uxRT1JuEu",
    "name": "fourier series",
    "updatedAt": "2024-05-27T16:44:53.422Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65e2566661874ae32aa41b36",
          "65e2566661874ae32aa41b35",
          "65e2566661874ae32aa41b37"
        ],
        "fileType": "folder",
        "_id": "65e2566661874ae32aa41b38",
        "isSelectedFile": false,
        "createdAt": "2024-05-27T16:44:53.422Z",
        "updatedAt": "2024-05-27T16:44:53.422Z",
        "id": "65e2566661874ae32aa41b38"
      },
      {
        "name": "sketch.js",
        "content": "let time = 0;\nlet wave = [];\nlet waveoff = 200;\n// amount of series to add up\nlet amount = 50;\nlet amp = 50;\nlet periodShift = 0.05;\nlet osc\n\nlet ampSlider;\nlet periodSlider;\nlet amountSlider;\nlet modeBox;\nlet revBox\nlet saw = false;\nlet revSaw = false\n\nfunction setup() {\n  createCanvas(800, 400);\n  ampSlider = createSlider(10, 100, amp);\n  periodSlider = createSlider(0, 0.5, periodShift, 0.01);\n  amountSlider = createSlider(1, 100, amount);\n  modeBox = createCheckbox();\n  revBox = createCheckbox()\n  osc = new p5.Oscillator();\n  osc.start()\n}\n\nfunction draw() {\n  background(0);\n\n  translate(100, height / 2);\n\n  amp = ampSlider.value();\n  periodShift = periodSlider.value();\n  amount = amountSlider.value();\n  saw = modeBox.checked();\n  revSaw = revBox.checked()\n\n  let x = 0;\n  let y = 0;\n\n  let sgn = -1;\n  for (let i = 0; i < amount; i++) {\n    let pX = x;\n    let pY = y;\n    let n = i * 2 + 1;\n\n    let sawN = i + 1;\n    // for multiplying PI - switches between pos and neg each loop if the saw wave is not reversed\n    let sgnN = sgn * sawN;\n    if (revSaw) {\n      sgn *= -1;\n    }\n    \n\n    let piMult = saw == true ? sgnN : n;\n    let timeMult = saw == true ? sawN : n;\n\n    let radius = amp * (4 / (piMult * PI));\n    let sawRadius = amp * (2 / (piMult * PI));\n\n    let rMult = saw == true ? sawRadius : radius;\n\n    x += cos(timeMult * time) * rMult;\n    y += sin(timeMult * time) * rMult;\n\n    // draw circles\n    // stroke(255, 100);\n    // noFill();\n    // ellipse(pX, pY, radius * 2);\n\n    // //draw dots\n    // fill(255);\n    // ellipse(x, y, 10);\n\n    // draw lines\n    // stroke(255);\n    // line(pX, pY, x, y);\n  }\n  wave.unshift(y);\n\n  noFill();\n  stroke(255);\n  beginShape();\n  for (let i = 0; i < wave.length; i++) {\n    let x = i + waveoff;\n    vertex(x, wave[i]);\n  }\n  endShape();\n\n  // draw line connecting last circle y to wave\n  // line(x, y, waveoff, y);\n  \n  let fr = map(y,-100,100, 500,50)\n  osc.freq(fr)\n\n  if (wave.length >= width / 2) {\n    wave.pop();\n  }\n  time += periodShift;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65e2566661874ae32aa41b35",
        "isSelectedFile": true,
        "createdAt": "2024-05-27T16:44:53.422Z",
        "updatedAt": "2024-05-27T16:44:53.422Z",
        "id": "65e2566661874ae32aa41b35"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65e2566661874ae32aa41b36",
        "isSelectedFile": false,
        "createdAt": "2024-05-27T16:44:53.422Z",
        "updatedAt": "2024-05-27T16:44:53.422Z",
        "id": "65e2566661874ae32aa41b36"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65e2566661874ae32aa41b37",
        "isSelectedFile": false,
        "createdAt": "2024-05-27T16:44:53.422Z",
        "updatedAt": "2024-05-27T16:44:53.422Z",
        "id": "65e2566661874ae32aa41b37"
      }
    ],
    "createdAt": "2024-03-01T23:30:25.420Z",
    "id": "uxRT1JuEu"
  },
  {
    "visibility": "Public",
    "_id": "JKfJjQTnh",
    "name": "froggy",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63d5aa7dfe6ecd001aa43f93",
          "63d5a856c5652e48c6b5b648",
          "63d5a856c5652e48c6b5b649",
          "63d5a856c5652e48c6b5b64a"
        ],
        "fileType": "folder",
        "_id": "63d5a856c5652e48c6b5b647",
        "createdAt": "2023-01-29T00:38:40.069Z",
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "isSelectedFile": false,
        "id": "63d5a856c5652e48c6b5b647"
      },
      {
        "name": "sketch.js",
        "content": "let x = 0\nlet y = 0\nlet h = 600\nlet froggys = []\n\n\nfunction preload() {\n  img = loadImage('img/froggy_kawaii.png')\n}\n\nfunction setup() {\n  createCanvas(600, 600)\n  background(0, 255, 0)\n  for (let i = 0; i < 12; i++) {\n    let newX = x + i * 25;\n    let newY = y + i * 25;\n    let newH = h - i * 50;\n    let d = round(120 / (i + 1))\n    let o = round((i + 1) * 5)\n    console.log(d, o)\n    froggys.push(new Froggy(newX, newY, newH, d, o))\n  }\n}\n\n\nfunction draw() {\n  \n   froggys.forEach(froggy => froggy.update())\n}\n\n\nclass Froggy{\n  constructor(x, y, h, d, o) {\n    this.x = x;\n    this.y = y;\n    this.height = h\n    this.max = this.y + o \n    this.min = this.y - o\n    this.reverse = false\n    this.started = false\n    this.delay = d\n    this.offset = o\n  }\n  \n  switch() {\n    if (this.y > this.max) {\n      this.reverse = true\n    } else if (this.y < this.min) {\n      this.reverse = false\n    }\n  }\n  \n  oscillate() {\n    if (this.reverse) {\n      this.y -= 1\n    } else {\n      this.y += 1\n    }\n  }\n  \n  draw() {\n    image(img, this.x, this.y, this.height, this.height)\n  }\n  \n  update() {\n    if (frameCount == this.delay) {\n       this.started = true\n     }\n   if (this.started) {\n      this.switch()\n      this.oscillate()\n      this.draw()\n   } else {\n     this.draw()\n   }\n  }\n}\n\n\n\n",
        "children": [],
        "fileType": "file",
        "_id": "63d5a856c5652e48c6b5b649",
        "isSelectedFile": true,
        "createdAt": "2023-01-29T00:38:40.069Z",
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "id": "63d5a856c5652e48c6b5b649"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63d5a856c5652e48c6b5b648",
        "createdAt": "2023-01-29T00:38:40.069Z",
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "isSelectedFile": false,
        "id": "63d5a856c5652e48c6b5b648"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63d5a856c5652e48c6b5b64a",
        "createdAt": "2023-01-29T00:38:40.069Z",
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "isSelectedFile": false,
        "id": "63d5a856c5652e48c6b5b64a"
      },
      {
        "name": "img",
        "content": "",
        "children": [
          "63d5aa96fe6ecd001aa4402f",
          "63d5af1d736479001af98d5a"
        ],
        "fileType": "folder",
        "_id": "63d5aa7dfe6ecd001aa43f93",
        "isSelectedFile": false,
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "createdAt": "2023-01-29T00:38:40.069Z",
        "id": "63d5aa7dfe6ecd001aa43f93"
      },
      {
        "name": "froggy.png",
        "content": "",
        "children": [],
        "fileType": "file",
        "_id": "63d5aa96fe6ecd001aa4402f",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/e4e2dca0-afeb-4459-9445-d46f54209800.png",
        "isSelectedFile": false,
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "createdAt": "2023-01-29T00:38:40.069Z",
        "id": "63d5aa96fe6ecd001aa4402f"
      },
      {
        "name": "froggy_kawaii.png",
        "content": "",
        "children": [],
        "fileType": "file",
        "_id": "63d5af1d736479001af98d5a",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/25b2eb4f-a3a0-4612-b92c-5e7dc94fe028.png",
        "updatedAt": "2023-01-29T00:38:40.069Z",
        "createdAt": "2023-01-29T00:38:40.069Z",
        "isSelectedFile": false,
        "id": "63d5af1d736479001af98d5a"
      }
    ],
    "createdAt": "2023-01-28T22:57:26.261Z",
    "updatedAt": "2023-01-29T00:38:40.069Z",
    "id": "JKfJjQTnh"
  },
  {
    "_id": "QnXH9aY_N",
    "name": "icm 10-23 cat",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68fa710b3e445099e9c77a81",
          "68fa70e23e445099e9c77a7e",
          "68fa70e23e445099e9c77a7d",
          "68fa70e23e445099e9c77a7f"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "68fa70e23e445099e9c77a80",
        "createdAt": "2025-10-23T18:39:36.120Z",
        "updatedAt": "2025-10-23T18:39:36.120Z",
        "id": "68fa70e23e445099e9c77a80"
      },
      {
        "name": "sketch.js",
        "content": "let cat;\n\nfunction preload() {\n  cat = loadImage(\"cat.jpg\");\n}\n\nfunction setup() {\n  createCanvas(cat.width, cat.height);\n}\n\nfunction draw() {\n  cat.loadPixels();\n  for (let i = 0; i< cat.pixels.length; i+= 4) {\n    cat.pixels[i]--\n     cat.pixels[i+1]++\n     cat.pixels[i+2]--\n  }\n \n \n  cat.updatePixels();\n  image(cat, 0, 0);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68fa70e23e445099e9c77a7d",
        "createdAt": "2025-10-23T18:39:36.120Z",
        "updatedAt": "2025-10-23T18:39:36.120Z",
        "id": "68fa70e23e445099e9c77a7d"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "68fa70e23e445099e9c77a7e",
        "createdAt": "2025-10-23T18:39:36.120Z",
        "updatedAt": "2025-10-23T18:39:36.120Z",
        "id": "68fa70e23e445099e9c77a7e"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "68fa70e23e445099e9c77a7f",
        "createdAt": "2025-10-23T18:39:36.120Z",
        "updatedAt": "2025-10-23T18:39:36.120Z",
        "id": "68fa70e23e445099e9c77a7f"
      },
      {
        "name": "cat.jpg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/9707af46-9743-4317-b88d-379fb83b6f69.jpg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "68fa710b3e445099e9c77a81",
        "createdAt": "2025-10-23T18:39:36.120Z",
        "updatedAt": "2025-10-23T18:39:36.120Z",
        "id": "68fa710b3e445099e9c77a81"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-23T18:39:36.120Z",
    "createdAt": "2025-10-23T18:38:55.652Z",
    "id": "QnXH9aY_N"
  },
  {
    "_id": "-4CXp0EJk",
    "name": "ICM final",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "693ad5fcdc7b8639bce61ecc",
          "693ad5fcdc7b8639bce61ecb",
          "693ad5fcdc7b8639bce61ecd"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "693ad5fcdc7b8639bce61ece",
        "createdAt": "2025-12-11T16:54:29.806Z",
        "updatedAt": "2025-12-11T16:54:29.806Z",
        "id": "693ad5fcdc7b8639bce61ece"
      },
      {
        "name": "sketch.js",
        "content": "let faceMesh;\nlet faces = [];\nlet video;\nlet options = { maxFaces: 1, refineLandmarks: false, flipped: true };\n\nlet right_corner = 20;\nlet left_corner = 10;\nlet bottom_outer = 5;\nlet bottom_inner = 26;\nlet top_outer = 15;\nlet top_inner = 36;\n\nlet active = 1;\n\nlet osc1\nlet osc2\n\nfunction preload() {\n  faceMesh = ml5.faceMesh(options);\n}\n\nfunction setup() {\n  createCanvas(400, 400);\n  rectMode(CENTER);\n  noStroke();\n  video = createCapture(VIDEO);\n  video.size(width, height);\n  video.hide();\n\n  faceMesh.detectStart(video, foundFaces);\n  \n  osc1 = new p5.Oscillator('sine');\n  osc2  = new p5.Oscillator('sine');\n \n\n}\n\nfunction foundFaces(results) {\n  faces = results;\n}\n\nfunction draw() {\n  background(220);\n  push();\n  scale(-1, 1);\n  translate(-width, 0);\n  image(video, 0, 0, width, height);\n  pop();\n\n  if (faces.length > 0) {\n    face = faces[0];\n    let lips = face.lips;\n\n    fill(0, 0, 255);\n    let top = lips.keypoints[top_inner];\n    let bottom = lips.keypoints[bottom_inner];\n    square(top.x, top.y, 10);\n    square(bottom.x, bottom.y, 10);\n\n    let d = dist(top.x, top.y, bottom.x, bottom.y);\n    text(d, 10, 20);\n\n    // do a loop around the keypoints and light up one at a time\n    for (let k = 0; k < lips.keypoints.length; k++) {\n      let keypoint = lips.keypoints[k];\n      if (k == active) {\n        fill(255, 0, 0);\n        circle(keypoint.x, keypoint.y, 4);\n      }\n    }\n\n    if (frameCount % 5 == 1) {\n      active += 1;\n      active = active % 42;\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "693ad5fcdc7b8639bce61ecb",
        "createdAt": "2025-12-11T16:54:29.806Z",
        "updatedAt": "2025-12-11T16:54:29.806Z",
        "id": "693ad5fcdc7b8639bce61ecb"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.11/addons/p5.sound.min.js\"></script>\n    <script src=\"https://unpkg.com/ml5@1/dist/ml5.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "693ad5fcdc7b8639bce61ecc",
        "createdAt": "2025-12-11T16:54:29.806Z",
        "updatedAt": "2025-12-11T16:54:29.806Z",
        "id": "693ad5fcdc7b8639bce61ecc"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "693ad5fcdc7b8639bce61ecd",
        "createdAt": "2025-12-11T16:54:29.806Z",
        "updatedAt": "2025-12-11T16:54:29.806Z",
        "id": "693ad5fcdc7b8639bce61ecd"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-12-11T16:54:29.806Z",
    "createdAt": "2025-12-11T15:39:44.911Z",
    "id": "-4CXp0EJk"
  },
  {
    "_id": "HFAwrbWE3",
    "name": "icm final 2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "693ae530ab6df68d2351e409",
          "693ae530ab6df68d2351e40f",
          "693ae530ab6df68d2351e410"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "693ae530ab6df68d2351e403",
        "createdAt": "2026-03-13T15:08:41.967Z",
        "updatedAt": "2026-03-13T15:08:41.967Z",
        "id": "693ae530ab6df68d2351e403"
      },
      {
        "name": "sketch.js",
        "content": "let faceMesh;\nlet faces = [];\nlet video;\nlet options = { maxFaces: 1, refineLandmarks: false, flipped: true };\n\nlet right_corner = 20;\nlet left_corner = 10;\nlet bottom_outer = 5;\nlet bottom_inner = 26;\nlet top_outer = 15;\nlet top_inner = 36;\n\nlet active = 1;\n// sound stuff\nlet delay;\nlet panTime = 0;\nlet ampTime = 0;\n\nlet counter = 0;\nlet osc;\nlet osc2;\nlet base = 155.5;\n// let ratios = [1.125, 1.2, 1.8, 2.25, 2.4, 3.6];\nlet filter;\nlet env;\nlet env2;\nlet distort\n\nlet t = 0;\n\nfunction preload() {\n  faceMesh = ml5.faceMesh(options);\n}\n\nfunction setup() {\n  createCanvas(windowWidth,windowHeight);\n  randomSeed(10);\n  noiseSeed(10);\n  rectMode(CENTER);\n  noStroke();\n  video = createCapture(VIDEO);\n  video.size(width, height);\n  video.hide();\n\n  faceMesh.detectStart(video, foundFaces);\n\n  delay = new p5.Delay();\n\n  osc = new p5.Oscillator(\"square\");\n  osc.freq(base);\n  osc.amp(0);\n  osc.start();\n\n  osc2 = new p5.Oscillator(\"triangle\");\n  osc2.freq(base*1.5);\n  osc2.amp(0);\n  osc2.start();\n\n  filter = new p5.LowPass();\n  filter.freq(700);\n  filter.res(10);\n  \n  distort = new p5.Distortion()\n  distort.set(0.1)\n\n  let attackLevel = 0.2;\n  let releaseLevel = 0;\n\n  env = new p5.Envelope();\n  env.setRange(attackLevel, releaseLevel); // set the volume range\n\n  // env2 = new p5.Envelope();\n  // env2.setRange(attackLevel, releaseLevel); // set the volume range\n\n  osc.disconnect();\n  osc.connect(filter);\n  // osc.amp(env);\n  osc.pan(0.5);\n\n  osc2.disconnect();\n  osc2.connect(filter);\n  // osc2.amp(env);\n  osc2.pan(-0.5)\n\n  // delay.process() accepts 4 parameters:\n  // source, delayTime (in seconds), feedback, filter frequency\n\n  delay.process(osc, 0.3, 0.6, 1300);\n  delay.process(osc2, 0.3, 0.6, 1300);\n  \n  // distort.process(osc)\n  // distort.process(osc2)\n\n  \n}\n\nfunction foundFaces(results) {\n  faces = results;\n\n}\n\nfunction draw() {\n  background(20);\n  let d; // distance between the top and bottom of mouth\n  let cY // center y of lips bounding\n  let cX // center x of lips bounding box\n  // video stuff\n  // push();\n  // scale(-1, 1);\n  // translate(-width, 0);\n  // image(video, 0, 0, width, height);\n  // pop();\n\n  if (faces.length > 0) {\n    face = faces[0];\n    let lips = face.lips;\n\n    // do a loop around the keypoints and light up one at a time\n    for (let k = 0; k < lips.keypoints.length; k++) {\n      let keypoint = lips.keypoints[k];\n      if (k == active) {\n        fill(219, 96, 201);\n        circle(keypoint.x, keypoint.y, 8);\n      } else {\n        fill(139, 232, 67);\n        circle(keypoint.x, keypoint.y, 4);\n      }\n      \n    }\n\n    fill(51, 177, 255);\n    let top = lips.keypoints[top_inner];\n    let bottom = lips.keypoints[bottom_inner];\n  \n    \n    square(top.x, top.y, 10);\n    square(bottom.x, bottom.y, 10);\n\n    d = dist(top.x, top.y, bottom.x, bottom.y);\n    cX = lips.centerX\n    cY = lips.centerY\n  \n\n    // sound stuff\n\n    // let fre = map(sin(t * 0.5), -1, 1, 600, 2000);\n    let fre = map(d, 0, 40, 0, 1000);\n    let ampli = map(d, 0, 40, 0, 1);\n    let oscFreq = map(cX,0,width,2,600)\n    let freqmult = 1.5\n    if (cY < 150) {\n      freqmult = 2\n    } else if (cY > 350) {\n      freqmult = 0.5;\n    }\n\n    filter.freq(fre);\n    osc.amp(ampli)\n    osc2.amp(ampli)\n    osc.freq(oscFreq)\n    osc2.freq(oscFreq*freqmult)\n    text(fre, 10, 20);\n      text(oscFreq, 10, 40);\n     text(`${cY}: ${freqmult}`, 10, 60);\n    // distort.set(0,0)\n    \n    // env.play();\n\n    if (frameCount % 5 == 1) {\n      active += 1;\n      active = active % 42;\n    }\n  }\n\n  t += 0.01;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "693ae530ab6df68d2351e40f",
        "createdAt": "2026-03-13T15:08:41.967Z",
        "updatedAt": "2026-03-13T15:08:41.967Z",
        "id": "693ae530ab6df68d2351e40f"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <script src=\"https://unpkg.com/ml5@1/dist/ml5.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "693ae530ab6df68d2351e409",
        "createdAt": "2026-03-13T15:08:41.967Z",
        "updatedAt": "2026-03-13T15:08:41.967Z",
        "id": "693ae530ab6df68d2351e409"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "693ae530ab6df68d2351e410",
        "createdAt": "2026-03-13T15:08:41.967Z",
        "updatedAt": "2026-03-13T15:08:41.967Z",
        "id": "693ae530ab6df68d2351e410"
      }
    ],
    "visibility": "Public",
    "createdAt": "2025-12-11T15:37:20.805Z",
    "updatedAt": "2026-03-13T15:08:41.967Z",
    "id": "HFAwrbWE3"
  },
  {
    "_id": "f7y-1W7B4",
    "name": "icm in class 10-30",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6903a540d50b0e1148eaf0dd",
          "6903a540d50b0e1148eaf0dc",
          "6903a540d50b0e1148eaf0de"
        ],
        "fileType": "folder",
        "_id": "6903a540d50b0e1148eaf0df",
        "createdAt": "2025-10-30T22:58:56.497Z",
        "updatedAt": "2025-10-30T22:58:56.497Z",
        "id": "6903a540d50b0e1148eaf0df"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet t = 0;\n\nfunction setup() {\n  cam = createCapture(VIDEO, rs);\n  cam.hide();\n}\n\nfunction rs() {\n  createCanvas(cam.width, cam.height);\n}\n\nlet y = 0;\n\nfunction draw() {\n  // background(20);\n  push();\n  scale(-1, 1);\n  image(cam, width, 0);\n  pop();\n\n  push();\n  copy(cam, 0, height/2, width, 10, 0, y, width, 10);\n  pop();\n  // push();\n  // a = map(sin(t), -1, 1, 0, 255);\n  // tint(255, a);\n  // let flip = createImage()\n  // image(cam, 0, 0);\n  //   pop();\n  // t += 0.05;\n  y += 1;\n  y = y %height;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6903a540d50b0e1148eaf0dc",
        "createdAt": "2025-10-30T22:58:56.497Z",
        "updatedAt": "2025-10-30T22:58:56.497Z",
        "id": "6903a540d50b0e1148eaf0dc"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "6903a540d50b0e1148eaf0dd",
        "createdAt": "2025-10-30T22:58:56.497Z",
        "updatedAt": "2025-10-30T22:58:56.497Z",
        "id": "6903a540d50b0e1148eaf0dd"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6903a540d50b0e1148eaf0de",
        "createdAt": "2025-10-30T22:58:56.497Z",
        "updatedAt": "2025-10-30T22:58:56.497Z",
        "id": "6903a540d50b0e1148eaf0de"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-30T22:58:56.497Z",
    "createdAt": "2025-10-30T22:58:56.497Z",
    "id": "f7y-1W7B4"
  },
  {
    "_id": "_CW5q3aBa",
    "name": "icm play-pause",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6914ce9c362d2e699a804d8d",
          "6914cc38a6132eb3501371f4",
          "6914cc38a6132eb3501371f3",
          "6914cc38a6132eb3501371f5"
        ],
        "fileType": "folder",
        "_id": "6914cc38a6132eb3501371f6",
        "createdAt": "2025-11-12T18:20:12.955Z",
        "updatedAt": "2025-11-12T18:20:12.955Z",
        "id": "6914cc38a6132eb3501371f6"
      },
      {
        "name": "sketch.js",
        "content": "let mp3;\nlet playing = false;\n\nfunction setup() {\n  createCanvas(400, 400);\n  mp3 = new p5.SoundFile('bells.mp3')\n}\n\nfunction mousePressed() {\n  if (!playing) {\n    mp3.play()\n    playing = true\n  } else {\n    mp3.pause();\n    playing = false\n  }\n}\n\nfunction draw() {\n  background(220);\n  \n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6914cc38a6132eb3501371f3",
        "createdAt": "2025-11-12T18:20:12.955Z",
        "updatedAt": "2025-11-12T18:20:12.955Z",
        "id": "6914cc38a6132eb3501371f3"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "6914cc38a6132eb3501371f4",
        "createdAt": "2025-11-12T18:20:12.955Z",
        "updatedAt": "2025-11-12T18:20:12.955Z",
        "id": "6914cc38a6132eb3501371f4"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6914cc38a6132eb3501371f5",
        "createdAt": "2025-11-12T18:20:12.955Z",
        "updatedAt": "2025-11-12T18:20:12.955Z",
        "id": "6914cc38a6132eb3501371f5"
      },
      {
        "name": "bells.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/0c2917e7-8261-4d99-9c9c-fddccb98d512.mp3",
        "children": [],
        "fileType": "file",
        "_id": "6914ce9c362d2e699a804d8d",
        "createdAt": "2025-11-12T18:20:12.955Z",
        "updatedAt": "2025-11-12T18:20:12.955Z",
        "id": "6914ce9c362d2e699a804d8d"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-12T18:20:12.955Z",
    "createdAt": "2025-11-12T18:20:12.955Z",
    "id": "_CW5q3aBa"
  },
  {
    "_id": "gKym3RARg",
    "name": "icm project 1",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690ba05f98e17555e7149400",
          "690ba6ebfd8b77d8f4c69379",
          "690261e7b669b9bcbd68bd1b",
          "690261e7b669b9bcbd68bd1a",
          "690261e7b669b9bcbd68bd1c"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "690261e7b669b9bcbd68bd1d",
        "createdAt": "2025-11-06T14:43:11.642Z",
        "updatedAt": "2025-11-06T14:43:11.642Z",
        "id": "690261e7b669b9bcbd68bd1d"
      },
      {
        "name": "sketch.js",
        "content": "let pSize = 10; //\"pixel\" width;\n\nlet img;\nlet amt = 2;\n\nlet totals = []; // pixel array\nlet balls = [];\nlet smallCanvas;\nlet xP;\n\nfunction preload() {\n  img = loadImage(\"duke.jpg\");\n}\n\nfunction setup() {\n  // img.resize(400, 0);\n  img = createCapture(VIDEO,onLoad)\n  img.hide();\n//   createCanvas(img.width, img.height);\n\n\n//   smallCanvas = createGraphics(width / pSize, height / pSize);\n  pixelDensity(1);\n\n  // xP = width / smallCanvas.width;\n  noStroke();\n\n  // for (let i = 0; i < 6; i++) {\n  //   let x = random(0, smallCanvas.width);\n  //   let y = random(0, smallCanvas.height);\n  //   balls.push(new Ball(x, y));\n  // }\n\n  //   img.loadPixels();\n  //   for (let x = 0; x < img.width; x += pSize) {\n  //     for (let y = 0; y < img.height; y += ySize) {\n  //       let index = (x + y * width) * 4;\n  //       let r = img.pixels[index];\n  //       let g = img.pixels[index + 1];\n  //       let b = img.pixels[index + 2];\n\n  //       let pixel = new Pixel(x, y, pSize, [r,g,b,255]);\n\n  //       pixeles.push(pixel);\n  //     }\n  // } // end for\n}\n\nfunction onLoad() {\n  createCanvas(img.width, img.height);\n\n\n  smallCanvas = createGraphics(width / pSize, height / pSize);\n   xP = width / smallCanvas.width;\n  for (let i = 0; i < 6; i++) {\n    let x = random(0, smallCanvas.width);\n    let y = random(0, smallCanvas.height);\n    balls.push(new Ball(x, y));\n  }\n}\n\nfunction draw() {\n  background(20);\n  // img.filter(GRAY);\n  // image(img, 0, 0);\n  for (let ball of balls) {\n    ball.update();\n  }\n\n  smallCanvas.loadPixels();\n  for (let i = 0; i < smallCanvas.width; i++) {\n    for (let j = 0; j < smallCanvas.height; j++) {\n      let index = i + j * smallCanvas.width;\n      let total = 0;\n      for (let ball of balls) {\n        const d = dist(ball.pos.x, ball.pos.y, i, j);\n        const col = (14 * ball.r) / d;\n        total += col;\n      }\n\n      total = 360 - total;\n      totals[index] = total;\n    }\n  }\n\n  img.loadPixels();\n\n  for (let x = 0; x < img.width; x += pSize) {\n    for (let y = 0; y < img.height; y += pSize) {\n      let index = (x + y * width) * 4;\n      let r = img.pixels[index];\n      let g = img.pixels[index + 1];\n      let b = img.pixels[index + 2];\n      \n      let bright = (r+g+b)/3\n\n      let totalIndex = index / 4;\n      let total = totals[totalIndex];\n      // let f = [r,g,b,0]\n      // let v = constrain(total, 160, 280);\n\n      let c = color(r, 100, 50);\n      let f;\n\n      if (bright > 50) {\n        f = fill(c);\n      } else {\n\n        f = fill(bright);\n      }\n\n      rect(x, y, xP, xP);\n    }\n  } // end for\n  // console.log(totals.length);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690261e7b669b9bcbd68bd1a",
        "createdAt": "2025-11-06T14:43:11.642Z",
        "updatedAt": "2025-11-06T14:43:11.642Z",
        "id": "690261e7b669b9bcbd68bd1a"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n     <script src=\"Pixel.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690261e7b669b9bcbd68bd1b",
        "createdAt": "2025-11-06T14:43:11.642Z",
        "updatedAt": "2025-11-06T14:43:11.642Z",
        "id": "690261e7b669b9bcbd68bd1b"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690261e7b669b9bcbd68bd1c",
        "createdAt": "2025-11-06T14:43:11.642Z",
        "updatedAt": "2025-11-06T14:43:11.642Z",
        "id": "690261e7b669b9bcbd68bd1c"
      },
      {
        "name": "Pixel.js",
        "content": "class Pixel {\n  constructor(x, y, size, rgbArray) {\n    this.x = x;\n    this.y = y;\n    this.size = size; // size\n    this.home = [x, y]; // save the home coordinates\n    this.rgbArray = rgbArray;\n    this.speed = null;\n    this.a = 255;\n    this.h = null;\n\n\n    if (rgbArray.r > 128) {\n      this.speed = random(-10, -5);\n      this.h = color(rgbArray[0], 128, 255 - rgbArray[2]);\n    } else {\n      this.speed = random(5, 10);\n      this.h = color(255 - rgbArray[0], 128, rgbArray[2]);\n    }\n  }\n\n  display() {\n    fill(this.rgbArray);\n    rect(this.x, this.y, this.size, this.size);\n  }\n\n  edges() {\n    if (this.y < 0) {\n      this.y = this.s;\n    } else if (this.y > height) {\n      this.y = height - this.s;\n    }\n  }\n\n  fadeOut() {\n    this.rgbArray[3] -= 5;\n  }\n\n   fadeIn() {\n    this.rgbArray[3] += 5;\n  }\n\n  update() {\n    if (this.rgbArray[3] > 0) {\n     this.fadeOut();\n    }\n   \n    // if (frameCount < 120) {\n    //   this.fade();\n    // } else {\n    //   this.y += this.speed;\n    //   this.edges();\n    // }\n  }\n}\n\nclass Ball {\n  constructor(x, y) {\n    this.pos = createVector(x, y);\n    this.vel = p5.Vector.random2D().mult(random(2));\n    this.r = random(15, 35);\n  }\n\n  update() {\n    this.pos.add(this.vel);\n    if (this.pos.x > smallCanvas.width || this.pos.x < 0) {\n      this.vel.mult(-1, 1);\n    } else if (this.pos.y > smallCanvas.height || this.pos.y < 0) {\n      this.vel.mult(1, -1);\n    }\n  }\n\n  show() {\n    circle(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690ba05f98e17555e7149400",
        "createdAt": "2025-11-06T14:43:11.642Z",
        "updatedAt": "2025-11-06T14:43:11.642Z",
        "id": "690ba05f98e17555e7149400"
      },
      {
        "name": "duke.jpg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/1ba02b98-6cc3-4ef2-88ae-77d6b0ae90d0.jpg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690ba6ebfd8b77d8f4c69379",
        "createdAt": "2025-11-06T14:43:11.642Z",
        "updatedAt": "2025-11-06T14:43:11.642Z",
        "id": "690ba6ebfd8b77d8f4c69379"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-06T14:43:11.642Z",
    "createdAt": "2025-10-29T19:12:25.435Z",
    "id": "gKym3RARg"
  },
  {
    "_id": "LgyQMKopX",
    "name": "ICM project 1.2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690a730b43756e6ef274d8b9",
          "690a492b43756e6ef274d8b6",
          "690a492b43756e6ef274d8b5",
          "690a492b43756e6ef274d8b7"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "690a492b43756e6ef274d8b8",
        "createdAt": "2025-11-04T21:48:57.121Z",
        "updatedAt": "2025-11-04T21:48:57.121Z",
        "id": "690a492b43756e6ef274d8b8"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet xSize = 4; //\"pixel\" width;\nlet ySize = 4; // \"pixel\" height - bigger numbers make it more pixelated\nlet t = 0;\nlet img;\nlet src;\n\nfunction preload() {\n  img = loadImage(\"city.jpeg\");\n}\n\nfunction setup() {\n  noStroke();\n  pixelDensity(1);\n  cam = createCapture(VIDEO, makeCanvas);\n  cam.hide();\n  src =cam;\n  // colorMode(HSB);\n}\n\nfunction makeCanvas() {\n  createCanvas(cam.width, cam.height);\n  img.resize(width, 0);\n}\n\nfunction draw() {\n  background(20);\n\n  src.loadPixels();\n  for (let x = 0; x < src.width; x += xSize) {\n    for (let y = 0; y < src.height; y += ySize) {\n      let index = (x + y * width) * 4;\n      let r = src.pixels[index];\n      let g = src.pixels[index + 1];\n      let b = src.pixels[index + 2];\n\n      let bright = (r + g + b) / 3;\n      let v = map(sin(t + bright * 0.01), -1, 1, 0, 255);\n\n      let r2 = (r - v) % 255;\n      let b2 = (v * 0.5 + g) % 255;\n      let g2 = (v * 2.2 + b) % 255;\n\n      fill(r2, b2, g2);\n\n      rect(x, y, xSize, ySize);\n    }\n  }\n\n  t += 0.01;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690a492b43756e6ef274d8b5",
        "createdAt": "2025-11-04T21:48:57.121Z",
        "updatedAt": "2025-11-04T21:48:57.121Z",
        "id": "690a492b43756e6ef274d8b5"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690a492b43756e6ef274d8b6",
        "createdAt": "2025-11-04T21:48:57.121Z",
        "updatedAt": "2025-11-04T21:48:57.121Z",
        "id": "690a492b43756e6ef274d8b6"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690a492b43756e6ef274d8b7",
        "createdAt": "2025-11-04T21:48:57.121Z",
        "updatedAt": "2025-11-04T21:48:57.121Z",
        "id": "690a492b43756e6ef274d8b7"
      },
      {
        "name": "city.jpeg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/b21459d8-3519-4cfa-a164-3901d315627a.jpeg",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690a730b43756e6ef274d8b9",
        "createdAt": "2025-11-04T21:48:57.121Z",
        "updatedAt": "2025-11-04T21:48:57.121Z",
        "id": "690a730b43756e6ef274d8b9"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-04T21:48:57.121Z",
    "createdAt": "2025-11-04T21:48:47.844Z",
    "id": "LgyQMKopX"
  },
  {
    "_id": "yEVCNyDVN",
    "name": "icm sound project",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "691cbed9c5a391568e688751",
          "691cbed99788ddf3b30b6f66",
          "691cbed9c5a391568e68873c",
          "691cbe71c5a391568e684fa8",
          "691b8e5ec5d4862334cdd33b",
          "691cbf9bd2dad176a156b9fb",
          "691cbf9beae76b4759e3ffab",
          "691cbed9223b9c1c92e77802",
          "691cbe87d2dad176a155fe25",
          "691cbea7d2dad176a1560f8d",
          "691b8e5ec5d4862334cdd33a",
          "691b8e5ec5d4862334cdd33c"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "691b8e5ec5d4862334cdd33d",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691b8e5ec5d4862334cdd33d"
      },
      {
        "name": "sketch.js",
        "content": "let sample;\nlet sample2;\nlet sample3;\nlet sample5;\nlet sample6;\nlet sample4;\nlet sample7;\nlet s = 1;\nlet p = 1;\nlet q = 1;\nlet delay\n\nfunction preload() {\n  sample = loadSound(\"mmmm.mp3\");\n  sample3 = loadSound(\"ooh.mp3\");\n  sample5 = loadSound(\"ooh.mp3\");\n  sample6 = loadSound(\"ooh.mp3\");\n  // sample2 = loadSound(\"sit_in_silence.mp3\");\n  sample4 = loadSound(\"hahaha.mp3\");\n  sample7 = loadSound(\"hahaha.mp3\");\n}\n\nfunction setup() {\n  createCanvas(400, 400);\n  sample4.rate(0.8);\n  sample4.amp(0.6);\n  sample4.pan(-0.2);\n  sample7.rate(0.8);\n  sample7.amp(0.6);\n  sample7.pan(0.2);\n\n  sample.rate(0.8);\n  sample.pan(1);\n\n\n  sample3.rate(1);\n  sample6.rate(0.667);\n  sample5.rate(1.25);\n  sample3.pan(-1);\n  sample5.pan(0);\n  sample6.pan(-1);\n   delay = new p5.Delay();\n\n  // delay.process() accepts 4 parameters:\n  // source, delayTime (in seconds), feedback, filter frequency\n  delay.process(sample3, 0.24, 0.6, 2300);\n  delay.process(sample6, 0.36, 0.6, 2300);\n  \n}\n\nfunction keyPressed() {\n  sample.play();\n}\n\nfunction draw() {\n  background(220);\n\n  if (frameCount % 240 == 1) {\n    sample4.play();\n  }\n\n  if (frameCount % 120 == 61) {\n    sample7.play();\n  }\n\n  if (frameCount > 420 && frameCount % 240 == 1) {\n    sample.play();\n  }\n  \n  if (frameCount > 420 && frameCount % 240 == 161) {\n      sample3.play();\n    sample6.play()\n  }\n\n  //   if (frameCount > 300) {\n  //     if (frameCount % 60 == q) {\n  //     sample3.play();\n\n  //     p += 2;\n\n  //     p = p % 59;\n  //   }\n\n  //   if (frameCount % 60 == s) {\n  //     sample5.play();\n  //     q += 1;\n\n  //     q = q % 59;\n  //   }\n  //   if (frameCount % 60 == p) {\n  //     sample6.play();\n  //     s += 3;\n  //     s = s % 59;\n\n  //   }\n  //   }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "691b8e5ec5d4862334cdd33a",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691b8e5ec5d4862334cdd33a"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691b8e5ec5d4862334cdd33b",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691b8e5ec5d4862334cdd33b"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691b8e5ec5d4862334cdd33c",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691b8e5ec5d4862334cdd33c"
      },
      {
        "name": "hahaha.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/39f20e54-1da7-4970-99bd-9e432a2d6f18.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbe71c5a391568e684fa8",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbe71c5a391568e684fa8"
      },
      {
        "name": "mmmm.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/14187e39-7989-4d69-82bd-09ab1d338068.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbe87d2dad176a155fe25",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbe87d2dad176a155fe25"
      },
      {
        "name": "ooh.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/7ef5e563-654c-47c4-95ef-1084a51bec69.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbea7d2dad176a1560f8d",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbea7d2dad176a1560f8d"
      },
      {
        "name": "friends.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/2be3d2e4-13ae-4735-b11b-47bd8495c4f2.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbed9c5a391568e68873c",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbed9c5a391568e68873c"
      },
      {
        "name": "crank.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/323358b6-659f-451b-aecb-be2bcb7addac.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbed9c5a391568e688751",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbed9c5a391568e688751"
      },
      {
        "name": "creak.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/c483e197-3eeb-4dd9-987c-0bf79be41d1e.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbed99788ddf3b30b6f66",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbed99788ddf3b30b6f66"
      },
      {
        "name": "me.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/5a607124-8dd9-43a5-9e9f-aa285c561167.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbed9223b9c1c92e77802",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbed9223b9c1c92e77802"
      },
      {
        "name": "lighter.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/8f96bc9d-0e95-4b06-a59c-5ccb653e0c89.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbf9bd2dad176a156b9fb",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbf9bd2dad176a156b9fb"
      },
      {
        "name": "lighter2.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/c89198a0-a11b-41d9-883e-f7ebfd7198bf.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cbf9beae76b4759e3ffab",
        "createdAt": "2025-11-18T18:52:54.449Z",
        "updatedAt": "2025-11-18T18:52:54.449Z",
        "id": "691cbf9beae76b4759e3ffab"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-18T18:52:54.449Z",
    "createdAt": "2025-11-17T22:07:05.367Z",
    "id": "yEVCNyDVN"
  },
  {
    "_id": "xfPCKWQBe",
    "name": "icm sound project v2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "691cc08ac5d4862334cdd343",
          "691cc08ac5d4862334cdd344",
          "691ccd86f6a70670541f443e",
          "691cc08ac5d4862334cdd345",
          "691cc08ac5d4862334cdd346",
          "691cc08ac5d4862334cdd347",
          "691cc08ac5d4862334cdd348",
          "691cc08ac5d4862334cdd349",
          "691cc08ac5d4862334cdd34a",
          "691cc08ac5d4862334cdd34b",
          "691cc08ac5d4862334cdd34c",
          "691cc08ac5d4862334cdd34d",
          "691cc08ac5d4862334cdd34e"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd342",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd342"
      },
      {
        "name": "sketch.js",
        "content": "let faceMesh;\nlet faces = [];\nlet video;\nlet options = { maxFaces: 1, refineLandmarks: false, flipped: true };\n\nlet right_corner = 20;\nlet left_corner = 10;\nlet bottom_outer = 5;\nlet bottom_inner = 26;\nlet top_outer = 15;\nlet top_inner = 36;\n\nlet active = 1;\n\nlet osc1\nlet osc2\n\nfunction preload() {\n  faceMesh = ml5.faceMesh(options);\n}\n\nfunction setup() {\n  createCanvas(400, 400);\n  rectMode(CENTER);\n  noStroke();\n  video = createCapture(VIDEO);\n  video.size(width, height);\n  video.hide();\n\n  faceMesh.detectStart(video, foundFaces);\n  \n  osc1 = new p5.Oscillator('sine');\n  osc2  = new p5.Oscillator('sine');\n \n\n}\n\nfunction foundFaces(results) {\n  faces = results;\n}\n\nfunction draw() {\n  background(220);\n  push();\n  scale(-1, 1);\n  translate(-width, 0);\n  image(video, 0, 0, width, height);\n  pop();\n\n  if (faces.length > 0) {\n    face = faces[0];\n    let lips = face.lips;\n\n    fill(0, 0, 255);\n    let top = lips.keypoints[top_inner];\n    let bottom = lips.keypoints[bottom_inner];\n    square(top.x, top.y, 10);\n    square(bottom.x, bottom.y, 10);\n\n    let d = dist(top.x, top.y, bottom.x, bottom.y);\n    text(d, 10, 20);\n\n    // do a loop around the keypoints and light up one at a time\n    for (let k = 0; k < lips.keypoints.length; k++) {\n      let keypoint = lips.keypoints[k];\n      if (k == active) {\n        fill(255, 0, 0);\n        circle(keypoint.x, keypoint.y, 4);\n      }\n    }\n\n    if (frameCount % 5 == 1) {\n      active += 1;\n      active = active % 42;\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "691cc08ac5d4862334cdd34d",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd34d"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd347",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd347"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd34e",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd34e"
      },
      {
        "name": "hahaha.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/727d8474-cb88-4ed8-971a-5bade7cd6754.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd346",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd346"
      },
      {
        "name": "mmmm.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/3a032328-c140-46bf-9e61-eea467abf5ac.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd34b",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd34b"
      },
      {
        "name": "ooh.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/2985a2e4-d881-4aae-86dc-056c5b58b507.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd34c",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd34c"
      },
      {
        "name": "friends.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/43415405-6f12-4b8a-8ad8-724eac10f267.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd345",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd345"
      },
      {
        "name": "crank.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/a9cec172-9ec4-48e2-a537-adeb76ed664b.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd343",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd343"
      },
      {
        "name": "creak.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/ec367db2-2ef8-4324-8980-d5e66f9b9c47.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd344",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd344"
      },
      {
        "name": "me.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/f10ce4bf-c2ab-4930-8eaa-e4c21280ab9a.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd34a",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd34a"
      },
      {
        "name": "lighter.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/983f15a9-521e-4aa2-9fb6-e932a02e994e.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd348",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd348"
      },
      {
        "name": "lighter2.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/0c20b144-1797-4c42-9198-f498d0f40a19.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691cc08ac5d4862334cdd349",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691cc08ac5d4862334cdd349"
      },
      {
        "name": "ends.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/62bd7c8e-f86f-48d2-abc2-189bdc1bc378.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "691ccd86f6a70670541f443e",
        "createdAt": "2025-12-11T19:28:48.612Z",
        "updatedAt": "2025-12-11T19:28:48.612Z",
        "id": "691ccd86f6a70670541f443e"
      }
    ],
    "visibility": "Public",
    "createdAt": "2025-11-18T18:52:59.029Z",
    "updatedAt": "2025-12-11T19:28:48.612Z",
    "id": "xfPCKWQBe"
  },
  {
    "_id": "U9P9D_E5-",
    "name": "icm week 10 worksheet q2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6914e1be13373114bf199caf",
          "6914e1bea0e0f97c78c7e840",
          "6914e1beef4b99b69ab3c298",
          "6914e224a0e0f97c78c81e71",
          "6914e1bf13373114bf199cd8",
          "6914e1bfa0e0f97c78c7e85c",
          "6914e1be2a20dc11631a82af",
          "6914dce901eb4a36ae18a6ac",
          "6914dce901eb4a36ae18a6ab",
          "6914dce901eb4a36ae18a6ad"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6914dce901eb4a36ae18a6ae",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914dce901eb4a36ae18a6ae"
      },
      {
        "name": "sketch.js",
        "content": "let tracks = []\nlet total = 7\nlet index = 0\n\n\nfunction preload() {\n  for (let i = 0; i < total; i++) {\n    tracks[i] = new p5.SoundFile(i+\".mp3\")\n  }\n}\n\nfunction setup() {\n  createCanvas(400, 400);\n  \n\n}\n\nfunction mousePressed() {  \n  let current = tracks[index]\n  \n  if (!current.isPlaying()) {\n    current.play()\n  } else {\n    current.pause();\n    index = (index+1) % total\n  }\n}\n\nfunction draw() {\n  background(20);  \n  fill(220)\n  text('current track:' + (index+1),10,20)\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6914dce901eb4a36ae18a6ab",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914dce901eb4a36ae18a6ab"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914dce901eb4a36ae18a6ac",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914dce901eb4a36ae18a6ac"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914dce901eb4a36ae18a6ad",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914dce901eb4a36ae18a6ad"
      },
      {
        "name": "0.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/188febab-4dad-4b7b-a48c-88c515ec27e5.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e1be13373114bf199caf",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e1be13373114bf199caf"
      },
      {
        "name": "6.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/d1b04ea2-f579-4c12-8289-2814eb6ca4a3.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e1be2a20dc11631a82af",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e1be2a20dc11631a82af"
      },
      {
        "name": "1.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/7807c859-22ff-43fe-baab-8b8df711252a.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e1bea0e0f97c78c7e840",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e1bea0e0f97c78c7e840"
      },
      {
        "name": "2.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/3f58b9cb-112a-491e-9484-f044d23ee83b.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e1beef4b99b69ab3c298",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e1beef4b99b69ab3c298"
      },
      {
        "name": "4.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/a22c535a-eaa9-48c7-92a7-52660519d78f.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e1bf13373114bf199cd8",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e1bf13373114bf199cd8"
      },
      {
        "name": "5.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/30037696-d14f-44e4-930a-8fa768c62170.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e1bfa0e0f97c78c7e85c",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e1bfa0e0f97c78c7e85c"
      },
      {
        "name": "3.mp3",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/bca64127-bcb5-404f-af4f-8879f8c79e56.mp3",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e224a0e0f97c78c81e71",
        "createdAt": "2025-11-12T19:40:22.698Z",
        "updatedAt": "2025-11-12T19:40:22.698Z",
        "id": "6914e224a0e0f97c78c81e71"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-12T19:40:22.698Z",
    "createdAt": "2025-11-12T19:24:56.735Z",
    "id": "U9P9D_E5-"
  },
  {
    "_id": "aExSGALQu",
    "name": "icm week 10 worksheet q3",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6914e2b964e71e3c6247edd0",
          "6914e2b964e71e3c6247edcf",
          "6914e2b964e71e3c6247edd1"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6914e2b964e71e3c6247edd2",
        "createdAt": "2025-11-12T20:00:27.364Z",
        "updatedAt": "2025-11-12T20:00:27.364Z",
        "id": "6914e2b964e71e3c6247edd2"
      },
      {
        "name": "sketch.js",
        "content": "let mic\nlet fft\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSB)\n  noStroke();\n  mic = new p5.AudioIn()\n  mic.start()\n  fft = new p5.FFT()\n  mic.connect(fft)\n}\n\nfunction draw() {\n  background(20,0,10);\n  let level = mic.getLevel()\n  if (level > 0.08) {\n    fill(random(360),80,80)\n  } else {\n    fill(180,80,80)\n  }\n  circle(width/2,height/6,level*1000)\n  let spectrum = fft.analyze()\n  for (let i = 0; i < spectrum.length; i++) {\n    let x= map(i, 0,spectrum.length,0,width)\n    let y = spectrum[i]\n    let h = (x+180) % 360\n    stroke(h,80,80)\n    line(x,height+1,x,height+1-y)\n  }\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6914e2b964e71e3c6247edcf",
        "createdAt": "2025-11-12T20:00:27.364Z",
        "updatedAt": "2025-11-12T20:00:27.364Z",
        "id": "6914e2b964e71e3c6247edcf"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e2b964e71e3c6247edd0",
        "createdAt": "2025-11-12T20:00:27.364Z",
        "updatedAt": "2025-11-12T20:00:27.364Z",
        "id": "6914e2b964e71e3c6247edd0"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e2b964e71e3c6247edd1",
        "createdAt": "2025-11-12T20:00:27.364Z",
        "updatedAt": "2025-11-12T20:00:27.364Z",
        "id": "6914e2b964e71e3c6247edd1"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-12T20:00:27.364Z",
    "createdAt": "2025-11-12T19:50:22.905Z",
    "id": "aExSGALQu"
  },
  {
    "_id": "DX2qDQmBA",
    "name": "ICM week 10 worksheet q4",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6914e76964e71e3c6247edd4",
          "6914e76964e71e3c6247edd3",
          "6914e76964e71e3c6247edd5"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6914e76964e71e3c6247edd6",
        "createdAt": "2025-11-13T21:27:22.719Z",
        "updatedAt": "2025-11-13T21:27:22.719Z",
        "id": "6914e76964e71e3c6247edd6"
      },
      {
        "name": "sketch.js",
        "content": "let osc;\nlet delay;\nlet root = 196; // G3\n// Diatonic, justly tuned, minor scale from // https://en.wikipedia.org/wiki/Just_intonation\nlet freqs = [1, 9 / 8, 6 / 5, 4 / 3, 3 / 2, 8 / 5, 9 / 5, 2];\nlet hueFreq = root;\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSB);\n  osc = new p5.Oscillator(\"triangle\");\n  osc.start();\n  osc.amp(0);\n  delay = new p5.Delay();\n\n  // delay.process() accepts 4 parameters:\n  // source, delayTime (in seconds), feedback, filter frequency\n  delay.process(osc, 0.12, 0.5, 1300);\n}\n\nfunction keyPressed() {\n  let freq = random(freqs);\n  hueFreq = (root * freq) % 360;\n  osc.freq(root * freq, 0.3);\n  osc.amp(1, 0.8);\n}\n\nfunction keyReleased() {\n  osc.amp(0, 1);\n}\n\nfunction draw() {\n  background(hueFreq, 80, 80);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6914e76964e71e3c6247edd3",
        "createdAt": "2025-11-13T21:27:22.719Z",
        "updatedAt": "2025-11-13T21:27:22.719Z",
        "id": "6914e76964e71e3c6247edd3"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e76964e71e3c6247edd4",
        "createdAt": "2025-11-13T21:27:22.719Z",
        "updatedAt": "2025-11-13T21:27:22.719Z",
        "id": "6914e76964e71e3c6247edd4"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6914e76964e71e3c6247edd5",
        "createdAt": "2025-11-13T21:27:22.719Z",
        "updatedAt": "2025-11-13T21:27:22.719Z",
        "id": "6914e76964e71e3c6247edd5"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-13T21:27:22.719Z",
    "createdAt": "2025-11-12T20:09:59.822Z",
    "id": "DX2qDQmBA"
  },
  {
    "_id": "c-nPWRd7c",
    "name": "ICM week 12 worksheet q1",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6931b43f4187a75544a65c60",
          "6931b43f4187a75544a65c5f",
          "6931b43f4187a75544a65c61"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6931b43f4187a75544a65c62",
        "createdAt": "2025-12-04T16:25:57.353Z",
        "updatedAt": "2025-12-04T16:25:57.353Z",
        "id": "6931b43f4187a75544a65c62"
      },
      {
        "name": "sketch.js",
        "content": "let chars = \"I wish to wash my Irish wristwatch\".split(\"\");\n\nfunction setup() {\n  createCanvas(400, 400);\n  background(20);\n  for (let i = 0; i < chars.length; i++) {\n    let x = random(10, width);\n    let y = random(10, height);\n    fill(224);\n    text(chars[i], x, y);\n  }\n\n  setInterval(() => {\n    background(20);\n    for (let i = 0; i < chars.length; i++) {\n      let x = random(10, width);\n      let y = random(10, height);\n      fill(224);\n      text(chars[i], x, y);\n    }\n  }, 2000);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6931b43f4187a75544a65c5f",
        "createdAt": "2025-12-04T16:25:57.353Z",
        "updatedAt": "2025-12-04T16:25:57.353Z",
        "id": "6931b43f4187a75544a65c5f"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.11/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6931b43f4187a75544a65c60",
        "createdAt": "2025-12-04T16:25:57.353Z",
        "updatedAt": "2025-12-04T16:25:57.353Z",
        "id": "6931b43f4187a75544a65c60"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6931b43f4187a75544a65c61",
        "createdAt": "2025-12-04T16:25:57.353Z",
        "updatedAt": "2025-12-04T16:25:57.353Z",
        "id": "6931b43f4187a75544a65c61"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-12-04T16:25:57.353Z",
    "createdAt": "2025-12-04T16:25:57.353Z",
    "id": "c-nPWRd7c"
  },
  {
    "_id": "qN4ZCD5i1",
    "name": "icm week 12 worksheet q2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6931b6384187a75544a65c64",
          "6931b6384187a75544a65c63",
          "6931b6384187a75544a65c65",
          "6931b7044187a75544a65c67"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6931b6384187a75544a65c66",
        "createdAt": "2025-12-04T16:50:14.317Z",
        "updatedAt": "2025-12-04T16:50:14.317Z",
        "id": "6931b6384187a75544a65c66"
      },
      {
        "name": "sketch.js",
        "content": "let words = []\nlet newString = []\nfunction setup() {\n  createCanvas(400, 400);\n  background(22)\n  fill(222)\n  textSize(18)\n  loadStrings('tongue_twister.txt', handleStrings)\n}\n\nfunction handleStrings(strings) {\n  let ts = textSize()\n  for (let string of strings) {\n    let tokens = splitTokens(string)\n    for (let token of tokens) {\n      token.trim()\n      words.push(token)\n    }\n  }\n\n  for (let i = words.length; i >0; i--) {\n    let index = floor(random(words.length))\n    let word = words[index]\n    newString.push(word)\n    words.splice(index,1)\n  }\n  let sentence = newString.join(' ')\n  textWrap(WORD)\n  text(sentence,10,height/4,width)\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6931b6384187a75544a65c63",
        "createdAt": "2025-12-04T16:50:14.317Z",
        "updatedAt": "2025-12-04T16:50:14.317Z",
        "id": "6931b6384187a75544a65c63"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.11/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6931b6384187a75544a65c64",
        "createdAt": "2025-12-04T16:50:14.317Z",
        "updatedAt": "2025-12-04T16:50:14.317Z",
        "id": "6931b6384187a75544a65c64"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6931b6384187a75544a65c65",
        "createdAt": "2025-12-04T16:50:14.317Z",
        "updatedAt": "2025-12-04T16:50:14.317Z",
        "id": "6931b6384187a75544a65c65"
      },
      {
        "name": "tongue_twister.txt",
        "content": "Betty Botter bought some butter but, said she, the butter’s bitter.\nIf I put it in my batter, it will make my batter bitter.\nBut a bit of better butter will make my bitter batter better.\nSo she bought some better butter, better than the bitter butter,\nput it in her bitter batter, made her bitter batter better.\nSo ‘t was better Betty Botter bought some better butter.\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6931b7044187a75544a65c67",
        "createdAt": "2025-12-04T16:50:14.317Z",
        "updatedAt": "2025-12-04T16:50:14.317Z",
        "id": "6931b7044187a75544a65c67"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-12-04T16:50:14.317Z",
    "createdAt": "2025-12-04T16:50:14.317Z",
    "id": "qN4ZCD5i1"
  },
  {
    "_id": "YqZNGlh6a",
    "name": "ICM week 9 project",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690cb599287a75a7ec7c6277",
          "690cb599287a75a7ec7c6276",
          "690cb599287a75a7ec7c6278"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "690cb599287a75a7ec7c6279",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cb599287a75a7ec7c6279"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet xSize = 8; //\"pixel\" width;\nlet ySize = 4; // \"pixel\" height - bigger numbers make it more pixelated\nlet t = 0; // time\nlet gOff = -30; // how much the second differs from the first\nlet bOff = -30; // how much the third color differs from the second\nlet timeMult = 0.005; // how fast sketch cycles throught the color wheel\nlet hueMin = 0; // sets the bottom of the range of hues\nlet hueMax = 30; // sets the top of the range of hues\nlet a = 0;\nlet bCutoff1 = 50; // the cutoff of the first brightness threshold\nlet bCutoff2 = 250 // the cutoff of the second brightness threshold\n\nfunction preload() {\n  // img = loadImage(\"city.jpeg\");\n}\n\nfunction setup() {\n  noStroke();\n  pixelDensity(1);\n  createCanvas(windowWidth, windowHeight);\n  cam = createCapture(VIDEO);\n  cam.size(width, height);\n  cam.hide();\n  colorMode(HSB, 360, 100, 100, 100);\n}\n\n// function makeCanvas() {\n//   createCanvas(cam.width, cam.height);\n// }\n\nfunction draw() {\n  background(20, 0, 100);\n  image(cam, 0, 0);\n  filter(GRAY);\n\n  cam.loadPixels();\n  hueMax = floor(map(sin(t), -1, 1, 0, 360));\n  hueMin = floor(map(sin(t), -1, 1, 360, 0));\n\n  for (let x = 0; x < cam.width + 1; x += xSize) {\n    for (let y = 0; y < cam.height + 1; y += ySize) {\n      let index = (x + y * width) * 4;\n      let r = cam.pixels[index];\n      let g = cam.pixels[index + 1];\n      let b = cam.pixels[index + 2];\n\n      let bright = (r + g + b) / 3;\n\n      let r2 = map(bright, 0, 255, hueMin, hueMax);\n \n      let g2 = (r2 + gOff) % 360;\n      let b2 = (g2 + bOff) % 360;\n\n      let f;\n\n      if (bright < bCutoff1) {\n        f = color(r2, 60, 90, a);\n      } else if (bright < bCutoff2) {\n        f = color(g2, 60, 80, a);\n      } else {\n        f = color(b2, 60, 70, a);\n      }\n      fill(f);\n      rect(x, y, xSize, ySize);\n    }\n  }\n  t += 0.01;\n  a = map(sin(t), -1, 1, 50, 80);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690cb599287a75a7ec7c6276",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cb599287a75a7ec7c6276"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690cb599287a75a7ec7c6277",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cb599287a75a7ec7c6277"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690cb599287a75a7ec7c6278",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cb599287a75a7ec7c6278"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-06T16:14:38.981Z",
    "createdAt": "2025-11-06T15:44:28.670Z",
    "id": "YqZNGlh6a"
  },
  {
    "_id": "43-CjASDr",
    "name": "ICM week 9 project copy",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690cdacbfc19bd9ba5d222cd",
          "690cdacbfc19bd9ba5d222ce",
          "690cdacbfc19bd9ba5d222cf"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "690cdacbfc19bd9ba5d222cc",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cdacbfc19bd9ba5d222cc"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet xSize = 8; //\"pixel\" width;\nlet ySize = 4; // \"pixel\" height - bigger numbers make it more pixelated\nlet t = 0; // time\nlet gOff = -30; // how much the second differs from the first\nlet bOff = -30; // how much the third color differs from the second\nlet timeMult = 0.005; // how fast sketch cycles throught the color wheel\nlet hueMin = 0; // sets the bottom of the range of hues\nlet hueMax = 30; // sets the top of the range of hues\nlet a = 0;\nlet bCutoff1 = 50; // the cutoff of the first brightness threshold\nlet bCutoff2 = 250 // the cutoff of the second brightness threshold\n\nfunction preload() {\n  // img = loadImage(\"city.jpeg\");\n}\n\nfunction setup() {\n  noStroke();\n  pixelDensity(1);\n  createCanvas(windowWidth, windowHeight);\n  cam = createCapture(VIDEO);\n  cam.size(width, height);\n  cam.hide();\n  colorMode(HSB, 360, 100, 100, 100);\n}\n\n// function makeCanvas() {\n//   createCanvas(cam.width, cam.height);\n// }\n\nfunction draw() {\n  background(20, 0, 100);\n  image(cam, 0, 0);\n  filter(GRAY);\n\n  cam.loadPixels();\n  hueMax = floor(map(sin(t), -1, 1, 0, 360));\n  hueMin = floor(map(sin(t), -1, 1, 360, 0));\n\n  for (let x = 0; x < cam.width + 1; x += xSize) {\n    for (let y = 0; y < cam.height + 1; y += ySize) {\n      let index = (x + y * width) * 4;\n      let r = cam.pixels[index];\n      let g = cam.pixels[index + 1];\n      let b = cam.pixels[index + 2];\n\n      let bright = (r + g + b) / 3;\n\n      let r2 = map(bright, 0, 255, hueMin, hueMax);\n \n      let g2 = (r2 + gOff) % 360;\n      let b2 = (g2 + bOff) % 360;\n\n      let f;\n\n      if (bright < bCutoff1) {\n        f = color(r2, 60, 90, a);\n      } else if (bright < bCutoff2) {\n        f = color(g2, 60, 80, a);\n      } else {\n        f = color(b2, 60, 70, a);\n      }\n      fill(f);\n      rect(x, y, xSize, ySize);\n    }\n  }\n  t += 0.01;\n  a = map(sin(t), -1, 1, 50, 80);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690cdacbfc19bd9ba5d222ce",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cdacbfc19bd9ba5d222ce"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690cdacbfc19bd9ba5d222cd",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cdacbfc19bd9ba5d222cd"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690cdacbfc19bd9ba5d222cf",
        "createdAt": "2025-11-06T16:14:38.981Z",
        "updatedAt": "2025-11-06T16:14:38.981Z",
        "id": "690cdacbfc19bd9ba5d222cf"
      }
    ],
    "visibility": "Public",
    "createdAt": "2025-11-06T17:28:43.548Z",
    "updatedAt": "2025-11-06T17:28:43.548Z",
    "id": "43-CjASDr"
  },
  {
    "_id": "XHeDeZiDA",
    "name": "ICM worksheet 008 p1",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69011ff4d449ad832fb96f16",
          "69011ff4d449ad832fb96f15",
          "69011ff4d449ad832fb96f17"
        ],
        "fileType": "folder",
        "_id": "69011ff4d449ad832fb96f18",
        "createdAt": "2025-10-28T19:58:47.332Z",
        "updatedAt": "2025-10-28T19:58:47.332Z",
        "id": "69011ff4d449ad832fb96f18"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(100, 100);\n  stroke(255,0,0)\n  for (let x = 0; x < width;x++) {\n    for (let y = 0; y < height; y++) {\n      point(x,y)\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "69011ff4d449ad832fb96f15",
        "createdAt": "2025-10-28T19:58:47.333Z",
        "updatedAt": "2025-10-28T19:58:47.333Z",
        "id": "69011ff4d449ad832fb96f15"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "69011ff4d449ad832fb96f16",
        "createdAt": "2025-10-28T19:58:47.333Z",
        "updatedAt": "2025-10-28T19:58:47.333Z",
        "id": "69011ff4d449ad832fb96f16"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "69011ff4d449ad832fb96f17",
        "createdAt": "2025-10-28T19:58:47.333Z",
        "updatedAt": "2025-10-28T19:58:47.333Z",
        "id": "69011ff4d449ad832fb96f17"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-28T19:58:47.333Z",
    "createdAt": "2025-10-28T19:58:47.333Z",
    "id": "XHeDeZiDA"
  },
  {
    "_id": "yGIu9kXPq",
    "name": "ICM worksheet 008 p2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690120c1d449ad832fb96f1d",
          "690120b2d449ad832fb96f1a",
          "690120b2d449ad832fb96f19",
          "690120b2d449ad832fb96f1b"
        ],
        "fileType": "folder",
        "_id": "690120b2d449ad832fb96f1c",
        "createdAt": "2025-10-28T20:39:20.552Z",
        "updatedAt": "2025-10-28T20:39:20.552Z",
        "id": "690120b2d449ad832fb96f1c"
      },
      {
        "name": "sketch.js",
        "content": "let cat;\n// function preload() {}\nfunction setup() {\n  cat = loadImage(\"cat.jpg\", onLoad);\n}\n\nfunction onLoad() {\n  createCanvas(cat.width, cat.height);\n\n  cat.loadPixels();\n\n  for (let y = 0; y < cat.height; y++) {\n    for (let x = 0; x < cat.width; x++) {\n      let i = (x + y * width)*4;\n  \n      if ((x+y) % 2 == 0) {\n        cat.pixels[i + 1] = 255;\n      }\n\n      if (x > cat.width / 2 - 5 && x < cat.width / 2 + 5) {\n        cat.pixels[i] = 0;\n        cat.pixels[i + 1] = 0;\n        cat.pixels[i + 2] = 255;\n      }\n\n      if (y == cat.height / 2) {\n        cat.pixels[i + 3] = 0;\n      }\n    }\n  }\n\n  cat.updatePixels();\n\n  image(cat, 0, 0);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690120b2d449ad832fb96f19",
        "createdAt": "2025-10-28T20:39:20.552Z",
        "updatedAt": "2025-10-28T20:39:20.552Z",
        "id": "690120b2d449ad832fb96f19"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "690120b2d449ad832fb96f1a",
        "createdAt": "2025-10-28T20:39:20.552Z",
        "updatedAt": "2025-10-28T20:39:20.552Z",
        "id": "690120b2d449ad832fb96f1a"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "690120b2d449ad832fb96f1b",
        "createdAt": "2025-10-28T20:39:20.552Z",
        "updatedAt": "2025-10-28T20:39:20.552Z",
        "id": "690120b2d449ad832fb96f1b"
      },
      {
        "name": "cat.jpg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/4cefde97-90c1-4006-9980-a822dea0f911.jpg",
        "children": [],
        "fileType": "file",
        "_id": "690120c1d449ad832fb96f1d",
        "createdAt": "2025-10-28T20:39:20.552Z",
        "updatedAt": "2025-10-28T20:39:20.552Z",
        "id": "690120c1d449ad832fb96f1d"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-28T20:39:20.552Z",
    "createdAt": "2025-10-28T20:30:22.592Z",
    "id": "yGIu9kXPq"
  },
  {
    "_id": "JhSXNlmdO",
    "name": "ICM worksheet 008 p3",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690129fad449ad832fb96f1f",
          "690129fad449ad832fb96f1e",
          "690129fad449ad832fb96f20"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "690129fad449ad832fb96f21",
        "createdAt": "2025-10-28T20:53:03.020Z",
        "updatedAt": "2025-10-28T20:53:03.020Z",
        "id": "690129fad449ad832fb96f21"
      },
      {
        "name": "sketch.js",
        "content": "let capture;\nlet pixelSize = 20\n\nfunction setup() {\n  noStroke();\n  capture = createCapture(VIDEO, onLoad);\n  capture.hide();\n}\n\nfunction onLoad() {\n  createCanvas(capture.width, capture.height);\n}\n\nfunction draw() {\n\n  capture.loadPixels();\n  for (let x = 0; x < width; x += pixelSize) {\n    for (let y = 0; y < height; y += pixelSize) {\n      let i = (x + y * width) * 4;\n      let c = [capture.pixels[i], \n               capture.pixels[i + 1], \n               capture.pixels[i + 2]];\n\n      let b = brightness(c)\n\n      if (b < 50) {\n        fill(0);\n      } else {\n        fill(255);\n      }\n      rect(x, y, pixelSize, pixelSize);\n    }\n  }\n  \n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690129fad449ad832fb96f1e",
        "createdAt": "2025-10-28T20:53:03.020Z",
        "updatedAt": "2025-10-28T20:53:03.020Z",
        "id": "690129fad449ad832fb96f1e"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690129fad449ad832fb96f1f",
        "createdAt": "2025-10-28T20:53:03.020Z",
        "updatedAt": "2025-10-28T20:53:03.020Z",
        "id": "690129fad449ad832fb96f1f"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690129fad449ad832fb96f20",
        "createdAt": "2025-10-28T20:53:03.020Z",
        "updatedAt": "2025-10-28T20:53:03.020Z",
        "id": "690129fad449ad832fb96f20"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-28T20:53:03.020Z",
    "createdAt": "2025-10-28T20:53:03.020Z",
    "id": "JhSXNlmdO"
  },
  {
    "_id": "zOLdxgWHq",
    "name": "ICM worksheet 008 p4",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69013119d449ad832fb96f23",
          "69013119d449ad832fb96f22",
          "69013119d449ad832fb96f24"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "69013119d449ad832fb96f25",
        "createdAt": "2025-10-29T13:45:38.214Z",
        "updatedAt": "2025-10-29T13:45:38.214Z",
        "id": "69013119d449ad832fb96f25"
      },
      {
        "name": "sketch.js",
        "content": "let hueCount = 18;\nlet w;\n\nfunction setup() {\n  createCanvas(600, 400);\n  colorMode(HSB);\n  noStroke();\n  w = width / hueCount;\n}\n\nfunction draw() {\n  for (let x = 0; x < hueCount; x++) {\n    let h = (360 / hueCount) * x;\n\n    fill(h, 80, 100);\n    rect(x * w, 0, w, height);\n  }\n\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "69013119d449ad832fb96f22",
        "createdAt": "2025-10-29T13:45:38.214Z",
        "updatedAt": "2025-10-29T13:45:38.214Z",
        "id": "69013119d449ad832fb96f22"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69013119d449ad832fb96f23",
        "createdAt": "2025-10-29T13:45:38.214Z",
        "updatedAt": "2025-10-29T13:45:38.214Z",
        "id": "69013119d449ad832fb96f23"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "69013119d449ad832fb96f24",
        "createdAt": "2025-10-29T13:45:38.214Z",
        "updatedAt": "2025-10-29T13:45:38.214Z",
        "id": "69013119d449ad832fb96f24"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-29T13:45:38.214Z",
    "createdAt": "2025-10-28T21:14:05.216Z",
    "id": "zOLdxgWHq"
  },
  {
    "_id": "dpUAtjDYr",
    "name": "ims01-gabriel",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69c6148818c0069f393b5254",
          "69c6148818c0069f393b5253",
          "69c6148818c0069f393b5255"
        ],
        "fileType": "folder",
        "_id": "69c6148818c0069f393b5256",
        "createdAt": "2026-03-27T14:10:49.654Z",
        "updatedAt": "2026-03-27T14:10:49.654Z",
        "id": "69c6148818c0069f393b5256"
      },
      {
        "name": "sketch.js",
        "content": "// https://openprocessing.org/sketch/1980771\n\n// By Roni Kaufman\n// https://ronikaufman.github.io\n\n\n// I don't even know where to begin here!\n// it's not using WEB_GL mode so it's not 3D but it certainly appears to be\n// it also doesn't work on the p5 editor but it does in openprocessing\n\n\nconst M = 4, N = 24;\nlet path = [], p;\nlet a, b, l0 = 80;\nlet brush;\n\nfunction setup() {\n  createCanvas(500, 500);\n\timageMode(CENTER);\n  \n  p = [2*~~random(M/2), 2*~~random(N/2)]; // starting point\n\t\n\ta = tan(PI/N)/sqrt(1+sq(tan(PI/N)));\n  b = (1+a)/(1-a);\n\t\n\tfunction easeInOutSine(x) {\n\t\treturn -(Math.cos(Math.PI * x) - 1) / 2;\n\t}\n\t\n\tlet palette = [\"#abcd5e\", \"#14976b\", \"#2b67af\", \"#62b6de\", \"#f589a3\", \"#ef562f\", \"#fc8405\", \"#f9d531\"];\n\t//palette = [\"#b3dce0\", \"#62b6de\", \"#2b67af\", \"#62b6de\"]\n\t//palette = [\"#ef562f\", \"#fc8405\", \"#f9d531\", \"#fc8405\"]\n  \n  // this makes a gradient circle out of arcs -\n\tbrush = createGraphics(width, height);\n\tbrush.noStroke();\n\tfor (let i = 0; i < palette.length; i++) {\n\t\tlet theta1 = i*TAU/palette.length;\n   \n\t\tlet theta2 = (i+1)*TAU/palette.length;\n         console.log(theta2)\n\t\tlet col1 = palette[i];\n\t\tlet col2 = palette[(i+1)%palette.length];\n\t\tlet thetaStep = (theta2-theta1)/50;\n\n\t\tfor (let theta = theta1; theta < theta2; theta += thetaStep) {\n\t\t\tlet t = map(theta, theta1, theta2, 0, 1);\n\t\t\tlet col = lerpColor(color(col1), color(col2), easeInOutSine(t));\n\t\t\tbrush.fill(col);\n\t\t\tbrush.arc(brush.width/2, brush.height/2, brush.width, brush.height, theta, theta+thetaStep);\n\t\t}\n  }\n  \n  \t\n}\n\nfunction draw() {\n  background(0);\n\n  //translate(-width/2, -height/2);\n\tdrawPath([...path, p], width/2, height/2, M, N, 0.9);\n\t\n\tif (path.length < M*N-1) {\n\t\tlet eventualNeighbors = shuffle(possibleNeighbors(p, M, N));\n\n\t\tlet neighbors = [[], []];\n\t\tfor (let neigh of eventualNeighbors) {\n\t\t\tlet projectedPath = [...path, p, neigh];\n\t\t\tlet count = countDeadends(projectedPath, possibleNeighbors(neigh, M, N), M, N);\n\t\t\tif (!inArray(neigh, path) && !disjointed(projectedPath, M, N) && count < 2 && !cursedCorners(projectedPath, M, N)) {\n\t\t\t\tneighbors[count].push(neigh);\n\t\t\t}\n\t\t}\n\t\tneighbors = neighbors.flat(1);\n\n\t\twhile (neighbors.length == 0) {\n\t\t\t// backtracking\n\t\t\tlet previous = path.pop();\n\t\t\tp = [previous[0], previous[1]];\n\t\t\tneighbors = previous[2];\n\t\t}\n\n\t\tlet pNext = neighbors.shift();\n\t\tpath.push([...p, neighbors]);\n\t\tp = pNext;\n\t}\n}\n\n// computing\n\nfunction possibleNeighbors([i, j], m, n) {\n  let possibilities = [];\n  if (j < n-1) possibilities.push([i, j+1]);\n  if (j > 0) possibilities.push([i, j-1]);\n  if (i < m-1) possibilities.push([i+1, j]);\n  if (i > 0) possibilities.push([i-1, j]);\n  return possibilities;\n}\n\nfunction inArray([i, j], arr) {\n  for (let e of arr) {\n    if (e[0] == i && e[1] == j) return true;\n  }\n  return false;\n}\n\n// does arr disjoint the m*n grid?\nfunction disjointed(arr, m, n) {\n  if (arr.length >= m*n) {\n    return false;\n  }\n  \n  // choose initial point\n  let p;\n  do {\n    p = [~~random(m), ~~random(n)];\n  } while (inArray(p, arr))\n    \n  // traverse the m*n grid where arr was removed, through a DFS\n  let discovered = [];\n  let stack = [p];\n  while (stack.length > 0) {\n    p = stack.pop();\n    if (!inArray(p, discovered)) {\n      discovered.push(p);\n      let neighbors = possibleNeighbors(p, m, n);\n      for (let neigh of neighbors) {\n        if (!inArray(neigh, arr)) stack.push(neigh);\n      }\n    }\n  }\n  \n  return discovered.length != m*n-arr.length;\n}\n\nfunction countDeadends(arr, ignoreMe, m, n) {\n  let count = 0;\n  for (let i = 0; i < m; i++) {\n    for (let j = 0; j < n; j++) {\n      if (!inArray([i, j], arr) && !inArray([i, j], ignoreMe)) {\n        let eventualNeighbors = possibleNeighbors([i, j], m, n);\n        let neighbors = [];\n        for (let neigh of eventualNeighbors) {\n          if (!inArray(neigh, arr)) neighbors.push(neigh);\n        }\n        if (neighbors.length < 2) {\n          count++;\n        }\n      }\n    }\n  }\n  return count;\n}\n\nfunction cursedCorners(arr, M, N) {\n  let corner1 = !inArray([0, 0], arr) && !inArray([1, 0], arr) && !inArray([0, 1], arr) && !inArray([1, 1], arr) && !inArray([2, 0], arr) && !inArray([0, 2], arr) && inArray([2, 1], arr) && inArray([1, 2], arr) && inArray([2, 2], arr);\n  let corner2 = !inArray([M-1, 0], arr) && !inArray([M-2, 0], arr) && !inArray([M-1, 1], arr) && !inArray([M-2, 1], arr) && !inArray([M-3, 0], arr) && !inArray([M-1, 2], arr) && inArray([M-3, 1], arr) && inArray([M-2, 2], arr) && inArray([M-3, 2], arr);\n  let corner3 = !inArray([M-1, N-1], arr) && !inArray([M-2, N-1], arr) && !inArray([M-1, N-2], arr) && !inArray([M-2, N-2], arr) && !inArray([M-3, N-1], arr) && !inArray([M-1, N-3], arr) && inArray([M-3, N-2], arr) && inArray([M-2, N-3], arr) && inArray([M-3, N-3], arr);\n  let corner4 = !inArray([0, N-1], arr) && !inArray([1, N-1], arr) && !inArray([0, N-2], arr) && !inArray([1, N-2], arr) && !inArray([2, N-1], arr) && !inArray([0, N-3], arr) && inArray([2, N-2], arr) && inArray([1, N-3], arr) && inArray([2, N-3], arr);\n  \n  return corner1 || corner2 || corner3 || corner4;\n}\n\n// drawing\n\nfunction drawPath(path, x0, y0, m, n, ratio) {\n\tfill(255, 0, 0);\n\t\n  push();\n  translate(x0, y0);\n  \n\tfor (let k = 0; k < path.length-1; k++) { \n  \tlet p1 = path[k], p2 = path[k+1];\n\t\t\n\t\tlet c1 = getCircle(p1[0], p1[1], ratio), c2 = getCircle(p2[0], p2[1], ratio);\n\t\tif (p1[1] == p2[1]) {\n\t\t\tmyLine(c1, c2);\n\t\t} else {\n\t\t\tlet theta1 = atan2(c1.y, c1.x);\n\t\t\tlet theta2 = (p1[1] < p2[1]) ? theta1+2*PI/N : theta1-2*PI/N;\n\t\t\tmyArc(c1, c2, theta1, theta2);\n\t\t}\n\t}\n  \n  pop();\n}\n\nfunction getCircle(i, j, ratio) {\n\tlet l = l0*pow(b, i);\n\tlet x = l*cos((2*j+1)*PI/N);\n\tlet y = l*sin((2*j+1)*PI/N);\n\tlet d = 2*l*a*ratio;\n\treturn {x: x, y: y, d: d};\n}\n\nfunction myLine(c1, c2) {\n\tfor (let t = 0; t <= 1; t += 0.01) {\n\t\tlet x = c1.x*(1-t)+c2.x*t;\n\t\tlet y = c1.y*(1-t)+c2.y*t;\n\t\tlet d = c1.d*(1-t)+c2.d*t;\n\t\tuseBrush(x, y, d);\n\t}\n}\n\nfunction myArc(c1, c2, theta1, theta2) {\n\tlet r = dist(0, 0, c1.x, c1.y);\n\tfor (let t = 0; t <= 1; t += 0.01) {\n\t\tlet theta = theta1*(1-t)+theta2*t;\n\t\tlet x = r*cos(theta), y = r*sin(theta);\n\t\tuseBrush(x, y, c1.d);\n\t}\n}\n\nfunction useBrush(x, y, d) {\n\tpush();\n\ttranslate(x, y);\n\trotate(frameCount/20);\n\timage(brush, 0, 0, d, d);\n\tpop();\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "69c6148818c0069f393b5253",
        "createdAt": "2026-03-27T14:10:49.654Z",
        "updatedAt": "2026-03-27T14:10:49.654Z",
        "id": "69c6148818c0069f393b5253"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "69c6148818c0069f393b5254",
        "createdAt": "2026-03-27T14:10:49.654Z",
        "updatedAt": "2026-03-27T14:10:49.654Z",
        "id": "69c6148818c0069f393b5254"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "69c6148818c0069f393b5255",
        "createdAt": "2026-03-27T14:10:49.654Z",
        "updatedAt": "2026-03-27T14:10:49.654Z",
        "id": "69c6148818c0069f393b5255"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2026-03-27T14:10:49.654Z",
    "createdAt": "2026-03-27T05:25:27.678Z",
    "id": "dpUAtjDYr"
  },
  {
    "_id": "O5AR9TiEY",
    "name": "ims01-gabriel",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69c69fe78908c733978dc2c3",
          "69c69fe78908c733978dc2c2",
          "69c69fe78908c733978dc2c4"
        ],
        "fileType": "folder",
        "_id": "69c69fe78908c733978dc2c5",
        "createdAt": "2026-03-27T15:19:28.550Z",
        "updatedAt": "2026-03-27T15:19:28.550Z",
        "id": "69c69fe78908c733978dc2c5"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(400, 400);\n}\n\nfunction draw() {\n  background(0,220,10);\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "69c69fe78908c733978dc2c2",
        "createdAt": "2026-03-27T15:19:28.550Z",
        "updatedAt": "2026-03-27T15:19:28.550Z",
        "id": "69c69fe78908c733978dc2c2"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "69c69fe78908c733978dc2c3",
        "createdAt": "2026-03-27T15:19:28.550Z",
        "updatedAt": "2026-03-27T15:19:28.550Z",
        "id": "69c69fe78908c733978dc2c3"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "69c69fe78908c733978dc2c4",
        "createdAt": "2026-03-27T15:19:28.550Z",
        "updatedAt": "2026-03-27T15:19:28.550Z",
        "id": "69c69fe78908c733978dc2c4"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2026-03-27T15:19:28.550Z",
    "createdAt": "2026-03-27T15:19:25.534Z",
    "id": "O5AR9TiEY"
  },
  {
    "_id": "GwcM5PWTc",
    "name": "ims02-gabriel",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "69cf6bbdb433c94ad7c70c45",
          "69cf6bbdb433c94ad7c70c44",
          "69cf6bbdb433c94ad7c70c46"
        ],
        "fileType": "folder",
        "_id": "69cf6bbdb433c94ad7c70c47",
        "createdAt": "2026-04-03T07:57:41.176Z",
        "updatedAt": "2026-04-03T07:57:41.176Z",
        "id": "69cf6bbdb433c94ad7c70c47"
      },
      {
        "name": "sketch.js",
        "content": "let t = 0;\nlet g;\nlet g2;\nlet patternWidth = 200;\nlet c1, c2;\nlet h1 = 0;\nlet h2 = 120;\nlet bg = 240;\nlet rows = 8;\nlet cols = 8;\nlet h, w;\n\nlet grid = [];\n\nlet startoffx;\nlet startoffy;\nlet destoffx;\nlet destoffy;\n\nfunction setup() {\n  createCanvas(windowWidth, windowHeight, WEBGL);\n  colorMode(HSL);\n  g = createGraphics(patternWidth, patternWidth);\n  g2 = createGraphics(patternWidth, patternWidth);\n  g.colorMode(HSL);\n  h = height / rows;\n  w = width / cols;\n  c1 = color(h1, 90, 450);\n  c2 = color(h2, 90, 45);\n  startoffx = 0;\n  startoffy = 0;\n  destoffx = startoffx;\n  destoffy = startoffy;\n  noStroke();\n  makeGrid();\n}\n\nfunction draw() {\n  // background(0, 50, 10);\n  if (frameCount % 120 == 0) {\n    makeGrid();\n  }\n  tilePattern(patternWidth);\n\n  // let angle = sin(t) * 20;\n  // let angle2 = sin(t);\n\n  translate(-width / 2 + w / 2, -height / 2 + h / 2, 0);\n  for (let j = 0; j < rows; j++) {\n    for (let i = 0; i < cols; i++) {\n      let x = i * w;\n      let y = j * h;\n      let gid = grid[j][i];\n      tile(x, y, w, h, gid);\n    }\n  }\n\n  t += 0.01;\n}\n\nfunction keyPressed(e) {\n  if (e.key == 'f') {\n    fullscreen(1);\n    setTimeout(() => {\n      resizeCanvas(windowWidth, windowHeight);\n      h = height / rows;\n      w = width / cols;\n    }, 1000);\n  }\n}\n\nfunction windowResized() {\n  resizeCanvas(windowWidth, windowHeight);\n  h = height / rows;\n  w = width / cols;\n}\n\nfunction makeGrid() {\n  grid = [];\n  for (let j = 0; j < rows; j++) {\n    let row = [];\n    for (let i = 0; i < cols; i++) {\n      let v;\n      if (random() > 0.4) {\n        v = 1;\n      } else {\n        v = 0;\n      }\n      row.push(v);\n    }\n    grid.push(row);\n  }\n}\n\nlet percent = 0;\nfunction tile(x, y, w, h, gid) {\n  let eased = easeInSine(percent);\n  let currxoff = lerp(startoffx, destoffx, eased);\n  let curryoff = lerp(startoffy, destoffy, eased);\n\n  if (percent >= 1) {\n    startoffx = destoffx;\n    startoffy = destoffy;\n    destoffx = random(-2, 2);\n    destoffy = random(-4, 4);\n\n    percent = 0;\n  }\n\n  push();\n  // translate(width / 2, height / 2);\n  translate(x + currxoff, y + curryoff);\n\n  if (gid) {\n    texture(g2);\n  } else {\n    texture(g);\n  }\n\n  plane(w, h);\n  pop();\n  percent += 0.006;\n}\n\nfunction tilePattern(w) {\n  // c1 = color(h1, 20, 50);\n  // c2 = color(h2, 60, 50);\n\n  g.push();\n\n  let increment = TWO_PI / w;\n  let step = 0;\n  for (let x = 0; x <= w; x++) {\n    // let lerped = lerpColor(c2, c1, x / w);\n\n    let sinHue = map(sin(step), -1, 1, h1, h2);\n\n    g.stroke(sinHue, 40, 50);\n    // g.stroke(lerped);\n    strokeWeight(1);\n    g.line(x, 0, x, w);\n    step += increment;\n  }\n\n  g2.image(g, 0, 0);\n  g2.filter(INVERT, 10);\n\n  h1 = (h1 + increment * 10) % 360;\n  h2 = (h2 + increment * 10) % 360;\n}\n\n// from easings.net\n\nfunction easeInSine(x) {\n  return 1 - Math.cos((x * Math.PI) / 2);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "69cf6bbdb433c94ad7c70c44",
        "createdAt": "2026-04-03T07:57:41.176Z",
        "updatedAt": "2026-04-03T07:57:41.176Z",
        "id": "69cf6bbdb433c94ad7c70c44"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.12/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.12/lib/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "69cf6bbdb433c94ad7c70c45",
        "createdAt": "2026-04-03T07:57:41.176Z",
        "updatedAt": "2026-04-03T07:57:41.176Z",
        "id": "69cf6bbdb433c94ad7c70c45"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "69cf6bbdb433c94ad7c70c46",
        "createdAt": "2026-04-03T07:57:41.176Z",
        "updatedAt": "2026-04-03T07:57:41.176Z",
        "id": "69cf6bbdb433c94ad7c70c46"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2026-04-03T07:57:41.176Z",
    "createdAt": "2026-04-03T07:27:29.868Z",
    "id": "GwcM5PWTc"
  },
  {
    "visibility": "Public",
    "_id": "NCxrUptvN",
    "name": "Ionized croissant",
    "updatedAt": "2023-09-14T07:48:04.118Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "650297f4fde9ab1f88da8577",
          "650297f4fde9ab1f88da8576",
          "650297f4fde9ab1f88da8578"
        ],
        "fileType": "folder",
        "_id": "650297f4fde9ab1f88da8579",
        "isSelectedFile": false,
        "createdAt": "2023-09-14T07:48:04.118Z",
        "updatedAt": "2023-09-14T07:48:04.118Z",
        "id": "650297f4fde9ab1f88da8579"
      },
      {
        "name": "sketch.js",
        "content": "let dot;\nlet dots = [];\nlet hues = [220, 320, 125];\nlet switches = [1, -1];\nlet r, amount;\nfunction setup() {\n  createCanvas(800, 600);\n  colorMode(HSL);\n  noStroke();\n\n  let r = 100;\n\n  let amount = (width * r) / r;\n\n  amount = 10;\n\n  let d = 20;\n\n  let x = width / 2;\n  let y = height / 2;\n\n  let xd = d;\n  let yd = d / 2;\n\n  let h = hues[round(random(2))];\n  h = hues[2];\n\n  // dot = new Dot(x, y, r, h, xd, yd, 10);\n\n  for (let i = 0; i < amount; i++) {\n    dots.push(new Dot(random(width), random(height), r, h, xd, yd, 10));\n    \n    xd *= -1;\n    yd *= -1\n  }\n}\n\nfunction draw() {\n  background(250, 0, 20);\n\n  dots.forEach(dot => dot.render())\n\n  if (frameCount % 6 === 0) {\n   dots.forEach(dot => dot.update())\n\n  }\n}\n\nclass Dot {\n  constructor(x, y, r, h, xd, yd, e) {\n    this.initX = x;\n    this.initY = y;\n    this.x = x;\n    this.y = y;\n    this.r = r;\n    this.h = h;\n    this.xd = xd;\n    this.yd = yd;\n    this.e = e;\n    this.ed = this.e * 20;\n    this.eSpace = 1;\n    this.l = 50;\n    this.prevX = [];\n    this.prevY = [];\n  }\n\n  updatePoints() {\n    this.prevX.unshift(this.x);\n    if (this.prevX.length > this.ed) {\n      this.prevX.pop();\n    }\n    this.prevY.unshift(this.y);\n    if (this.prevY.length > this.ed) {\n      this.prevY.pop();\n    }\n  }\n\n  update() {\n    if (this.x > width || this.x < 0) {\n      this.xd *= -1;\n    }\n    if (this.y > height || this.y < 0) {\n      this.yd *= -1;\n    }\n\n    this.x += this.xd;\n    this.y += this.yd;\n\n    this.updatePoints();\n  }\n\n  render() {\n    fill(this.h, 100, this.l);\n    circle(this.x, this.y, this.r);\n    for (let i = 0; i < this.e; i++) {\n      const curr = i * this.eSpace;\n      const curry = i * this.eSpace + i;\n      const x = this.prevX[curr];\n      const y = this.prevY[curr];\n      r = this.r - (i * this.r) / 10;\n      if (x != undefined && y != undefined) {\n        fill(this.h + i, 100, 50, 1 - i/10);\n        circle(x, y, r);\n      }\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "650297f4fde9ab1f88da8576",
        "isSelectedFile": true,
        "createdAt": "2023-09-14T07:48:04.118Z",
        "updatedAt": "2023-09-14T07:48:04.118Z",
        "id": "650297f4fde9ab1f88da8576"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "650297f4fde9ab1f88da8577",
        "isSelectedFile": false,
        "createdAt": "2023-09-14T07:48:04.118Z",
        "updatedAt": "2023-09-14T07:48:04.118Z",
        "id": "650297f4fde9ab1f88da8577"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "650297f4fde9ab1f88da8578",
        "isSelectedFile": false,
        "createdAt": "2023-09-14T07:48:04.118Z",
        "updatedAt": "2023-09-14T07:48:04.118Z",
        "id": "650297f4fde9ab1f88da8578"
      }
    ],
    "createdAt": "2023-09-14T06:59:58.501Z",
    "id": "NCxrUptvN"
  },
  {
    "visibility": "Public",
    "_id": "wvVxSoPu3",
    "name": "map generation",
    "updatedAt": "2023-06-21T20:26:06.682Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "649340e1c97c706d5a4a9043",
          "649340e1c97c706d5a4a9042",
          "649340e1c97c706d5a4a9044"
        ],
        "fileType": "folder",
        "_id": "649340e1c97c706d5a4a9045",
        "isSelectedFile": false,
        "createdAt": "2023-06-21T20:26:06.682Z",
        "updatedAt": "2023-06-21T20:26:06.682Z",
        "id": "649340e1c97c706d5a4a9045"
      },
      {
        "name": "sketch.js",
        "content": "let map =[]\n\nlet idea =  [\n  [2,0,1,0,2],\n  [0,1,2,1,0],\n  [1,2,0,2,1],\n  [0,1,2,1,0],\n  [2,0,1,0,2],\n]\n\nlet colors = []\nlet colorIds=[]\nlet rows, columns\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n\n  colors.push(color(30, 100, 60))\n  colors.push(color(50, 100, 50))\n  colors.push(color(250, 100, 85))\n  \n  colorIds=[0,1,2]\n  \n   stroke(0,0,60)\n  noStroke()\n  \n  rows = 20;\n  columns = 20;\n  generateMap()\n}\n\nfunction draw() {\n  background(200,100,50)\n  if (frameCount % 60 == 0) {\n    generateMap()\n  }\n  \n  drawMap()\n}\n\nfunction generateMap() {\n  map = []\n     for (let i = 0; i < rows; i++) {\n    let row = []\n    for (let j = 0; j < columns; j++) {\n        row.push(floor(random(0,3)))\n    }\n    map.push(row)\n  }\n}\n\nfunction drawMap() {\n  for (let i = 0; i < map.length; i++) {\n    let row = map[i]\n    for (let j = 0; j < row.length; j++) {\n      let item = row[j]\n      fill(colors[item])\n        let h = height / map.length \n        let w = width / map[0].length\n      ellipse(j * w + w/2, i * h + h/2, w, h)\n    }\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "649340e1c97c706d5a4a9042",
        "isSelectedFile": true,
        "createdAt": "2023-06-21T20:26:06.682Z",
        "updatedAt": "2023-06-21T20:26:06.682Z",
        "id": "649340e1c97c706d5a4a9042"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "649340e1c97c706d5a4a9043",
        "isSelectedFile": false,
        "createdAt": "2023-06-21T20:26:06.682Z",
        "updatedAt": "2023-06-21T20:26:06.682Z",
        "id": "649340e1c97c706d5a4a9043"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "649340e1c97c706d5a4a9044",
        "isSelectedFile": false,
        "createdAt": "2023-06-21T20:26:06.682Z",
        "updatedAt": "2023-06-21T20:26:06.682Z",
        "id": "649340e1c97c706d5a4a9044"
      }
    ],
    "createdAt": "2023-06-21T19:49:20.210Z",
    "id": "wvVxSoPu3"
  },
  {
    "visibility": "Public",
    "_id": "3dRs43DZr",
    "name": "marching squares",
    "updatedAt": "2024-04-15T19:45:30.731Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65d8d97e4de365280086d214",
          "65d8d97e4de365280086d213",
          "65d8d97e4de365280086d215"
        ],
        "fileType": "folder",
        "_id": "65d8d97e4de365280086d216",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T19:45:30.731Z",
        "updatedAt": "2024-04-15T19:45:30.731Z",
        "id": "65d8d97e4de365280086d216"
      },
      {
        "name": "sketch.js",
        "content": "let res = 4;\nlet rows, cols;\nlet field = [];\nlet inc = 0.04;\nlet zOff = 0;\nlet cam;\n\nfunction setup() {\n  createCanvas(620,420);\n  colorMode(HSL);\n  cols = 1 + width / res;\n  rows = 1 + height / res;\n\n  for (let i = 0; i < cols; i += 1) {\n    let r = [];\n    for (let j = 0; j < rows; j += 1) {\n      r.push(0);\n    }\n    field.push(r);\n  }\n \n}\n\nfunction draw() {\n  background(0,0,0);\n  updatePoints();\n  drawPoints();\n  drawContour();\n  zOff += 0.01;\n  // noLoop()\n}\n\n\nfunction mousePressed () {\n  fullscreen(true)\n}\n\nfunction updatePoints() {\n  let yoff = 0;\n  for (let i = 0; i < cols; i += 1) {\n    yoff += inc;\n    let xoff = 0;\n    for (let j = 0; j < rows; j += 1) {\n      field[i][j] = noise(xoff, yoff, zOff);\n      xoff += inc;\n    }\n  }\n}\n\nfunction drawLine(v1, v2) {\n  line(v1.x, v1.y, v2.x, v2.y);\n}\n\nfunction getState(a, b, c, d) {\n  return a * 8 + b * 4 + c * 2 + d * 1;\n}\n\nfunction drawPoints() {\n  for (let i = 0; i < cols; i += 1) {\n    for (let j = 0; j < rows; j += 1) {\n      const h = map(field[i][j], 0, 0.8, 50, 100);\n      fill(200, 100, h);\n      noStroke();\n      rect(i * res, j * res, res, res);\n    }\n  }\n}\n\nfunction drawContour() {\n  for (let i = 0; i < cols - 1; i += 1) {\n    for (let j = 0; j < rows - 1; j += 1) {\n      const x = i * res;\n      const y = j * res;\n      const a = createVector(x + res * 0.5, y);\n      const b = createVector(x + res, y + res * 0.5);\n      const c = createVector(x + res * 0.5, y + res);\n      const d = createVector(x, y + res * 0.5);\n\n      const state = getState(\n        floor(field[i][j] * 2),\n        floor(field[i + 1][j] * 2),\n        floor(field[i + 1][j + 1] * 2),\n        floor(field[i][j + 1] * 2)\n      );\n\n      stroke(50, 100, 50);\n      strokeWeight(1);\n      switch (state) {\n        case 1:\n          drawLine(c, d);\n          break;\n        case 2:\n          drawLine(b, c);\n          break;\n        case 3:\n          drawLine(b, d);\n          break;\n        case 4:\n          drawLine(a, b);\n          break;\n        case 5:\n          drawLine(a, d);\n          drawLine(b, c);\n          break;\n        case 6:\n          drawLine(a, c);\n          break;\n        case 7:\n          drawLine(a, d);\n          break;\n        case 8:\n          drawLine(a, d);\n          break;\n        case 9:\n          drawLine(a, c);\n          break;\n        case 10:\n          drawLine(a, b);\n          drawLine(c, d);\n          break;\n        case 11:\n          drawLine(a, b);\n          break;\n        case 12:\n          drawLine(b, d);\n          break;\n        case 13:\n          drawLine(b, c);\n          break;\n        case 14:\n          drawLine(c, d);\n          break;\n        case 15:\n          break;\n      }\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d8d97e4de365280086d213",
        "isSelectedFile": true,
        "createdAt": "2024-04-15T19:45:30.731Z",
        "updatedAt": "2024-04-15T19:45:30.731Z",
        "id": "65d8d97e4de365280086d213"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65d8d97e4de365280086d214",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T19:45:30.731Z",
        "updatedAt": "2024-04-15T19:45:30.731Z",
        "id": "65d8d97e4de365280086d214"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d8d97e4de365280086d215",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T19:45:30.731Z",
        "updatedAt": "2024-04-15T19:45:30.731Z",
        "id": "65d8d97e4de365280086d215"
      }
    ],
    "createdAt": "2024-02-23T18:00:05.955Z",
    "id": "3dRs43DZr"
  },
  {
    "visibility": "Public",
    "_id": "m4VqQ1tPoz",
    "name": "mariposa",
    "updatedAt": "2023-06-15T00:27:59.311Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "648a195575aae61c37bf3b34",
          "648a195575aae61c37bf3b33",
          "648a195575aae61c37bf3b35"
        ],
        "fileType": "folder",
        "_id": "648a195575aae61c37bf3b36",
        "isSelectedFile": false,
        "createdAt": "2023-06-15T00:27:59.311Z",
        "updatedAt": "2023-06-15T00:27:59.311Z",
        "id": "648a195575aae61c37bf3b36"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n  background(300, 80, 80)\n  translate(width/2, height/2)\n  stroke(0,0,30)\n  strokeWeight(2)\n  fill(90, 100, 50)\n  \n  drawWings()\n  drawBody()\n  \n}\n\nfunction drawWings() {\n     beginShape()\n  // left wing bottom\n  vertex(-6, 0)\n  quadraticVertex(-150,-26, -100, 76)\n  quadraticVertex(-50, 150, -6, 0)\n  endShape(CLOSE)\n  \n  beginShape()\n  // left wing top\n  vertex(-6, -20)\n  quadraticVertex(-70, -140, -140, -120)\n  quadraticVertex(-160, -100, -140, -20)\n  quadraticVertex(-120, 20, -6, 0)\n\n  endShape(CLOSE)\n\n    beginShape()\n  // right wing bottom\n  vertex(6, 0)\n  quadraticVertex(150,-26, 100, 76)\n  quadraticVertex(50, 150, 6, 0)\n  endShape(CLOSE)\n  \n  beginShape()\n  // right wing top\n  vertex(6, -20)\n  quadraticVertex(70, -140, 140, -120)\n  quadraticVertex(160, -100, 140, -20)\n  quadraticVertex(120, 20, 6, 0)\n\n  endShape(CLOSE)\n}\n\nfunction drawBody() {\n   // body\n  fill(0,0,30)\n  beginShape()\n  vertex(-2, 40)\n  quadraticVertex(-8, 10, -4, 4)\n  quadraticVertex(-15, -20, -4, -30)\n  quadraticVertex(-10, -35, -3, -40)\n  quadraticVertex(0, -42, 3, -40)\n  quadraticVertex(10, -35, 4, -30)\n  quadraticVertex(14, -20, 4, 4)\n  quadraticVertex(8, 10, 2, 40)\n  quadraticVertex(0, 50, -2, 40)\n  endShape()\n drawAntennae()\n}\n\nfunction drawAntennae() {\n   // left\n  noFill()\n  beginShape()\n  vertex(-2, -42)\n  quadraticVertex(-10, -100, -32, -100)\n  endShape()\n  //right\n  noFill()\n  beginShape()\n  vertex(2, -42)\n  quadraticVertex(10, -100, 32, -100)\n  endShape()\n}",
        "children": [],
        "fileType": "file",
        "_id": "648a195575aae61c37bf3b33",
        "isSelectedFile": true,
        "createdAt": "2023-06-15T00:27:59.311Z",
        "updatedAt": "2023-06-15T00:27:59.311Z",
        "id": "648a195575aae61c37bf3b33"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "648a195575aae61c37bf3b34",
        "isSelectedFile": false,
        "createdAt": "2023-06-15T00:27:59.311Z",
        "updatedAt": "2023-06-15T00:27:59.311Z",
        "id": "648a195575aae61c37bf3b34"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "648a195575aae61c37bf3b35",
        "isSelectedFile": false,
        "createdAt": "2023-06-15T00:27:59.311Z",
        "updatedAt": "2023-06-15T00:27:59.311Z",
        "id": "648a195575aae61c37bf3b35"
      }
    ],
    "createdAt": "2023-06-14T20:24:28.904Z",
    "id": "m4VqQ1tPoz"
  },
  {
    "visibility": "Public",
    "_id": "YtFT-W7Ng",
    "name": "mariposa %",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "648a5b3375aae61c37bf3b38",
          "648a5b3375aae61c37bf3b39",
          "648a5b3375aae61c37bf3b3a"
        ],
        "fileType": "folder",
        "_id": "648a5b3375aae61c37bf3b37",
        "isSelectedFile": false,
        "createdAt": "2023-06-18T01:03:00.357Z",
        "updatedAt": "2023-06-18T01:03:00.357Z",
        "id": "648a5b3375aae61c37bf3b37"
      },
      {
        "name": "sketch.js",
        "content": "let w, h, w2, h2\nlet butterfly\nlet frame = 0\nlet capturing = true\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n  w = width\n  h = height\n  \n  background(300, 80, 80)\n  stroke(0,0,30)\n  strokeWeight(2)\n  \n  butterfly = new Butterfly(w, h, 1)\n  \n}\n\nfunction draw() {\n   background(300, 80, 80)\n    butterfly.draw()\n  if( frameCount == 0 || frameCount % 60 == 0) {    \n    if (capturing) capture()\n    butterfly.update()\n  }\n \n\n}\n\nclass Butterfly {\n  constructor(w,h, mult){\n    this.x = w/2\n    this.y = h/2 \n    this.h = h * mult\n    this.w = w * mult\n    this.max = this.w\n    this.speed = 10\n    this.flap = true\n  }\n  \n  drawWings() {\n    fill(90, 100, 50)\n    beginShape()\n    // left bottom\n    vertex(-this.w*0.01, 0)\n    quadraticVertex(-this.w*0.4,-this.h*0.06, -this.w*0.25, this.h*0.2)\n    quadraticVertex(-this.w*0.13, this.h*0.4, -this.w*0.01, 0)\n    endShape(CLOSE)\n\n     beginShape()\n    // left top\n    vertex(-this.w*0.01, -this.h*0.05)\n    quadraticVertex(-this.w*0.18, -this.h*0.35, -this.w*0.35, -this.h*0.3)\n    quadraticVertex(-this.w*0.4, -this.h*0.25, -this.w*0.35, -this.h*0.05)\n    quadraticVertex(-this.w*0.3, this.h*0.05, -this.w*0.01, 0)\n    quadraticVertex(-this.w*0.025, -this.h*0.025, -this.w*0.01, -this.h*0.05)\n    endShape(CLOSE)\n    \n    beginShape()\n    // right bottom\n    vertex(this.w*0.01, 0)\n    quadraticVertex(this.w*0.4,-this.h*0.06, this.w*0.25, this.h*0.2)\n    quadraticVertex(this.w*0.13, this.h*0.4, this.w*0.01, 0)\n    endShape(CLOSE)\n\n     beginShape()\n    // right top\n    vertex(this.w*0.01, -this.h*0.05)\n    quadraticVertex(this.w*0.18, -this.h*0.35, this.w*0.35, -this.h*0.3)\n    quadraticVertex(this.w*0.4, -this.h*0.25, this.w*0.35, -this.h*0.05)\n    quadraticVertex(this.w*0.3, this.h*0.05, this.w*0.01, 0)\n    quadraticVertex(this.w*0.025, -this.h*0.025, this.w*0.01, -this.h*0.05)\n    endShape(CLOSE)\n\n  }\n  \n  drawBody() {\n    fill(0,0,30)\n    beginShape()\n    vertex(-this.h*0.005, this.h*0.1)\n    quadraticVertex(-this.h*0.02, this.h*0.025, -this.h*0.01, this.h*0.01)\n    quadraticVertex(-this.h*0.04, -this.h*0.05, -this.h*0.01, -this.h*0.08)\n    quadraticVertex(-this.h*0.025, -this.h*0.09, -this.h*0.01, -this.h*0.1)\n    quadraticVertex(0, -this.h*0.105, this.h*0.01, -this.h*0.1)\n    quadraticVertex(this.h*0.025, -this.h*0.09, this.h*0.01, -this.h*0.08)\n    quadraticVertex(this.h*0.038, -this.h*0.05, this.h*0.01, this.h*0.01)\n    quadraticVertex(this.h*0.02, this.h*0.025, this.h*0.005, this.h*0.1)\n    quadraticVertex(0, this.h*0.13, -this.h*0.005, this.h*0.1)\n    endShape()\n  }\n  \n  drawAntennae() {\n     // left\n    noFill()\n    beginShape()\n    vertex(-this.h * 0.005, -this.h * 0.105)\n    quadraticVertex(-this.h * 0.025, -this.h * 0.25, -this.h * 0.08, -this.h * 0.25)\n    endShape()\n    //right\n    noFill()\n    beginShape()\n    vertex(this.h * 0.005, -this.h * 0.105)\n    quadraticVertex(this.h * 0.025, -this.h * 0.25, this.h * 0.08, -this.h * 0.25)\n    endShape()\n  }\n  \n  draw() {\n    \n    translate(this.x, this.y)\n     this.drawBody()\n     this.drawAntennae()\n     this.drawWings()\n    // this.drawBody()\n  }\n  \n  update() {\n    if (this.w <= 80) {\n      this.flap = false\n    } else if (this.w >= this.max && this.flap == false) {\n      this.flap = true\n      capturing = false\n    }\n    if (this.flap) {\n       this.w -= this.speed\n    } else {\n      this.w += this.speed\n    }\n   \n  }\n  \n}\n\nfunction capture () {\n  const canvas = document.querySelector('canvas')\n  const png = canvas.toDataURL('image/png')\n  const link = document.createElement('a')\n  link.href = png\n  link.download = `butterfly_0${frame}` \n  link.click()\n  link.remove()\n  frame++\n}",
        "children": [],
        "fileType": "file",
        "_id": "648a5b3375aae61c37bf3b39",
        "isSelectedFile": true,
        "createdAt": "2023-06-18T01:03:00.357Z",
        "updatedAt": "2023-06-18T01:03:00.357Z",
        "id": "648a5b3375aae61c37bf3b39"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "648a5b3375aae61c37bf3b38",
        "isSelectedFile": false,
        "createdAt": "2023-06-18T01:03:00.357Z",
        "updatedAt": "2023-06-18T01:03:00.357Z",
        "id": "648a5b3375aae61c37bf3b38"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "648a5b3375aae61c37bf3b3a",
        "isSelectedFile": false,
        "createdAt": "2023-06-18T01:03:00.357Z",
        "updatedAt": "2023-06-18T01:03:00.357Z",
        "id": "648a5b3375aae61c37bf3b3a"
      }
    ],
    "createdAt": "2023-06-15T00:28:35.403Z",
    "updatedAt": "2023-06-18T01:03:00.357Z",
    "id": "YtFT-W7Ng"
  },
  {
    "visibility": "Public",
    "_id": "uL15Pgro3",
    "name": "metaballs",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "661d843aaf59f2f19d3ad389",
          "661d843aaf59f2f19d3ad38a",
          "661d843aaf59f2f19d3ad38b"
        ],
        "fileType": "folder",
        "_id": "661d843aaf59f2f19d3ad388",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T22:56:09.504Z",
        "updatedAt": "2024-04-15T22:56:09.504Z",
        "id": "661d843aaf59f2f19d3ad388"
      },
      {
        "name": "sketch.js",
        "content": "balls = [];\nlet low, high, size\n\nfunction setup() {\n  colorMode(HSL);\n  createCanvas(200, 150);\n  pixelDensity(1);\n  low = createSlider(0,360,100)\n  high = createSlider(0,360,240)\n  size = createSlider(10,200, 100)\n  \n  for (let i = 0; i < 10; i++) {\n    let x = random(0, width);\n    let y = random(0, height);\n    balls.push(new Ball(x, y));\n  }\n}\n\nfunction draw() {\n  for (let ball of balls) {\n    ball.update();\n  }\n\n  loadPixels();\n  for (let i = 0; i < width; i++) {\n    for (let j = 0; j < height; j++) {\n      let total = 0;\n      for (let ball of balls) {\n        const d = dist(ball.pos.x, ball.pos.y, i, j);\n        const col = (size.value() * ball.r) / d;\n        total += col;\n      }\n\n      let v = constrain(total, low.value(), high.value())\n     \n      let c = color(v, 100, 50);\n      set(i, j, c);\n    }\n  }\n  updatePixels();\n}\n\nclass Ball {\n  constructor(x, y) {\n    this.pos = createVector(x, y);\n    this.vel = p5.Vector.random2D().mult(random(8,12));\n    this.r = random(15,35);\n  }\n\n  update() {\n    this.pos.add(this.vel);\n    if (this.pos.x > width || this.pos.x < 0) {\n      this.vel.mult(-1, 0);\n    } else if (this.pos.y > height || this.pos.y < 0) {\n      this.vel.mult(0, -1);\n    }\n  }\n\n  show() {\n    circle(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661d843aaf59f2f19d3ad38a",
        "isSelectedFile": true,
        "createdAt": "2024-04-15T22:56:09.504Z",
        "updatedAt": "2024-04-15T22:56:09.504Z",
        "id": "661d843aaf59f2f19d3ad38a"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "661d843aaf59f2f19d3ad389",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T22:56:09.504Z",
        "updatedAt": "2024-04-15T22:56:09.504Z",
        "id": "661d843aaf59f2f19d3ad389"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661d843aaf59f2f19d3ad38b",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T22:56:09.504Z",
        "updatedAt": "2024-04-15T22:56:09.504Z",
        "id": "661d843aaf59f2f19d3ad38b"
      }
    ],
    "createdAt": "2024-04-15T19:47:07.075Z",
    "updatedAt": "2024-04-15T22:56:09.504Z",
    "id": "uL15Pgro3"
  },
  {
    "visibility": "Public",
    "_id": "uJ3a_GNL-",
    "name": "mirror drawing",
    "updatedAt": "2023-10-30T17:44:45.480Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "653b6286e8afc003b158d935",
          "653b6286e8afc003b158d934",
          "653b6286e8afc003b158d936"
        ],
        "fileType": "folder",
        "_id": "653b6286e8afc003b158d937",
        "isSelectedFile": false,
        "createdAt": "2023-10-30T17:44:45.480Z",
        "updatedAt": "2023-10-30T17:44:45.480Z",
        "id": "653b6286e8afc003b158d937"
      },
      {
        "name": "sketch.js",
        "content": "let prevX = null;\nlet prevY = null;\nlet currentX = null;\nlet currentY = null;\nlet brushColor;\nlet brushShape = \"circle\";\nlet button,\n  buttonOrange,\n  buttonBlue,\n  buttonPink,\n  buttonCircle,\n  buttonSquare,\n  sliderSize;\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL);\n  background(100, 100, 50);\n  brushColor = [200, 100, 50];\n  buttonClear = createButton(\"clear\");\n  buttonOrange = createButton(\"orange\");\n  buttonBlue = createButton(\"blue\");\n  buttonPink = createButton(\"pink\");\n  buttonSquare = createButton(\"square\");\n  buttonCircle = createButton(\"circle\");\n  sliderSize = createSlider(1, 100, 50);\n  buttonClear.position(0,450)\n  buttonOrange.position(50,450)\n  buttonBlue.position(112,450)\n  buttonPink.position(158,450)\n  buttonSquare.position(204, 450)\n  buttonCircle.position(266,450)\n  sliderSize.position(320, 450)\n  buttonClear.mousePressed(clearPoints);\n  buttonOrange.mousePressed(() => {\n    setColor(\"orange\");\n  });\n  buttonBlue.mousePressed(() => {\n    setColor(\"blue\");\n  });\n  buttonPink.mousePressed(() => {\n    setColor(\"pink\");\n  });\n  buttonSquare.mousePressed(() => {\n    setShape(\"square\");\n  });\n  buttonCircle.mousePressed(() => {\n    setShape(\"circle\");\n  });\n}\n\nfunction clearPoints() {\n  background(100, 100, 50);\n}\n\nfunction setColor(color) {\n  switch (color) {\n    case \"blue\":\n      brushColor = [200, 100, 50];\n      break;\n    case \"orange\":\n      brushColor = [40, 100, 50];\n      break;\n    case \"pink\":\n      brushColor = [0, 100, 80];\n  }\n}\n\nfunction setShape(shape) {\n  brushShape = shape;\n}\n\nfunction mouseMoved() {\n  currentX = mouseX - width / 2;\n  currentY = mouseY - width / 2;\n  prevX = currentX;\n  prevY = currentY;\n}\n\nfunction mouseDragged() {\n  currentX = mouseX - width / 2;\n  currentY = mouseY - width / 2;\n  push();\n  translate(width / 2, height / 2);\n  fill(brushColor);\n  drawLine();\n  pop();\n}\n\nfunction drawLine() {\n  if (prevX == null || prevY == null) {\n    prevX = currentX;\n    prevY = currentY;\n    return;\n  }\n  strokeWeight(sliderSize.value());\n  stroke(brushColor);\n  line(prevX, prevY, currentX, currentY);\n  line(-prevX, -prevY, -currentX, -currentY);\n  line(-prevX, prevY, -currentX, currentY);\n  line(prevX, -prevY, currentX, -currentY);\n  prevX = currentX;\n  prevY = currentY;\n}\n\n// function drawPoint() {\n//   noStroke();\n//   if (brushShape == \"circle\") {\n//     circle(currentX, currentY, sliderSize.value());\n//     circle(-currentX, currentY, sliderSize.value());\n//     circle(currentX, -currentY, sliderSize.value());\n//     circle(-currentX, -currentY, sliderSize.value());\n//   } else if (brushShape == \"square\") {\n//     square(currentX, currentY, sliderSize.value());\n//     square(-currentX, currentY, sliderSize.value());\n//     square(currentX, -currentY, sliderSize.value());\n//     square(-currentX, -currentY, sliderSize.value());\n//   }\n// }\n",
        "children": [],
        "fileType": "file",
        "_id": "653b6286e8afc003b158d934",
        "isSelectedFile": true,
        "createdAt": "2023-10-30T17:44:45.480Z",
        "updatedAt": "2023-10-30T17:44:45.480Z",
        "id": "653b6286e8afc003b158d934"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "653b6286e8afc003b158d935",
        "isSelectedFile": false,
        "createdAt": "2023-10-30T17:44:45.480Z",
        "updatedAt": "2023-10-30T17:44:45.480Z",
        "id": "653b6286e8afc003b158d935"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "653b6286e8afc003b158d936",
        "isSelectedFile": false,
        "createdAt": "2023-10-30T17:44:45.480Z",
        "updatedAt": "2023-10-30T17:44:45.480Z",
        "id": "653b6286e8afc003b158d936"
      }
    ],
    "createdAt": "2023-10-27T07:41:44.071Z",
    "id": "uJ3a_GNL-"
  },
  {
    "_id": "B6PanelvU",
    "name": "Misty psychology copy",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "690cca34bfb08e76a9d3c5ab",
          "690cca34bfb08e76a9d3c5ac",
          "690cca34bfb08e76a9d3c5ad"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "690cca34bfb08e76a9d3c5aa",
        "createdAt": "2025-11-04T20:47:14.180Z",
        "updatedAt": "2025-11-04T20:47:14.180Z",
        "id": "690cca34bfb08e76a9d3c5aa"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet squeeze = 1;   \nlet pixelSize = 10;  \nlet t = 0;  \n\nfunction setup() {\n  createCanvas(windowWidth, windowHeight);\n  cam = createCapture(VIDEO);\n  cam.size(width, height);\n  cam.hide();\n  noStroke();\n  rectMode(CENTER);\n}\n\nfunction draw() {\n  background(0);\n  t += 0.01; \n\n  squeeze = map(mouseX, 0, width, 0.5, 2.0, true);\n  pixelSize = int(map(mouseY, 0, height, 5, 40, true));\n\n  cam.loadPixels();\n  if (cam.pixels.length > 0) {\n    for (let y = 0; y < height; y += pixelSize) {\n      for (let x = 0; x < width; x += pixelSize) {\n        let i = (y * width + x) * 4;\n        let r = cam.pixels[i];\n        let g = cam.pixels[i + 1];\n        let b = cam.pixels[i + 2];\n        let brightness = (r + g + b) / 3;\n\n        let color1 = map(sin(t + brightness * 0.05), -1, 1, 0, 255);\n        fill(\n          (r + color1) % 255,\n          (g + 0.4 * color1) % 255,\n          (b + 1.2 * color1) % 255\n        );\n\n        push();\n        translate(width / 2, height / 2);\n        scale(squeeze, 1);\n        rect(x - width / 2, y - height / 2, pixelSize, pixelSize);\n        pop();\n      }\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "690cca34bfb08e76a9d3c5ac",
        "createdAt": "2025-11-04T20:47:14.181Z",
        "updatedAt": "2025-11-04T20:47:14.181Z",
        "id": "690cca34bfb08e76a9d3c5ac"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690cca34bfb08e76a9d3c5ab",
        "createdAt": "2025-11-04T20:47:14.181Z",
        "updatedAt": "2025-11-04T20:47:14.181Z",
        "id": "690cca34bfb08e76a9d3c5ab"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "690cca34bfb08e76a9d3c5ad",
        "createdAt": "2025-11-04T20:47:14.181Z",
        "updatedAt": "2025-11-04T20:47:14.181Z",
        "id": "690cca34bfb08e76a9d3c5ad"
      }
    ],
    "visibility": "Public",
    "createdAt": "2025-11-06T16:17:56.552Z",
    "updatedAt": "2025-11-06T16:17:56.552Z",
    "id": "B6PanelvU"
  },
  {
    "visibility": "Public",
    "_id": "yCbwIqof1",
    "name": "motion w/ vectors",
    "updatedAt": "2024-02-25T00:15:45.863Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65da5804ed156b6d94130ff6",
          "65da5820ed156b6d94130ff9",
          "65da5804ed156b6d94130ff5",
          "65da5804ed156b6d94130ff7"
        ],
        "fileType": "folder",
        "_id": "65da5804ed156b6d94130ff8",
        "isSelectedFile": false,
        "createdAt": "2024-02-25T00:15:45.863Z",
        "updatedAt": "2024-02-25T00:15:45.863Z",
        "id": "65da5804ed156b6d94130ff8"
      },
      {
        "name": "sketch.js",
        "content": "let movers = [];\nfunction setup() {\n  colorMode(HSL);\n  createCanvas(600, 400);\n  pixelDensity(1);\n  for (let i = 0; i < 10; i++) {\n    launch()\n  }\n}\n\nfunction mousePressed() {\n  launch();\n}\n\nfunction launch() {\n  const m = random(1, 10);\n  const v = random(4,12)\n  const x = random(0, width)\n  const mover = new Mover(x, 0, m, 2);\n  movers.push(mover);\n}\n\nfunction draw() {\n  background(100, 100, 50);\n  fill(200,100,50,0.5)\n  rect(0, height/2, width,height/2)\n  const gravity = createVector(0, 0.1);\n  for (let mover of movers) {\n    const weight = p5.Vector.mult(gravity, mover.mass);\n    if (mover.pos.y > height/2) {\n       mover.drag()\n    }\n    \n    mover.applyForce(weight);\n\n    // mover.friction()\n    mover.update();\n    mover.edges();\n    mover.show();\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da5804ed156b6d94130ff5",
        "isSelectedFile": false,
        "createdAt": "2024-02-25T00:15:45.863Z",
        "updatedAt": "2024-02-25T00:15:45.863Z",
        "id": "65da5804ed156b6d94130ff5"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"mover.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65da5804ed156b6d94130ff6",
        "isSelectedFile": false,
        "createdAt": "2024-02-25T00:15:45.863Z",
        "updatedAt": "2024-02-25T00:15:45.863Z",
        "id": "65da5804ed156b6d94130ff6"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da5804ed156b6d94130ff7",
        "isSelectedFile": false,
        "createdAt": "2024-02-25T00:15:45.863Z",
        "updatedAt": "2024-02-25T00:15:45.863Z",
        "id": "65da5804ed156b6d94130ff7"
      },
      {
        "name": "mover.js",
        "content": "class Mover {\n  constructor(x, y, m, i) {\n    this.pos = createVector(x, y);\n    this.vel = createVector(0,-i);\n    this.r = sqrt(m) * 10;\n    this.acc = createVector(0,0);\n    this.mass = m\n    this.reduce = -0.8\n  }\n\n  edges() {\n    if (this.pos.x >= width - this.r) {\n      this.pos.x = width - this.r;\n      this.vel.x *= this.reduce;\n    }\n    if (this.pos.x < this.r) {\n      this.pos.x = this.r;\n      this.vel.x *= this.reduce;\n    }\n    if (this.pos.y > height - this.r) {\n      this.pos.y = height - this.r;\n      this.vel.y *= this.reduce;\n    }\n    if (this.pos.y < this.r) {\n      this.pos.y = this.r;\n      this.vel.y *= this.reduce;\n    }\n  }\n  \n  drag () {\n    const drag = this.vel.copy()\n    drag.normalize().mult(-1)\n    const speedSq = this.vel.magSq()\n    const c = 0.02\n    drag.setMag(c * speedSq * this.r)\n    this.applyForce(drag)\n  }\n  \n  friction () {\n    const d = height - (this.pos.y + this.r)\n    if (d < 1) {\n      \n    const friction = this.vel.copy()\n    friction.normalize().mult(-1)\n    \n    const mu = 0.1\n    const normal = this.mass\n    \n    friction.setMag(mu * normal)\n    \n    this.applyForce(friction)\n    }\n  }\n\n  applyForce(force) {\n    const f = p5.Vector.div(force,this.mass)\n    this.acc.add(f)\n  }\n\n  update() {\n    this.vel.add(this.acc);\n    this.pos.add(this.vel);\n    this.acc.set(0,0)\n  }\n\n  show() {\n    noStroke();\n    fill(200, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da5820ed156b6d94130ff9",
        "isSelectedFile": true,
        "createdAt": "2024-02-25T00:15:45.863Z",
        "updatedAt": "2024-02-25T00:15:45.863Z",
        "id": "65da5820ed156b6d94130ff9"
      }
    ],
    "createdAt": "2024-02-24T21:36:41.821Z",
    "id": "yCbwIqof1"
  },
  {
    "visibility": "Public",
    "_id": "gq2kXVrGu",
    "name": "mouse pixels",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65da6172ed156b6d94130ffb",
          "65da6172ed156b6d94130ffc",
          "65da6172ed156b6d94130ffd"
        ],
        "fileType": "folder",
        "_id": "65da6172ed156b6d94130ffa",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T19:46:17.884Z",
        "updatedAt": "2024-04-15T19:46:17.884Z",
        "id": "65da6172ed156b6d94130ffa"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  colorMode(HSL);\n  createCanvas(600, 400);\n  pixelDensity(1);\n}\n\nfunction draw() {\n  background(175);\n\n  loadPixels();\n  for (let i = 0; i < width; i++) {\n    for (let j = 0; j < height; j++) {\n      const d = dist(mouseX, mouseY, i, j);\n      let v = map(d, 0, 565, 0, 200);\n      let c = color(v, 100, 50);\n      set(i, j, c);\n    }\n  }\n  updatePixels();\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da6172ed156b6d94130ffc",
        "isSelectedFile": true,
        "createdAt": "2024-04-15T19:46:17.884Z",
        "updatedAt": "2024-04-15T19:46:17.884Z",
        "id": "65da6172ed156b6d94130ffc"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65da6172ed156b6d94130ffb",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T19:46:17.884Z",
        "updatedAt": "2024-04-15T19:46:17.884Z",
        "id": "65da6172ed156b6d94130ffb"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65da6172ed156b6d94130ffd",
        "isSelectedFile": false,
        "createdAt": "2024-04-15T19:46:17.884Z",
        "updatedAt": "2024-04-15T19:46:17.884Z",
        "id": "65da6172ed156b6d94130ffd"
      }
    ],
    "createdAt": "2024-02-24T21:36:50.563Z",
    "updatedAt": "2024-04-15T19:46:17.884Z",
    "id": "gq2kXVrGu"
  },
  {
    "visibility": "Public",
    "_id": "oe2S7JwCL",
    "name": "mutual attraction",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dbe0c5ed156b6d94131006",
          "65dbe0c5ed156b6d94131007",
          "65dbe0c5ed156b6d94131009",
          "65dbe0c5ed156b6d9413100a"
        ],
        "fileType": "folder",
        "_id": "65dbe0c5ed156b6d94131004",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T01:39:50.658Z",
        "updatedAt": "2024-02-26T01:39:50.658Z",
        "id": "65dbe0c5ed156b6d94131004"
      },
      {
        "name": "sketch.js",
        "content": "let movers = [];\nlet sun \n\nfunction setup() {\n  colorMode(HSL);\n  createCanvas(400, 400);\n  for (let i = 0; i < 20; i++) {\n    const pos = p5.Vector.random2D()\n  \n    const vel = pos.copy()\n    vel.setMag(random(1,10))\n    vel.rotate(PI/2)\n    pos.setMag(random(100, 200))\n    const m = 20\n    mover = new Mover(pos.x,pos.y,vel.x,vel.y,m);\n    movers.push(mover);\n  }\n  sun = new Mover(0,0,0,0,300)\n\n}\n\nfunction draw() {\n  background(200, 100, 50, 0.3);\n  translate(width/2, height/2)\n  \n  for (let mover of movers) {\n    sun.attract(mover)\n    for (let other of movers) {\n      if (mover !== other) {\n        mover.attract(other)\n      }\n    }\n  }\n  for (let mover of movers) {\n    mover.update();\n    mover.show();\n  }\n  \n\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbe0c5ed156b6d94131009",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T01:39:50.658Z",
        "updatedAt": "2024-02-26T01:39:50.658Z",
        "id": "65dbe0c5ed156b6d94131009"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n    <meta charset=\"utf-8\" />\n  </head>\n  <body>\n    <main></main>\n    <script src=\"mover.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbe0c5ed156b6d94131006",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T01:39:50.658Z",
        "updatedAt": "2024-02-26T01:39:50.658Z",
        "id": "65dbe0c5ed156b6d94131006"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbe0c5ed156b6d9413100a",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T01:39:50.658Z",
        "updatedAt": "2024-02-26T01:39:50.658Z",
        "id": "65dbe0c5ed156b6d9413100a"
      },
      {
        "name": "mover.js",
        "content": "class Mover {\n  constructor(x, y, vx,vy,m) {\n    this.pos = createVector(x, y);\n    // this.vel = p5.Vector.random2D();\n    this.vel = createVector(vx, vy)\n    this.vel.mult(0.6)\n    this.r = sqrt(m) * 2;\n    this.acc = createVector(0,0);\n    this.mass = m\n    this.reduce = -0.8\n  }\n\n  edges() {\n    if (this.pos.x >= width - this.r) {\n      this.pos.x = width - this.r;\n      this.vel.x *= this.reduce;\n    }\n    if (this.pos.x < this.r) {\n      this.pos.x = this.r;\n      this.vel.x *= this.reduce;\n    }\n    if (this.pos.y > height - this.r) {\n      this.pos.y = height - this.r;\n      this.vel.y *= this.reduce;\n    }\n    if (this.pos.y < this.r) {\n      this.pos.y = this.r;\n      this.vel.y *= this.reduce;\n    }\n  }\n  \n   getStrength(mover, force) {\n    const distanceSq = constrain(force.magSq(), 100, 1000);\n    const G = 1\n    const strength = G * (this.mass * mover.mass) / distanceSq;\n    return strength\n  }\n\n  attract(mover) {\n    const force = p5.Vector.sub(this.pos, mover.pos);\n    const strength = this.getStrength(mover, force)\n    force.setMag(strength)\n    mover.applyForce(force);\n  }\n  \n  drag () {\n    const drag = this.vel.copy()\n    drag.normalize().mult(-1)\n    const speedSq = this.vel.magSq()\n    const c = 0.02\n    drag.setMag(c * speedSq * this.r)\n    this.applyForce(drag)\n  }\n  \n  friction () {\n    const d = height - (this.pos.y + this.r)\n    if (d < 1) {\n      \n    const friction = this.vel.copy()\n    friction.normalize().mult(-1)\n    \n    const mu = 0.1\n    const normal = this.mass\n    \n    friction.setMag(mu * normal)\n    \n    this.applyForce(friction)\n    }\n  }\n\n  applyForce(force) {\n    const f = p5.Vector.div(force,this.mass)\n    this.acc.add(f)\n  }\n\n  update() {\n    this.vel.add(this.acc);\n    this.pos.add(this.vel);\n    this.acc.set(0,0)\n  }\n\n  show() {\n    noStroke();\n    fill(100, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbe0c5ed156b6d94131007",
        "isSelectedFile": false,
        "createdAt": "2024-02-26T01:39:50.658Z",
        "updatedAt": "2024-02-26T01:39:50.658Z",
        "id": "65dbe0c5ed156b6d94131007"
      }
    ],
    "createdAt": "2024-02-26T00:52:21.276Z",
    "updatedAt": "2024-02-26T01:39:50.658Z",
    "id": "oe2S7JwCL"
  },
  {
    "visibility": "Public",
    "_id": "eQXELY71Y",
    "name": "octagon grow",
    "updatedAt": "2023-08-09T19:11:43.130Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "64d3cf06b15e4b3692c2dd95",
          "64d3cf06b15e4b3692c2dd94",
          "64d3cf06b15e4b3692c2dd96"
        ],
        "fileType": "folder",
        "_id": "64d3cf06b15e4b3692c2dd97",
        "isSelectedFile": false,
        "createdAt": "2023-08-09T19:11:43.130Z",
        "updatedAt": "2023-08-09T19:11:43.130Z",
        "id": "64d3cf06b15e4b3692c2dd97"
      },
      {
        "name": "sketch.js",
        "content": "let size\nlet weight \nlet amount\nlet octagons = []\nlet speed = 12\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n  pixelDensity(1)\n  size = 50\n  weight = 20\n  amount = width/size+weight\n  \n  for (let i = 0; i < amount; i++) {\n    const newSize = (i * size)\n    const gap = i * 50\n     octagons.push(new Octagon(newSize + gap))\n  }\n}\n\nfunction draw() {\n  background(100,100,70);\n octagons.forEach(octagon => {\n   octagon.apply()\n   if (frameCount % 8 == 0) {\n     octagon.update()\n   }\n })\n}\n\n\n\n\nclass Octagon {\n  constructor(s) {\n    this.og = 10\n    this.s = s\n    this.speed = speed\n  }\n  \n  apply() {\n  noFill()\n  stroke(320,100,80)\n  strokeWeight(weight)\n  push()\n  translate(width/2,height/2)\n  beginShape()\n  vertex(-this.s*0.3, -this.s*0.6)\n  vertex(this.s*0.3, -this.s*0.6)\n  vertex(this.s*0.6, -this.s*0.3)\n  vertex(this.s*0.6, this.s*0.3)\n  vertex(this.s*0.3, this.s*0.6)\n  vertex(-this.s*0.3, this.s*0.6)\n  vertex(-this.s*0.6, this.s*0.3)\n  vertex(-this.s*0.6, -this.s*0.3)\n  vertex(-this.s*0.3, -this.s*0.6)\n  endShape()\n  pop()\n}\n  \n  update() {\n    if (this.s >= width) {\n      this.s = this.og\n     \n    } else {\n      this.s += this.speed\n  \n    }\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "64d3cf06b15e4b3692c2dd94",
        "isSelectedFile": true,
        "createdAt": "2023-08-09T19:11:43.130Z",
        "updatedAt": "2023-08-09T19:11:43.130Z",
        "id": "64d3cf06b15e4b3692c2dd94"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "64d3cf06b15e4b3692c2dd95",
        "isSelectedFile": false,
        "createdAt": "2023-08-09T19:11:43.130Z",
        "updatedAt": "2023-08-09T19:11:43.130Z",
        "id": "64d3cf06b15e4b3692c2dd95"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64d3cf06b15e4b3692c2dd96",
        "isSelectedFile": false,
        "createdAt": "2023-08-09T19:11:43.130Z",
        "updatedAt": "2023-08-09T19:11:43.130Z",
        "id": "64d3cf06b15e4b3692c2dd96"
      }
    ],
    "createdAt": "2023-08-09T18:11:59.165Z",
    "id": "eQXELY71Y"
  },
  {
    "visibility": "Public",
    "_id": "EW_MO6eK7",
    "name": "OoOo",
    "updatedAt": "2023-02-27T22:02:57.782Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63f96cf8bdc15953413f971f",
          "63f96cf8bdc15953413f971e",
          "63f96cf8bdc15953413f9720"
        ],
        "fileType": "folder",
        "_id": "63f96cf8bdc15953413f9721",
        "isSelectedFile": false,
        "createdAt": "2023-02-27T22:02:57.782Z",
        "updatedAt": "2023-02-27T22:02:57.782Z",
        "id": "63f96cf8bdc15953413f9721"
      },
      {
        "name": "sketch.js",
        "content": "\nlet stroke_opacity = 0.4\nlet c_array = []\nlet c_width\nlet offset = 0\nlet amount_x = 9\nlet rotation = 403\n\nfunction setup() {\n  createCanvas(550, 550);\n \n  pixelDensity(1)\n  redoArray()\n  \n}\n\nfunction draw() {\n  background(253, 145, 255)\n  angleMode(DEGREES)\n  \n  c_array.forEach((c, i) => {\n    c.update()\n    // c.draw()\n  })\n  \n  if (frameCount % 2 === 0) {\n    // rotation -= 0.01\n    // translate(rotation, rotation)\n    // redoArray()\n  }\n}\n\nclass C {\n  constructor(x, y, d) {\n    this.x = x;\n    this.y = y\n    this.d = d\n    this.direction = 'close'\n    this.maxHeight = 0.4\n    this.greenMult = this.maxHeight\n    // // this.greenMult = 0.76\n    this.lastBlink = 0\n  }\n  \n  draw() {\n    this.drawTopCircle(this.x, this.y, this.d)\n    this.drawBottomCircle(this.x, this.y, this.d)\n \n  }\n  \n   drawBottomCircle(x, y, d) {\n   fill(0,225,0)\n  stroke(`rgba(255, 0, 255, ${stroke_opacity})`)\n     const w = d * 0.74\n     const h = d * this.greenMult\n  ellipse(x, y, w, h)\n  }\n\n  drawTopCircle(x, y, d) {\n  fill(250, 245, 142)\n   stroke(`rgba(0, 0, 255, ${stroke_opacity})`)\n  const mult = 1\n  ellipse(x, y, d * mult, d * mult )\n  \n  }\n  \n  blink() {\n    if (frameCount > this.lastBlink + 220) {\n       if (this.direction === 'open') {\n        this.greenMult += 0.02\n      } else {\n        this.greenMult -= 0.02\n      }\n      if (this.direction == 'open' && this.greenMult >= this.maxHeight) {\n       this.lastBlink = frameCount\n        this.direction = 'close'\n      } else if (this.direction === 'close' && this.greenMult < 0.04) {\n      this.direction = 'open'\n    }\n \n    }\n     \n  }\n  \n  update() {\n    this.blink()\n    this.draw()\n  }\n}\n\n\n\n\nfunction redoArray () {\n  background(0, 155, 255, 0.9)\n  c_array = []\n  \n  c_width = width / amount_x \n  \n  // offset = c_width * 0.5\n  \n  for (let i = 0; i < amount_x + 4; i++) {\n    for (let j = 0; j < amount_x + 2; j++) {\n      let posX = i * c_width - offset\n      let posY = j * c_width - offset\n    c_array.push(new C(posX, posY, c_width / 1.25))\n    }\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "63f96cf8bdc15953413f971e",
        "isSelectedFile": true,
        "createdAt": "2023-02-27T22:02:57.782Z",
        "updatedAt": "2023-02-27T22:02:57.782Z",
        "id": "63f96cf8bdc15953413f971e"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63f96cf8bdc15953413f971f",
        "isSelectedFile": false,
        "createdAt": "2023-02-27T22:02:57.782Z",
        "updatedAt": "2023-02-27T22:02:57.782Z",
        "id": "63f96cf8bdc15953413f971f"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63f96cf8bdc15953413f9720",
        "isSelectedFile": false,
        "createdAt": "2023-02-27T22:02:57.782Z",
        "updatedAt": "2023-02-27T22:02:57.782Z",
        "id": "63f96cf8bdc15953413f9720"
      }
    ],
    "createdAt": "2023-02-25T03:05:56.520Z",
    "id": "EW_MO6eK7"
  },
  {
    "visibility": "Public",
    "_id": "oZFdcwRgn",
    "name": "particle system",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dd8f259731b8001aaafc39",
          "65dd6ffab6911f81f5254343",
          "65dd6ffab6911f81f5254344",
          "65dd6ffab6911f81f5254345",
          "65dd6ffab6911f81f5254347"
        ],
        "fileType": "folder",
        "_id": "65dd6ffab6911f81f5254342",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T07:38:53.568Z",
        "updatedAt": "2024-02-27T07:38:53.568Z",
        "id": "65dd6ffab6911f81f5254342"
      },
      {
        "name": "sketch.js",
        "content": "let emitters = []\n\nfunction setup() {\n  createCanvas(600, 600);\n  colorMode(HSL);\n}\n\nfunction draw() {\n   background(240, 60, 40);\n  for (let emitter of emitters){\n  emitter.emit()\n  }\n}\n\nfunction mousePressed() {\n  emitters.push(new Emitter(mouseX,mouseY))\n}",
        "children": [],
        "fileType": "file",
        "_id": "65dd6ffab6911f81f5254345",
        "isSelectedFile": true,
        "createdAt": "2024-02-27T07:38:53.568Z",
        "updatedAt": "2024-02-27T07:38:53.568Z",
        "id": "65dd6ffab6911f81f5254345"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"particle.js\"></script>\n    <script src=\"emitter.js\"></script>\n    <script src=\"spring.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd6ffab6911f81f5254343",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T07:38:53.568Z",
        "updatedAt": "2024-02-27T07:38:53.568Z",
        "id": "65dd6ffab6911f81f5254343"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd6ffab6911f81f5254347",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T07:38:53.568Z",
        "updatedAt": "2024-02-27T07:38:53.568Z",
        "id": "65dd6ffab6911f81f5254347"
      },
      {
        "name": "particle.js",
        "content": "class Particle {\n  constructor(x, y) {\n    this.pos = createVector(x, y);\n    this.vel = p5.Vector.random2D();\n    this.vel.mult(random(3))\n    this.acc = createVector(0, 0);\n    this.size = 4;\n    this.color = color(100, 100, 50);\n    this.lifetime = 1;\n    this.mass = 1;\n    this.shape = ellipse(this.pos.x, this.pos.y, this.size * 2);\n    \n    // this.transparency\n  }\n  \n  isDead() {\n    return (this.lifetime < 0)\n  }\n\n  edges() {\n    if (this.pos.y + this.size > height) {\n      this.pos.y = height - this.size;\n      this.vel.y *= -1;\n    }\n  }\n\n  applyForce(force) {\n    const f = force.copy();\n    f.div(this.mass);\n    this.acc.add(f);\n  }\n\n  update() {\n    this.vel.mult(0.99);\n    this.vel.add(this.acc);\n    this.pos.add(this.vel);\n    this.acc.mult(0);\n    this.lifetime -= 0.01;\n  }\n\n  show() {\n    noStroke();\n    fill(160, 80, 50, this.lifetime);\n    // ellipse(this.pos.x, this.pos.y, this.size * 2);\n    rect(this.pos.x, this.pos.y, this.size, this.size * 2)\n   \n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd6ffab6911f81f5254344",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T07:38:53.568Z",
        "updatedAt": "2024-02-27T07:38:53.568Z",
        "id": "65dd6ffab6911f81f5254344"
      },
      {
        "name": "emitter.js",
        "content": "class Emitter {\n  constructor(x, y) {\n    this.pos = createVector(x, y);\n    this.particles = [];\n    this.gravity = createVector(0, 0.1);\n  }\n\n  emit() {\n    for (let i = 0; i < 4; i++) {\n      let particle = new Particle(this.pos.x, this.pos.y);\n      this.particles.push(particle);\n    }\n\n    for (let particle of this.particles) {\n      particle.applyForce(this.gravity);\n      particle.update();\n      particle.show();\n    }\n    this.particles = this.particles.filter((particle) => !particle.isDead());\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd8f259731b8001aaafc39",
        "isSelectedFile": false,
        "updatedAt": "2024-02-27T07:38:53.568Z",
        "createdAt": "2024-02-27T07:38:53.568Z",
        "id": "65dd8f259731b8001aaafc39"
      }
    ],
    "createdAt": "2024-02-27T05:15:38.814Z",
    "updatedAt": "2024-02-27T07:38:53.568Z",
    "id": "oZFdcwRgn"
  },
  {
    "visibility": "Public",
    "_id": "lFj2aKuAw",
    "name": "piercing",
    "updatedAt": "2024-02-22T05:47:41.849Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65d6ace21c99017a11a59ce7",
          "65d6ace21c99017a11a59ce6",
          "65d6ace21c99017a11a59ce8"
        ],
        "fileType": "folder",
        "_id": "65d6ace21c99017a11a59ce9",
        "isSelectedFile": false,
        "createdAt": "2024-02-22T05:47:41.849Z",
        "updatedAt": "2024-02-22T05:47:41.849Z",
        "id": "65d6ace21c99017a11a59ce9"
      },
      {
        "name": "sketch.js",
        "content": "let angle = 0\n\nfunction setup() {\n  createCanvas(400, 300, WEBGL);\n}\n\n\nfunction draw() {\n  ambientLight(0,200, 250);\n  let v = createVector(-200,-150,-1)\n  v.div(100)\n  directionalLight(200,0,0,v)\n\n  background(0,0,100);\n\n  noStroke();\n  rotateY(angle);\n  rotateZ(4.5);\n  specularMaterial(255);\n  translate(30,0)\n  torus(80, 10);\n \n  translate(-100,0)\n  sphere(50,20)\n  \n\n  angle += 0.03;\n}",
        "children": [],
        "fileType": "file",
        "_id": "65d6ace21c99017a11a59ce6",
        "isSelectedFile": true,
        "createdAt": "2024-02-22T05:47:41.849Z",
        "updatedAt": "2024-02-22T05:47:41.849Z",
        "id": "65d6ace21c99017a11a59ce6"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65d6ace21c99017a11a59ce7",
        "isSelectedFile": false,
        "createdAt": "2024-02-22T05:47:41.849Z",
        "updatedAt": "2024-02-22T05:47:41.849Z",
        "id": "65d6ace21c99017a11a59ce7"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d6ace21c99017a11a59ce8",
        "isSelectedFile": false,
        "createdAt": "2024-02-22T05:47:41.849Z",
        "updatedAt": "2024-02-22T05:47:41.849Z",
        "id": "65d6ace21c99017a11a59ce8"
      }
    ],
    "createdAt": "2024-02-22T05:47:28.277Z",
    "id": "lFj2aKuAw"
  },
  {
    "_id": "fOFvsKb5E",
    "name": "pixel camera icm 10-23",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68fa79223e445099e9c77a88",
          "68fa79223e445099e9c77a87",
          "68fa79223e445099e9c77a89"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "68fa79223e445099e9c77a8a",
        "createdAt": "2025-10-23T18:56:40.172Z",
        "updatedAt": "2025-10-23T18:56:40.172Z",
        "id": "68fa79223e445099e9c77a8a"
      },
      {
        "name": "sketch.js",
        "content": "let cam\nlet t = 0;\nlet pixelSize = 1;\n\n\nfunction setup() {\n  cam = createCapture(VIDEO,resizeCanv)\n  cam.hide()\n  noStroke()\n}\n\nfunction resizeCanv(){\n   createCanvas(cam.width, cam.height);\n}\n\nfunction draw() {\n  cam.loadPixels();\n  pixelSize = floor(map(sin(t),-1,1,10,40));\n  for (let x = 0; x < cam.width; x += pixelSize) {\n    for (let y = 0; y < cam.height; y += pixelSize) {\n      let i = (y * width + x) * 4;\n      let r = cam.pixels[i + 0]; // r\n      let g = cam.pixels[i + 1]; // g\n      let b = cam.pixels[i + 2]--; // b\n\n      fill(r, g, b);\n      rect(x, y, pixelSize, pixelSize);\n    }\n  }\n  t += 0.05;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68fa79223e445099e9c77a87",
        "createdAt": "2025-10-23T18:56:40.172Z",
        "updatedAt": "2025-10-23T18:56:40.172Z",
        "id": "68fa79223e445099e9c77a87"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "68fa79223e445099e9c77a88",
        "createdAt": "2025-10-23T18:56:40.172Z",
        "updatedAt": "2025-10-23T18:56:40.172Z",
        "id": "68fa79223e445099e9c77a88"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "68fa79223e445099e9c77a89",
        "createdAt": "2025-10-23T18:56:40.172Z",
        "updatedAt": "2025-10-23T18:56:40.172Z",
        "id": "68fa79223e445099e9c77a89"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-23T18:56:40.172Z",
    "createdAt": "2025-10-23T18:56:40.172Z",
    "id": "fOFvsKb5E"
  },
  {
    "visibility": "Public",
    "_id": "GSj2p2JBy",
    "name": "png",
    "updatedAt": "2023-10-21T19:00:32.584Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "64e7a5189b88ccf5c88d3c95",
          "65297944334c8a001a44a3db",
          "64e7a85c9b88ccf5c88d3c96",
          "6534192e7883ab001cf052d3",
          "64e7a34e9b88ccf5c88d3c91",
          "64e7a34e9b88ccf5c88d3c90",
          "64e7a34e9b88ccf5c88d3c92"
        ],
        "fileType": "folder",
        "_id": "64e7a34e9b88ccf5c88d3c93",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T19:00:32.584Z",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "id": "64e7a34e9b88ccf5c88d3c93"
      },
      {
        "name": "sketch.js",
        "content": "let butterfly, face, flower\nlet w = 80\nlet xs = []\nlet widths \nlet i = 0\nlet index\nfunction setup() {\n  createCanvas(400, 400);\n  // face = loadImage(\"face-test.png\");\n   flower = loadImage(\"flower.png\");\n  colorMode(HSL)\n  noStroke()\n  for (let i = 0; i < 24; i++) {\n    xs.push(i)\n  }\n  widths = xs.map(x => 10 * sin(x))\n}\n\nfunction draw() {\n  background(200,100,50)\n  index = i % 20\n \n  push()\n  translate(width/2, height/2)\n  fill(100,100,50)\n  square(-100,-100,200)\n   pop()\n  let currDiff = widths[index]\n  w = 80 + currDiff\n  image(flower, 0, 320, w, w)\n  image(flower, 100, 320, w, w)\n  image(flower, 220, 320, w, w)\n  image(flower, 320, 320, w, w)\n  if (frameCount % 12 === 0) {\n    i++\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "64e7a34e9b88ccf5c88d3c90",
        "isSelectedFile": true,
        "createdAt": "2023-10-21T19:00:32.584Z",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "id": "64e7a34e9b88ccf5c88d3c90"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "64e7a34e9b88ccf5c88d3c91",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T19:00:32.584Z",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "id": "64e7a34e9b88ccf5c88d3c91"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64e7a34e9b88ccf5c88d3c92",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T19:00:32.584Z",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "id": "64e7a34e9b88ccf5c88d3c92"
      },
      {
        "name": "butterfly-transparent.png",
        "content": "",
        "children": [],
        "fileType": "file",
        "_id": "64e7a5189b88ccf5c88d3c95",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/f058c853-d64f-4235-ba2c-6ec3deb5e096.png",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T19:00:32.584Z",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "id": "64e7a5189b88ccf5c88d3c95"
      },
      {
        "name": "face-test.png",
        "content": "",
        "children": [],
        "fileType": "file",
        "_id": "64e7a85c9b88ccf5c88d3c96",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/402ebb6c-da76-4b3d-9f97-8115c1527f84.png",
        "isSelectedFile": false,
        "createdAt": "2023-10-21T19:00:32.584Z",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "id": "64e7a85c9b88ccf5c88d3c96"
      },
      {
        "name": "cat.gif",
        "content": "",
        "children": [],
        "fileType": "file",
        "_id": "65297944334c8a001a44a3db",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/5f784a44-4df1-4af8-97da-82c0ec072e30.gif",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "createdAt": "2023-10-21T19:00:32.584Z",
        "isSelectedFile": false,
        "id": "65297944334c8a001a44a3db"
      },
      {
        "name": "flower.png",
        "content": "",
        "children": [],
        "fileType": "file",
        "_id": "6534192e7883ab001cf052d3",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/a33d097c-bd1c-4427-8776-bbb87ae04597.png",
        "updatedAt": "2023-10-21T19:00:32.584Z",
        "createdAt": "2023-10-21T19:00:32.584Z",
        "isSelectedFile": false,
        "id": "6534192e7883ab001cf052d3"
      }
    ],
    "createdAt": "2023-08-24T19:41:53.084Z",
    "id": "GSj2p2JBy"
  },
  {
    "visibility": "Public",
    "_id": "zBYeE2ntQ",
    "name": "pnoise tiles",
    "updatedAt": "2024-04-17T09:34:19.730Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "661f69a699e8d439b118adc1",
          "661f69a699e8d439b118adc0",
          "661f69a699e8d439b118adc2"
        ],
        "fileType": "folder",
        "_id": "661f69a699e8d439b118adc3",
        "isSelectedFile": false,
        "updatedAt": "2024-04-17T09:34:19.730Z",
        "createdAt": "2024-04-17T09:34:19.730Z",
        "id": "661f69a699e8d439b118adc3"
      },
      {
        "name": "sketch.js",
        "content": "let tileSize = 20;\nlet off = 0;\nlet xoff = 0;\nlet yoff = 0;\nlet scl = 0.07;\nlet buffer = 10;\n\nlet xTO, yTO, xRO, yRO;\nlet w, h;\n\nlet speed = 5;\n\nlet tiles = [];\n\nfunction setup() {\n  noStroke();\n\n  strokeWeight(4);\n  createCanvas(600, 400);\n  w = width / tileSize + buffer;\n  h = height / tileSize + buffer;\n}\n\nfunction keyPressed() {\n  if (key == \"ArrowUp\") yoff -= speed;\n  if (key == \"ArrowDown\") yoff += speed;\n  if (key == \"ArrowLeft\") xoff -= speed;\n  if (key == \"ArrowRight\") xoff += speed;\n}\n\nfunction move() {\n  if (keyIsDown(LEFT_ARROW)) xoff -= speed;\n  if (keyIsDown(RIGHT_ARROW)) xoff += speed;\n  if (keyIsDown(UP_ARROW)) yoff -= speed;\n  if (keyIsDown(DOWN_ARROW)) yoff += speed;\n}\n\nfunction draw() {\n  background(0, 120, 255);\n  move();\n  drawTiles();\n}\n\nfunction drawTiles() {\n  // xRO = xoff % tileSize;\n  // yRO = yoff % tileSize;\n  xTO = floor(xoff / tileSize);\n  yTO = floor(yoff / tileSize);\n  // xTO = xoff\n  // yTO = yoff\n\n  for (let i = 0; i < w; i++) {\n    for (let j = 0; j < h; j++) {\n      let c = getColors(i, j);\n      tiles[i + j * w] = c;\n    }\n  }\n\n  for (let i = 0; i < w; i++) {\n    for (let j = 0; j < h; j++) {\n      fill(tiles[i + j * w]);\n      rect(\n        (i - buffer / 2) * tileSize, // - xRO,\n        (j - buffer / 2) * tileSize, // - yRO,\n        tileSize,\n        tileSize\n      );\n    }\n  }\n}\n\nfunction getColors(x, y) {\n  let v = noise((x + xTO) * scl, (y + yTO) * scl);\n  // return color(255, 255, 255, v*255);\n  if (v < 0.4) {\n    return color(255, 255, 255);\n  } else {\n    return color(255, 255, 255, 0);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661f69a699e8d439b118adc0",
        "isSelectedFile": true,
        "updatedAt": "2024-04-17T09:34:19.730Z",
        "createdAt": "2024-04-17T09:34:19.730Z",
        "id": "661f69a699e8d439b118adc0"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "661f69a699e8d439b118adc1",
        "isSelectedFile": false,
        "updatedAt": "2024-04-17T09:34:19.730Z",
        "createdAt": "2024-04-17T09:34:19.730Z",
        "id": "661f69a699e8d439b118adc1"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661f69a699e8d439b118adc2",
        "isSelectedFile": false,
        "updatedAt": "2024-04-17T09:34:19.730Z",
        "createdAt": "2024-04-17T09:34:19.730Z",
        "id": "661f69a699e8d439b118adc2"
      }
    ],
    "createdAt": "2024-04-17T09:34:12.165Z",
    "id": "zBYeE2ntQ"
  },
  {
    "visibility": "Public",
    "_id": "dD_6pc3pI",
    "name": "pseudo 3d screensaver",
    "updatedAt": "2025-01-07T23:31:57.435Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63d453b219cb43001a713f69",
          "63d4698919cb43001a71d171",
          "63d433b96ee5af8608ce064d",
          "63d4578b19cb43001a715e7d",
          "63d433b96ee5af8608ce064c",
          "63d433b96ee5af8608ce064e"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "63d433b96ee5af8608ce064f",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d433b96ee5af8608ce064f"
      },
      {
        "name": "sketch.js",
        "content": "let stringy = 'freeak/user/forge'\n\n\nlet rate = 1\nlet coordRate = 5\nlet min = 5\nlet max = 214\nlet coordsMin = 100\nlet coordsMax = 200\n\nlet reverse = false\nlet reverseCoords = false\n\nlet r = 5\nlet g = max\nlet b = min\nlet a = 1\n\nlet colors = [r,g,b,a]\n\nlet coords = 100\nlet xs = [ 0, 0,coords, coords]\nlet ys = [coords,0, 0, coords]\n\nlet i = 2\nlet j = 2\n\n\n\nfunction setup() {\n  createCanvas(400, 400);\n}\n\nfunction oscillateColors() {\n    if (colors[i] > max ) {\n      reverse = true\n  } else if (colors[i] <= min) {\n    reverse = false\n  }\n  \n    if (reverse){\n      colors[i] -= rate\n    } else {\n      colors[i] += rate\n    }\n}\n\nfunction oscillateCoords() {\n    if (ys[0] >= coordsMax ) {\n      reverseCoords = true\n  } else if (ys[0] <= coordsMin) {\n    reverseCoords = false\n  }\n  \n    if (reverseCoords){\n      ys[0] -= coordRate\n    } else {\n      ys[0] += coordRate\n    }\n}\n\n\nfunction draw() {\n  background(255)\n  oscillateColors()\n  // oscillateCoords()\n  \n  const color = `rgba(${colors[0]}, ${colors[1]}, ${colors[2]}, ${colors[3]})`\n  const colorInvert = `rgba(${colors[2]}, ${colors[0]}, ${colors[1]}, ${colors[3]})`\n\n  const colorOpts = [color, colorInvert]\n  \n  noStroke()\n  \n  xs.forEach((x, i) => {\n    fill(colorOpts[i % 2])\n    console.log(x, ys[i])\n    square(x, ys[i], 200)\n  })\n\n  \n  fill(226, 237,5)\n  square(100, 100, 100)\n \n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "63d433b96ee5af8608ce064c",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d433b96ee5af8608ce064c"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"randomize.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "63d433b96ee5af8608ce064d",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d433b96ee5af8608ce064d"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "63d433b96ee5af8608ce064e",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d433b96ee5af8608ce064e"
      },
      {
        "name": "ball.js",
        "content": "let stringy = 'freeak/user/forge'\n\n\nlet rate = 1\nlet coordRate = 5\nlet min = 5\nlet max = 214\nlet coordsMin = 100\nlet coordsMax = 200\n\nlet reverse = false\nlet reverseCoords = false\n\nlet r = 5\nlet g = max\nlet b = min\nlet a = 0.2\n\n\n\nlet x = 0\nlet y = 100\n\nlet i = 2\nlet j = 2\n\n\n\nfunction setup() {\n  createCanvas(400, 400);\n}\n\nfunction oscillateColors() {\n    if (colors[i] > max ) {\n      reverse = true\n  } else if (colors[i] <= min) {\n    reverse = false\n  }\n  \n    if (reverse){\n      colors[i] -= rate\n    } else {\n      colors[i] += rate\n    }\n}\n\nfunction oscillateCoords() {\n    if (y > 450) {\n      reverseCoords = true\n  } else if (y <= -50) {\n    reverseCoords = false\n  }\n  \n    if (reverseCoords){\n      console.log('backword', y)\n      y -= coordRate\n    } else {\n      console.log('forward', y)\n      y += coordRate\n    }\n}\n\n\nfunction draw() {\n  background(255)\n  oscillateColors()\n  oscillateCoords()\n  \n  \n \n  \n  noStroke()\n  \n \n  for (let i = 0; i <= 3; i++) {\n    let delay\n    const color = `rgba(${colors[0]}, ${colors[1]}, ${colors[2]}, ${colors[3] + 0.05 * i})`\n    fill(color)\n    if (reverseCoords) {\n      delay = y - i * 25\n    } else {\n      delay = y + i * 25\n    }\n    console.log('delay:', y)\n    ellipse(100, delay, 50)\n  }\n  \n \n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "63d453b219cb43001a713f69",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d453b219cb43001a713f69"
      },
      {
        "name": "randomize.js",
        "content": "let spheres = []\nlet amount = 30\nlet radius = 90\nlet timeout = 8\nconst orangeHue = 21;\nconst pinkHue = 311\nconst greenHue = 115\nconst blueHue = 208\nconst bgHSL = [206, 56, 100, 50]\n\n\nfunction setup() {\n  createCanvas(600, 600);\n  colorMode(HSB, 360, 100, 100, 100);\n  \n  generateSphere(5, greenHue, 220)\n  generateSphere(30, pinkHue, 40)\n  generateSphere(20, blueHue, radius)\n  \n background(bgHSL[0], bgHSL[1], bgHSL[2], bgHSL[3])\n}\n\nfunction draw() {\n  \n  if (frameCount % 240 === 0) {\n    background(bgHSL[0], bgHSL[1], bgHSL[2], bgHSL[3])\n  }\n  \n  \n  for (let i = 0; i < spheres.length; i++) {\n    spheres[i].update()\n  }\n \n \n}\n\n\n\n\n\n// +++++++++++++++++++++++++++++++\n// +++++++++++++++++++++++++++++++\n// +++++++++++++++++++++++++++++++\n\n\n\nfunction radicalGradient(sX, sY, sR, eX, eY, eR, colorS, colorE) {\n  let gradient = drawingContext.createRadialGradient(\n    sX, sY, sR, eX, eY, eR\n  )\n  gradient.addColorStop(0, colorS)\n  gradient.addColorStop(1, colorE)\n  \n  drawingContext.fillStyle = gradient\n}\n\nclass Sphere {\n  constructor(x, y, xV, yV, c, r=radius) {\n    this.x = x;\n    this.y = y;\n    this.xVelocity = xV;\n    this.yVelocity = yV;\n    this.decay = timeout\n    this.radius = r\n    this.color = c\n    this.upperBound = 600 + ( this.radius * 2)\n    this.lowerBound = 0 - (this.radius * 2)\n  }\n  \n  draw() {\n    stroke(10)\n    strokeWeight(2)\n \n  radicalGradient(\n    this.x + 20, this.y - 20, 0,\n    this.x + 20, this.y - 20, 50,\n    color(54, 78, 92),\n     color(this.color, 78, 92)\n  );\n    noStroke()\n    ellipse(this.x, this.y, this.radius)\n  }\n  \n  reset () {\n    this.x = Math.random() * 600\n    this.y = Math.random() * 600\n    this.decay = timeout\n  }\n  \n  update() {\n   if (this.x > this.upperBound || this.x < this.lowerBound) {\n     this.xVelocity *= -1\n   } else if (this.y > this.upperBound || this.y < this.lowerBound) {\n     this.yVelocity *= -1\n   }\n    \n    this.x += this.xVelocity\n    this.y += this.yVelocity\n    \n    this.draw()\n  }\n  \n}\n\nfunction generateSphere(a, color, radius) {\n  for (let i = 0; i < a; i ++) {\n    let x = Math.random() * 600\n    let y = Math.random() * 600\n    let xV = Math.random() * (5 - 10) + (5)\n    let yV = Math.random() * (5 - 10) + (5)\n    \n    spheres.push(new Sphere(x, y, xV, yV, color, radius))\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "63d4578b19cb43001a715e7d",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d4578b19cb43001a715e7d"
      },
      {
        "name": "gradient.js",
        "content": "\n\nfunction setup(){\n  createCanvas(400, 400);\n  angleMode(DEGREES);\n  colorMode(HSB, 360, 100, 100, 100);\n  noStroke();\n}\n\nfunction draw(){\n  background(230, 30, 23);\n\n  radialGradient(\n    width/2, height/2, 0,//Start pX, pY, start circle radius\n    width/2, height/2, 150,//End pX, pY, End circle radius\n    color(190, 100, 100, 100), //Start color\n    color(310, 100, 100, 100) //End color\n  );\n  ellipse(width/2, height/2, 200, 200);\n  // shadow();\n}\n\nfunction radialGradient(sX, sY, sR, eX, eY, eR, colorS, colorE){\n  let gradient = drawingContext.createRadialGradient(\n    sX, sY, sR, eX, eY, eR\n  );\n  gradient.addColorStop(0, colorS);\n  gradient.addColorStop(1, colorE);\n\n  drawingContext.fillStyle = gradient;\n}\n\nfunction shadow(){\n  drawingContext.shadowOffsetX = 10;\n  drawingContext.shadowOffsetY = 10;\n  drawingContext.shadowBlur = 16;\n  drawingContext.shadowColor = color(230, 30, 18, 100);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "63d4698919cb43001a71d171",
        "createdAt": "2025-01-07T23:31:57.435Z",
        "updatedAt": "2025-01-07T23:31:57.435Z",
        "id": "63d4698919cb43001a71d171"
      }
    ],
    "createdAt": "2023-01-27T20:28:53.278Z",
    "id": "dD_6pc3pI"
  },
  {
    "visibility": "Public",
    "_id": "Gxx_19jAh",
    "name": "rect sine",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "648f93c6033f4aa0aededb9f",
          "648f93c6033f4aa0aededba0",
          "648f93c6033f4aa0aededba1"
        ],
        "fileType": "folder",
        "_id": "648f93c6033f4aa0aededb9e",
        "isSelectedFile": false,
        "createdAt": "2023-06-19T00:21:45.672Z",
        "updatedAt": "2023-06-19T00:21:45.672Z",
        "id": "648f93c6033f4aa0aededb9e"
      },
      {
        "name": "sketch.js",
        "content": "let xs = []\nlet points\nlet eSize = 8\nlet sp33d = 1\nlet dx = 10\nlet amplitude = 100\nlet w \nlet period = 46\nlet xSpacing = eSize * 1.2\nlet graphCoords = []\nlet graphSize = 2.5\nlet graphGap = graphSize * 2\n\nlet reverseTime = 5\nlet reverse = false\n\nfunction setup() {\n  createCanvas(620, 400);\n  colorMode(HSL)\n  rectMode(CENTER)\n  pixelDensity(1)\n  w = width + eSize * 3\n  makeXs()\n  // background(290, 100, 80)\n  makeGraph()\n  makePoints()\n  drawPoints()\n  // noStroke()\n}\n\nfunction draw() {\n  background(290, 100, 80)\n  \n  if (reverse) {\n    dx -= sp33d\n  } else {\n    dx += sp33d\n  }\n  \n  // drawGraph()\n  makePoints()\n  drawPoints()\n  \n}\n\nfunction mouseDragged () {\n  period = mouseX\n  amplitude = height - mouseY\n}\n\nfunction makeXs() {\n   for (let i = -eSize*10; i < w ; i+=xSpacing) {\n    xs.push(i)\n  }\n}\n\nfunction makePoints() {\n points = xs.map(x => {\n   let y = height / 2 + amplitude * sin((x + dx) / period)\n\n   return [x, y]\n })\n \n}\n\nfunction drawPoints() {\n  let val = 50\n  let val2 = 50\n  points.forEach((point, i) => {\n    fill(50,100, val+i/2)\n    stroke(30, 100, val2)\n    rect(point[0], point[1], eSize * 2, eSize*18)\n  })\n}\n\nfunction makeGraph() {\n    for (let i = 0; i <= height; i+= graphGap) {\n    let x = width * 0.5;\n    let y = i\n    graphCoords.push([x, y])\n    x = width * 0.25;\n    graphCoords.push([x, y])\n    x = width * 0.75;\n    graphCoords.push([x, y])\n\n  }\n  \n  for (let i = 0; i <= width; i+= graphGap) {\n    let y = height * 0.5;\n    let x = i\n    graphCoords.push([x, y])\n    y = height * 0.25;\n    graphCoords.push([x, y])\n    y = height * 0.75;\n    graphCoords.push([x, y])\n    \n  }\n  \n}\n\nfunction drawGraph() {\n  let hue = 50\n  noStroke()\n  graphCoords.forEach((coord, i) => {\n     fill(hue, 100, 50)\n    square(coord[0], coord[1], graphSize)\n  })\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "648f93c6033f4aa0aededba0",
        "isSelectedFile": true,
        "createdAt": "2023-06-19T00:21:45.672Z",
        "updatedAt": "2023-06-19T00:21:45.672Z",
        "id": "648f93c6033f4aa0aededba0"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "648f93c6033f4aa0aededb9f",
        "isSelectedFile": false,
        "createdAt": "2023-06-19T00:21:45.672Z",
        "updatedAt": "2023-06-19T00:21:45.672Z",
        "id": "648f93c6033f4aa0aededb9f"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "648f93c6033f4aa0aededba1",
        "isSelectedFile": false,
        "createdAt": "2023-06-19T00:21:45.672Z",
        "updatedAt": "2023-06-19T00:21:45.672Z",
        "id": "648f93c6033f4aa0aededba1"
      }
    ],
    "createdAt": "2023-06-18T23:31:18.482Z",
    "updatedAt": "2023-06-19T00:21:45.672Z",
    "id": "Gxx_19jAh"
  },
  {
    "visibility": "Public",
    "_id": "mQNtNzqLe",
    "name": "ripples",
    "updatedAt": "2024-02-26T06:08:51.634Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dbebe7ed156b6d9413100c",
          "65dbebe7ed156b6d9413100b",
          "65dbebe7ed156b6d9413100d"
        ],
        "fileType": "folder",
        "_id": "65dbebe7ed156b6d9413100e",
        "createdAt": "2024-02-26T06:08:51.634Z",
        "updatedAt": "2024-02-26T06:08:51.634Z",
        "isSelectedFile": false,
        "id": "65dbebe7ed156b6d9413100e"
      },
      {
        "name": "sketch.js",
        "content": "let emitters = [];\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL);\n\n  for (let i = 0; i < 1; i++) {\n    emitters.push(new Emitter(i * 200 + 100, i * 100 + 100, 30));\n  }\n}\n\nfunction draw() {\n  background(200, 100, 50);\n\n  for (let emitter of emitters) {\n    // emitter.show();\n    emitter.emit();\n  }\n}\n\nclass Emitter {\n  constructor(x, y, rv) {\n    this.x = x;\n    this.y = y;\n    this.rv = rv;\n    this.ripples = [];\n  }\n\n  addRipple() {\n    this.ripples.push(new Ripple(this.rv, this.x, this.y));\n  }\n\n  emit() {\n    if (frameCount % 60 == 0) {\n      this.addRipple();\n    }\n    for (let r of this.ripples) {\n      if (r.lifetime <= 0) {\n        this.ripples.shift();\n      }\n\n      r.update();\n      r.show();\n    }\n  }\n\n  show() {\n    noStroke();\n    fill(100, 100, 50);\n    ellipse(this.x, this.y, 20);\n  }\n}\n\nclass Ripple {\n  constructor(v, x, y) {\n    this.numVertex = v;\n    this.spacing = TWO_PI / v;\n    this.inc = 1;\n    this.x = x;\n    this.y = y;\n    this.lifetime = 20;\n    this.decay = 0.1;\n    this.vertices = [];\n  }\n\n  update() {\n    for (let v of this.vertices) {\n      v.update();\n    }\n    this.lifetime -= this.decay;\n  }\n\n  makeVertices() {\n    for (let i = 0; i < this.numVertex; i++) {\n      let r = 10\n      let angle = i * this.spacing;\n      let y = sin(angle) * r;\n      let x = cos(angle) * r;\n      let vertex = createVector(x, y);\n      this.vertices.push(new RVertex(vertex));\n    }\n  }\n\n  show() {\n    if (this.vertices.length == 0) {\n      this.makeVertices();\n    }\n    push();\n    translate(this.x, this.y);\n    noFill();\n    strokeWeight(3);\n    stroke(200, 100, 50 + this.lifetime);\n    beginShape();\n    for (let v of this.vertices) {\n      vertex(v.x, v.y);\n    }\n\n    endShape(CLOSE);\n    pop();\n  }\n}\n\nclass RVertex {\n  constructor(v) {\n    this.x = v.x;\n    this.y = v.y;\n    this.vel = v;\n    this.acc = v.copy().setMag(1);\n  }\n\n  update() {\n    this.vel.add(this.acc);\n    this.x = this.vel.x;\n    this.y = this.vel.y;\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbebe7ed156b6d9413100b",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T06:08:51.634Z",
        "updatedAt": "2024-02-26T06:08:51.634Z",
        "id": "65dbebe7ed156b6d9413100b"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbebe7ed156b6d9413100c",
        "createdAt": "2024-02-26T06:08:51.634Z",
        "updatedAt": "2024-02-26T06:08:51.634Z",
        "isSelectedFile": false,
        "id": "65dbebe7ed156b6d9413100c"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dbebe7ed156b6d9413100d",
        "createdAt": "2024-02-26T06:08:51.634Z",
        "updatedAt": "2024-02-26T06:08:51.634Z",
        "isSelectedFile": false,
        "id": "65dbebe7ed156b6d9413100d"
      }
    ],
    "createdAt": "2024-02-26T01:45:20.468Z",
    "id": "mQNtNzqLe"
  },
  {
    "visibility": "Public",
    "_id": "nFrxrELgQ",
    "name": "roses",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "66a085eac511d57a356df4d0",
          "66a085eac511d57a356df4cf",
          "66a085eac511d57a356df4d1"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "66a085eac511d57a356df4d2",
        "createdAt": "2024-07-24T22:04:58.743Z",
        "updatedAt": "2024-07-24T22:04:58.743Z",
        "id": "66a085eac511d57a356df4d2"
      },
      {
        "name": "sketch.js",
        "content": "let n, d;\nlet nSlider, dSlider;\nlet off = 0;\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL);\n  angleMode(DEGREES);\n  nSlider = createSlider(1, 10, 2);\n  dSlider = createSlider(1, 20, 1);\n}\n\nfunction draw() {\n  n = nSlider.value();\n  d = dSlider.value();\n  background(0, 0, 14);\n  stroke(244);\n  strokeWeight(2);\n  noFill();\n  // fill(244)\n  translate(width / 2, height / 2);\n  beginShape();\n\n  for (let i = 0; i < 361 * d; i++) {\n    const ampli = 170;\n\n    let k = n / d;\n\n    r = ampli * sin(k * i);\n\n    const x = r * cos(i);\n    const y = r * sin(i);\n    const di = dist(x, y, 0, 0);\n\n    const h = (map(di, 0, ampli, 0, 360) + off) % 360;\n    strokeWeight(3);\n    stroke(h, 100, 80);\n    point(x, y);\n\n    stroke(0, 0, 100, 0.5);\n    vertex(x, y);\n \n  }\n  off = (off + 2) % 360;\n\n  endShape();\n  strokeWeight(1);\n  text(`n: ${n}`, -190, -180);\n  text(`d: ${d}`, -190, -160);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "66a085eac511d57a356df4cf",
        "createdAt": "2024-07-24T22:04:58.743Z",
        "updatedAt": "2024-07-24T22:04:58.743Z",
        "id": "66a085eac511d57a356df4cf"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "66a085eac511d57a356df4d0",
        "createdAt": "2024-07-24T22:04:58.743Z",
        "updatedAt": "2024-07-24T22:04:58.743Z",
        "id": "66a085eac511d57a356df4d0"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "66a085eac511d57a356df4d1",
        "createdAt": "2024-07-24T22:04:58.743Z",
        "updatedAt": "2024-07-24T22:04:58.743Z",
        "id": "66a085eac511d57a356df4d1"
      }
    ],
    "updatedAt": "2024-07-24T22:04:58.743Z",
    "createdAt": "2024-07-24T09:22:10.290Z",
    "id": "nFrxrELgQ"
  },
  {
    "visibility": "Public",
    "_id": "RcYL937bB",
    "name": "satellite",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6789518b3120f4229f2a30d0",
          "6789518b3120f4229f2a30cf",
          "6789518b3120f4229f2a30d1"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6789518b3120f4229f2a30d2",
        "createdAt": "2025-01-16T18:59:26.484Z",
        "updatedAt": "2025-01-16T18:59:26.484Z",
        "id": "6789518b3120f4229f2a30d2"
      },
      {
        "name": "sketch.js",
        "content": "let planet\nlet singer\nlet t = 0\n\nfunction setup() {\n  createCanvas(400, 400);\n  planet = new Planet(width/2,height/2,100)\n  singer = new Singer(width/4,height/2,20)\n  singer.orbit(planet)\n}\n\nfunction draw() {\n  background(220);\n  planet.render()\n  singer.update()\n  singer.render()\n}\n\n\nclass Singer {\n  constructor(x, y, w, sound) {\n    this.x = x;\n    this.y = y;\n    this.w = w;\n    // this.sound = sound;\n    // this.sound.amp(0.5);\n    // this.sound.playMode('untilDone');\n    this.isIntersecting = false;\n    // this.orbitR = dist(this.x, this.y, planetX, planetY);\n    this.orbitR = dist(this.x,this.y,planet.pos.x,planet.pos.y)\n    this.angle = 0;\n    this.angularV = 0;\n    this.angularA = 0;\n    this.maxV = 0\n  }\n\n  orbit(planet) {\n    const G = 5;\n    let vel = sqrt((G * planet.mass) / this.orbitR);\n    let acc = (G * planet.mass) / pow(this.orbitR, 2);\n    this.maxV = vel;\n    this.angularA = acc;\n  }\n\n  update() {\n    if (this.angularV < this.maxV) {\n       this.angularV += this.angularA;\n    }\n   \n    this.angle += this.angularV/100;\n \n  }\n\n  render() {\n    push();\n    noFill()\n    circle(planet.pos.x, planet.pos.y, this.orbitR * 2);\n     translate(planet.pos.x,planet.pos.y);\n    let x = sin(this.angle) * this.orbitR\n    let y = cos(this.angle) * this.orbitR\n    \n   \n    // rotateX(HALF_PI);\n\n    let mult = this.isIntersecting ? 1.1 : 1;\n    fill(24)\n    translate(x,y)\n    circle(0,0,this.w)\n    // cylinder(this.w * 0.5 * mult, this.w / 2, 8, 1);\n    pop();\n  }\n\n  checkIntersect(comets) {\n    this.isIntersecting = false;\n    for (let comet of comets) {\n      if (this.intersects(comet.pos.x, comet.pos.y)) {\n        this.sound.play();\n        this.isIntersecting = true;\n      }\n    }\n  }\n\n  intersects(x, y) {\n    return (\n      x > this.x - this.w * 0.5 &&\n      x < this.x + this.w * 0.5 &&\n      y > this.y - this.w * 0.5 &&\n      y < this.y + this.w * 0.5\n    );\n  }\n}\n\nclass Planet {\n  constructor(x, y, m) {\n    this.pos = createVector(x, y);\n    this.mass = m;\n    this.r = sqrt(this.mass) * 20;\n  }\n\n  getStrength(mover, force) {\n    const distanceSq = constrain(force.magSq(), 250, 2500);\n    const G = 5;\n    const strength = (G * (this.mass * mover.mass)) / distanceSq;\n    return strength;\n  }\n\n  attract(mover) {\n    const force = p5.Vector.sub(this.pos, mover.pos);\n    const strength = this.getStrength(mover, force);\n    force.setMag(strength);\n    mover.applyForce(force);\n  }\n\n  render() {\n    push();\n    translate(this.pos.x, this.pos.y);\n    fill(100, 255, 100, 20);\n    // rotateY(t * 0.001);\n    // sphere(this.r * 2, 20, 20);\n    circle(0,0,this.r/2)\n    pop();\n  }\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6789518b3120f4229f2a30cf",
        "createdAt": "2025-01-16T18:59:26.484Z",
        "updatedAt": "2025-01-16T18:59:26.484Z",
        "id": "6789518b3120f4229f2a30cf"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6789518b3120f4229f2a30d0",
        "createdAt": "2025-01-16T18:59:26.484Z",
        "updatedAt": "2025-01-16T18:59:26.484Z",
        "id": "6789518b3120f4229f2a30d0"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6789518b3120f4229f2a30d1",
        "createdAt": "2025-01-16T18:59:26.484Z",
        "updatedAt": "2025-01-16T18:59:26.484Z",
        "id": "6789518b3120f4229f2a30d1"
      }
    ],
    "updatedAt": "2025-01-16T18:59:26.484Z",
    "createdAt": "2025-01-16T18:39:04.140Z",
    "id": "RcYL937bB"
  },
  {
    "visibility": "Public",
    "_id": "iRQ2RZ_Jv",
    "name": "sawtooth gradient",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65d930074f0779196d317a58",
          "65d930074f0779196d317a59",
          "65d930074f0779196d317a5a"
        ],
        "fileType": "folder",
        "_id": "65d930074f0779196d317a57",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T00:35:34.008Z",
        "updatedAt": "2024-02-24T00:35:34.008Z",
        "id": "65d930074f0779196d317a57"
      },
      {
        "name": "sketch.js",
        "content": "let phase = 0;\nlet speedSlider, freqSlider;\nfunction setup() {\n  createCanvas(400, 400);\n  speedSlider = createSlider(0, 4, 2, 0.01);\n  freqSlider = createSlider(0, 400, 20, 1);\n}\n\nfunction sgn(val) {\n  if (val > 0) {\n    return 1;\n  } else if (val < 0) {\n    return -1;\n  } else {\n    return 0;\n  }\n}\n\nfunction draw() {\n  background(220);\n\n  loadPixels();\n\n  let period = freqSlider.value();\n  \n  let frequency = 1 / period;\n  for (let r = 0; r < height; r++) {\n    for (let c = 0; c < width; c++) {\n      let phaseShift = c + phase;\n      let saw = 2 * (phaseShift / period - floor(0.5 + phaseShift / period));\n      let amplitude = map(-saw, -1, 1, 0, 255);\n      let hue = color(100, 200, amplitude);\n      set(c, r, hue);\n    }\n  }\n  updatePixels();\n  phase += speedSlider.value();\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d930074f0779196d317a59",
        "isSelectedFile": true,
        "createdAt": "2024-02-24T00:35:34.008Z",
        "updatedAt": "2024-02-24T00:35:34.008Z",
        "id": "65d930074f0779196d317a59"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65d930074f0779196d317a58",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T00:35:34.008Z",
        "updatedAt": "2024-02-24T00:35:34.008Z",
        "id": "65d930074f0779196d317a58"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d930074f0779196d317a5a",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T00:35:34.008Z",
        "updatedAt": "2024-02-24T00:35:34.008Z",
        "id": "65d930074f0779196d317a5a"
      }
    ],
    "createdAt": "2024-02-23T23:53:43.216Z",
    "updatedAt": "2024-02-24T00:35:34.008Z",
    "id": "iRQ2RZ_Jv"
  },
  {
    "_id": "Qhmw7rrU5",
    "name": "schmitt trigger osc frequency calculator",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "699bc08b50e497c043b53918",
          "699bc08b50e497c043b53917",
          "699bc08b50e497c043b53919"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "699bc08b50e497c043b5391a",
        "createdAt": "2026-02-23T04:58:49.341Z",
        "updatedAt": "2026-02-23T04:58:49.341Z",
        "id": "699bc08b50e497c043b5391a"
      },
      {
        "name": "sketch.js",
        "content": "// formula for calculating the frequency of a schmitt trigger based relaxation oscillator found here: https://en.wikipedia.org/wiki/Relaxation_oscillator#Frequency_of_oscillation\n\nlet R, C, rmult, cmult;\nlet rInput, cInput, rMultSelect, cMultSelect, calc;\nlet answer = \"\";\nlet resistanceMults = { ohms: 1, k: 1000, M: 1000000 };\nlet capacitanceMults = { uf: 1e-6, nf: 1e-9, pf: 1e-12 };\nlet div\nlet yOff = 20\n\n\nfunction setup() {\n   createCanvas(windowWidth, windowHeight);\n\n  div = createDiv()\n  div.position(40,10)\n  div.size(width-40,30)\n  \n  rInput = createInput();\n  rInput.parent(div)\n  \n  rMultSelect = createSelect();\n  rMultSelect.option(\"ohms\");\n  rMultSelect.option(\"k\");\n  rMultSelect.option(\"M\");\n  rMultSelect.parent(div)\n\n  cInput = createInput();\n  cInput.parent(div)\n  \n  cMultSelect = createSelect();\n  cMultSelect.option(\"uf\");\n  cMultSelect.option(\"nf\");\n  cMultSelect.option(\"pf\");\n  cMultSelect.parent(div)\n\n  calc = createButton(\"calculate\");\n  calc.parent(div)\n  \n  calc.mousePressed(() => {\n    calculateFreq();\n  });\n\n  textAlign(CENTER);\n  rectMode(CENTER)\n \n}\n\nfunction draw() {\n  background(220);\n  fill(22)\n  rect(width/2,height/2,width-80,height-80)\n   fill(0,200,0)\n  textSize(36)\n  text(answer, width / 2, height/3);\n}\n\nfunction calculateFreq() {\n  if (rInput.value() == \"\" || cInput.value() == \"\") return;\n  rMult = resistanceMults[rMultSelect.value()];\n  cMult = capacitanceMults[cMultSelect.value()];\n  R = rInput.value() * rMult;\n  C = cInput.value() * cMult;\n\n  freq = 1 / (2 * log(3) * R * C);\n\n  answer = `${round(freq, 2)} hz`;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "699bc08b50e497c043b53917",
        "createdAt": "2026-02-23T04:58:49.341Z",
        "updatedAt": "2026-02-23T04:58:49.341Z",
        "id": "699bc08b50e497c043b53917"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    \n    \n    \n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "699bc08b50e497c043b53918",
        "createdAt": "2026-02-23T04:58:49.341Z",
        "updatedAt": "2026-02-23T04:58:49.341Z",
        "id": "699bc08b50e497c043b53918"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "699bc08b50e497c043b53919",
        "createdAt": "2026-02-23T04:58:49.341Z",
        "updatedAt": "2026-02-23T04:58:49.341Z",
        "id": "699bc08b50e497c043b53919"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2026-02-23T04:58:49.341Z",
    "createdAt": "2026-02-23T04:04:48.825Z",
    "id": "Qhmw7rrU5"
  },
  {
    "visibility": "Public",
    "_id": "5CbnR2SuK",
    "name": "shaders intro",
    "updatedAt": "2024-04-19T06:10:30.238Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "661eadb2e12f84079b9e9c25",
          "6621ffc555d484001a2acf2a",
          "661eadbce12f84079b9e9c28",
          "661eadc1e12f84079b9e9c29",
          "661eadb2e12f84079b9e9c24",
          "661eadb2e12f84079b9e9c26"
        ],
        "fileType": "folder",
        "_id": "661eadb2e12f84079b9e9c27",
        "isSelectedFile": false,
        "createdAt": "2024-04-19T06:10:30.238Z",
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "id": "661eadb2e12f84079b9e9c27"
      },
      {
        "name": "sketch.js",
        "content": "let customShader\nconst numCircles = 40;\nlet circles = []\n\nfunction preload() {\n  customShader = loadShader('shader.vert', 'noisecircles.frag')\n}\n\nfunction setup() {\n  createCanvas(400, 400, WEBGL);\n  rectMode(CENTER)\n  shader(customShader)\n  \n  for (let i = 0; i < numCircles; i++) {\n    circles.push(random(), random(), random(0.02, 0.14))\n  }\n  \n  noStroke()\n}\n\nfunction draw() {\n  clear()\n\n  customShader.setUniform('circles', circles)\n  customShader.setUniform('m', millis())\n  rect(0,0,width,height)\n\n}",
        "children": [],
        "fileType": "file",
        "_id": "661eadb2e12f84079b9e9c24",
        "isSelectedFile": false,
        "createdAt": "2024-04-19T06:10:30.238Z",
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "id": "661eadb2e12f84079b9e9c24"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "661eadb2e12f84079b9e9c25",
        "isSelectedFile": false,
        "createdAt": "2024-04-19T06:10:30.238Z",
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "id": "661eadb2e12f84079b9e9c25"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "661eadb2e12f84079b9e9c26",
        "isSelectedFile": false,
        "createdAt": "2024-04-19T06:10:30.238Z",
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "id": "661eadb2e12f84079b9e9c26"
      },
      {
        "name": "shader.frag",
        "content": "precision mediump float;\n\nvarying vec2 pos;\n\nuniform float millis;\n\nvoid main() {\n  float c = (sin(pos.x * 16. + millis/1000.)+1.) / 2.;\n  \n\n  gl_FragColor = vec4(c, 0., 1.,1.);\n}",
        "children": [],
        "fileType": "file",
        "_id": "661eadbce12f84079b9e9c28",
        "isSelectedFile": false,
        "createdAt": "2024-04-19T06:10:30.238Z",
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "id": "661eadbce12f84079b9e9c28"
      },
      {
        "name": "shader.vert",
        "content": "attribute vec3 aPosition;\nattribute vec2 aTexCoord;\n\nvarying vec2 pos;\n  \nvoid main() {\n  pos = aTexCoord;\n  \n  vec4 position = vec4( aPosition, 1.0);\n  position.xy = position.xy * 2.0 - 1.0;\n\n  gl_Position = position;\n}",
        "children": [],
        "fileType": "file",
        "_id": "661eadc1e12f84079b9e9c29",
        "isSelectedFile": false,
        "createdAt": "2024-04-19T06:10:30.238Z",
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "id": "661eadc1e12f84079b9e9c29"
      },
      {
        "name": "noisecircles.frag",
        "content": "precision mediump float;\n\nvarying vec2 pos;\n\nconst int num_circles = 40;\nuniform vec3 circles[num_circles];\nuniform float m;\n\nfloat rand(vec2 co){\n    return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\n\nvoid main() {\n  \n  float sw = 1.0;\n  for (int i = 0; i < num_circles; i++) {\n    float d = length(pos - circles[i].xy) - circles[i].z;\n    d = step(0.0, d);\n    sw *= d;\n  }  \n  float color = -1.0 * sw + rand(pos * m);\n\n  gl_FragColor = vec4(1., 0.4, color,1.);\n}",
        "children": [],
        "fileType": "file",
        "_id": "6621ffc555d484001a2acf2a",
        "isSelectedFile": true,
        "updatedAt": "2024-04-19T06:10:30.238Z",
        "createdAt": "2024-04-19T06:10:30.238Z",
        "id": "6621ffc555d484001a2acf2a"
      }
    ],
    "createdAt": "2024-04-16T18:52:58.029Z",
    "id": "5CbnR2SuK"
  },
  {
    "visibility": "Public",
    "_id": "4olscYflX",
    "name": "ship",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dc15080c9d07c9b44accd9",
          "65dc15080c9d07c9b44accda",
          "65dc15080c9d07c9b44accdb",
          "65dc15080c9d07c9b44accdc",
          "65dc15080c9d07c9b44accdd",
          "65dc15080c9d07c9b44accde"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "65dc15080c9d07c9b44accd8",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accd8"
      },
      {
        "name": "sketch.js",
        "content": "let ship;\nlet attractors = [];\nfunction setup() {\n  colorMode(HSL);\n  createCanvas(400, 400);\n  ship = new Mover(200, 200, 60);\n  for (let i = 0; i < 1; i++) {\n     let x = i * 300 + 50\n    let y = i * 300 + 50\n    attractors.push(new Attractor(x,y, 40));\n  }\n  \n  document.addEventListener('keydown', (e) => {\n   if (e.keyCode == 82) {\n     reset()\n   }\n  })\n}\n\nfunction reset() {\n  background(200, 100, 50);\n  attractors = [];\n  ship = new Mover(200, 200, 60);\n  for (let i = 0; i < 2; i++) {\n    let x = i * 300 + 50\n    let y = i * 300 + 50\n    attractors.push(new Attractor(x,y, 40));\n  }\n}\n\nfunction draw() {\n  background(200, 100, 50, 0.2);\n\n  for (let attractor of attractors) {\n    attractor.attract(ship);\n    attractor.show();\n  }\n\n  ship.edges();\n  ship.drag();\n  ship.update();\n  ship.show();\n\n  if (keyIsDown(LEFT_ARROW)) {\n    ship.turn(-0.1);\n  } else if (keyIsDown(RIGHT_ARROW)) {\n    ship.turn(0.1);\n  } else if (keyIsDown(90)) {\n    ship.thrust();\n  } \n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "65dc15080c9d07c9b44accdd",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accdd"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n    <meta charset=\"utf-8\" />\n  </head>\n  <body>\n    <main></main>\n    <script src=\"attractor.js\"></script>\n    <script src=\"repeller.js\"></script>\n    <script src=\"mover.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65dc15080c9d07c9b44accda",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accda"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65dc15080c9d07c9b44accde",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accde"
      },
      {
        "name": "mover.js",
        "content": "class Mover {\n  constructor(x, y, m) {\n    this.pos = createVector(x, y);\n    this.vel = createVector(1,-1)\n    this.vel.mult(1)\n    this.r = sqrt(m) * 2;\n    this.acc = createVector(0,0);\n    this.angle = 0\n    this.mass = m\n    this.reduce = -0.8\n  }\n\n  edges() {\n    let mult = 3\n    if (this.pos.x >= width + mult * this.r) {\n      this.pos.x = -this.r;\n    }\n    if (this.pos.x < -mult * this.r) {\n      this.pos.x = width + this.r;\n     \n    }\n    if (this.pos.y > height + mult *  this.r) {\n      this.pos.y = -this.r;\n      // this.vel.y *= this.reduce;\n    }\n    if (this.pos.y < -mult * this.r) {\n      this.pos.y = height + mult * this.r\n    }\n  }\n  \n  drag () {\n    const drag = this.vel.copy()\n    drag.normalize().mult(-1)\n    const speedSq = this.vel.magSq()\n    const c = 0.06\n    drag.setMag(c * speedSq * this.r)\n    this.applyForce(drag)\n  }\n  \n  turn(amount) {\n    this.angle += amount\n  }\n  \n  thrust() {\n    const thrust = p5.Vector.fromAngle(this.angle)\n    thrust.setMag(4)\n    this.applyForce(thrust)\n  }\n\n  applyForce(force) {\n    const f = p5.Vector.div(force,this.mass)\n    this.acc.add(f)\n  }\n\n  update() {\n    this.vel.add(this.acc)\n    this.pos.add(this.vel);\n    this.acc.set(0,0)\n  }\n\n  show() {\n    noStroke();\n    fill(100, 100, 50);\n    translate(this.pos.x,this.pos.y)\n    // rotate(this.angle)\n    rotate(this.vel.heading())\n    triangle(-this.r, -this.r/2, -this.r, this.r/2, this.r, 0)\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65dc15080c9d07c9b44accdb",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accdb"
      },
      {
        "name": "attractor.js",
        "content": "class Attractor {\n  constructor(x, y, m) {\n    this.pos = createVector(x, y);\n    this.mass = m;\n    this.r = sqrt(this.mass) * 2;\n  }\n  \n  getStrength(mover, force) {\n    const distanceSq = constrain(force.magSq(), 250, 2500);\n    const G = 5;\n    const strength = G * (this.mass * mover.mass) / distanceSq;\n    return strength\n  }\n\n  attract(mover) {\n    const force = p5.Vector.sub(this.pos, mover.pos);\n    const strength = this.getStrength(mover, force)\n    force.setMag(strength)\n    mover.applyForce(force);\n  }\n\n  show() {\n    fill(20, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65dc15080c9d07c9b44accd9",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accd9"
      },
      {
        "name": "repeller.js",
        "content": "class Repeller extends Attractor {\n  constructor(x,y,m) {\n    super(x,y,m)\n  }\n  \n  repel(mover) {\n    const force = p5.Vector.sub(this.pos, mover.pos)\n    const strength = this.getStrength(mover, force) * -1\n    force.setMag(strength)\n    mover.applyForce(force)\n  }\n  \n  show() {\n    fill(50, 100, 50);\n    ellipse(this.pos.x, this.pos.y, this.r * 2);\n  }\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65dc15080c9d07c9b44accdc",
        "createdAt": "2025-01-07T23:23:53.982Z",
        "updatedAt": "2025-01-07T23:23:53.982Z",
        "id": "65dc15080c9d07c9b44accdc"
      }
    ],
    "createdAt": "2024-02-26T04:35:20.432Z",
    "updatedAt": "2025-01-07T23:23:53.982Z",
    "id": "4olscYflX"
  },
  {
    "visibility": "Public",
    "_id": "ZSOPN_LF_",
    "name": "sine gradient",
    "updatedAt": "2024-02-24T01:54:06.417Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65d928b44f0779196d317a50",
          "65d928b44f0779196d317a4f",
          "65d928b44f0779196d317a51"
        ],
        "fileType": "folder",
        "_id": "65d928b44f0779196d317a52",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T01:54:06.417Z",
        "updatedAt": "2024-02-24T01:54:06.417Z",
        "id": "65d928b44f0779196d317a52"
      },
      {
        "name": "sketch.js",
        "content": "class Wave {\n  constructor(amp, period, phase) {\n    this.amp = amp;\n    this.period = period;\n    this.phase = phase;\n    this.phaseShift = 0.1;\n  }\n\n  update() {\n    this.phase += this.phaseShift;\n  }\n\n  evaluate(x) {\n    let y = sin(this.phase + (TWO_PI * x) / this.period);\n    let normalized = map(y, -1, 1, 0, this.amp);\n\n    return normalized;\n  }\n\n  setPhaseShift(v) {\n    this.phaseShift = v;\n  }\n\n  setPeriod(v) {\n    this.period = v;\n  }\n}\n\nlet speedSlider, freqSlider;\nlet wave;\nfunction setup() {\n  createCanvas(400, 400);\n  speedSlider = createSlider(0, 2, 0.5, 0.01);\n  freqSlider = createSlider(0, 800, 200, 1);\n  wave = new Wave(255, freqSlider.value(), speedSlider.value());\n}\n\nfunction draw() {\n  background(220);\n\n  loadPixels();\n  let period = freqSlider.value();\n  let phaseShift = speedSlider.value();\n\n  for (let r = 0; r < height; r++) {\n    for (let c = 0; c < width; c++) {\n      let l = wave.evaluate(c);\n      let hue = color(100,l,200);\n      set(c, r, hue);\n    }\n  }\n\n  updatePixels();\n  wave.setPeriod(period);\n  wave.setPhaseShift(phaseShift)\n  wave.update();\n\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d928b44f0779196d317a4f",
        "isSelectedFile": true,
        "createdAt": "2024-02-24T01:54:06.417Z",
        "updatedAt": "2024-02-24T01:54:06.417Z",
        "id": "65d928b44f0779196d317a4f"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65d928b44f0779196d317a50",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T01:54:06.417Z",
        "updatedAt": "2024-02-24T01:54:06.417Z",
        "id": "65d928b44f0779196d317a50"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d928b44f0779196d317a51",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T01:54:06.417Z",
        "updatedAt": "2024-02-24T01:54:06.417Z",
        "id": "65d928b44f0779196d317a51"
      }
    ],
    "createdAt": "2024-02-23T23:43:39.583Z",
    "id": "ZSOPN_LF_"
  },
  {
    "visibility": "Public",
    "_id": "97ZgqdT_e",
    "name": "sine vertices",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dc33a8a94e501180d8222b",
          "65dc33a8a94e501180d8222c",
          "65dc33a8a94e501180d8222d"
        ],
        "fileType": "folder",
        "_id": "65dc33a8a94e501180d8222a",
        "createdAt": "2024-02-26T07:09:41.218Z",
        "updatedAt": "2024-02-26T07:09:41.218Z",
        "isSelectedFile": false,
        "id": "65dc33a8a94e501180d8222a"
      },
      {
        "name": "sketch.js",
        "content": "let rotation = 0;\nlet angle = 0\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL);\n}\n\nfunction draw() {\n  background(200, 100, 60);\n  noFill();\n  stroke(60,100,50);\n  translate(200, 200);\n  const r = 60\n  ellipse(0,0, 2 * r)\n//   rotate(rotation);\n//   beginShape();\n//   g =  map(sin(time), -1, 1, PI, 0.01)\n\n//   for (let i = 0; i < TWO_PI; i += 0.1) {\n//     const radius = 100;\n//     const angle = i;\n//     let r2 = radius + random(-6,6)\n//     let x = cos(angle) * r2\n//     let y = sin(angle) * r2;\n//     vertex(x, y);\n//   }\n\n//   endShape(CLOSE);\n  const x = cos(angle) * r \n  const y = sin(angle) * r\n  let r2= 10\n  ellipse(x,y, 2 * r2)\n  let x2 = cos(0) * r2\n  let y2 = sin(0) * r2\n  line(r+x2,r+y2,x2+50, y2)\n  angle += 0.01\n  // time += 0.01\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc33a8a94e501180d8222c",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T07:09:41.218Z",
        "updatedAt": "2024-02-26T07:09:41.218Z",
        "id": "65dc33a8a94e501180d8222c"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc33a8a94e501180d8222b",
        "createdAt": "2024-02-26T07:09:41.218Z",
        "updatedAt": "2024-02-26T07:09:41.218Z",
        "isSelectedFile": false,
        "id": "65dc33a8a94e501180d8222b"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc33a8a94e501180d8222d",
        "createdAt": "2024-02-26T07:09:41.218Z",
        "updatedAt": "2024-02-26T07:09:41.218Z",
        "isSelectedFile": false,
        "id": "65dc33a8a94e501180d8222d"
      }
    ],
    "createdAt": "2024-02-26T06:46:00.271Z",
    "updatedAt": "2024-02-26T07:09:41.218Z",
    "id": "97ZgqdT_e"
  },
  {
    "visibility": "Public",
    "_id": "PW67TBZkc",
    "name": "sphere move",
    "updatedAt": "2023-06-21T21:13:22.984Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6493627ec97c706d5a4a9047",
          "6493627ec97c706d5a4a9046",
          "6493627ec97c706d5a4a9048"
        ],
        "fileType": "folder",
        "_id": "6493627ec97c706d5a4a9049",
        "isSelectedFile": false,
        "createdAt": "2023-06-21T21:13:22.984Z",
        "updatedAt": "2023-06-21T21:13:22.984Z",
        "id": "6493627ec97c706d5a4a9049"
      },
      {
        "name": "sketch.js",
        "content": "let sphere\nlet timeout = 100 \nlet capturing = true\nlet frame = 0\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL)\n  noStroke()\n  let myGreen = color(100, 100, 80)\n  sphere = new Sphere(-200, 200, 100, 0, myGreen, 200)\n  \n}\n\nfunction draw() {\n  background(280, 100, 90);\n   sphere.draw()\n  if (frameCount % 60 == 0 ) {\n    if (capturing) capture()\n    sphere.update()\n  }\n \n}\n\nfunction radicalGradient(sX, sY, sR, eX, eY, eR, colorS, colorE) {\n  let gradient = drawingContext.createRadialGradient(\n    sX, sY, sR, eX, eY, eR\n  )\n  gradient.addColorStop(0, colorS)\n  gradient.addColorStop(1, colorE)\n  \n  drawingContext.fillStyle = gradient\n}\n\nclass Sphere {\n  constructor(x, y, xV, yV, c, r=radius) {\n    this.x = x;\n    this.y = y;\n    this.xVelocity = xV;\n    this.yVelocity = yV;\n    this.decay = timeout\n    this.radius = r\n    this.color = c\n    // this.upperBound = 600 + ( this.radius * 2)\n    this.upperBound = this.radius * 2\n    \n    this.lowerBound = 0 - (this.radius * 2)\n  }\n  \n  draw() {\n    stroke(10)\n    strokeWeight(2)\n \n  radicalGradient(\n    this.x + 20, this.y - 20, 0,\n    this.x + 20, this.y - 20, 50,\n    color(50, 100, 80),\n     this.color\n  );\n    noStroke()\n    ellipse(this.x, this.y, this.radius)\n  }\n  \n  reset () {\n    this.x = Math.random() * 600\n    this.y = Math.random() * 600\n    this.decay = timeout\n  }\n  \n  update() {\n   if (this.x > this.upperBound || this.x < this.lowerBound) {\n     capturing = false\n     this.xVelocity *= -1\n   } else if (this.y > this.upperBound || this.y < this.lowerBound) {\n     this.yVelocity *= -1\n   }\n    \n    this.x += this.xVelocity\n    this.y += this.yVelocity\n    \n    this.draw()\n  }\n  \n}\n\nfunction capture () {\n  const canvas = document.querySelector('canvas')\n  const png = canvas.toDataURL('image/png')\n  const link = document.createElement('a')\n  link.href = png\n  link.download = `sphere_${String(frame).padStart(4,'0')}` \n  link.click()\n  link.remove()\n  frame++\n}",
        "children": [],
        "fileType": "file",
        "_id": "6493627ec97c706d5a4a9046",
        "isSelectedFile": true,
        "createdAt": "2023-06-21T21:13:22.984Z",
        "updatedAt": "2023-06-21T21:13:22.984Z",
        "id": "6493627ec97c706d5a4a9046"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "6493627ec97c706d5a4a9047",
        "isSelectedFile": false,
        "createdAt": "2023-06-21T21:13:22.984Z",
        "updatedAt": "2023-06-21T21:13:22.984Z",
        "id": "6493627ec97c706d5a4a9047"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "6493627ec97c706d5a4a9048",
        "isSelectedFile": false,
        "createdAt": "2023-06-21T21:13:22.984Z",
        "updatedAt": "2023-06-21T21:13:22.984Z",
        "id": "6493627ec97c706d5a4a9048"
      }
    ],
    "createdAt": "2023-06-21T21:13:22.984Z",
    "id": "PW67TBZkc"
  },
  {
    "visibility": "Public",
    "_id": "drTb5wWg3",
    "name": "spinning circle and rects",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "678317d716174ff88310cfbd",
          "678317d716174ff88310cfbc",
          "678317d716174ff88310cfbe"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "678317d716174ff88310cfbf",
        "createdAt": "2025-01-12T01:40:54.665Z",
        "updatedAt": "2025-01-12T01:40:54.665Z",
        "id": "678317d716174ff88310cfbf"
      },
      {
        "name": "sketch.js",
        "content": "let t = 0\nfunction setup() {\n  createCanvas(400, 400, WEBGL);\n}\n\nfunction draw() {\n  background(220);\n  let r = 1000\n  noStroke();\n  translate(r*0.8,0,0)\n  rotateY(t) \n  translate(0, 100, 0);\n  rotateX(HALF_PI);\n\n  fill(200,200,244);\n\n  beginShape();\n  for (let i = 0; i < 100; i++) {\n    let angle = map(i, 0, 100, 0, TWO_PI);\n    let radius = r;\n    let x = cos(angle) * radius;\n    let y = sin(angle) * radius;\n    let z = 0;\n    vertex(x, y, z);\n  }\n\n  endShape();\n\n  let v = 10;\n  for (let i = 0; i < v; i++) {\n    let angle = map(i, 0, v, 0, TWO_PI);\n    let radius = r *0.8;\n    let x = cos(angle) * radius;\n    let y = sin(angle) * radius;\n    let z = 0;\n    push();\n    translate(x, y, z);\n    rotateZ(angle)\n    let c = map(sin(angle),-1,1,129,255)\n    fill(c,128,200);\n    stroke(c,128,0);\n    \n\n    box(200,100,500);\n    pop();\n  }\n  t+= 0.008\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "678317d716174ff88310cfbc",
        "createdAt": "2025-01-12T01:40:54.665Z",
        "updatedAt": "2025-01-12T01:40:54.665Z",
        "id": "678317d716174ff88310cfbc"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "678317d716174ff88310cfbd",
        "createdAt": "2025-01-12T01:40:54.665Z",
        "updatedAt": "2025-01-12T01:40:54.665Z",
        "id": "678317d716174ff88310cfbd"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "678317d716174ff88310cfbe",
        "createdAt": "2025-01-12T01:40:54.665Z",
        "updatedAt": "2025-01-12T01:40:54.665Z",
        "id": "678317d716174ff88310cfbe"
      }
    ],
    "updatedAt": "2025-01-12T01:40:54.665Z",
    "createdAt": "2025-01-12T01:16:40.816Z",
    "id": "drTb5wWg3"
  },
  {
    "visibility": "Public",
    "_id": "X54dGovgU",
    "name": "spinning squares",
    "updatedAt": "2023-04-22T21:19:01.341Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "643f03e532be2a1b10436531",
          "643f03e532be2a1b10436530",
          "643f03e532be2a1b10436532"
        ],
        "fileType": "folder",
        "_id": "643f03e532be2a1b10436533",
        "isSelectedFile": false,
        "createdAt": "2023-04-22T21:19:01.341Z",
        "updatedAt": "2023-04-22T21:19:01.341Z",
        "id": "643f03e532be2a1b10436533"
      },
      {
        "name": "sketch.js",
        "content": "let squares = []\nlet blue, pink\nlet amount\nfunction setup() {\n  createCanvas(600, 600);\n  pixelDensity(1)\n  colorMode(HSL)\n  pink = color(240, 100, 90)\n  blue = color(200, 100, 40)\n  amount = 3\n\n  generateSquares()\n}\n\nfunction draw() {\n  background(blue);\n  \n  squares.forEach(square => {\n    square.update()\n    square.draw()\n  }) \n}\n\nfunction generateSquares() {\n  squares = []\n  for (let i = 0; i < amount+1; i++) {\n    for (let j = 0; j < amount+1; j++) {\n      let w = width  / amount \n      let h = height / amount\n      let x = i * 2\n      let y = j * 2 \n      let idVal = i + j\n      \n      let square = new Square(x, y, w, h,0.4 , idVal)\n      // square.update()\n      squares.push(square)\n      \n    }\n  }\n}\n\nclass Square {\n  constructor(x,y, w, h, rotation, id) {\n    this.x = x;\n    this.y = y;\n    this.w = w / 2\n    this.h = h / 2\n    this.rotation = rotation\n    this.id = id\n  }\n  \n  update() {\n    if (frameCount % 6 == 0) {\n      if (this.id % 2) {\n        this.rotation -= 0.02\n      } else {\n        this.rotation += 0.03\n      }\n      \n    }\n  }\n  \n  draw() {\n    push()\n    const x = this.w * this.x\n    const y = this.h * this.y\n    translate(x, y)\n    rotate(this.rotation)\n    noStroke()\n    fill(pink)\n    rect(-this.w, -this.h, this.w*2, this.h*2)\n    pop()\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "643f03e532be2a1b10436530",
        "isSelectedFile": true,
        "createdAt": "2023-04-22T21:19:01.341Z",
        "updatedAt": "2023-04-22T21:19:01.341Z",
        "id": "643f03e532be2a1b10436530"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "643f03e532be2a1b10436531",
        "isSelectedFile": false,
        "createdAt": "2023-04-22T21:19:01.341Z",
        "updatedAt": "2023-04-22T21:19:01.341Z",
        "id": "643f03e532be2a1b10436531"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "643f03e532be2a1b10436532",
        "isSelectedFile": false,
        "createdAt": "2023-04-22T21:19:01.341Z",
        "updatedAt": "2023-04-22T21:19:01.341Z",
        "id": "643f03e532be2a1b10436532"
      }
    ],
    "createdAt": "2023-04-18T21:26:57.819Z",
    "id": "X54dGovgU"
  },
  {
    "visibility": "Public",
    "_id": "4VHOy6hbg",
    "name": "spiral",
    "updatedAt": "2024-02-26T06:45:36.449Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dc2c3f0c9d07c9b44acce0",
          "65dc2c3f0c9d07c9b44accdf",
          "65dc2c3f0c9d07c9b44acce1"
        ],
        "fileType": "folder",
        "_id": "65dc2c3f0c9d07c9b44acce2",
        "createdAt": "2024-02-26T06:45:36.449Z",
        "updatedAt": "2024-02-26T06:45:36.449Z",
        "isSelectedFile": false,
        "id": "65dc2c3f0c9d07c9b44acce2"
      },
      {
        "name": "sketch.js",
        "content": "let rotation = 0;\nlet time = 0\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSL);\n  // background(0)\n}\n\nfunction draw() {\n  background(0, 0, 0);\n  noFill();\n  stroke(255);\n  translate(200, 200);\n  rotate(rotation);\n  beginShape();\n  g =  map(sin(time), -1, 1, 0.01, PI)\n\n  for (let i = 0; i < TWO_PI; i += g) {\n    const radius = 100;\n    const angle = i;\n    let x = cos(angle) * radius;\n    let y = sin(angle) * radius;\n    vertex(x, y);\n  }\n\n  endShape(CLOSE);\n  rotation += 0.01;\n  time += 0.01\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc2c3f0c9d07c9b44accdf",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T06:45:36.449Z",
        "updatedAt": "2024-02-26T06:45:36.449Z",
        "id": "65dc2c3f0c9d07c9b44accdf"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc2c3f0c9d07c9b44acce0",
        "createdAt": "2024-02-26T06:45:36.449Z",
        "updatedAt": "2024-02-26T06:45:36.449Z",
        "isSelectedFile": false,
        "id": "65dc2c3f0c9d07c9b44acce0"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc2c3f0c9d07c9b44acce1",
        "createdAt": "2024-02-26T06:45:36.449Z",
        "updatedAt": "2024-02-26T06:45:36.449Z",
        "isSelectedFile": false,
        "id": "65dc2c3f0c9d07c9b44acce1"
      }
    ],
    "createdAt": "2024-02-26T06:26:08.078Z",
    "id": "4VHOy6hbg"
  },
  {
    "visibility": "Public",
    "_id": "cI6ZWfnpA",
    "name": "springs",
    "updatedAt": "2024-02-27T05:13:24.355Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dd18a5b6911f81f525433d",
          "65dd18adb6911f81f5254340",
          "65dd18a5b6911f81f525433c",
          "65dd19a8b6911f81f5254341",
          "65dd18a5b6911f81f525433e"
        ],
        "fileType": "folder",
        "_id": "65dd18a5b6911f81f525433f",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T05:13:24.355Z",
        "updatedAt": "2024-02-27T05:13:24.355Z",
        "id": "65dd18a5b6911f81f525433f"
      },
      {
        "name": "sketch.js",
        "content": "let gravity;\nlet particles = [];\nlet springs = [];\nlet spacing = 20;\n\nfunction setup() {\n  createCanvas(600, 600);\n  colorMode(HSL);\n  for (let i = 0; i < spacing; i++) {\n    let particle = new Particle(300, i * spacing);\n    particles.push(particle);\n    if (i !== 0) {\n      let a = particles[i]\n      let b = particles[i-1]\n      let spring = new Spring(0.01, spacing, a,b)\n      springs.push(spring)\n    }\n  }\n  particles[0].locked = true\n  gravity = createVector(0, 0.01);\n}\n\nfunction draw() {\n  background(200, 100, 50);\n  let head = particles[0]\n  let tail = particles[particles.length - 1]\n  if (mouseIsPressed) {\n    let tail = particles[particles.length - 1]\n    tail.pos.set(mouseX, mouseY)\n    tail.vel.set(0,0)\n  }\n  for (let spring of springs) {\n    // spring.show()\n    spring.update()\n  }\n  beginShape()\n  \n  vertex(head.pos.x, head.pos.y)\n  for (let particle of particles) {\n    // particle.show();\n    tail.show()\n    noFill()\n    strokeWeight(2)\n    stroke(100,100,80)\n    curveVertex(particle.pos.x, particle.pos.y)\n    particle.applyForce(gravity)\n    particle.update()\n  }\n  vertex(tail.pos.x, tail.pos.y)\n  endShape()\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd18a5b6911f81f525433c",
        "isSelectedFile": true,
        "createdAt": "2024-02-27T05:13:24.355Z",
        "updatedAt": "2024-02-27T05:13:24.355Z",
        "id": "65dd18a5b6911f81f525433c"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"particle.js\"></script>\n    <script src=\"spring.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd18a5b6911f81f525433d",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T05:13:24.355Z",
        "updatedAt": "2024-02-27T05:13:24.355Z",
        "id": "65dd18a5b6911f81f525433d"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd18a5b6911f81f525433e",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T05:13:24.355Z",
        "updatedAt": "2024-02-27T05:13:24.355Z",
        "id": "65dd18a5b6911f81f525433e"
      },
      {
        "name": "particle.js",
        "content": "class Particle {\n  constructor(x, y) {\n    this.pos = createVector(x, y);\n    this.vel = createVector(0, 0);\n    this.acc = createVector(0, 0);\n    this.mass = 1;\n    this.locked = false;\n  }\n\n  applyForce(force) {\n    const f = force.copy();\n    f.div(this.mass);\n    this.acc.add(f);\n  }\n\n  update() {\n    if (!this.locked) {\n      this.vel.mult(0.99);\n      this.vel.add(this.acc);\n      this.pos.add(this.vel);\n      this.acc.mult(0);\n    }\n  }\n\n  show() {\n    noStroke();\n    fill(100, 100, 50);\n    ellipse(this.pos.x, this.pos.y, 12);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd18adb6911f81f5254340",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T05:13:24.355Z",
        "updatedAt": "2024-02-27T05:13:24.355Z",
        "id": "65dd18adb6911f81f5254340"
      },
      {
        "name": "spring.js",
        "content": "class Spring {\n  constructor(k, restLength, a, b) {\n    this.k = k;\n    this.restLength = restLength;\n    this.a = a;\n    this.b = b;\n    \n  }\n\n  update() {\n    const force = p5.Vector.sub(this.b.pos, this.a.pos);\n    const x = force.mag() - this.restLength;\n    force.normalize()\n    force.mult(this.k * x);\n    this.a.applyForce(force);\n    force.mult(-1)\n    this.b.applyForce(force);\n  }\n\n  show() {\n    strokeWeight(3)\n    stroke(220, 100, 80);\n    line(this.a.pos.x, this.a.pos.y, this.b.pos.x, this.b.pos.y);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dd19a8b6911f81f5254341",
        "isSelectedFile": false,
        "createdAt": "2024-02-27T05:13:24.355Z",
        "updatedAt": "2024-02-27T05:13:24.355Z",
        "id": "65dd19a8b6911f81f5254341"
      }
    ],
    "createdAt": "2024-02-27T00:08:44.080Z",
    "id": "cI6ZWfnpA"
  },
  {
    "visibility": "Public",
    "_id": "N16xosl53",
    "name": "square gradient",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65d92dad4f0779196d317a54",
          "65d92dad4f0779196d317a55",
          "65d92dad4f0779196d317a56"
        ],
        "fileType": "folder",
        "_id": "65d92dad4f0779196d317a53",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T00:18:26.564Z",
        "updatedAt": "2024-02-24T00:18:26.564Z",
        "id": "65d92dad4f0779196d317a53"
      },
      {
        "name": "sketch.js",
        "content": "let offset = 0\nlet speedSlider, freqSlider\nfunction setup() {\n  createCanvas(400, 400); \n  speedSlider = createSlider(0, 2,0.5, 0.01)\n  freqSlider = createSlider(0, 100, 20, 1)\n}\n\nfunction sgn(val) {\n  if (val > 0) {\n    return 1\n  } else if (val < 0 ) {\n    return -1\n  } else {\n    return 0\n  }\n}\n\nfunction draw() {\n  background(220);\n\n  loadPixels()\n  let frequency = 1/freqSlider.value()\n\n  for(let r = 0; r < height; r++) {\n    for (let c = 0; c < width; c++) {\n      let square = sgn(sin(frequency*c + offset) )\n      let h = map(square, -1, 1, 0, 255)\n      let hue = color(100,200, h)\n      set(c,r, hue)\n    }\n  }\n  updatePixels()\n  offset += speedSlider.value()\n}",
        "children": [],
        "fileType": "file",
        "_id": "65d92dad4f0779196d317a55",
        "isSelectedFile": true,
        "createdAt": "2024-02-24T00:18:26.564Z",
        "updatedAt": "2024-02-24T00:18:26.564Z",
        "id": "65d92dad4f0779196d317a55"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65d92dad4f0779196d317a54",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T00:18:26.564Z",
        "updatedAt": "2024-02-24T00:18:26.564Z",
        "id": "65d92dad4f0779196d317a54"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d92dad4f0779196d317a56",
        "isSelectedFile": false,
        "createdAt": "2024-02-24T00:18:26.564Z",
        "updatedAt": "2024-02-24T00:18:26.564Z",
        "id": "65d92dad4f0779196d317a56"
      }
    ],
    "createdAt": "2024-02-23T23:43:41.910Z",
    "updatedAt": "2024-02-24T00:18:26.564Z",
    "id": "N16xosl53"
  },
  {
    "visibility": "Public",
    "_id": "_0NjaLOLn",
    "name": "square moves",
    "updatedAt": "2023-12-09T19:33:45.816Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63d84de0b1cad7698d7c0ed6",
          "63d84de0b1cad7698d7c0ed5",
          "63d84de0b1cad7698d7c0ed7"
        ],
        "fileType": "folder",
        "_id": "63d84de0b1cad7698d7c0ed8",
        "isSelectedFile": false,
        "createdAt": "2023-12-09T19:33:45.816Z",
        "updatedAt": "2023-12-09T19:33:45.816Z",
        "id": "63d84de0b1cad7698d7c0ed8"
      },
      {
        "name": "sketch.js",
        "content": "let coords = []\nlet amount = 27\nlet count = amount / 2 \nlet sideWidth\nlet sideHeight\nlet end\nlet spaces = 6\nlet spaceIndex = 0\nlet fRate = 12\n\nfunction setup() {\n\n  createCanvas(625, 625);\n  sideWidth = width / amount\n  sideHeight = height / amount\n  for (let i = 0; i < count; i++) {\n    if (i % 2 === 0) {\n      makeCoords(i)\n    } else {\n      makeCoords(i, true)\n    }\n    // makeCoords(i)\n  }\n  \n}\n\nfunction draw() {\n  // background(232, 213, 7)\n  \n  drawSquares(coords.length)\n\n}\n\nfunction makeCoords(offset, reverse=false) {\n  const xMult = sideWidth\n  const yMult = sideHeight\n  const start = 0 + offset\n  const end = amount -  1 - offset\n  \n  let _coords = []\n\n  for (let i = start; i < amount - offset; i++) {\n    _coords.push([i * xMult, (start * yMult)])\n  }\n  for (let i = start + 1; i < end; i++) {\n    _coords.push([end * xMult, i * yMult])\n  }\n  for (let i = end; i > start; i--) {\n    _coords.push([i * xMult, end * yMult])\n  }\n  for (let i = end; i > start; i--) {\n    _coords.push([start * xMult, i * yMult])\n  }\n  \n  if (reverse) {\n    const _coordsReversed = _coords.reverse()\n    coords = coords.concat(_coordsReversed)\n  } else {\n    coords = coords.concat(_coords)\n  }\n} \n\nfunction drawSquares(limit) {\n    for (i = 0; i < limit; i++) {\n      stroke(0, 0, 255)\n      // noStroke()\n\n      if (i % spaces === spaceIndex % spaces) {\n        fill(0, 0, 255)\n      } else if (i % (spaces / 2) === spaceIndex % (spaces / 2)) {\n        fill(0, 255, 0)\n      } else {\n        fill(255)\n      }\n\n      rect(coords[i][0], coords[i][1], sideWidth, sideHeight)\n    }\n  \n    if (frameCount % fRate === 0) {\n      spaceIndex += 1\n    }\n}\n\n",
        "children": [],
        "fileType": "file",
        "_id": "63d84de0b1cad7698d7c0ed5",
        "isSelectedFile": true,
        "createdAt": "2023-12-09T19:33:45.816Z",
        "updatedAt": "2023-12-09T19:33:45.816Z",
        "id": "63d84de0b1cad7698d7c0ed5"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63d84de0b1cad7698d7c0ed6",
        "isSelectedFile": false,
        "createdAt": "2023-12-09T19:33:45.816Z",
        "updatedAt": "2023-12-09T19:33:45.816Z",
        "id": "63d84de0b1cad7698d7c0ed6"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63d84de0b1cad7698d7c0ed7",
        "isSelectedFile": false,
        "createdAt": "2023-12-09T19:33:45.816Z",
        "updatedAt": "2023-12-09T19:33:45.816Z",
        "id": "63d84de0b1cad7698d7c0ed7"
      }
    ],
    "createdAt": "2023-01-31T00:58:12.324Z",
    "id": "_0NjaLOLn"
  },
  {
    "visibility": "Public",
    "_id": "zlmBcieIT",
    "name": "squares and circles",
    "updatedAt": "2024-03-22T21:56:22.949Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63d4358a16643fed2c32b3c5",
          "63d4358a16643fed2c32b3c4",
          "63d4358a16643fed2c32b3c6"
        ],
        "fileType": "folder",
        "_id": "63d4358a16643fed2c32b3c7",
        "createdAt": "2024-03-22T21:56:22.949Z",
        "updatedAt": "2024-03-22T21:56:22.949Z",
        "isSelectedFile": false,
        "id": "63d4358a16643fed2c32b3c7"
      },
      {
        "name": "sketch.js",
        "content": "let x1 = 0\nlet x2 = 600\nlet y = 0\nlet ys1 = [0, 80, 160, 240, 320, 400,]\nlet ys2 = [40, 120, 200, 280, 360, 440]\n\n\nfunction setup() {\n  createCanvas(600, 480);\n   background(255)\n}\n\nfunction draw() {\n\n  if (frameCount % 5 === 0) {\n  for (let i = 0; i < ys1.length; i++) {\n    if (i % 2 === 0) {\n      drawSquare2(ys2[i], 20, y)\n      drawSquare1(ys1[i], 10, -y)\n      \n    } else {\n       drawSquare2(ys2[i], 10, -y)\n       drawSquare1(ys1[i], 20, y)\n    }\n  }\n  }\n  \n  if (frameCount % 30 === 0) {\n    y -= Math.floor(Math.random() * (75-10) + 10)\n  } else if (frameCount % 60 === 0) {\n    y -= Math.floor(Math.random() * (100-50) + (50))\n  } else if (frameCount % 240 === 0) {\n    y += 300\n  }   else {\n    y += 0\n  }\n  \n  x1 += 1\n  x2 -= 2\n}\n\nfunction drawSquare1(y, offsetX, offsetY) {\n    stroke(0, 0, 214)\n  fill(255)\n  square(x1 - offsetX, y + offsetY, 40)\n  ellipse(y + offsetY, x1 - offsetX, 20)\n  fill(0, 255, 0)\n  square(x1, y + offsetY, 40)\n  ellipse(y + offsetY, x1, 20)\n}\n\nfunction drawSquare2(y, offsetX, offsetY) {\n    stroke(0, 0, 214)\n fill(0, 255, 0)\n  square(x2 + offsetX, y + offsetY, 40)\n  ellipse(y + offsetY, x2 + offsetX, 20)\n  fill(255)\n  square(x2, y + offsetY, 40)\n  ellipse( y + offsetY, x2, 20)\n}",
        "children": [],
        "fileType": "file",
        "_id": "63d4358a16643fed2c32b3c4",
        "isSelectedFile": true,
        "createdAt": "2024-03-22T21:56:22.949Z",
        "updatedAt": "2024-03-22T21:56:22.949Z",
        "id": "63d4358a16643fed2c32b3c4"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63d4358a16643fed2c32b3c5",
        "createdAt": "2024-03-22T21:56:22.949Z",
        "updatedAt": "2024-03-22T21:56:22.949Z",
        "isSelectedFile": false,
        "id": "63d4358a16643fed2c32b3c5"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63d4358a16643fed2c32b3c6",
        "createdAt": "2024-03-22T21:56:22.949Z",
        "updatedAt": "2024-03-22T21:56:22.949Z",
        "isSelectedFile": false,
        "id": "63d4358a16643fed2c32b3c6"
      }
    ],
    "createdAt": "2023-01-27T20:35:50.673Z",
    "id": "zlmBcieIT"
  },
  {
    "visibility": "Public",
    "_id": "8nanAdK3z",
    "name": "Star balaur",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "677dc4f948974ed8c25afa1a",
          "677dc4f948974ed8c25afa19",
          "677dc4f948974ed8c25afa1b"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "677dc4f948974ed8c25afa1c",
        "createdAt": "2025-01-08T00:42:54.386Z",
        "updatedAt": "2025-01-08T00:42:54.386Z",
        "id": "677dc4f948974ed8c25afa1c"
      },
      {
        "name": "sketch.js",
        "content": "let bg;\nlet bgi;\nlet maskLayer;\n\nfunction setup() {\n  createCanvas(400, 400);\n  bg = createGraphics(width, height);\n  maskLayer = createGraphics(width, height);\n  bgi = createImage(width, height);\n\n  makeBg();\n  makeMask();\n}\n\nfunction draw() {\n  background(220);\n  fill(22);\n  // plane(width, height);\n  bgi.mask(maskLayer)\n  // image(bgi, 0,0);\n  image(maskLayer,0,0)\n}\n\nfunction makeBg() {\n  for (let i = 0; i < height; i++) {\n    let d = dist(0, i, 0, height / 2);\n    let h = map(d, 0, height / 2, 255, 0);\n    bg.stroke(0, h, 255);\n    bg.line(0, i, width, i);\n  }\n\n  bgi.set(0, 0, bg);\n}\n\nfunction makeMask() {\n  maskLayer.fill(255);\n  maskLayer.circle(width / 2, height / 2, 200);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "677dc4f948974ed8c25afa19",
        "createdAt": "2025-01-08T00:42:54.386Z",
        "updatedAt": "2025-01-08T00:42:54.386Z",
        "id": "677dc4f948974ed8c25afa19"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677dc4f948974ed8c25afa1a",
        "createdAt": "2025-01-08T00:42:54.386Z",
        "updatedAt": "2025-01-08T00:42:54.386Z",
        "id": "677dc4f948974ed8c25afa1a"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677dc4f948974ed8c25afa1b",
        "createdAt": "2025-01-08T00:42:54.386Z",
        "updatedAt": "2025-01-08T00:42:54.386Z",
        "id": "677dc4f948974ed8c25afa1b"
      }
    ],
    "updatedAt": "2025-01-08T00:42:54.386Z",
    "createdAt": "2025-01-08T00:40:51.464Z",
    "id": "8nanAdK3z"
  },
  {
    "visibility": "Public",
    "_id": "Y4QXu3BaF",
    "name": "Summer equipment",
    "updatedAt": "2023-02-15T22:20:41.332Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "63ed58aad61e0d7ddd4bb879",
          "63ed58aad61e0d7ddd4bb878",
          "63ed58aad61e0d7ddd4bb87a"
        ],
        "fileType": "folder",
        "_id": "63ed58aad61e0d7ddd4bb87b",
        "createdAt": "2023-02-15T22:20:41.332Z",
        "updatedAt": "2023-02-15T22:20:41.332Z",
        "id": "63ed58aad61e0d7ddd4bb87b"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(400, 400);\n  angleMode(DEGREES)\n}\n\nfunction draw() {\n  background(0)\n  noStroke()\n  fill(0, 255, 0)\n  ellipse(200, 200, 100)\n  push()\n  rotate(-45)\n  rect(-13, 160, 25, 100)\n  pop()\n  push()\n  rotate(45)\n  rect(270, -120, 25, 100)\n pop()\n  ellipse(120, 120, 50)\n  ellipse(300, 100, 50)\n  \n}",
        "children": [],
        "fileType": "file",
        "_id": "63ed58aad61e0d7ddd4bb878",
        "isSelectedFile": true,
        "createdAt": "2023-02-15T22:20:41.332Z",
        "updatedAt": "2023-02-15T22:20:41.332Z",
        "id": "63ed58aad61e0d7ddd4bb878"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "63ed58aad61e0d7ddd4bb879",
        "createdAt": "2023-02-15T22:20:41.332Z",
        "updatedAt": "2023-02-15T22:20:41.332Z",
        "id": "63ed58aad61e0d7ddd4bb879"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "63ed58aad61e0d7ddd4bb87a",
        "createdAt": "2023-02-15T22:20:41.332Z",
        "updatedAt": "2023-02-15T22:20:41.332Z",
        "id": "63ed58aad61e0d7ddd4bb87a"
      }
    ],
    "createdAt": "2023-02-15T22:20:41.332Z",
    "id": "Y4QXu3BaF"
  },
  {
    "visibility": "Public",
    "_id": "WkdSxVFJs",
    "name": "teardrop",
    "updatedAt": "2023-07-13T18:45:22.914Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "64b0437cd6ee0b1846f6f8b9",
          "64b0437cd6ee0b1846f6f8b8",
          "64b0437cd6ee0b1846f6f8ba"
        ],
        "fileType": "folder",
        "_id": "64b0437cd6ee0b1846f6f8bb",
        "isSelectedFile": false,
        "createdAt": "2023-07-13T18:45:22.914Z",
        "updatedAt": "2023-07-13T18:45:22.914Z",
        "id": "64b0437cd6ee0b1846f6f8bb"
      },
      {
        "name": "sketch.js",
        "content": "function setup() {\n  createCanvas(400, 400);\n  translate(width/2, height/2)\n  beginShape()\n  vertex(0,0)\n  bezierVertex(0, 30, 50, 70, 50,100)\n  bezierVertex(50, 150, -50, 150, -50, 100)\n  bezierVertex(-50, 70, 0, 30,  0,0)\n  endShape()\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64b0437cd6ee0b1846f6f8b8",
        "isSelectedFile": true,
        "createdAt": "2023-07-13T18:45:22.914Z",
        "updatedAt": "2023-07-13T18:45:22.914Z",
        "id": "64b0437cd6ee0b1846f6f8b8"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "64b0437cd6ee0b1846f6f8b9",
        "isSelectedFile": false,
        "createdAt": "2023-07-13T18:45:22.914Z",
        "updatedAt": "2023-07-13T18:45:22.914Z",
        "id": "64b0437cd6ee0b1846f6f8b9"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64b0437cd6ee0b1846f6f8ba",
        "isSelectedFile": false,
        "createdAt": "2023-07-13T18:45:22.914Z",
        "updatedAt": "2023-07-13T18:45:22.914Z",
        "id": "64b0437cd6ee0b1846f6f8ba"
      }
    ],
    "createdAt": "2023-07-13T18:45:22.914Z",
    "id": "WkdSxVFJs"
  },
  {
    "_id": "AP-AMCVrj",
    "name": "Torch diagnostic",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68fa76773e445099e9c77a86",
          "68fa766a3e445099e9c77a83",
          "68fa766a3e445099e9c77a82",
          "68fa766a3e445099e9c77a84"
        ],
        "fileType": "folder",
        "_id": "68fa766a3e445099e9c77a85",
        "createdAt": "2025-10-23T18:51:11.636Z",
        "updatedAt": "2025-10-23T18:51:11.636Z",
        "id": "68fa766a3e445099e9c77a85"
      },
      {
        "name": "sketch.js",
        "content": "let cat;\nlet t = 0;\nlet pixelSize = 1;\n\nfunction preload() {\n  cat = loadImage(\"cat.jpg\");\n}\n\nfunction setup() {\n  createCanvas(cat.width, cat.height);\n  noStroke()\n}\n\nfunction draw() {\n  cat.loadPixels();\n  pixelSize = floor(map(sin(t),-1,1,1,40));\n  for (let x = 0; x < cat.width; x += pixelSize) {\n    for (let y = 0; y < cat.height; y += pixelSize) {\n      let i = (y * width + x) * 4;\n      let r = cat.pixels[i + 0]; // r\n      let g = cat.pixels[i + 1]; // g\n      let b = cat.pixels[i + 2]--; // b\n\n      fill(r, g, b);\n      rect(x, y, pixelSize, pixelSize);\n    }\n  }\n  t += 0.05;\n  // cat.updatePixels();\n  // image(cat, 0, 0);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68fa766a3e445099e9c77a82",
        "createdAt": "2025-10-23T18:51:11.636Z",
        "updatedAt": "2025-10-23T18:51:11.636Z",
        "id": "68fa766a3e445099e9c77a82"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "68fa766a3e445099e9c77a83",
        "createdAt": "2025-10-23T18:51:11.636Z",
        "updatedAt": "2025-10-23T18:51:11.636Z",
        "id": "68fa766a3e445099e9c77a83"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "68fa766a3e445099e9c77a84",
        "createdAt": "2025-10-23T18:51:11.636Z",
        "updatedAt": "2025-10-23T18:51:11.636Z",
        "id": "68fa766a3e445099e9c77a84"
      },
      {
        "name": "cat.jpg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/c47490a2-d8e8-4010-9dee-779d1140b970.jpg",
        "children": [],
        "fileType": "file",
        "_id": "68fa76773e445099e9c77a86",
        "createdAt": "2025-10-23T18:51:11.636Z",
        "updatedAt": "2025-10-23T18:51:11.636Z",
        "id": "68fa76773e445099e9c77a86"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-23T18:51:11.637Z",
    "createdAt": "2025-10-23T18:51:11.637Z",
    "id": "AP-AMCVrj"
  },
  {
    "visibility": "Public",
    "_id": "BwLQzw_fX",
    "name": "two eyes class",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "64375cf3205e2f9dbb0041c0",
          "64375cf3205e2f9dbb0041c1",
          "64375cf3205e2f9dbb0041c2"
        ],
        "fileType": "folder",
        "_id": "64375cf3205e2f9dbb0041bf",
        "createdAt": "2023-04-13T02:53:14.675Z",
        "updatedAt": "2023-04-13T02:53:14.675Z",
        "isSelectedFile": false,
        "id": "64375cf3205e2f9dbb0041bf"
      },
      {
        "name": "sketch.js",
        "content": "let pink, green, darkBlue, lightBlue, yellow\nlet h, w, h2\nlet cloudArray = []\nlet colorArray = []\nlet eyes\nlet mouse\n\nfunction setup() {\n  createCanvas(600, 400);\n  \n  h = height\n  w = width\n  pink = color(245, 112, 250)\n  green = color(93, 212, 38)\n  darkBlue = color(0, 10, 122)\n  lightBlue = color(78, 189, 252)\n  yellow = color(237, 219, 21)\n  colorArray.push(green,darkBlue,yellow, pink)\n  stroke(darkBlue)\n  strokeWeight(1.75)\n  strokeCap(ROUND)\n  \n  for (let i = 0; i < 4; i++) {\n     const y = random(0.2, 0.8)\n      const x = random(-0.6, 0)\n    cloudArray.push(new Cloud(x, y))\n  }\n\n  eyes = new Eye(20, w/2 - 20, -76, w/2 + 20, w - 20)\n  // background(lightBlue);\n}\n\nfunction draw() {\n  background(lightBlue);\n  \n  cloudArray.forEach(cloud => {\n    cloud.update()\n    cloud.draw()\n  })\n  \n  stroke(darkBlue)\n  eyes.draw()\n  \n}\n\nfunction mouseMoved() {\n  mouse = (w/2 - mouseX) / 1800\n  console.log(mouse)\n}\n\nclass Eye {\n  constructor (lStart,lEnd,outlineH, rStart, rEnd) {\n\n    this.lStart = lStart\n    this.lEnd = lEnd\n    this.rStart = rStart\n    this.rEnd = rEnd\n    this.outlineH = outlineH\n    this.s = 50\n    this.ratio = 360 / this.s\n    this.pupilDiam = 0.3\n    this.midPoint = h/2\n  }\n\n  \n  drawOutline() {\n    // fill(pink)\n    fill(green)\n    beginShape()\n      vertex(-1, h+1);\n      vertex(w+1, h+1);\n      vertex(w+1, -1);\n      vertex(-1,-1);\n        beginContour()\n          vertex(this.lStart, this.midPoint + 10)\n          quadraticVertex(5, h * 0.5, this.lStart, this.midPoint - 10)\n          quadraticVertex(w*0.25, -this.outlineH * 1.2, this.lEnd, this.midPoint - 10)\n          quadraticVertex(w/2-5, this.midPoint, this.lEnd, this.midPoint + 10)\n          quadraticVertex(w/4, h + this.outlineH, this.lStart, this.midPoint + 10)\n        endContour()\n    beginContour()\n          vertex(this.rStart, h/2 + 10)\n          quadraticVertex(w/2+5, h * 0.5, this.rStart, h / 2 - 10)\n          quadraticVertex(w*0.75, -this.outlineH*1.2, this.rEnd, h/2 - 10)\n          quadraticVertex(w-5, h/2, this.rEnd, h / 2 + 10)\n          quadraticVertex(w*0.75, h + this.outlineH, this.rStart, h/2 + 10)\n        endContour()\n      endShape()\n  }\n  \n  drawPupil() {\n    fill(yellow)\n    beginShape()\n      vertex(0, h);\n      vertex(w, h);\n      vertex(w, 0);\n      vertex(0, 0);\n      beginContour()\n        for(let i = 0; i < this.s; i++) {\n          const x = cos(radians(i * this.ratio)) * h/2*this.pupilDiam;\n          const y = sin(radians(i * this.ratio)) * h/2*this.pupilDiam;\n          vertex(x+w*(-mouse + 0.25), y+h*0.5);\n        }\n      endContour()\n    beginContour()\n        for(let i = 0; i < this.s; i++) {\n          const x = cos(radians(i * this.ratio)) * h/2*this.pupilDiam;\n          const y = sin(radians(i * this.ratio)) * h/2*this.pupilDiam;\n     \n          vertex(x+w*(-mouse + 0.75), y+h*0.5);\n        }\n      endContour()\n    endShape()\n  }\n  \n  draw() {\n    this.drawPupil()\n    this.drawOutline()\n  }\n  \n}\n\n\nclass Cloud {\n  constructor(x,y) {\n    this.x = x\n    this.y = y\n    this.color = pink\n  }\n  \n  \n  draw() {\n  fill(255, 253, 237)\n    // fill(this.color)\n  noStroke()\n  push()\n    translate(w*this.x,h*this.y)\n    beginShape()\n      vertex(-40,6)\n      quadraticVertex(-140, 4, -40, -6)\n      quadraticVertex(-28, -28, -10, -22)\n      quadraticVertex(0, -50, 18, -42)\n      quadraticVertex(48, -80, 100, -42)\n      quadraticVertex(140, -40, 132, -18)\n      quadraticVertex(268, 2, 118, 6)\n    endShape()\n  pop()\n  }\n  \n   update() {\n    if (frameCount % 2 === 0) {\n      if (this.x < 1) {\n        this.x += 0.006\n      } else {\n        this.y = random(0.2, 0.8)\n        this.x = floor(random(-2, 0))\n        // const i = floor(random(0, colorArray.length))\n        // this.color = colorArray[i]\n      }\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64375cf3205e2f9dbb0041c1",
        "isSelectedFile": true,
        "createdAt": "2023-04-13T02:53:14.675Z",
        "updatedAt": "2023-04-13T02:53:14.675Z",
        "id": "64375cf3205e2f9dbb0041c1"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "64375cf3205e2f9dbb0041c0",
        "createdAt": "2023-04-13T02:53:14.675Z",
        "updatedAt": "2023-04-13T02:53:14.675Z",
        "isSelectedFile": false,
        "id": "64375cf3205e2f9dbb0041c0"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "64375cf3205e2f9dbb0041c2",
        "createdAt": "2023-04-13T02:53:14.675Z",
        "updatedAt": "2023-04-13T02:53:14.675Z",
        "isSelectedFile": false,
        "id": "64375cf3205e2f9dbb0041c2"
      }
    ],
    "createdAt": "2023-04-13T01:37:55.391Z",
    "updatedAt": "2023-04-13T02:53:14.675Z",
    "id": "BwLQzw_fX"
  },
  {
    "visibility": "Public",
    "_id": "Lm3a3tOHL",
    "name": "video stuff",
    "updatedAt": "2024-03-04T18:56:36.340Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65e0e94d61874ae32aa41b32",
          "65e0e94d61874ae32aa41b31",
          "65e0e94d61874ae32aa41b33"
        ],
        "fileType": "folder",
        "_id": "65e0e94d61874ae32aa41b34",
        "isSelectedFile": false,
        "createdAt": "2024-03-04T18:56:36.340Z",
        "updatedAt": "2024-03-04T18:56:36.340Z",
        "id": "65e0e94d61874ae32aa41b34"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet vScale = 1;\nlet scans = []\nlet offset = 0\nlet slitWidth = 4\n\nfunction setup() {\n  createCanvas(400, 200);\n  pixelDensity(1);\n  cam = createCapture(VIDEO);\n  cam.size(width, height).hide()\n background(0,255,0);\n}\n\nfunction draw() {\n  // background(0,255,0);\n  // drawImageWithSquares()\n  slitScanCopy()\n}\n\nfunction slitScanCopy() {\n  cam.loadPixels()\n  let w = cam.width\n  let h = cam.height\n  \n  copy(cam, w/2, 0, slitWidth,h, offset, 0, slitWidth, h)\n  offset = (offset + 1) % width\n}\n\n\nfunction slitScan() {\n  let slitX = 200\n  loadPixels()\n  cam.loadPixels()\n  let scanned = []\n  for (let y = 0; y < cam.height; y++) {\n    let p = cam.get(slitX, y)\n    scanned[y] = p\n  }\n  \n  for (let i = 0; i < scanned.length; i++) {\n    set(offset, i, scanned[i])\n  }\n    offset = (offset + 1) % width\n  updatePixels()\n \n}\n\nfunction drawImageWithSquares() {\n   cam.loadPixels();\n  for (let y = 0; y < cam.height; y++) {\n    for (let x = 0; x < cam.width; x++) {\n      let index = (x + y * cam.width) * 4;\n\n      let r = cam.pixels[index];\n      let g = cam.pixels[index + 1];\n      let b = cam.pixels[index + 2];\n      let a = cam.pixels[index + 3];\n      \n      noStroke();\n      bright = (r +g +b)/3\n      const w = map(bright, 0, 255,1,vScale)\n      fill(r,g,b)\n      // const c = (bright) % 360\n      // fill(c, 100, 50);\n      const vX = (x * vScale ) + (vScale * 0.5)\n      const vY = (y * vScale ) + (vScale * 0.5)\n      rect(vX, vY, w, w);\n\n    }\n  }\n}",
        "children": [],
        "fileType": "file",
        "_id": "65e0e94d61874ae32aa41b31",
        "isSelectedFile": true,
        "createdAt": "2024-03-04T18:56:36.340Z",
        "updatedAt": "2024-03-04T18:56:36.340Z",
        "id": "65e0e94d61874ae32aa41b31"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65e0e94d61874ae32aa41b32",
        "isSelectedFile": false,
        "createdAt": "2024-03-04T18:56:36.340Z",
        "updatedAt": "2024-03-04T18:56:36.340Z",
        "id": "65e0e94d61874ae32aa41b32"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65e0e94d61874ae32aa41b33",
        "isSelectedFile": false,
        "createdAt": "2024-03-04T18:56:36.340Z",
        "updatedAt": "2024-03-04T18:56:36.340Z",
        "id": "65e0e94d61874ae32aa41b33"
      }
    ],
    "createdAt": "2024-02-29T21:26:55.345Z",
    "id": "Lm3a3tOHL"
  },
  {
    "_id": "8WiB_myJU",
    "name": "vl palette 3",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68deafd40be4340b861e2f4c",
          "68deafd40be4340b861e2f4b",
          "68deafd40be4340b861e2f4d"
        ],
        "fileType": "folder",
        "_id": "68deafd40be4340b861e2f4e",
        "createdAt": "2025-10-02T17:01:59.464Z",
        "updatedAt": "2025-10-02T17:01:59.464Z",
        "id": "68deafd40be4340b861e2f4e"
      },
      {
        "name": "sketch.js",
        "content": "// this one is inspired by, a.k.a. stolen from Vera Molnár\n// in particular, this work: https://cdn.prod.website-files.com/61e6c06a23cb13bf76051194/630371e22764636d16d0f04e_Screen%20Shot%202022-08-22%20at%2014.08.41.png\n\nconst myPalette = ['#FA6E41', '#E1CA0B', '#5774FA', '#2F9213', '#805041'];\n\nlet squareSize;\nlet squareAmt = 6;\n\nfunction setup() {\n  createCanvas(600, 600);\n  noStroke();\n\n  // make sure that the squares fit evenly on the canvas no matter how many there are\n  squareSize = width / squareAmt;\n  rectMode(CENTER);\n\n  let bg = random(myPalette);\n  // don't use the background color in the rest of the squares\n  let currPalette = myPalette.filter((x) => x != bg);\n  background(bg);\n  // iterate along the x axis\n  for (let i = 0; i < squareAmt; i++) {\n    //iterate along the y axis\n    for (let j = 0; j < squareAmt; j++) {\n      // add half the width of the squares to center them\n      let x = squareSize * i + squareSize * 0.5;\n      let y = squareSize * j + squareSize * 0.5;\n      // subtract a random amount from the initial width\n      let w = squareSize - ceil(random(10, 20));\n      // set a previous fill so that we can make sure we don't draw two squares in a row in the same color\n      let prevFill = random(currPalette);\n\n      // draw four squares, shrinking by a random amount each time\n      for (let k = 0; k < 4; k++) {\n        // select a new color\n        currFill = random(currPalette);\n        // if it's the same as the previous one, select again, until they're different\n        do {\n          currFill = random(currPalette);\n        } while (currFill == prevFill);\n\n        push();\n        fill(currFill);\n        // translate the canvas's origin to the coordinates of the square's center so we can rotate it around it's center\n        translate(x, y);\n        let degrees = QUARTER_PI / 8;\n        rotate(random(-degrees, degrees));\n        square(0, 0, w);\n        pop();\n        // subtract another random amount from the width\n        w -= ceil(random(10, 20));\n        // update the previous fill so we know what color was just drawn\n        prevFill = currFill;\n      }\n    }\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68deafd40be4340b861e2f4b",
        "createdAt": "2025-10-02T17:01:59.464Z",
        "updatedAt": "2025-10-02T17:01:59.464Z",
        "id": "68deafd40be4340b861e2f4b"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "68deafd40be4340b861e2f4c",
        "createdAt": "2025-10-02T17:01:59.464Z",
        "updatedAt": "2025-10-02T17:01:59.464Z",
        "id": "68deafd40be4340b861e2f4c"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "68deafd40be4340b861e2f4d",
        "createdAt": "2025-10-02T17:01:59.464Z",
        "updatedAt": "2025-10-02T17:01:59.464Z",
        "id": "68deafd40be4340b861e2f4d"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-02T17:01:59.464Z",
    "createdAt": "2025-10-02T17:01:33.239Z",
    "id": "8WiB_myJU"
  },
  {
    "_id": "ChKmT-nR9",
    "name": "vl-gradient-1",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68deaee7bb374e792d08f679",
          "68deaee7bb374e792d08f678",
          "68deaee7bb374e792d08f67a"
        ],
        "fileType": "folder",
        "_id": "68deaee7bb374e792d08f67b",
        "createdAt": "2025-10-02T16:58:59.186Z",
        "updatedAt": "2025-10-02T16:58:59.186Z",
        "id": "68deaee7bb374e792d08f67b"
      },
      {
        "name": "sketch.js",
        "content": "// this idea was inspired by this sketch by Roni Kaufman:\n// https://openprocessing.org/sketch/2501172\n// I also used some code ideas from it\n\nconst myPalette = ['#FA6E41', '#E1CA0B', '#5774FA', '#2F9213', '#805041'];\n\nlet rowHeight = 20;\nlet y = 0;\n\nfunction setup() {\n  createCanvas(600, 600);\n  let rows = height / rowHeight;\n  for (let i = 0; i < rows; i++) {\n    generateRow();\n  }\n}\n\nfunction generateRow() {\n  let remainingLength = width;\n  let maxDivisor = width / rowHeight;\n  let currentX = 0;\n\n  let w = width / ceil(random(maxDivisor));\n  while (remainingLength > 0) {\n    let randomColor = random(myPalette);\n    stroke(randomColor);\n    fill(randomColor);\n    rect(currentX, y * rowHeight, w, rowHeight);\n    currentX += w;\n    remainingLength -= w;\n  }\n  y++;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68deaee7bb374e792d08f678",
        "createdAt": "2025-10-02T16:58:59.186Z",
        "updatedAt": "2025-10-02T16:58:59.186Z",
        "id": "68deaee7bb374e792d08f678"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "68deaee7bb374e792d08f679",
        "createdAt": "2025-10-02T16:58:59.186Z",
        "updatedAt": "2025-10-02T16:58:59.186Z",
        "id": "68deaee7bb374e792d08f679"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "68deaee7bb374e792d08f67a",
        "createdAt": "2025-10-02T16:58:59.186Z",
        "updatedAt": "2025-10-02T16:58:59.186Z",
        "id": "68deaee7bb374e792d08f67a"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-02T16:58:59.187Z",
    "createdAt": "2025-10-02T16:58:59.187Z",
    "id": "ChKmT-nR9"
  },
  {
    "_id": "tjkQaSWZd",
    "name": "vl-palette 2",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68deaf970be4340b861e2f48",
          "68deaf970be4340b861e2f47",
          "68deaf970be4340b861e2f49"
        ],
        "fileType": "folder",
        "_id": "68deaf970be4340b861e2f4a",
        "createdAt": "2025-10-02T17:00:28.280Z",
        "updatedAt": "2025-10-02T17:00:28.280Z",
        "id": "68deaf970be4340b861e2f4a"
      },
      {
        "name": "sketch.js",
        "content": "const myPalette = ['#FA6E41', '#E1CA0B', '#5774FA', '#2F9213', '#805041'];\n\nlet tileSize;\n\nfunction setup() {\n  createCanvas(600, 600);\n  strokeCap(SQUARE);\n  tileSize = width / 10;\n  background(244);\n  makeTiles();\n}\n\nfunction makeTiles() {\n  for (let i = 0; i < width / tileSize; i++) {\n    for (let j = 0; j < width / tileSize; j++) {\n      const x = i * tileSize;\n      const y = j * tileSize;\n      const variant = floor(random(4));\n      push();\n      translate(x, y);\n      tile(variant);\n      pop();\n    }\n  }\n}\n\nfunction tile(variant) {\n  let strokeColor = random(myPalette);\n\n  do {\n    fillColor = random(myPalette);\n  } while (fillColor == strokeColor);\n\n  strokeWeight(4);\n  noStroke();\n  fill(fillColor);\n  square(0, 0, tileSize);\n  noFill();\n  stroke(strokeColor);\n\n  switch (variant) {\n    case 0:\n      arc(0, 0, tileSize + 1, tileSize + 1, 0, HALF_PI);\n      arc(tileSize, tileSize, tileSize, tileSize, PI, PI + HALF_PI);\n      break;\n    case 1:\n      arc(0, tileSize, tileSize, tileSize, PI + HALF_PI, 0);\n      arc(tileSize, 0, tileSize, tileSize, HALF_PI, PI);\n      break;\n    case 2:\n      arc(0, 0, tileSize, tileSize, 0, HALF_PI);\n      arc(tileSize, tileSize, tileSize, tileSize, PI, PI + HALF_PI);\n      break;\n    case 3:\n      arc(0, tileSize, tileSize, tileSize, PI + HALF_PI, 0);\n      arc(tileSize, 0, tileSize, tileSize, HALF_PI, PI);\n      break;\n    default:\n      break;\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68deaf970be4340b861e2f47",
        "createdAt": "2025-10-02T17:00:28.280Z",
        "updatedAt": "2025-10-02T17:00:28.280Z",
        "id": "68deaf970be4340b861e2f47"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "68deaf970be4340b861e2f48",
        "createdAt": "2025-10-02T17:00:28.280Z",
        "updatedAt": "2025-10-02T17:00:28.280Z",
        "id": "68deaf970be4340b861e2f48"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "68deaf970be4340b861e2f49",
        "createdAt": "2025-10-02T17:00:28.280Z",
        "updatedAt": "2025-10-02T17:00:28.280Z",
        "id": "68deaf970be4340b861e2f49"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-02T17:00:28.280Z",
    "createdAt": "2025-10-02T17:00:28.280Z",
    "id": "tjkQaSWZd"
  },
  {
    "_id": "Xk0-7grmG",
    "name": "vl-palette 4",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "68deb02c0be4340b861e2f50",
          "68deb02c0be4340b861e2f4f",
          "68deb02c0be4340b861e2f51",
          "68deb0b54f280e0eea737be0"
        ],
        "fileType": "folder",
        "_id": "68deb02c0be4340b861e2f52",
        "createdAt": "2025-10-02T17:04:58.635Z",
        "updatedAt": "2025-10-02T17:04:58.635Z",
        "id": "68deb02c0be4340b861e2f52"
      },
      {
        "name": "sketch.js",
        "content": "let myPalette = [\n  [250, 110, 65],\n  [225, 202, 11],\n  [87, 116, 250],\n  [47, 146, 19],\n  [128, 60, 65],\n];\n\nlet img;\n\nfunction preload() {\n  img = loadImage('vera.jpg');\n}\n\nfunction setup() {\n  pixelDensity(1);\n  img.resize(600, 0);\n  createCanvas(img.width, img.height);\n\n  img.loadPixels();\n\n  for (let y = 0; y < img.height; y++) {\n    for (let x = 0; x < img.width; x++) {\n      let index = (x + y * width) * 4;\n      let r = img.pixels[index];\n      let g = img.pixels[index + 1];\n      let b = img.pixels[index + 2];\n      let a = img.pixels[index + 3];\n\n      let bright = brightness([r, g, b, a]);\n\n      if (bright < 30) {\n        r = myPalette[2][0];\n        g = myPalette[2][1];\n        b = myPalette[2][2];\n      } else if (bright < 60) {\n        r = myPalette[3][0];\n        g = myPalette[3][1];\n        b = myPalette[3][2];\n      } else {\n        r = myPalette[1][0];\n        g = myPalette[1][1];\n        b = myPalette[1][2];\n      }\n\n      // if (bright < 20) {\n      //   r = myPalette[2][0];\n      //   g = myPalette[2][1];\n      //   b = myPalette[2][2];\n      // } else if (bright < 40) {\n      //   r = myPalette[4][0];\n      //   g = myPalette[4][1];\n      //   b = myPalette[4][2];\n      // } else if (bright < 60) {\n      //   r = myPalette[0][0];\n      //   g = myPalette[0][1];\n      //   b = myPalette[0][2];\n      // }\n      // else if (bright < 80) {\n      //   r = myPalette[3][0];\n      //   g = myPalette[3][1];\n      //   b = myPalette[3][2];\n      // } else {\n      //   r = myPalette[1][0];\n      //   g = myPalette[1][1];\n      //   b = myPalette[1][2];\n      // }\n\n      img.pixels[index] = r;\n      img.pixels[index + 1] = g;\n      img.pixels[index + 2] = b;\n      img.pixels[index + 3] = 200;\n    }\n  }\n  img.updatePixels();\n  image(img, 0, 0);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "68deb02c0be4340b861e2f4f",
        "createdAt": "2025-10-02T17:04:58.635Z",
        "updatedAt": "2025-10-02T17:04:58.635Z",
        "id": "68deb02c0be4340b861e2f4f"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "68deb02c0be4340b861e2f50",
        "createdAt": "2025-10-02T17:04:58.635Z",
        "updatedAt": "2025-10-02T17:04:58.635Z",
        "id": "68deb02c0be4340b861e2f50"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "68deb02c0be4340b861e2f51",
        "createdAt": "2025-10-02T17:04:58.635Z",
        "updatedAt": "2025-10-02T17:04:58.635Z",
        "id": "68deb02c0be4340b861e2f51"
      },
      {
        "name": "vera.jpg",
        "content": "",
        "url": "https://assets.editor.p5js.org/63d433b8b2735f001a901865/d2103a93-43c0-4276-9775-6473db261745.jpg",
        "children": [],
        "fileType": "file",
        "_id": "68deb0b54f280e0eea737be0",
        "createdAt": "2025-10-02T17:04:58.635Z",
        "updatedAt": "2025-10-02T17:04:58.635Z",
        "id": "68deb0b54f280e0eea737be0"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-10-02T17:04:58.635Z",
    "createdAt": "2025-10-02T17:02:51.265Z",
    "id": "Xk0-7grmG"
  },
  {
    "visibility": "Public",
    "_id": "LZ4mRhjJW",
    "name": "wave gradients",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65d94c3fbf61555ff4239606",
          "65d94c3fbf61555ff4239607",
          "65d94c3fbf61555ff4239608",
          "65d94c524e6d07001a1f8d0e"
        ],
        "fileType": "folder",
        "_id": "65d94c3fbf61555ff4239605",
        "isSelectedFile": false,
        "createdAt": "2024-05-27T16:46:32.769Z",
        "updatedAt": "2024-05-27T16:46:32.769Z",
        "id": "65d94c3fbf61555ff4239605"
      },
      {
        "name": "sketch.js",
        "content": "let phaseShiftSlider, freqSlider;\nlet wave;\nfunction setup() {\n  createCanvas(400, 400);\n  phaseShiftSlider = createSlider(0, 2, 0.5, 0.01);\n  freqSlider = createSlider(0, 800, 200, 1);\n  wave = new SineWave(255, freqSlider.value(), 0, phaseShiftSlider.value());\n  //  wave = new SquareWave(255, freqSlider.value(), 0, phaseShiftSlider.value());\n  // wave = new SawtoothWave(255, freqSlider.value(), 0, phaseShiftSlider.value());\n}\n\nfunction draw() {\n  background(220);\n\n  loadPixels();\n  let period = freqSlider.value();\n  let phaseShift = phaseShiftSlider.value();\n\n  for (let r = 0; r < height; r++) {\n    for (let c = 0; c < width; c++) {\n      let l = wave.evaluate(c);\n      let hue = color(100, l, 200);\n      set(c, r, hue);\n    }\n  }\n\n  updatePixels();\n  wave.setPeriod(period);\n  wave.setPhaseShift(phaseShift);\n  wave.update();\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d94c3fbf61555ff4239607",
        "isSelectedFile": true,
        "createdAt": "2024-05-27T16:46:32.769Z",
        "updatedAt": "2024-05-27T16:46:32.769Z",
        "id": "65d94c3fbf61555ff4239607"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"waves.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65d94c3fbf61555ff4239606",
        "isSelectedFile": false,
        "createdAt": "2024-05-27T16:46:32.769Z",
        "updatedAt": "2024-05-27T16:46:32.769Z",
        "id": "65d94c3fbf61555ff4239606"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d94c3fbf61555ff4239608",
        "isSelectedFile": false,
        "createdAt": "2024-05-27T16:46:32.769Z",
        "updatedAt": "2024-05-27T16:46:32.769Z",
        "id": "65d94c3fbf61555ff4239608"
      },
      {
        "name": "waves.js",
        "content": "class Wave {\n  constructor(amp, period, phase, phaseShift) {\n    this.amp = amp;\n    this.period = period;\n    this.phase = phase;\n    this.phaseShift = phaseShift;\n  }\n\n  update() {\n    this.phase += this.phaseShift;\n  }\n\n  setPhaseShift(v) {\n    this.phaseShift = v;\n  }\n\n  setPeriod(v) {\n    this.period = v;\n  }\n}\n\nclass SineWave extends Wave {\n  constructor(amp, period, phase, phaseShift) {\n    super(amp, period, phase, phaseShift);\n  }\n\n  evaluate(x) {\n    let y = sin(this.phase + (TWO_PI * x) / this.period);\n    let normalized = map(y, -1, 1, 0, this.amp);\n\n    return normalized;\n  }\n}\n\nclass SquareWave extends Wave {\n  constructor(amp, period, phase, phaseShift) {\n    super(amp, period, phase, phaseShift);\n  }\n\n  sgn(v) {\n    if (v > 0) {\n      return 1;\n    } else if (v < 0) {\n      return -1;\n    } else {\n      return 0;\n    }\n  }\n  \n  evaluate(x) {\n    let y = sin(this.phase + (TWO_PI * x) / this.period);\n    let normalized = map(this.sgn(y), -1, 1, 0, this.amp);\n\n    return normalized;\n  }\n}\n\nclass SawtoothWave extends Wave {\n  constructor(amp, period, phase, phaseShift) {\n    super(amp, period, phase, phaseShift);\n  }\n  \n  evaluate(x) {\n    let a = (x + this.phase) / this.period;\n    let saw = 2 * (a - floor(0.5 + a));\n    let normalized = map(saw, -1, 1, 0, this.amp);\n    \n    return normalized;\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65d94c524e6d07001a1f8d0e",
        "isSelectedFile": false,
        "updatedAt": "2024-05-27T16:46:32.769Z",
        "createdAt": "2024-05-27T16:46:32.769Z",
        "id": "65d94c524e6d07001a1f8d0e"
      }
    ],
    "createdAt": "2024-02-24T01:54:07.756Z",
    "updatedAt": "2024-05-27T16:46:32.769Z",
    "id": "LZ4mRhjJW"
  },
  {
    "_id": "MxtxeamgY",
    "name": "website POV",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "6910cb7df00fcc1d9e89d4bb",
          "6910cb7df00fcc1d9e89d4ba",
          "6910cb7df00fcc1d9e89d4bc"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "6910cb7df00fcc1d9e89d4bd",
        "createdAt": "2025-11-09T17:56:15.597Z",
        "updatedAt": "2025-11-09T17:56:15.597Z",
        "id": "6910cb7df00fcc1d9e89d4bd"
      },
      {
        "name": "sketch.js",
        "content": "let cam;\nlet sitePOV = false;\nlet switchButton;\n\nfunction setup() {\n  createCanvas(400, 400);\n  colorMode(HSB)\n  noStroke()\n  \n  cam = createCapture(VIDEO, onCamLoad)\n  cam.hide();\n  \n  switchButton = createButton('Change POV')\n  switchButton.position(10,10)\n  switchButton.mousePressed(switchPOV)\n  noCursor()\n}\n\nfunction onCamLoad() {\n    resizeCanvas(cam.width, cam.height)\n}\n\nfunction switchPOV() {\n  sitePOV = !sitePOV\n}\n\nfunction draw() {\n  \n  if (!sitePOV) {\n      // cursor()\n    drawScreen()\n  } else {\n    drawSitePOV()\n  }\n}\n\nfunction drawScreen(alpha = 1) {\n  fill(120,80,90,alpha)\n  rect(0,0,width,height)\n  fill(200,80,90)\n  switchButton.position(10,10)\n  circle(width/4,height/2,100)\n   fill(100,0,90)\n  triangle(mouseX+30,mouseY+10,mouseX+10, mouseY+25,mouseX,mouseY)\n}\n\nfunction drawSitePOV () {\n  image(cam,0,0)\n  scale(-1,1)\n  translate(-width,0)\n  drawScreen(0.5)\n\n}",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "6910cb7df00fcc1d9e89d4ba",
        "createdAt": "2025-11-09T17:56:15.597Z",
        "updatedAt": "2025-11-09T17:56:15.597Z",
        "id": "6910cb7df00fcc1d9e89d4ba"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/p5.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/p5@1.11.11/lib/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6910cb7df00fcc1d9e89d4bb",
        "createdAt": "2025-11-09T17:56:15.597Z",
        "updatedAt": "2025-11-09T17:56:15.597Z",
        "id": "6910cb7df00fcc1d9e89d4bb"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "6910cb7df00fcc1d9e89d4bc",
        "createdAt": "2025-11-09T17:56:15.597Z",
        "updatedAt": "2025-11-09T17:56:15.597Z",
        "id": "6910cb7df00fcc1d9e89d4bc"
      }
    ],
    "visibility": "Public",
    "updatedAt": "2025-11-09T17:56:15.597Z",
    "createdAt": "2025-11-09T17:42:14.308Z",
    "id": "MxtxeamgY"
  },
  {
    "visibility": "Public",
    "_id": "sWb--Bare",
    "name": "wheel",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65dc3a74a94e501180d8222f",
          "65dc3a74a94e501180d82230",
          "65dc3a74a94e501180d82231"
        ],
        "fileType": "folder",
        "_id": "65dc3a74a94e501180d8222e",
        "createdAt": "2024-02-26T08:08:09.881Z",
        "updatedAt": "2024-02-26T08:08:09.881Z",
        "isSelectedFile": false,
        "id": "65dc3a74a94e501180d8222e"
      },
      {
        "name": "sketch.js",
        "content": "let rotation = 0;\nlet angle = 0\n\nfunction setup() {\n  createCanvas(600, 400);\n  colorMode(HSL);\n}\n\nfunction draw() {\n  background(200, 100, 60);\n  noFill();\n  stroke(60,100,50);\n  translate(100, 200);\n  const r = 60\n  ellipse(0,0, 2 * r)\n  const x = cos(angle) * r \n  const y = sin(angle) * r\n  let r2= 10\n  ellipse(x,y, 2 * r2)\n  line(x,y,160, y)\n  square(160, y-60, 60)\n  let y2 = map(y, -r, r, -1.5 * r, 1.5 * r)\n  ellipse(210, y-10, 20)\n  line(210, y-10, 340, y2)\n  push()\n  translate(-50, -10)\n  rect(340, y2,100,20)\n  pop()\n  angle += 0.1\n  rotation += 0.001\n  // time += 0.01\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc3a74a94e501180d82230",
        "isSelectedFile": true,
        "createdAt": "2024-02-26T08:08:09.881Z",
        "updatedAt": "2024-02-26T08:08:09.881Z",
        "id": "65dc3a74a94e501180d82230"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc3a74a94e501180d8222f",
        "createdAt": "2024-02-26T08:08:09.881Z",
        "updatedAt": "2024-02-26T08:08:09.881Z",
        "isSelectedFile": false,
        "id": "65dc3a74a94e501180d8222f"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65dc3a74a94e501180d82231",
        "createdAt": "2024-02-26T08:08:09.881Z",
        "updatedAt": "2024-02-26T08:08:09.881Z",
        "isSelectedFile": false,
        "id": "65dc3a74a94e501180d82231"
      }
    ],
    "createdAt": "2024-02-26T07:15:01.109Z",
    "updatedAt": "2024-02-26T08:08:09.881Z",
    "id": "sWb--Bare"
  },
  {
    "visibility": "Public",
    "_id": "LYiv0Z4je",
    "name": "wobbles",
    "updatedAt": "2024-03-05T21:44:29.953Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65e77368e19230b1dcfae04b",
          "65e77368e19230b1dcfae04a",
          "65e77368e19230b1dcfae04c",
          "65e77372e19230b1dcfae04e"
        ],
        "fileType": "folder",
        "_id": "65e77368e19230b1dcfae04d",
        "isSelectedFile": false,
        "createdAt": "2024-03-05T21:44:29.953Z",
        "updatedAt": "2024-03-05T21:44:29.953Z",
        "id": "65e77368e19230b1dcfae04d"
      },
      {
        "name": "sketch.js",
        "content": "let wobbles = [];\nlet colors = []\nlet index = 0;\nlet amount = 10\n\nfunction setup() {\n  createCanvas(600, 400);\n  colorMode(HSL)\n  for (let i = 0; i < amount; i++) {\n    let h = map(i, 0, amount, 50, 200 )\n    colors.push(color(h, 100, 50, 0.5))\n  }\n}\n\nfunction draw() {\n  // background(0,100,50);\n  if (frameCount % 120 == 0) {\n    let newFill = colors[index];\n    wobbles.push(new Wobble(newFill));\n    index = (index + 1) % colors.length;\n  }\n  for (let wobble of wobbles) {\n    wobble.update();\n    wobble.show();\n    if (wobble.r > width * 0.9) {\n      wobbles.shift();\n    }\n  }\n\n  // noLoop()\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65e77368e19230b1dcfae04a",
        "isSelectedFile": true,
        "createdAt": "2024-03-05T21:44:29.953Z",
        "updatedAt": "2024-03-05T21:44:29.953Z",
        "id": "65e77368e19230b1dcfae04a"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"wobble.js\"></script>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "_id": "65e77368e19230b1dcfae04b",
        "isSelectedFile": false,
        "createdAt": "2024-03-05T21:44:29.953Z",
        "updatedAt": "2024-03-05T21:44:29.953Z",
        "id": "65e77368e19230b1dcfae04b"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65e77368e19230b1dcfae04c",
        "isSelectedFile": false,
        "createdAt": "2024-03-05T21:44:29.953Z",
        "updatedAt": "2024-03-05T21:44:29.953Z",
        "id": "65e77368e19230b1dcfae04c"
      },
      {
        "name": "wobble.js",
        "content": "class Wobble {\n  constructor(fill) {\n    this.time = 0;\n    this.r = 1;\n    this.inc = 0.1;\n    this.noiseMax = 1;\n    this.fill = fill;\n  }\n\n  update() {\n    this.r += 0.4;\n  }\n\n  show() {\n    push();\n    translate(width / 2, height / 2);\n    stroke(255);\n    noStroke();\n    fill(this.fill);\n    // noFill();\n    beginShape();\n\n    for (let a = 0; a < TWO_PI; a += this.inc) {\n      let xoff = map(cos(a), -1, 1, 0, this.noiseMax);\n      let yoff = map(sin(a), -1, 1, 0, this.noiseMax);\n      let r = map(\n        noise(xoff, yoff, this.time),\n        0,\n        1,\n        this.r * 0.8,\n        this.r * 1.2\n      );\n      let x = cos(a) * r;\n      let y = sin(a) * r;\n      vertex(x, y);\n    }\n    endShape(CLOSE);\n    pop();\n    this.time += 0.01;\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "_id": "65e77372e19230b1dcfae04e",
        "isSelectedFile": false,
        "createdAt": "2024-03-05T21:44:29.953Z",
        "updatedAt": "2024-03-05T21:44:29.953Z",
        "id": "65e77372e19230b1dcfae04e"
      }
    ],
    "createdAt": "2024-03-05T20:17:03.989Z",
    "id": "LYiv0Z4je"
  },
  {
    "visibility": "Public",
    "_id": "CdOj61wCX",
    "name": "wobbly chess",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "677c2e12374aae3fdec177a8",
          "677c2e12374aae3fdec177a7",
          "677c2e12374aae3fdec177a9"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "677c2e12374aae3fdec177aa",
        "createdAt": "2025-01-06T19:54:22.508Z",
        "updatedAt": "2025-01-06T19:54:22.508Z",
        "id": "677c2e12374aae3fdec177aa"
      },
      {
        "name": "sketch.js",
        "content": "let size = 100;\nlet amt;\nlet t = 0;\nfunction setup() {\n  createCanvas(800, 600);\n  amt = width / size;\n  noStroke();\n}\n\nfunction draw() {\n  blendMode(BLEND);\n  background(\"#d6ecff\");\n\n  blendMode(EXCLUSION);\n  fill(\"#d6ecff\");\n  for (let i = -4; i < amt+4; i++) {\n\n    let d = dist(0, i * size, width / 2, height / 2);\n    let s = ((sin(t - d + i) + 2) / 2) * size;\n    rect(0, i * size, width, s);\n  }\n\n  for (let i = -4; i < amt+4; i++) {\n    let d = dist(0, i * size, width / 2, height / 2);\n    let s = ((cos(t - d + i) + 2) / 2) * size;\n    rect((i + 0) * s, 0, s, height);\n  }\n  t += 0.006;\n  filter(BLUR, 1);\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "677c2e12374aae3fdec177a7",
        "createdAt": "2025-01-06T19:54:22.508Z",
        "updatedAt": "2025-01-06T19:54:22.508Z",
        "id": "677c2e12374aae3fdec177a7"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677c2e12374aae3fdec177a8",
        "createdAt": "2025-01-06T19:54:22.508Z",
        "updatedAt": "2025-01-06T19:54:22.508Z",
        "id": "677c2e12374aae3fdec177a8"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "677c2e12374aae3fdec177a9",
        "createdAt": "2025-01-06T19:54:22.508Z",
        "updatedAt": "2025-01-06T19:54:22.508Z",
        "id": "677c2e12374aae3fdec177a9"
      }
    ],
    "updatedAt": "2025-01-06T19:54:22.508Z",
    "createdAt": "2025-01-06T19:35:32.459Z",
    "id": "CdOj61wCX"
  },
  {
    "visibility": "Public",
    "_id": "HSRzMaEyy",
    "name": "Wood canoe",
    "updatedAt": "2025-01-03T23:48:52.551Z",
    "files": [
      {
        "name": "root",
        "content": "",
        "children": [
          "65862d601697403306c570bb",
          "65862d601697403306c570ba",
          "65862d601697403306c570bc"
        ],
        "fileType": "folder",
        "isSelectedFile": false,
        "_id": "65862d601697403306c570bd",
        "createdAt": "2025-01-03T23:48:52.551Z",
        "updatedAt": "2025-01-03T23:48:52.551Z",
        "id": "65862d601697403306c570bd"
      },
      {
        "name": "sketch.js",
        "content": "let w, h, maxW, minW, maxH, minH, t,a;\nfunction setup() {\n  createCanvas(640, 360);\n  colorMode(HSL);\n  noStroke();\n  w = width;\n  h = height;\n  minW = w - 50;\n  maxW = w + 5;\n  minH = h - 10;\n  maxH = h + 5;\n  t = 0;\n  a = 0\n}\n\nfunction draw() {\n  background(200, 100, 40);\n  fill(0, 0, 0);\n  translate(width/2,height/2)\n    rotate(a)\n  ellipse(0,0, w, h);\n  oscillate();\n  t+=0.06\n}\n\nfunction oscillate() {\n  w = map(sin(t), -1,1,minW, maxW)\n  h = map(cos(t), -1,1,minH, maxH)\n  // a = map(sin(t), -1,1,-0.5,0.5)\n\n}\n\nfunction keyPressed() {\n  if (key === \"s\") {\n    saveGif(\"ellipse\", 5);\n  }\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": true,
        "_id": "65862d601697403306c570ba",
        "createdAt": "2025-01-03T23:48:52.551Z",
        "updatedAt": "2025-01-03T23:48:52.551Z",
        "id": "65862d601697403306c570ba"
      },
      {
        "name": "index.html",
        "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.sound.min.js\"></script>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n    <meta charset=\"utf-8\" />\n\n  </head>\n  <body>\n    <main>\n    </main>\n    <script src=\"sketch.js\"></script>\n  </body>\n</html>\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65862d601697403306c570bb",
        "createdAt": "2025-01-03T23:48:52.551Z",
        "updatedAt": "2025-01-03T23:48:52.551Z",
        "id": "65862d601697403306c570bb"
      },
      {
        "name": "style.css",
        "content": "html, body {\n  margin: 0;\n  padding: 0;\n}\ncanvas {\n  display: block;\n}\n",
        "children": [],
        "fileType": "file",
        "isSelectedFile": false,
        "_id": "65862d601697403306c570bc",
        "createdAt": "2025-01-03T23:48:52.551Z",
        "updatedAt": "2025-01-03T23:48:52.551Z",
        "id": "65862d601697403306c570bc"
      }
    ],
    "createdAt": "2023-12-24T18:44:59.559Z",
    "id": "HSRzMaEyy"
  }
]
