0x4666fd1f…6b59sent to0x62e37f66…923b·#13,789,321·view on Etherscan
class e{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}setSeed(e){this.seed=e}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,s=e.slice();i;)t=Math.floor(this.rnd()*i--),h=s[i],s[i]=s[t],s[t]=h;return s}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,s=0,n=0;do{n=(i=2*this.rnd()-1)*i+(s=2*this.rnd()-1)*s}while(n>=1||0===n);var r=Math.sqrt(-2*Math.log(n)/n);return this._nextGaussian=s*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const t=(e,t,i,s=!1)=>s?h(e+(t-e)*i,0,1):e+(t-e)*i,h=(e,t,h)=>e<t?t:e>h?h:e,i=(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(),s=(e,t,h,n,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o)if(h>=n){let l=h*i(f,a[0],a[1]);s(e,t,l,n,r,d,o,a,f),s(e+l,t,h-l,n,r,d,o,a,f)}else{let l=n*i(f,a[0],a[1]);s(e,t,h,l,r,d,o,a,f),s(e,t+l,h,n-l,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:n,n:r})},n=(e,t,h,s,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o){let l=h*i(f,a[0],a[1]);n(e,t,l,s,r,d,o,a,f),n(e+l,t,h-l,s,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:r})},r=(e,t,h,s,n,d,o,a,f,l)=>{if(n--,l||n>=0&&i(f)<o){let l=s*i(f,a[0],a[1]);r(e,t,h,l,n,d,o,a,f),r(e,t+l,h,s-l,n,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:n})},d=(e,t,h,i,s,n,r=.7,o,a)=>{if(s--,a||s>=0&&o()<r){let a=h/2,f=i/2;d(e,t,a,f,s,n,r,o),d(e+a,t,a,f,s,n,r,o),d(e+a,t+f,a,f,s,n,r,o),d(e,t+f,a,f,s,n,r,o)}else n.push({x:e,y:t,w:h,h:i,n:s})},o=(e,h,i)=>e.map(((s,n)=>t(e[n],h[n],i))),a=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),f=(e,t)=>{const h=[],i=Math.ceil(t/e.length),s=1/i,n=e.map((e=>a(e)));for(let e=0;e<n.length;e+=1)for(let t=0;t<i;t+=1){const i=n[e],r=n[(e+1)%n.length];h.push(o(i,r,(t+1)*s))}return h},l=(e,t,h,i,s,n)=>{const r=i>=0?i:0,d=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return s.forEach(((e,t)=>d.addColorStop(e,n[t]))),e.drawingContext.fillStyle=d,d},c=(e,t,h,i,s,n,r)=>{const d=e.drawingContext.createLinearGradient(t,h,i,s);return n.forEach(((e,t)=>d.addColorStop(e,r[t]))),e.drawingContext.fillStyle=d,d},g=(e,t,h,i,s,n,r,d,o)=>{const a=[];for(let f=0;f<=o;f+=1){const l=f/o,c=bezierPoint(e,h,s,r,l),g=bezierPoint(t,i,n,d,l);a.push({x:c,y:g})}return a},p=(e,t,h,i,s)=>{const n=[];for(let r=0;r<h;r+=1)n.push({x:e+i*cos(s),y:t+i*sin(s)}),s+=360/h;return n},u=(e,h,i,s,n,r)=>{const d=p(e,h,s,n,r),o=i/s,a=[];for(let e=0;e<s;e+=1)for(let h=0;h<o;h+=1){const i=t(d[e].x,d[(e+1)%d.length].x,h/o),s=t(d[e].y,d[(e+1)%d.length].y,h/o);a.push({x:i,y:s})}return a},w=(e,h,i,s,n)=>{const r=[];for(let d=0;d<n-1;d+=1){const o=t(e,i,d/(n-1)),a=t(h,s,d/(n-1));r.push({x:o,y:a})}return r.push({x:i,y:s}),r},b=[["#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 x;console.log("\nmade by\n█▀▀ █░░█ ▀█░█▀ █▀▀ █▀▄▀█ █▀▀▄ █░░ █▀▀▄ █▀▀█\n▀▀█ █▀▀█ ░█▄█░ █▀▀ █░▀░█ █▀▀▄ █░░ █░░█ █▄▄▀\n▀▀▀ ▀░░▀ ░░▀░░ ▀▀▀ ▀░░░▀ ▀▀▀░ ▀▀▀ ▀▀▀░ ▀░▀▀\n ");const y=void 0;let k=(C=tokenData,parseInt(C.hash.slice(0,16),16)),v=k;var C;const m=new e(k),{rnd:F,range:S,rangeFloor:M,pick:W,shuffleArray:E}=m;let A,G;const R={};let _,N,z,D;function setup(){z=createCanvas(_,N),angleMode(DEGREES),G=createGraphics(_,N),A=()=>{D=.001*width,G.strokeCap(SQUARE),G.angleMode(DEGREES);const e=M(b.length-1);R.currentPalette=b[e];const t=F();R.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":W(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),R.size=10*D,"tree"===R.shape&&(R.size=12*D),R.waveR=S(.1,1),"tree"===R.shape&&(R.waveR=0),"v-streams"===R.shape&&(R.waveR=F()>.95?.9:S(.6,2)),"h-streams"===R.shape&&(R.waveR=S(.4,2)),"spiral"===R.shape&&(R.waveR=S(1,4)),"curls"===R.shape&&(R.waveR=S(.2,1.5)),"plexus"===R.shape&&(R.waveR=S(.3,4)),R.roots="structure"!==R.shape&&F()>.8,R.noFill=R.roots&&F()>.9;const h=F()>.8;R.roots?R.angle=h?S(20,180):W([30,60,90,120,150,180]):R.angle=h?S(20,100):W([30,60,90]),R.blackStroke=R.roots&&F()>.7,R.divider=R.roots?M(3,21):M(3,9),"tree"===R.shape&&(R.divider=M(3,6)),R.bigStroke="structure"!==R.shape&&F()>.95,R.longColors=F()>.7,R.rCount=200;const i=void 0,s=!["curls","plexus"].includes(R.shape)&&F()>.9;R.weeds=s?S(1,2):1,"wall"===R.shape&&(R.waveR=0,R.roots=!0),"tree"===R.shape&&(R.rCount=1e3),R.colorCount=Math.round(map(F(),0,1,.5*R.rCount,1.5*R.rCount)),R.longColors&&(R.colorCount=Math.round(map(F(),0,1,1.5*R.rCount,3*R.rCount))),"structure"===R.shape&&(R.rCount=100,R.colorCount=Math.round(map(F(),0,1,100,300)));const{colorCount:n,rCount:r}=R,d=E(R.currentPalette);R.lerpColors=f(E(d),n).map((e=>color(e))),R.backColors=f(E(d),n/2).map((e=>color(e))),R.backColors2=f(E(d),n).map((e=>{const t=color(e);return t.setAlpha(100),t}));let o=[],a=[];if("h-storm"===R.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=S(.25,.75),h=g(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);o=[...o,...h]}if("v-storm"===R.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=S(.25,.75),h=g(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);o=[...o,...h]}if("wall"===R.shape){const e=new Array(200).fill(null).map((()=>({x:S(width),y:S(height)})));o=[...w(0,.05*height,width,.05*height,800),...w(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===R.shape&&(o=[...O(width/2,.25*height,.6*width,180,400),...O(width/2,.5*height,.6*width,180,400),...O(width/2,.75*height,.6*width,180,400),...O(width/2,.25*height,.6*width,-180,400),...O(width/2,.5*height,.6*width,-180,400),...O(width/2,.75*height,.6*width,-180,400)]),"oscillations"===R.shape){const e=S(.8,1.2);o=[...I(width/2,height/2,width,360,1600,e),...I(width/2,height/2,.6*width,360,800,e)]}if("curls"===R.shape&&(o=q(width/2,height/2,.7*width,360,1600,M(3,10))),"spiral"===R.shape){const e=$(width/2,height/2,width*S(.01,.005),1440,1600,.1);o=F()>.5?e.reverse():e}if("v-streams"===R.shape)for(let e=.1*width;e<width;e+=.2*width){const t=w(e,0,e,height,400);o=[...o,...t]}if("h-streams"===R.shape)for(let e=.1*height;e<height;e+=.2*height){const t=w(0,e,width,e,400);o=[...o,...t]}if("unity"===R.shape){const e=S(360),t=u(.5*width,.33*height,400,400,.3*width,e),h=u(.5*width,.66*height,400,400,.3*width,e);o=F()>.95?E([...t,...h]):[...t,...h]}if("structure"===R.shape){for(let e=.2*width;e<width;e+=.2*width){const t=w(e,.1*height,e,.9*height,400);o=[...o,...t]}for(let e=.2*height;e<height;e+=.2*height){const t=w(.1*width,e,.9*width,e,400);o=[...o,...t]}}if("grass"===R.shape){for(let e=.05*-width;e<1.1