0x57ca1267…d46csent to0xf28f163e…abec·#23,036,964·view on Etherscan
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);
}