0x4666fd1f…6b59sent to0x62e37f66…923b·#13,759,692·view on Etherscan
function e(e){return e&&e.__esModule?e.default:e}var t={};t="precision highp float;\n#define GLSLIFY 1\nvarying vec2 vPos;\nuniform sampler2D p;\nuniform float rr;\nuniform float pd;\nuniform vec2 resolution;\n\nfloat rnd(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt = dot(co.xy, vec2(a, b));\n highp float sn = mod(dt, 3.14);\n return fract(sin(sn) * c);\n}\n\nvoid main() {\n vec2 uv = vPos * .5 + .5;\n gl_FragColor.rgb = texture2D(p, vec2(uv.x, 1. - uv.y)).rgb;\n\n vec2 uvSand = gl_FragCoord.xy/min(resolution.x,resolution.y);\n uvSand = floor(uvSand * 2048. / pd);\n uvSand += vec2(123.456, 31.171);\n uvSand += rr;\n gl_FragColor.rgb += .1 * rnd(uvSand);\n\n gl_FragColor.a = 1.;\n gl_FragColor = clamp(gl_FragColor, 0., 1.);\n}\n";var h={};h="precision highp float;\n#define GLSLIFY 1\nvarying vec2 vPos;\nattribute vec3 aPosition;\nvoid main() {\n vPos = (gl_Position = vec4(aPosition,1.0)).xy;\n}\n";class i{constructor(e){this.seed=e,this.rnd=this.rnd.bind(this),this.range=this.range.bind(this),this.rangeFloor=this.rangeFloor.bind(this),this.pick=this.pick.bind(this),this.shuffleArray=this.shuffleArray.bind(this),this.gaussian=this.gaussian.bind(this),this._hasNextGaussian=!1,this._nextGaussian=null}rnd(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}range(e,t){return t?this.rnd()*(t-e)+e:this.rnd()*e}rangeFloor(e,t){return Math.floor(this.range(e,t))}pick(e){return e[this.rangeFloor(0,e.length)]}shuffleArray(e){for(var t,h,i=e.length,n=e.slice();i;)t=Math.floor(this.rnd()*i--),h=n[i],n[i]=n[t],n[t]=h;return n}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,n=0,s=0;do{s=(i=2*this.rnd()-1)*i+(n=2*this.rnd()-1)*n}while(s>=1||0===s);var r=Math.sqrt(-2*Math.log(s)/s);return this._nextGaussian=n*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const n=(e,t,h,i=!1)=>i?s(e+(t-e)*h,0,1):e+(t-e)*h,s=(e,t,h)=>e<t?t:e>h?h:e,r=(e,t,h)=>Array.isArray(t)?t[e*t.length|0]:t||0===t?h||0===h?(t>h&&([t,h]=[h,t]),t+e()*(h-t)):e()*t:e(),o=(e,t,h,i,n,s,a,d,f,l)=>{if(n--,l||n>=0&&r(f)<a)if(h>=i){let l=h*r(f,d[0],d[1]);o(e,t,l,i,n,s,a,d,f),o(e+l,t,h-l,i,n,s,a,d,f)}else{let l=i*r(f,d[0],d[1]);o(e,t,h,l,n,s,a,d,f),o(e,t+l,h,i-l,n,s,a,d,f)}else s.push({x:e,y:t,w:h,h:i,n:n})},a=(e,t,h,i,n,s,o,d,f,l)=>{if(n--,l||n>=0&&r(f)<o){let l=h*r(f,d[0],d[1]);a(e,t,l,i,n,s,o,d,f),a(e+l,t,h-l,i,n,s,o,d,f)}else s.push({x:e,y:t,w:h,h:i,n:n})},d=(e,t,h,i,n,s,o,a,f,l)=>{if(n--,l||n>=0&&r(f)<o){let l=i*r(f,a[0],a[1]);d(e,t,h,l,n,s,o,a,f),d(e,t+l,h,i-l,n,s,o,a,f)}else s.push({x:e,y:t,w:h,h:i,n:n})},f=(e,t,h,i,n,s,r=.7,o,a)=>{if(n--,a||n>=0&&o()<r){let a=h/2,d=i/2;f(e,t,a,d,n,s,r,o),f(e+a,t,a,d,n,s,r,o),f(e+a,t+d,a,d,n,s,r,o),f(e,t+d,a,d,n,s,r,o)}else s.push({x:e,y:t,w:h,h:i,n:n})},l=(e,t,h)=>e.map(((i,s)=>n(e[s],t[s],h))),c=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),g=(e,t)=>{const h=[],i=Math.ceil(t/e.length),n=1/i,s=e.map((e=>c(e)));for(let e=0;e<s.length;e+=1)for(let t=0;t<i;t+=1){const i=s[e],r=s[(e+1)%s.length];h.push(l(i,r,(t+1)*n))}return h},u=(e,t,h,i,n,s)=>{const r=i>=0?i:0,o=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return n.forEach(((e,t)=>o.addColorStop(e,s[t]))),e.drawingContext.fillStyle=o,o},p=(e,t,h,i,n,s,r)=>{const o=e.drawingContext.createLinearGradient(t,h,i,n);return s.forEach(((e,t)=>o.addColorStop(e,r[t]))),e.drawingContext.fillStyle=o,o},w=(e,t,h,i,n,s,r,o,a)=>{const d=[];for(let f=0;f<=a;f+=1){const l=f/a,c=bezierPoint(e,h,n,r,l),g=bezierPoint(t,i,s,o,l);d.push({x:c,y:g})}return d},b=(e,t,h,i,n)=>{const s=[];for(let r=0;r<h;r+=1)s.push({x:e+i*cos(n),y:t+i*sin(n)}),n+=360/h;return s},x=(e,t,h,i,s,r)=>{const o=b(e,t,i,s,r),a=h/i,d=[];for(let e=0;e<i;e+=1)for(let t=0;t<a;t+=1){const h=n(o[e].x,o[(e+1)%o.length].x,t/a),i=n(o[e].y,o[(e+1)%o.length].y,t/a);d.push({x:h,y:i})}return d},y=(e,t,h,i,s)=>{const r=[];for(let o=0;o<s-1;o+=1){const a=n(e,h,o/(s-1)),d=n(t,i,o/(s-1));r.push({x:a,y:d})}return r.push({x:h,y:i}),r},v=[["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#80ffdb"],["#F9FBFF","#212121","#F9FBFF","#212121","#F9FBFF","#212121"],["#efffff","#f20082","#5db1ff","#ff00ca","#3a0bba"],["#521262","#6639a6","#3490de","#6fe7dd","#ff7c38","#e03e36","#b80d57","#700961"],["#a7ff83","#17b978","#086972","#071a52","#80d6ff","#edf798","#fab57a","#f06868"],["#01608F","#EF91A9","#EB4626","#F4BA10","#34A096","#2C2F8C"],["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d90429"],["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"],["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#283d3b","#197278","#edddd4","#c44536","#772e25"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d80032"],["#50514f","#f25f5c","#ffe066","#247ba0","#70c1b3"],["#fffcf2","#ccc5b9","#403d39","#252422","#eb5e28"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#002642","#840032","#e59500","#e5dada","#02040f"],["#0c0a3e","#7b1e7a","#b33f62","#f9564f","#f3c677"],["#b80c09","#0b4f6c","#01baef","#fbfbff","#040f16"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#1f271b","#19647e","#28afb0","#f4d35e","#ee964b"],["#06aed5","#086788","#f0c808","#fff1d0","#dd1c1a"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#001524","#15616d","#ffecd1","#ff7d00","#78290f"],["#dad2d8","#143642","#0f8b8d","#ec9a29","#a8201a"],["#003049","#d62828","#f77f00","#fcbf49"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#55dde0","#33658a","#2f4858","#f6ae2d","#f26419"],["#010417","#0029c1","#2bb59c","#f7dc09","#e22b00"],["#0c090d","#e01a4f","#f15946","#f9c22e","#53b3cb"],["#01638d","#abcecc","#fff2cd","#ff004c","#610d4b"],["#2d728f","#3b8ea5","#f5ee9e","#f49e4c","#ab3428"],["#d00000","#ffba08","#3f88c5","#032b43","#032b43"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#083d77","#f4d35e","#ee964b","#f95738"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#010000","#a74c00","#ffa100","#ffd300","#f1f2f1"],["#e6eed6","#bbc5aa","#a72608","#090c02"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#fff2cd","#abcecc","#01638d","#ff004c","#610d4b"],["#33658a","#86bbd8","#2f4858","#f6ae2d","#f26419"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#820263","#d90368","#eadeda","#2e294e","#ffd400"],["#a832a0","#7d32a8","#598fb5","#fffb00"],["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],["#003f88","#00509d","#fdc500","#ffd500"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#0d1b2a","#1b263b","#415a77","#778da9","#e0e1dd"],["#0c0f0a","#ff206e","#fbff12","#41ead4"],["#000000","#2f4550","#586f7c","#b8dbd9","#f4f4f9"],["#970005","#ed0101","#0c44ac","#000052"],["#ff6d69","#fecc50","#0be7fb","#010b8b","#1e0521"],["#c9e4ca","#87bba2","#55828b","#3b6064","#364958"]];var k;const m=void 0;let C;const F=new i((W=tokenData,parseInt(W.hash.slice(0,16),16))),{rnd:S,range:M,rangeFloor:E,pick:_,shuffleArray:G}=F;var W;let A,R,L;const P={};let D,N,z,B;function setup(){z=createCanvas(D,N,WEBGL),A=createShader(e(h),e(t)),angleMode(DEGREES),L=createGraphics(D,N),R=()=>{B=.001*width,L.strokeCap(SQUARE),L.angleMode(DEGREES);const e=E(v.length-1);console.log(v.length-1),P.currentPalette=v[e];const t=S();P.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":_(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),P.size=10*B,"tree"===P.shape&&(P.size=12*B),P.waveR=M(.1,1),"tree"===P.shape&&(P.waveR=0),"v-streams"===P.shape&&(P.waveR=S()>.95?.9:M(.6,2)),"h-streams"===P.shape&&(P.waveR=M(.4,2)),"spiral"===P.shape&&(P.waveR=M(1,4)),"curls"===P.shape&&(P.waveR=M(.2,1.5)),"plexus"===P.shape&&(P.waveR=M(.3,4)),P.roots="structure"!==P.shape&&S()>.5,P.noFill=P.roots&&S()>.9;const h=S()>.8;P.roots?P.angle=h?M(20,180):_([30,60,90,120,150,180]):P.angle=h?M(20,100):_([30,60,90]),P.blackStroke=P.roots&&S()>.7,P.divider=P.roots?E(3,21):E(3,9),"tree"===P.shape&&(P.divider=E(3,6)),P.bigStroke="structure"!==P.shape&&S()>.95,P.longColors=S()>.7,P.rCount=200;const i=void 0,n=!["curls","plexus"].includes(P.shape)&&S()>.9;P.weeds=n?M(1,2):1,"wall"===P.shape&&(P.waveR=0,P.roots=!0),"tree"===P.shape&&(P.rCount=1e3),P.colorCount=Math.round(map(S(),0,1,.5*P.rCount,1.5*P.rCount)),P.longColors&&(P.colorCount=Math.round(map(S(),0,1,1.5*P.rCount,3*P.rCount))),"structure"===P.shape&&(P.rCount=100,P.colorCount=Math.round(map(S(),0,1,100,300)));const{colorCount:s,rCount:r}=P,o=G(P.currentPalette);P.lerpColors=g(G(o),s).map((e=>color(e))),P.backColors=g(G(o),s/2).map((e=>color(e))),P.backColors2=g(G(o),s).map((e=>{const t=color(e);return t.setAlpha(100),t}));let a=[],d=[];if("h-storm"===P.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=M(.25,.75),h=w(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);a=[...a,...h]}if("v-storm"===P.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=M(.25,.75),h=w(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);a=[...a,...h]}if("wall"===P.shape){const e=new Array(200).fill(null).map((()=>({x:M(width),y:M(height)})));a=[...y(0,.05*height,width,.05*height,800),...y(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===P.shape&&(a=[...Q(width/2,.25*height,.6*width,180,400),...Q(width/2,.5*height,.6*width,180,400),...Q(width/2,.75*height,.6*width,180,400),...Q(width/2,.25*height,.6*width,-180,400),...Q(width/2,.5*height,.6*width,-180,400),...Q(width/2,.75*height,.6*width,-180,400)]),"oscillations"===P.shape){const e=M(.8,1.2);a=[...Y(width/2,height/2,width,360,1600,e),...Y(width/2,height/2,.6*width,360,800,e)]}if("curls"===P.shape&&(a=V(width/2,height/2,.7*width,360,1600,E(3,10))),"spiral"===P.shape){const e=O(width/2,height/2,.01*width,1440,