let lineShader, blobShader, bgShader
const maxScale = random(8, 25)
const numBlobs = ceil(map(maxScale, 8, 25, 12, 5))
for (let i = 0; i < numBlobs; i++) {
blobs.push(blob({ maxScale }))
const maxK = random(1, 5)
const numSquiggles = ceil(map(maxK, 1, 5, 24, 12))
for (let i = 0; i < numSquiggles; i++) {
const newSquiggle = squiggle({ maxK })
const x = randomGaussian(0, width/6)
const y = randomGaussian(0, height/6)
squiggles.push((progress) => {
const bgSeed = random()*1000
bgShader.setUniform('pixelDensity', pixelDensity())
bgShader.setUniform('seed', bgSeed)
rect(0, 0, width, height)
createCanvas(600, 600, WEBGL)
setAttributes({ antialias: true })
lineShader = createShader(...lineShaderSource())
blobShader = createShader(...blobShaderSource())
bgShader = createShader(...bgShaderSource())
function mousePressed() {
gl.disable(gl.DEPTH_TEST)
const { bg, blobs, squiggles, startTime } = state
const delta = millis() - startTime
const progress = map(delta, 0, 5000, 0, 1, true)
for (const blob of blobs) blob(progress)
for (const squiggle of squiggles) squiggle(progress)
function mousePressed() {