0xaf0c0936…b4desent to0xa7d8d9ef…d270·#14,650,523·view on Etherscan
(()=>{"use strict";const t=new THREE.Vector3;function e(e,n,o,s,r,a){const i=2*Math.PI*r/4,c=Math.max(a-2*r,0),l=Math.PI/4;t.copy(n),t[s]=0,t.normalize();const d=.5*i/(i+c),h=1-t.angleTo(e)/l;return 1===Math.sign(t[o])?h*d:c/(i+c)+d+d*(1-h)}class n extends THREE.BoxBufferGeometry{constructor(t=1,n=1,o=1,s=2,r=.1){if(s=2*s+1,r=Math.min(t/2,n/2,o/2,r),super(1,1,1,s,s,s),1===s)return;const a=this.toNonIndexed();this.index=null,this.attributes.position=a.attributes.position,this.attributes.normal=a.attributes.normal,this.attributes.uv=a.attributes.uv;const i=new THREE.Vector3,c=new THREE.Vector3,l=new THREE.Vector3(t,n,o).divideScalar(2).subScalar(r),d=this.attributes.position.array,h=this.attributes.normal.array,f=this.attributes.uv.array,p=d.length/6,u=new THREE.Vector3,E=.5/s;for(let s=0,a=0;s<d.length;s+=3,a+=2)switch(i.fromArray(d,s),c.copy(i),c.x-=Math.sign(c.x)*E,c.y-=Math.sign(c.y)*E,c.z-=Math.sign(c.z)*E,c.normalize(),d[s+0]=l.x*Math.sign(i.x)+c.x*r,d[s+1]=l.y*Math.sign(i.y)+c.y*r,d[s+2]=l.z*Math.sign(i.z)+c.z*r,h[s+0]=c.x,h[s+1]=c.y,h[s+2]=c.z,Math.floor(s/p)){case 0:u.set(1,0,0),f[a+0]=e(u,c,"z","y",r,o),f[a+1]=1-e(u,c,"y","z",r,n);break;case 1:u.set(-1,0,0),f[a+0]=1-e(u,c,"z","y",r,o),f[a+1]=1-e(u,c,"y","z",r,n);break;case 2:u.set(0,1,0),f[a+0]=1-e(u,c,"x","z",r,t),f[a+1]=e(u,c,"z","x",r,o);break;case 3:u.set(0,-1,0),f[a+0]=1-e(u,c,"x","z",r,t),f[a+1]=1-e(u,c,"z","x",r,o);break;case 4:u.set(0,0,1),f[a+0]=1-e(u,c,"x","y",r,t),f[a+1]=1-e(u,c,"y","x",r,n);break;case 5:u.set(0,0,-1),f[a+0]=e(u,c,"x","y",r,t),f[a+1]=1-e(u,c,"y","x",r,n)}}}const o=new class{constructor(t){this.useA=!1;let e=function(t){let e=parseInt(t.substr(0,8),16),n=parseInt(t.substr(8,8),16),o=parseInt(t.substr(16,8),16),s=parseInt(t.substr(24,8),16);return function(){e|=0,n|=0,o|=0,s|=0;let t=(e+n|0)+s|0;return s=s+1|0,e=n^n>>>9,n=o+(o<<3)|0,o=o<<21|o>>>11,o=o+t|0,(t>>>0)/4294967296}};this.prngA=new e(t.hash.substr(2,32)),this.prngB=new e(t.hash.substr(34,32));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}rd(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}rn(t,e){return t+(e-t)*this.rd()}ri(t,e){return Math.floor(this.rn(t,e+1))}rb(t=.5){return this.rd()<t}rc(t){return t[this.ri(0,t.length-1)]}}(tokenData);let s=!/\bHeadlessChrome/.test(navigator.userAgent);const r=(t=-1)=>{const e=o.rn(t,1),n=2*o.rd()*Math.PI,s=Math.sqrt(1-e**2),r=s*Math.cos(n),a=s*Math.sin(n);return new THREE.Vector3(r,a,e)},a=t=>0==t?r(0):r(),i={s:{ranges:[[.1,.3],[.1,.3],[.1,.3]]},m:{ranges:[[.2,.5],[1,2],[.1,.5]]},l:{ranges:[[1,3.5],[4,6],[.5,2.5]]}},c=[{name:"day",light:.45,shadow:.015,ply:1.75},{name:"dawn",light:.35,shadow:.015,ply:.5},{name:"dusk",light:.23,shadow:.03,ply:-1.75}],l=(t=0)=>new THREE.MeshStandardMaterial({roughness:.4,side:THREE.DoubleSide,metalness:t}),d=(t,e=0)=>{if(0==t)return l(e);{const t=l(e);return[t,t,t,t,null,null]}};let h=0;const f=o.rc([{name:"soapbar mudbar",colors:["#ff0000","#0000ff"],bgColors:["#ffffff"],spot:["#00fffc"]},{name:"primary sink",colors:["#ff006e","#3a86ff","#ffbe0b","#003049"],bgColors:["#737373"],spot:["#00fffc"]},{name:"pasteleria",l:!0,f:!0,colors:["#70d6ff","#ff70a6","#d9ed92","#e9ff70"],bgColors:["#BAD0E6","#d9d9d9"],spot:["#00fffc"]},{name:"sliver",l:!0,f:!0,colors:["#c4c4c4","#878787","#575757","#dbfdff"],bgColors:["#afc6e4","#b2cedc"],spot:["#00aaff"]},{name:"royalty",f:!0,u:!0,colors:["#2d2c01","#FFE047","#edc531","#ffaa00","#ffd500"],c2:["#1c0bfe","#5e00bd","#becbfe","#b343fe"],bgColors:["#e3e3e3","#ded9e8"],spot:["#383800"],s2:["#570981"]},{name:"pure guava",f:!0,colors:["#ff1f96","#f129ff","#ff0000","#d4ff00","#62d24b"],bgColors:["#e3e3e3","#ffcccc"],spot:["#ed0c39"]}]);f.u&&(o.rb()?(f.colors=f.c2,f.spot=f.s2):h=.3);const p=o.rc(["piet","von","vich"]),u=o.rd();let E="unknown";E="vich"==p?"irrelevant":u<.25?"minimal":u<.75?"moderate":"total";const w=o.rc([9,13,17,22,25,33,37]),g=o.rc([0,1]),m=d(g,h),b=o.rb(.7),y=40;let M=o.rc([8,0,y,0,0,y,y]);const R=o.rc(f.bgColors);let H=o.ri(0,1);const T=o.rc(["gang","mob","anarchopanda"]);let x=null,z=2*Math.PI;"gang"==T?(x=[0,1,2].map((t=>a(g))),z=Math.PI/12):"mob"==T&&(x=[0,1,2,3,4].map((t=>a(g))),z=Math.PI/6),f.l&&(c[0]=c[2]);const S=o.rc(c),v=o.rd(),P=o.rd(),A=o.rc([.02,.02,.03,.03,.03,.04,.04,.05,.08]),I=["#ff3030","#393939"];let k=!1;0==g&&o.rb(.04)&&(k=!0,M=y);const C=o.rd(),L=t=>{if(k){const e=o.rb(C);et(t,e?I[0]:I[1])}},B=document.createElement("canvas");document.body.appendChild(B);const V=new THREE.Scene;V.fog=new THREE.FogExp2("#000000",.0125);const F=new THREE.AmbientLight(16777215,S.light);V.add(F);const D=o.rc(f.colors);if(f.f){const t=f.colors.indexOf(D);-1!=t&&f.colors.splice(t,1)}const G=o.rc(f.colors),j=new THREE.HemisphereLight(D,G,.3);V.add(j);let O=S.shadow;const W=o.rc(f.spot),q=new THREE.DirectionalLight(W,.3-O);q.position.set(1,.25,2),V.add(q);const X=q.clone();X.intensity=O,X.castShadow=!0,X.shadow.camera.near=-5,X.shadow.camera.far=6,X.shadow.mapSize.width=512,X.shadow.mapSize.height=512,X.shadow.bias=-.004,V.add(X);const Z=new THREE.PointLight("#ffA733",.5,10,2);Z.position.set(.5,S.ply,-5),Z.lookAt(0,0,0),V.add(Z);const N=new THREE.PointLight("#fff1a8",.2,10,2);V.add(N);const J=new THREE.Group,K=-Math.PI*o.rn(-.04,.03),Q=-Math.PI*o.rn(-.02,.03),U=(t,e=null)=>{const s=(t=>{const e=i[t].ranges.map((t=>o.rn(...t)));return new n(...e,16,A)})(t),r=o.rb(P),a=e||d(r?0:1,h),c=new THREE.Mesh(s,a);return c.castShadow=!0,c.receiveShadow=!0,c.position.z=3,c.rotateZ(K),c.rotateX(Q),c},Y=(t,e)=>{var n=(new THREE.Box3).setFromObject(t,!0);for(let t of e){var o=(new THREE.Box3).setFromObject(t,!0);if(n.intersectsBox(o))return!0}return!1},$=[.15,.4],_=(t,e)=>{const n=(()=>{let t=null;if(x){t=o.rc(x);const e=new THREE.Euler(o.rn(-z,z),o.rn(-z,z),o.rn(-z,z));t.applyEuler(e)}else t=a(g);return t})();for(;Y(t,e.children);){const e=o.rn(...$);t.position.addScaledVector(n,e)}},tt=t=>{const e=o.rb(u);let n=0;"piet"==p&&e?n=.5*Math.PI:"von"==p?(n=.25*Math.PI,e&&(n=-n)):"vich"==p&&(n=o.rn(0,Math.PI)),t.rotateZ(n)},et=(t,e)=>{t.material instanceof Array?(t.material[0].color.set(e),t.material[0].metalness=.5):(t.material.color.set(e),t.material.metalness=.5)},nt=U("l",m);b&&tt(nt),nt.rotateX(.1),L(nt),J.add(nt);for(let t=1;t<w;t++){const t=U(o.rb(v)?"m":"s");_(t,J),tt(t),t.position.z<6.2&&J.add(t),L(t)}V.add(J),J.children.reduce(((t,e)=>t+e.position.z),0),J.children.length;const ot=J.children.reduce(((t,e)=>e.position.z>t.position.z?e:t),J.children[0]),st=ot.position.z;let rt=3;if(1==g&&(rt=st),Z.position.z=o.rn(-3,rt),M!=y){const t=0==H?"#ffffff":"#444444",e=new THREE.MeshStandardMaterial({color:t,roughness:.5,side:THREE.DoubleSide,metalness:0}),n=new THREE.Mesh(new THREE.SphereGeometry(45,16,12),e),o=f.l?.1:.25,s=new THREE.SpotLight("#ffffff",o);s.angle=1.5*Math.PI,s.penumbra=1,s.position.set(30,-15,-10),s.target.position.set(0,0,-45),V.add(s),V.add(s.target);const r=s.clone();s.position.set(-15,30,-10),s.target.position.set(0,0,-45),V.add(r),V.add(r.target),V.fog.density=1e-4,V.add(n)}if(M>0){const t=new THREE.MeshStandardMaterial({color:R,roughness:.6,side:THREE.DoubleSide,metalness:k?.25:0});if(M==y){const e=new THREE.Mesh(new THREE.SphereGeometry(M,16,12),t);e.receiveShadow=!0,V.fog.density=.0125,V.add(e)}else{const e=new THREE.Mesh(new THREE.PlaneGeometry(M,M),t);e.receiveShadow=!0,V.add(e)}}const at={width:window.innerWidth,height:window.innerHeight},it=(t=.99)=>r(t).multiplyScalar(8),ct=()=>{if(o.rb(.66))return it(.98);{const t=o.ri(1,J.children.length-1),e=J.children[t],n=o.rn(e.position.length()+.5,9);return e.position.clone().setLength(n)}},lt=new THREE.PerspectiveCamera(75,at.width/at.height,.01,100),dt=ct(),ht=dt.clone();ht.clampLength(7,9),lt.position.copy(ht),lt.lookAt(nt.position),N.position.copy(lt.position),N.lookAt(nt.position),V.add(lt);const ft=new THREE.WebGLRenderer({antialias:!0,canvas:B});ft.setSize(at.width,at.height),ft.setPixelRatio(Math.min(window.devicePixelRatio,2)),ft.shadowMap.enabled=!0,ft.shadowMap.type=THREE.PCFSoftShadowMap,window.addEventListener("resize",(()=>{at.width=window.innerWidth,at.height=window.innerHeight,lt&&(lt.aspect=at.width/at.height,lt.updateProjectionMatrix()),ft&&(ft.setSize(at.width,at.height),ft.setPixelRatio(Math.min(window.devicePixelRatio,2)))}));let pt=dt;8==dt.length()&&(pt=(()=>{const t=ot.position.clone();return t.z+=o.rn(.1,3),t})());let ut=it();const Et=4*Math.PI,wt=.38*Et;let gt=0;const mt=new THREE.Clock,bt=()=>{try{if(s){const n=mt.getElapsedTime()+wt,o=Math.floor(n/Et);o!=gt&&(gt=o,pt=lt.position.clone(),ut=ct());const s=n%Et;lt.position.lerpVectors(pt,ut,(t=s,e=1-0,(t/=Et/2)<1?e/2*t*t*t*t*t+0:e/2*((t-=2)*t*t*t*t+2)+0)),lt.lookAt(nt.position),N.position.copy(lt.position),N.lookAt(nt.position)}ft.render(V,lt),window.requestAnimationFrame(bt)}catch(t){console.log(t)}var t,e};let yt=0;document.body.onkeyup=function(t){" "==t.key|"Space"==t.code&&(mt.running?(yt=mt.getElapsedTime(),mt.stop()):(mt.start(),mt.elapsedTime=yt))},bt()})();