0x57ca…d46c

All memos sent from and to 0x57ca…d46c.

ipfs://bafybeie4oc7oabjov37ys3vp7sbkfbk5ixdatgealgxdvcnm6bdvajgfmqlet circleRadius,timeOffset=0,res=2; function setup(){ let s=min(windowWidth,windowHeight); createCanvas(s,s); colorMode(HSB,360,100,100); circleRadius=width*0.4; noStroke(); } function windowResized(){ let s=min(windowWidth,windowHeight); resizeCanvas(s,s); circleRadius=width*0.4; } function draw(){ if(frameCount<2){background(0);return;} background(0); timeOffset+=0.015; push(); translate(width/2,height/2); let t1=timeOffset*0.3,t2=timeOffset*0.2,t3=timeOffset*0.4,t4=timeOffset*0.5,t5=timeOffset*0.6; let hue=(timeOffset*100)%360,ns=0.01,off=res*0.7,lf=15; for(let y=-circleRadius;y<=circleRadius;y+=res){ for(let x=-circleRadius;x<=circleRadius;x+=res){ let d=sqrt(x*x+y*y); if(d>circleRadius)continue; let r1x=x*0.7-y*0.7,r1y=x*0.7+y*0.7,r2x=-x*0.5+y*0.866,r2y=-x*0.866-y*0.5; let n1=noise(x*ns+t1,y*ns+t2,t3),n2=noise(r1x*ns*1.3+t3,r1y*ns*1.3+t2,t4),n3=noise(r2x*ns*1.7+t4,r2y*ns*1.7+t3,t5); let c=n1*0.5+n2*0.3+n3*0.2; let nb1=noise((x+off)*ns+t1,y*ns+t2,t3),nb2=noise((r1x+off*0.7)*ns*1.3+t3,r1y*ns*1.3+t2,t4),nb3=noise((r2x+off*0.5)*ns*1.7+t4,r2y*ns*1.7+t3,t5); let nc=nb1*0.5+nb2*0.3+nb3*0.2; let m=(c*lf)%1,tl=m<0.025||m>0.975,g=abs(c-nc),gl=g>0.05&&g<0.1; if(tl||gl){ let r=d/circleRadius,sat=map(r,0,1,100,20),br=r<0.67?map(r,0,0.67,95,70):map(pow((r-0.67)/0.33,2.5),0,1,70,0); fill(hue,sat,br); rect(x,y,res,res); } } } pop(); }
ipfs://bafkreihftlgwc2miemmkrxulvsel2w7ccwnn53on5p2hikh6c2kvwgqgaulet digits=[]; let groundDigits=[]; let moonDigits=[]; let canvasSize=0; let moonX=0; let moonY=0; let moonRadius=0; let digitsPerFrame=144; let walkCycle=0; let walkSpeed=0.05; let groundOffset=0; let groundSpeed=3; let bodyParts={head:{x:0,y:0,radius:0},torso:{x:0,y:0,width:0,height:0},frontArm:{x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},backArm:{x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},frontLeg:{x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},backLeg:{x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},hips:{x:0,y:0,width:0}}; function setup(){ canvasSize=min(windowWidth,windowHeight); createCanvas(canvasSize,canvasSize); background(0); textAlign(CENTER,CENTER); moonX=width*0.12; moonY=height*0.1; moonRadius=canvasSize*0.05; initGround(); initMoon(); } function initMoon(){ let sc=canvasSize/600; let tiltAngle=radians(-15); let innerRadius=moonRadius*0.95; let offsetDist=moonRadius*0.3; for(let i=0;i<375;i++){ let angle=random(TWO_PI); let r=sqrt(random())*moonRadius; let x=moonX+cos(angle)*r; let y=moonY+sin(angle)*r; let innerCircleX=moonX+cos(tiltAngle)*offsetDist; let innerCircleY=moonY+sin(tiltAngle)*offsetDist; let distFromInner=dist(x,y,innerCircleX,innerCircleY); if(distFromInner>innerRadius){ moonDigits.push({x:x,y:y,size:random(3,6)*sc,digit:floor(random(10)),rotation:random(TWO_PI)}); } } } function getGroundY(x){ return lerp(height*0.5,height,x/width); } function initGround(){ let sc=canvasSize/600; for(let i=0;i<80;i++){ let x=random(width); let baseY=getGroundY(x); let groundDepth=lerp(height*0.5,0,x/width); let yOffset=random()*random()*groundDepth; if(baseY+yOffset<=height){ groundDigits.push({x:x,y:baseY+yOffset,size:random(4,8)*sc,digit:floor(random(10)),rotation:random(TWO_PI)}); } } } function updateBodyParts(){ let sc=canvasSize/600; let ms=sc*0.6; let centerX=width*0.7; let baseY=getGroundY(centerX); let legPhase=sin(walkCycle); let armPhase=sin(walkCycle+PI); let bodyBob=abs(sin(walkCycle*2))*6*ms; let leanAngle=radians(10); let hipY=baseY-210*ms-bodyBob*0.5; bodyParts.hips={x:centerX,y:hipY,width:20*ms}; let torsoLength=110*ms; let headOffset=150*ms; let shoulderX=centerX-sin(leanAngle)*torsoLength; let shoulderY=hipY-cos(leanAngle)*torsoLength-bodyBob; bodyParts.torso={x:centerX-sin(leanAngle)*(torsoLength*0.5),y:hipY-cos(leanAngle)*(torsoLength*0.5)-bodyBob,width:25*ms,height:70*ms,shoulderY:shoulderY}; bodyParts.head={x:centerX-sin(leanAngle)*headOffset,y:hipY-cos(leanAngle)*headOffset-bodyBob,radius:20*ms}; let frontLegSwing=legPhase; let frontKneeX=centerX-frontLegSwing*60*ms; let frontKneeY=hipY+100*ms; if(frontLegSwing>0)frontKneeY=hipY+90*ms; let frontFootX=frontKneeX-max(0,frontLegSwing)*30*ms; let frontFootGroundY=getGroundY(frontFootX); let frontFootY=frontFootGroundY; if(frontLegSwing>0.3)frontFootY=frontFootGroundY-(frontLegSwing-0.3)*40*ms; bodyParts.frontLeg={x1:centerX,y1:hipY,x2:frontKneeX,y2:frontKneeY,x3:frontFootX,y3:frontFootY,thickness:7*ms}; let backLegSwing=-legPhase; let backKneeX=centerX-backLegSwing*60*ms; let backKneeY=hipY+100*ms; if(backLegSwing>0)backKneeY=hipY+90*ms; let backFootX=backKneeX-max(0,backLegSwing)*30*ms; let backFootGroundY=getGroundY(backFootX); let backFootY=backFootGroundY; if(backLegSwing>0.3)backFootY=backFootGroundY-(backLegSwing-0.3)*40*ms; bodyParts.backLeg={x1:centerX,y1:hipY,x2:backKneeX,y2:backKneeY,x3:backFootX,y3:backFootY,thickness:6*ms}; let upperArmLength=75*ms; let forearmLength=68*ms; let leftRotation=map(armPhase,-1,1,HALF_PI*0.9,-HALF_PI*0.9); let leftUpperAngle=HALF_PI+leftRotation; let leftForearmAngle=PI+leftRotation; let leftElbowX=centerX+cos(leftUpperAngle)*upperArmLength; let leftElbowY=shoulderY+sin(leftUpperAngle)*upperArmLength; let leftHandX=leftElbowX+cos(leftForearmAngle)*forearmLength; let leftHandY=leftElbowY+sin(leftForearmAngle)*forearmLength; let rightRotation=map(-armPhase,-1,1,HALF_PI*0.9,-HALF_PI*0.9); let rightUpperAngle=HALF_PI+rightRotation; let rightForearmAngle=PI+rightRotation; let rightElbowX=centerX+cos(rightUpperAngle)*upperArmLength; let rightElbowY=shoulderY+sin(rightUpperAngle)*upperArmLength; let rightHandX=rightElbowX+cos(rightForearmAngle)*forearmLength; let rightHandY=rightElbowY+sin(rightForearmAngle)*forearmLength; if(leftElbowX<rightElbowX){ bodyParts.frontArm={x1:centerX,y1:shoulderY,x2:leftElbowX,y2:leftElbowY,x3:leftHandX,y3:leftHandY,thickness:6*ms,fistSize:5*ms}; bodyParts.backArm={x1:centerX,y1:shoulderY,x2:rightElbowX,y2:rightElbowY,x3:rightHandX,y3:rightHandY,thickness:5*ms,fistSize:4*ms}; }else{ bodyParts.frontArm={x1:centerX,y1:shoulderY,x2:rightElbowX,y2:rightElbowY,x3:rightHandX,y3:rightHandY,thickness:6*ms,fistSize:5*ms}; bodyParts.backArm={x1:centerX,y1:shoulderY,x2:leftElbowX,y2:leftElbowY,x3:leftHandX,y3:leftHandY,thickness:5*ms,fistSize:4*ms}; } } function isInsideBody(px,py){ let sc=canvasSize/600; let head=bodyParts.head; if(dist(px,py,head.x,head.y)<head.radius)return true; let torso=bodyParts.torso; let dx=(px-torso.x)/torso.width; let dy=(py-torso.y)/torso.height; if(dx*dx+dy*dy<1)return true; let hips=bodyParts.hips; if(dist(px,py,hips.x,hips.y)<hips.width*0.8)return true; if(isNearLimb(px,py,bodyParts.backArm))return true; if(isNearLimb(px,py,bodyParts.backLeg))return true; if(isNearLimb(px,py,bodyParts.frontArm))return true; if(isNearLimb(px,py,bodyParts.frontLeg))return true; let neckX=bodyParts.head.x; let neckY=bodyParts.head.y+head.radius*0.8; if(dist(px,py,neckX,neckY)<10*sc)return true; return false; } function isNearLimb(px,py,limb){ let d1=distToSegment(px,py,limb.x1,limb.y1,limb.x2,limb.y2); let d2=distToSegment(px,py,limb.x2,limb.y2,limb.x3,limb.y3); let t=limb.thickness; let inLimb=d1<t||d2<t*0.8; if(limb.fistSize){ let dFist=dist(px,py,limb.x3,limb.y3); if(dFist<limb.fistSize)return true; } return inLimb; } function distToSegment(px,py,x1,y1,x2,y2){ let dx=x2-x1; let dy=y2-y1; let len2=dx*dx+dy*dy; if(len2===0)return dist(px,py,x1,y1); let t=max(0,min(1,((px-x1)*dx+(py-y1)*dy)/len2)); return dist(px,py,x1+t*dx,y1+t*dy); } function draw(){ background(0); let sc=canvasSize/600; walkCycle+=walkSpeed; groundOffset+=groundSpeed; updateBodyParts(); let slopeRatio=(height*0.5)/width; let keepGround=[]; for(let i=0;i<groundDigits.length;i++){ let d=groundDigits[i]; d.x+=groundSpeed; d.y+=groundSpeed*slopeRatio; if(random()>=0.02&&d.x<=width+20&&d.y<=height+20)keepGround.push(d); } groundDigits=keepGround; let maxGround=800; if(groundDigits.length>maxGround)groundDigits=groundDigits.slice(-maxGround); let groundDepthAtLeft=height*0.5; if(groundDigits.length<maxGround){ for(let g=0;g<4;g++){ if(random()<0.8){ let baseY=getGroundY(0); let yOffset=random()*random()*groundDepthAtLeft; groundDigits.push({x:0,y:baseY+yOffset,size:random(4,8)*sc,digit:floor(random(10)),rotation:random(TWO_PI)}); } } for(let g=0;g<4;g++){ if(random()<0.3){ let x=random(width); let baseY=getGroundY(x); let groundDepth=lerp(height*0.5,0,x/width); if(groundDepth>10){ let yOffset=random()*random()*groundDepth; groundDigits.push({x:x,y:baseY+yOffset,size:random(4,8)*sc,digit:floor(random(10)),rotation:random(TWO_PI)}); } } } } moonDigits=moonDigits.filter(()=>random()>=0.02); let tiltAngle=radians(-15); let innerRadius=moonRadius*0.95; let offsetDist=moonRadius*0.3; while(moonDigits.length<32){ let angle=random(TWO_PI); let r=sqrt(random())*moonRadius; let x=moonX+cos(angle)*r; let y=moonY+sin(angle)*r; let innerCircleX=moonX+cos(tiltAngle)*offsetDist; let innerCircleY=moonY+sin(tiltAngle)*offsetDist; let distFromInner=dist(x,y,innerCircleX,innerCircleY); if(distFromInner>innerRadius){ moonDigits.push({x:x,y:y,size:random(3,6)*sc,digit:floor(random(10)),rotation:random(TWO_PI)}); } } digits=digits.filter(()=>random()>=0.05); let ms=sc*0.6; let manCenterX=width*0.7; let manCenterY=getGroundY(manCenterX)-180*ms; for(let i=0;i<digitsPerFrame;i++){ let px=manCenterX+random(-120*ms,120*ms); let py=manCenterY+random(-220*ms,220*ms); if(isInsideBody(px,py)){ digits.push({x:px,y:py,size:random(2,6)*ms,digit:floor(random(10)),rotation:random(TWO_PI)}); } } if(digits.length>4000)digits=digits.slice(-4000); noStroke(); fill(255); for(let d of moonDigits){push();translate(d.x,d.y);rotate(d.rotation);textSize(d.size);text(d.digit,0,0);pop();} for(let d of groundDigits){push();translate(d.x,d.y);rotate(d.rotation);textSize(d.size);text(d.digit,0,0);pop();} for(let d of digits){push();translate(d.x,d.y);rotate(d.rotation);textSize(d.size);text(d.digit,0,0);pop();} } function windowResized(){ canvasSize=min(windowWidth,windowHeight); resizeCanvas(canvasSize,canvasSize); moonX=width*0.12; moonY=height*0.1; moonRadius=canvasSize*0.05; digits=[]; groundDigits=[]; moonDigits=[]; initGround(); initMoon(); background(0); }
ipfs://bafybeic44kygkk5donu3b3kbo4srwi5hlcmgpzrwydr5kewb4ty4gwdqmelet canvasSize = 0; let centerX = 0; let centerY = 0; let plumes = []; let layerColors = []; let animationProgress = 0; let animationSpeed = 0.001; let breathProgress = 0; let lastRegenerationTime = 0; let cycleDuration = 2000; let expandDuration = 800; let holdDuration = 200; let contractDuration = 1000; function getRandomColor() { colorMode(HSB, 360, 100, 100); let c = color(random(360), 100, 100); colorMode(RGB, 255); return c; } function generatePlumes() { plumes = []; layerColors = []; let scaleFactor = canvasSize / 500; let numLayers = floor(random(3, 6)); let innerRadius = canvasSize / 30; let maxOuterRadius = canvasSize * 0.48; for (let layer = 0; layer < numLayers; layer++) { if (layer === 0) { layerColors[layer] = getRandomColor(); } else { layerColors[layer] = color(255, 255, 255); } let isOuterLayer = (layer === numLayers - 1); let layerProgress = layer / max(1, numLayers - 1); let layerInnerRadius = innerRadius + (maxOuterRadius - innerRadius) * layerProgress * random(0.7, 0.9); let layerOuterRadius = layerInnerRadius + (maxOuterRadius - layerInnerRadius) * random(0.4, 0.9); if (isOuterLayer) { layerOuterRadius = maxOuterRadius; } let numPlumesInLayer = floor(random(12, 25)); let angleStep = TWO_PI / numPlumesInLayer; for (let i = 0; i < numPlumesInLayer; i++) { let angle = i * angleStep + random(-angleStep * 0.4, angleStep * 0.4); let plumeInnerRadius = layerInnerRadius + random(-layerInnerRadius * 0.3, layerInnerRadius * 0.4); plumeInnerRadius = max(0, plumeInnerRadius); let plumeOuterRadius = layerOuterRadius + random(-layerOuterRadius * 0.2, layerOuterRadius * 0.15); plumeOuterRadius = constrain(plumeOuterRadius, plumeInnerRadius + canvasSize * 0.02, maxOuterRadius); let baseWidth = (canvasSize / 8) * (1 + layer * 0.5); let width = baseWidth * random(0.5, 2.5); let maxWidthRadius = random(0.2, 0.8); plumes.push({ angle: angle, innerRadius: plumeInnerRadius, outerRadius: plumeOuterRadius, width: width, maxWidthRadius: maxWidthRadius, layer: layer, turbulence: random(0.5, 2.0), density: random(0.6, 1.0) }); } } } function getPlumeWidthAtRadius(plume, radius) { let normalizedRadius = (radius - plume.innerRadius) / (plume.outerRadius - plume.innerRadius); if (normalizedRadius < 0 || normalizedRadius > 1) return 0; let distanceFromMax = abs(normalizedRadius - plume.maxWidthRadius); let widthFactor = 1 - pow(distanceFromMax, 0.8); widthFactor = max(0, widthFactor); let noiseFactor = 1 + noise(plume.angle * 10 + animationProgress * 2, normalizedRadius * 5) * 0.4 - 0.2; let taperFactor = 1 - pow(normalizedRadius, 2.5) * 0.3; return plume.width * widthFactor * taperFactor * noiseFactor; } function getBreathState() { let elapsed = millis() - lastRegenerationTime; if (elapsed < expandDuration) { let progress = elapsed / expandDuration; return { phase: 'expand', progress: progress, size: progress, opacity: 1 }; } else if (elapsed < expandDuration + holdDuration) { return { phase: 'hold', progress: 1, size: 1, opacity: 1 }; } else if (elapsed < expandDuration + holdDuration + contractDuration) { let contractElapsed = elapsed - expandDuration - holdDuration; let progress = contractElapsed / contractDuration; return { phase: 'contract', progress: progress, size: 1 - progress, opacity: 1 - progress }; } else { return { phase: 'complete', progress: 1, size: 0, opacity: 0 }; } } function drawGaseousPlume(plume, breathState) { let col = layerColors[plume.layer]; let maxRadius = map(breathState.size, 0, 1, plume.innerRadius, plume.outerRadius); maxRadius = constrain(maxRadius, plume.innerRadius, plume.outerRadius); if (maxRadius <= plume.innerRadius) return; let passes = 2; for (let pass = 0; pass < passes; pass++) { let passAlpha = map(pass, 0, passes - 1, 20, 8); if (plume.layer !== 0) { passAlpha *= breathState.opacity; } else { passAlpha = map(pass, 0, passes - 1, 50, 25); } let passRadiusStep = map(pass, 0, passes - 1, 8, 15); for (let r = plume.innerRadius; r < maxRadius; r += passRadiusStep) { let normalizedR = (r - plume.innerRadius) / (plume.outerRadius - plume.innerRadius); let plumeWidth = getPlumeWidthAtRadius(plume, r); if (plumeWidth <= 0) continue; let densityFactor = 1 - abs(normalizedR - plume.maxWidthRadius) * 0.5; densityFactor *= plume.density; let distanceFromEdge = maxRadius - r; let edgeFadeDist = (plume.outerRadius - plume.innerRadius) * 0.1; let edgeFade = constrain(distanceFromEdge / edgeFadeDist, 0, 1); densityFactor *= edgeFade; let angleWidth = plumeWidth / r; let numSegments = max(2, floor(angleWidth * r / 10)); for (let seg = 0; seg < numSegments; seg++) { let segmentProgress = seg / numSegments; let offsetAngle = map(segmentProgress, 0, 1, -angleWidth * 0.5, angleWidth * 0.5); let currentAngle = plume.angle + offsetAngle; let noiseOffset = noise( currentAngle * 3 + animationProgress, r * 0.01, plume.layer * 0.5 ) * plume.turbulence * 0.3; currentAngle += noiseOffset; let x = centerX + cos(currentAngle) * r; let y = centerY + sin(currentAngle) * r; let edgeFactor = 1 - abs((segmentProgress - 0.5) * 2); edgeFactor = pow(edgeFactor, 0.7); let alpha = passAlpha * densityFactor * edgeFactor; let scaleFactor = canvasSize / 500; let particleSize = (500 / 80) * (1 + pass * 0.8) * sqrt(scaleFactor); fill(red(col), green(col), blue(col), alpha); noStroke(); ellipse(x, y, particleSize, particleSize); } } } } function setup() { canvasSize = min(windowWidth, windowHeight); createCanvas(canvasSize, canvasSize); centerX = width / 2; centerY = height / 2; generatePlumes(); background(0); lastRegenerationTime = millis(); } function draw() { let breathState = getBreathState(); if (breathState.phase === 'complete') { generatePlumes(); lastRegenerationTime = millis(); background(0); breathState = getBreathState(); } background(0, 0, 0, 25); animationProgress += animationSpeed; for (let plume of plumes) { drawGaseousPlume(plume, breathState); } } function windowResized() { canvasSize = min(windowWidth, windowHeight); resizeCanvas(canvasSize, canvasSize); centerX = width / 2; centerY = height / 2; generatePlumes(); lastRegenerationTime = millis(); background(0); } function mousePressed() { generatePlumes(); lastRegenerationTime = millis(); background(0); }
ipfs://bafkreichumfgiuu75fwlpp6lj2n23dodhpa6a75vl42rhigjt2t2ankxculet dots = []; let cycleStartTime = 0; let cycleDuration = 5000; let isWhitePhase = true; let totalDotsNeeded = 50000; let canvasSize = 0; let centerX = 0; let centerY = 0; let petals = []; let dotsInCurrentPhase = 0; let dotsInsidePetals = 0; let dotsRemovedOutside = 0; let dotsRemovedInside = 0; let initialWhiteDotsInside = 0; let initialWhiteDotsOutside = 0; let initialFillComplete = false; let cycleCount = 0; let isBlackout = false; let blackoutStartDots = 0; let blackoutRemoved = 0; let dotSize = 2; function generatePetals() { petals = []; let numLayers = floor(random(2, 5)); let innerRadius = canvasSize / 25; let baseSpan = canvasSize * 0.05; let maxOuterRadius = canvasSize * 0.475; let basePetalWidth = canvasSize / 15; let totalAvailableRadius = maxOuterRadius - innerRadius; let currentRadius = innerRadius; for (let layer = 0; layer < numLayers; layer++) { let isOuterLayer = (layer === numLayers - 1); let layerProgress = layer / (numLayers - 1); let layerSpan = baseSpan * (1 + layerProgress * 2); let layerInnerRadius = currentRadius; let layerOuterRadius = layerInnerRadius + layerSpan; if (isOuterLayer) { layerOuterRadius = maxOuterRadius; } else if (layerOuterRadius > maxOuterRadius) { layerOuterRadius = maxOuterRadius; } let numPetals = floor(random(7, 14)); let angleStep = TWO_PI / numPetals; let petalWidth = basePetalWidth * (1 + layer * 0.8); for (let i = 0; i < numPetals; i++) { let angle = i * angleStep + random(-angleStep * 0.1, angleStep * 0.1); let offsetFactor = layer === 0 ? 0.2 : (layer === 1 ? 0.1 : 0.05); let petalInnerRadius = layerInnerRadius + random(0, layerSpan * offsetFactor); let petalOuterRadius; if (isOuterLayer) { let minOuter = maxOuterRadius * 0.85; let maxOuter = maxOuterRadius; petalOuterRadius = random(minOuter, maxOuter); } else { petalOuterRadius = layerOuterRadius - random(0, layerSpan * (offsetFactor * 0.75)); } let width = petalWidth * random(0.8, 1.4); let maxWidthRadius = 0.4 + random(-0.1, 0.1); petals.push({ angle: angle, innerRadius: petalInnerRadius, outerRadius: petalOuterRadius, width: width, maxWidthRadius: maxWidthRadius }); } if (!isOuterLayer) { let overlap = layerSpan * 0.3; currentRadius = layerOuterRadius - overlap; } } } function getPetalWidthAtRadius(petal, radius) { let normalizedRadius = (radius - petal.innerRadius) / (petal.outerRadius - petal.innerRadius); if (normalizedRadius < 0 || normalizedRadius > 1) return 0; let distanceFromMax = abs(normalizedRadius - petal.maxWidthRadius); let widthFactor = 1 - (distanceFromMax / max(0.4, 1 - petal.maxWidthRadius)); widthFactor = pow(max(0, widthFactor), 1.5); let taperFactor = 1 - pow(normalizedRadius, 1.8); return petal.width * widthFactor * taperFactor; } function isPointInPetals(x, y) { let dx = x - centerX; let dy = y - centerY; let distFromCenter = sqrt(dx * dx + dy * dy); let angle = atan2(dy, dx); if (angle < 0) angle += TWO_PI; for (let petal of petals) { if (distFromCenter < petal.innerRadius || distFromCenter > petal.outerRadius) { continue; } let petalWidthAtRadius = getPetalWidthAtRadius(petal, distFromCenter); if (petalWidthAtRadius <= 0) continue; let angleDiff = abs(angle - petal.angle); if (angleDiff > PI) angleDiff = TWO_PI - angleDiff; let petalAngleWidth = petalWidthAtRadius / distFromCenter; if (angleDiff <= petalAngleWidth * 0.5) { return true; } } return false; } function getRandomPositionInPetals() { if (petals.length === 0) return null; let petal = random(petals); let attempts = 0; while (attempts < 50) { let radius = random(petal.innerRadius, petal.outerRadius); let petalWidthAtRadius = getPetalWidthAtRadius(petal, radius); if (petalWidthAtRadius <= 0) { attempts++; continue; } let angleOffset = random(-petalWidthAtRadius / (radius * 2), petalWidthAtRadius / (radius * 2)); let angle = petal.angle + angleOffset; let testX = centerX + cos(angle) * radius; let testY = centerY + sin(angle) * radius; if (isPointInPetals(testX, testY)) { return { x: testX, y: testY }; } attempts++; } return null; } function setup() { canvasSize = min(windowWidth, windowHeight); createCanvas(canvasSize, canvasSize); centerX = width / 2; centerY = height / 2; dotSize = max(1, canvasSize / 500); generatePetals(); background(0); cycleStartTime = millis(); cycleCount = 0; isBlackout = false; blackoutStartDots = 0; blackoutRemoved = 0; dotsInCurrentPhase = 0; dotsInsidePetals = 0; dotsRemovedOutside = 0; dotsRemovedInside = 0; initialWhiteDotsInside = 0; initialWhiteDotsOutside = 0; initialFillComplete = false; if (isWhitePhase) { initialWhiteDotsInside = dots.filter(d => d.isInsidePetals && d.color === 255).length; } else { initialWhiteDotsOutside = dots.filter(d => !d.isInsidePetals && d.color === 255).length; } } function draw() { background(0); let elapsed = millis() - cycleStartTime; let progress = elapsed / cycleDuration; if (progress >= 1.0) { if (isBlackout) { dots = []; generatePetals(); cycleCount = 0; isBlackout = false; blackoutStartDots = 0; blackoutRemoved = 0; isWhitePhase = true; dotsInCurrentPhase = 0; dotsInsidePetals = 0; dotsRemovedOutside = 0; dotsRemovedInside = 0; initialWhiteDotsInside = 0; initialWhiteDotsOutside = 0; initialFillComplete = false; cycleStartTime = millis(); progress = 0; } else { cycleCount++; if (cycleCount >= 2) { isBlackout = true; blackoutStartDots = dots.length; blackoutRemoved = 0; cycleStartTime = millis(); progress = 0; } else { if (isWhitePhase) { for (let j = dots.length - 1; j >= 0; j--) { if (dots[j].isInsidePetals && dots[j].color === 255) { dots.splice(j, 1); } } initialWhiteDotsOutside = dots.filter(d => !d.isInsidePetals && d.color === 255).length; } else { for (let j = dots.length - 1; j >= 0; j--) { if (!dots[j].isInsidePetals && dots[j].color === 255) { dots.splice(j, 1); } } initialWhiteDotsInside = dots.filter(d => d.isInsidePetals && d.color === 255).length; } cycleStartTime = millis(); isWhitePhase = !isWhitePhase; dotsInCurrentPhase = 0; dotsInsidePetals = 0; dotsRemovedOutside = 0; dotsRemovedInside = 0; progress = 0; } } } if (isBlackout) { let targetProgress = progress * progress; let targetRemoved = Math.round(blackoutStartDots * targetProgress); let dotsToRemove = targetRemoved - blackoutRemoved; let removed = 0; let maxRemovals = Math.max(100, Math.min(400, dotsToRemove)); for (let i = 0; i < dotsToRemove && i < maxRemovals && removed < dots.length; i++) { if (dots.length > 0) { dots.splice(floor(random(dots.length)), 1); blackoutRemoved++; removed++; } } } else { if (dots.length >= totalDotsNeeded && !initialFillComplete) { initialFillComplete = true; } let targetProgress = progress * progress; let targetDots = Math.floor(totalDotsNeeded * targetProgress); if (isWhitePhase) { let dotsToAddOutside = 0; let dotsToRemoveInside = 0; if (!initialFillComplete) { dotsToAddOutside = targetDots - dotsInCurrentPhase; } else { let targetRemoved = Math.round(initialWhiteDotsInside * targetProgress); dotsToRemoveInside = targetRemoved - dotsRemovedInside; dotsToAddOutside = dotsToRemoveInside; } if (initialFillComplete && dotsToRemoveInside > 0) { let removedInside = 0; let currentWhiteDotsInside = dots.filter(d => d.isInsidePetals && d.color === 255).length; let maxRemovals = Math.max(100, Math.min(400, dotsToRemoveInside)); for (let i = 0; i < dotsToRemoveInside && i < maxRemovals && removedInside < currentWhiteDotsInside; i++) { for (let j = dots.length - 1; j >= 0; j--) { if (dots[j].isInsidePetals && dots[j].color === 255) { dots.splice(j, 1); dotsRemovedInside++; removedInside++; break; } } } } else if (!initialFillComplete) { let targetRemoved = Math.round(initialWhiteDotsInside * targetProgress); dotsToRemoveInside = targetRemoved - dotsRemovedInside; let removedInside = 0; let currentWhiteDotsInside = dots.filter(d => d.isInsidePetals && d.color === 255).length; let maxRemovals = Math.max(100, Math.min(400, dotsToRemoveInside)); for (let i = 0; i < dotsToRemoveInside && i < maxRemovals && removedInside < currentWhiteDotsInside; i++) { for (let j = dots.length - 1; j >= 0; j--) { if (dots[j].isInsidePetals && dots[j].color === 255) { dots.splice(j, 1); dotsRemovedInside++; removedInside++; break; } } } } for (let i = 0; i < dotsToAddOutside && i < 100 && dots.length < totalDotsNeeded; i++) { let x, y; let attempts = 0; do { x = random(width); y = random(height); attempts++; } while (isPointInPetals(x, y) && attempts < 50); if (!isPointInPetals(x, y)) { dots.push({ x: x, y: y, color: 255, size: dotSize, isInsidePetals: false }); dotsInCurrentPhase++; } } } else { let dotsToAddInside = 0; let dotsToRemoveOutside = 0; if (!initialFillComplete) { dotsToAddInside = targetDots - dotsInsidePetals; } else { let targetRemoved = Math.round(initialWhiteDotsOutside * targetProgress); dotsToRemoveOutside = targetRemoved - dotsRemovedOutside; dotsToAddInside = dotsToRemoveOutside; } if (initialFillComplete && dotsToRemoveOutside > 0) { let removedOutside = 0; let currentWhiteDotsOutside = dots.filter(d => !d.isInsidePetals && d.color === 255).length; let maxRemovals = Math.max(100, Math.min(400, dotsToRemoveOutside)); for (let i = 0; i < dotsToRemoveOutside && i < maxRemovals && removedOutside < currentWhiteDotsOutside; i++) { for (let j = dots.length - 1; j >= 0; j--) { if (!dots[j].isInsidePetals && dots[j].color === 255) { dots.splice(j, 1); dotsRemovedOutside++; removedOutside++; break; } } } } else if (!initialFillComplete) { let targetRemoved = Math.round(initialWhiteDotsOutside * targetProgress); dotsToRemoveOutside = targetRemoved - dotsRemovedOutside; let removedOutside = 0; let currentWhiteDotsOutside = dots.filter(d => !d.isInsidePetals && d.color === 255).length; let maxRemovals = Math.max(100, Math.min(400, dotsToRemoveOutside)); for (let i = 0; i < dotsToRemoveOutside && i < maxRemovals && removedOutside < currentWhiteDotsOutside; i++) { for (let j = dots.length - 1; j >= 0; j--) { if (!dots[j].isInsidePetals && dots[j].color === 255) { dots.splice(j, 1); dotsRemovedOutside++; removedOutside++; break; } } } } for (let i = 0; i < dotsToAddInside && i < 100 && dots.length < totalDotsNeeded; i++) { let pos = getRandomPositionInPetals(); if (pos) { dots.push({ x: pos.x, y: pos.y, color: 255, size: dotSize, isInsidePetals: true }); dotsInsidePetals++; } } } } noStroke(); for (let dot of dots) { fill(dot.color); ellipse(dot.x, dot.y, dot.size, dot.size); } } function windowResized() { canvasSize = min(windowWidth, windowHeight); resizeCanvas(canvasSize, canvasSize); centerX = width / 2; centerY = height / 2; dotSize = max(1, canvasSize / 500); generatePetals(); dots = []; cycleCount = 0; isBlackout = false; blackoutStartDots = 0; blackoutRemoved = 0; dotsInCurrentPhase = 0; dotsInsidePetals = 0; dotsRemovedOutside = 0; dotsRemovedInside = 0; initialWhiteDotsInside = 0; initialWhiteDotsOutside = 0; initialFillComplete = false; cycleStartTime = millis(); background(0); }
ipfs://bafybeiaqzmnv6my3ptf4ltmamftcrwhvvitkti24jb33ceizh44fnkl5rulet lineCount=50,minStroke=1,maxStroke=12,duration=10000,startTime; function setup(){let s=min(windowWidth,windowHeight);createCanvas(s,s);background(0);startTime=millis();loop()} function draw(){let t=(millis()-startTime)%duration,p=t/duration,e=(1-cos(p*TWO_PI))/2,w=lerp(minStroke,maxStroke,e);background(100);push();translate(width/2,height/2);rotate(-HALF_PI);translate(-width/2,-height/2);noFill();let h=height/2;for(let i=0;i<lineCount;i++){let y=map(i,0,lineCount-1,0,height),c=abs(h-y)/h,m=lerp(maxStroke,minStroke,c),seg=20,sw=width/seg;for(let j=0;j<seg;j++){let x1=j*sw,x2=(j+1)*sw,tf=abs(width-x1)/width,ts=lerp(w,m,tf),vf=map(x1,0,width,0,1),cs=(millis()/1000)%60,hue=map(cs,0,60,0,360),sat=map(vf,0,1,20,80),bri=map(vf,0,1,40,200);colorMode(HSB,360,100,255);stroke(hue,sat,bri);strokeWeight(ts);line(x1,y,x2,y)}}pop()} function windowResized(){let s=min(windowWidth,windowHeight);resizeCanvas(s,s)}
Algorithmic De StijlAnimated onchain script inspired by the De Stijl principles and work of Piet Mondrian, with the additional use of Fibonacci proportions. A new composition forms each second — click to freeze.
Gray HoodsAn on-chain generative portrait engine with virtually infinite variation, crafted with a minimal aesthetic. A new Gray Hood is randomly generated each second, purely with code — each defined by its own unique mix of shape, proportion, facial features, monogrammed initials, background variants, and a few rare traits. This is not a profile pic — this is a profile engine.
ipfs://bafkreiappmwiqf32pmca5pkfhknbau6u2yjc3w657jmthhcykjh6oexaualet t=0,maskImg; function setup(){ createCanvas(min(windowWidth,windowHeight),min(windowWidth,windowHeight)); noFill(); stroke(255,50); strokeWeight(2); frameRate(60); maskImg=createGraphics(width,height); } function draw(){ let r=min(width,height)*.4; maskImg.background(0); maskImg.fill(0); maskImg.noStroke(); maskImg.ellipse(width/2,height/2,r*2,r*2); image(maskImg,0,0); translate(width/2,height/2); let f=createHelix(t,r); drawingContext.shadowColor=color(255,255,255); drawingContext.shadowBlur=15; beginShape(); f.forEach(p=>curveVertex(p.x,p.y)); endShape(); f.forEach(p=>ellipse(p.x,p.y,2,2)); drawGlowyBorder(r); t+=.02; } function createHelix(t,r){ let p=[],n=400; for(let i=0;i<n;i++){ let a=map(i,0,n,0,TWO_PI*3), nx=map(noise(t*3+i),0,1,-40,140), ny=map(noise(t*5+i+10),0,1,-40,140), nz=map(noise(t*7+i+20),0,1,-30,140), x=(r+nx)*cos(a+sin(t*.5+a*.2))*sin(t*.3+a*.1), y=(r+ny)*sin(a+cos(t*.7+a*.3))*cos(t*.4+a*.2), z=map(i,0,n,-100,100)+nz+t*5; let d=dist(0,0,x,y); if(d>r){x*=r/d;y*=r/d;} p.push(createVector(x,y,z)); } return p; } function drawGlowyBorder(r){ stroke(255,100); strokeWeight(2); drawingContext.shadowBlur=map(sin(t),-1,1,8,20); ellipse(0,0,r*2,r*2); } function windowResized(){ resizeCanvas(min(windowWidth,windowHeight),min(windowWidth,windowHeight)); maskImg=createGraphics(width,height); }
OpePaintA tool for everyone. View random generations or create your own using the language and framework of Opepen. Instructions: Random generations are provided as a start. To begin, click the canvas to freeze the image. Click again to add/change figure cells (each click cycles through options). KEYBOARD COMMANDS: H + Arrows - Adjust Hue of all figure cells. S + Arrows - Adjust Saturation. L + Arrows - Adjust Lightness. V + H/S/L + Arrows - Adjust H/S/L of individual cells (hover mouse over cell to specify). A + H/S/L + Arrows - Adjust Background. Z + Click - Toggle Outlines. Q + Click - Restart. All 64 cells are available to change. Canvas scales per the window. Right-Click-Save as desired.
ipfs://bafybeifncbl7k4w4ftgg4bf5gtcw6okmsp3r5mn4jot7ym2uh4wo5tqiqa >let gc=10,gr=10,cyc=1000,rot=0.01,nts=0.055,nsf=0.055,cam=500,cells=[],cw,ch; function setup(){ createCanvas(windowWidth,windowHeight,WEBGL); angleMode(RADIANS); cw=width/gc;ch=height/gr; createCells(); } function draw(){ background(0); translate(0,0,-cam); rotateX(-PI/6); rotateY(PI/4+frameCount*rot); let t=frameCount%cyc,tn=t/cyc,ph,i=0; if(tn<0.25) ph=0; else if(tn<0.5){ph=1;i=map(tn,0.25,0.5,0,1);} else if(tn<0.75){ph=2;i=map(tn,0.5,0.75,0,1);} else {ph=3;i=map(tn,0.75,1,0,1);} for(let c of cells) drawCell(c,ph,i); if(t==0 && frameCount>0) createCells(); } function createCells(){ cells=[]; for(let i=0;i<gc;i++){ for(let j=0;j<gr;j++){ let x0=-width/2+i*cw, x1=-width/2+(i+1)*cw, y0=-height/2+j*ch, y1=-height/2+(j+1)*ch, bh=random(cw*0.2,cw*0.8), bd=bh*random(2,3), dx=random(1,2), dy=random(1,2), dz=random(0.5,2); cells.push({x0,y0,x1,y1,bh,bd,dx,dy,dz}); } } } function drawCell(c,ph,tVal){ let {x0,y0,x1,y1,bh,bd,dx,dy,dz}=c; let v0=createVector(x0,y0,0), v1=createVector(x1,y0,0), v2=createVector(x1,y1,0), v3=createVector(x0,y1,0), b0=createVector(x0,y0,bd), b1=createVector(x1,y0,bd), b2=createVector(x1,y1,bd), b3=createVector(x0,y1,bd), tf=frameCount*nts; function oV(bv){ let _dx=map(noise(bv.x*nsf,bv.y*nsf,tf),0,1,-bd*dx,bd*dx), _dy=map(noise(bv.x*nsf+100,bv.y*nsf+100,tf),0,1,-bd*dy,bd*dy), _dz=map(noise(bv.x*nsf+200,bv.y*nsf+200,tf),0,1,-bd*dz,bd*dz); return p5.Vector.add(bv,createVector(_dx,_dy,_dz)); } let o0=oV(b0), o1=oV(b1), o2=oV(b2), o3=oV(b3), t0,t1,t2,t3; if(ph===0){t0=v0.copy();t1=v1.copy();t2=v2.copy();t3=v3.copy();} else if(ph===1){t0=p5.Vector.lerp(v0,b0,tVal);t1=p5.Vector.lerp(v1,b1,tVal); t2=p5.Vector.lerp(v2,b2,tVal);t3=p5.Vector.lerp(v3,b3,tVal);} else if(ph===2){t0=p5.Vector.lerp(b0,o0,tVal);t1=p5.Vector.lerp(b1,o1,tVal); t2=p5.Vector.lerp(b2,o2,tVal);t3=p5.Vector.lerp(b3,o3,tVal);} else if(ph===3){t0=p5.Vector.lerp(o0,v0,tVal);t1=p5.Vector.lerp(o1,v1,tVal); t2=p5.Vector.lerp(o2,v2,tVal);t3=p5.Vector.lerp(o3,v3,tVal);} stroke(255);noFill(); beginShape();vertex(v0.x,v0.y,v0.z);vertex(v1.x,v1.y,v1.z); vertex(v2.x,v2.y,v2.z);vertex(v3.x,v3.y,v3.z);endShape(CLOSE); beginShape();vertex(t0.x,t0.y,t0.z);vertex(t1.x,t1.y,t1.z); vertex(t2.x,t2.y,t2.z);vertex(t3.x,t3.y,t3.z);endShape(CLOSE); line(v0.x,v0.y,v0.z,t0.x,t0.y,t0.z); line(v1.x,v1.y,v1.z,t1.x,t1.y,t1.z); line(v2.x,v2.y,v2.z,t2.x,t2.y,t2.z); line(v3.x,v3.y,v3.z,t3.x,t3.y,t3.z); } function windowResized(){ resizeCanvas(windowWidth,windowHeight); cw=width/gc;ch=height/gr; createCells(); }
Perfect MazeAn on-chain generative script utilizing the Hunt and Kill maze generation technique combined with Depth-First Search—to create a perfect maze with no loops or inaccessible areas. Click three times to reveal the solution, then click again to generate a brand-new maze. The maze dynamically adjusts its size based on your window dimensions.
Hue WiperOn-Chain P5.js script responding to the Genuary 16 prompt \"Generative Palette\". Hues are randomly generated with each wipe. Several other subtle random variables. Click for new random width configuation of 50 bars. Canvas expands to window size.
https://ipfs.io/ipfs/QmaR8Uz3pKvRucSUc9Cnu8rqovzmhL1jeVcey9Wx1NP6V1let scaleRange = {min: 0.05, max: 0.12}, rarities = {vertical: 0.1, horizontal: 0.1, xShape: 0.03, outline: 0.01, empty: 0.59, fillColor: 0.01}, blackCellPercentage = 0.8, bgHexColors = [], bgHexSize, hueStart; function setup() {colorMode(HSB, 360, 100, 100); createCanvas(windowWidth, windowHeight); hueStart = random(360); noLoop(); drawGrid();} function initBgHexColors(mainHexSize) {bgHexColors = []; bgHexSize = mainHexSize / 4; let w = sqrt(3) * bgHexSize, h = 1.5 * bgHexSize; for (let y = 0, i = 0; y < height + h; y += h, i++) {let row = []; for (let x = 0; x < width + w; x += w) row.push({x: x + (i % 2 ? w / 2 : 0), y, color: color((hueStart + random(20)) % 360, random(50, 100), random(0, 70), 0.5)}); bgHexColors.push(row);}} function drawGrid() {background(0); let hexSize = random(scaleRange.min, scaleRange.max) * min(width, height), w = sqrt(3) * hexSize, h = 1.5 * hexSize; initBgHexColors(hexSize); drawBgHexLayer(); stroke(255); strokeWeight(min(width, height) * 0.002); for (let y = 0, i = 0; y < height + h; y += h, i++) for (let x = 0; x < width + w; x += w) drawHexCell(x + (i % 2 ? w / 2 : 0), y, hexSize, random() < blackCellPercentage);} function drawBgHexLayer() {noStroke(); bgHexColors.forEach(row => row.forEach(h => (fill(h.color), drawHexAt(h.x, h.y, bgHexSize))));} function drawHexCell(x, y, r, isBlack) { push(); translate(x, y); if (isBlack) { fill(0); noStroke(); drawHex(r); } let c = randomType(rarities); if (c === 'vertical') drawLine(0, -r, 0, r); else if (c === 'horizontal') drawLine(-sqrt(3) / 2 * r, 0, sqrt(3) / 2 * r, 0); else if (c === 'xShape') drawX(r); else if (c === 'fillColor') { fill(0, 0, 100); noStroke(); drawHex(r); } if (c === 'outline') drawHex(r); if (c !== 'outline') drawEdges(r); pop(); } function drawHex(r) {beginShape(); for (let i = 0; i < 6; i++) vertex(cos((TWO_PI / 6) * i - PI / 6) * r, sin((TWO_PI / 6) * i - PI / 6) * r); endShape(CLOSE);} function drawHexAt(x, y, r) {push(); translate(x, y); drawHex(r); pop();} function drawX(r) {drawLine(-sqrt(3) / 2 * r, -r / 2, sqrt(3) / 2 * r, r / 2); drawLine(-sqrt(3) / 2 * r, r / 2, sqrt(3) / 2 * r, -r / 2);} function drawLine(x1, y1, x2, y2) {stroke(255); line(x1, y1, x2, y2);} function drawEdges(r) {stroke(200); for (let i = 0, s = []; i < int(random(1, 3)); i++) {let ed; do ed = int(random(6)); while (s.includes(ed)); s.push(ed); let a1 = (TWO_PI / 6) * ed - PI / 6, a2 = (TWO_PI / 6) * ((ed + 1) % 6) - PI / 6; drawLine(cos(a1) * r, sin(a1) * r, cos(a2) * r, sin(a2) * r);}} function randomType(w) {let t = Object.values(w).reduce((a, b) => a + b, 0), p = random(t), c = 0; for (let k in w) if ((c += w[k]) > p) return k;} function mousePressed() {hueStart = random(360); drawGrid();} function windowResized() {resizeCanvas(windowWidth, windowHeight); drawGrid();}
1-50 of 97