0xe8e01e71…b877sent to0xa7d8d9ef…d270·#15,538,574·view on Etherscan
class Random{constructor(){this.useA=!1;let e=function(e){let r=parseInt(e.substr(0,8),16),t=parseInt(e.substr(8,8),16),l=parseInt(e.substr(16,8),16),o=parseInt(e.substr(24,8),16);return function(){r|=0,t|=0,l|=0,o|=0;let e=(r+t|0)+o|0;return o=o+1|0,r=t^t>>>9,t=l+(l<<3)|0,l=l<<21|l>>>11,l=l+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}rdm(e,r=0){return Math.round(r+this.random_dec()*e)}}let grdBackgroundColIn,grdBackgroundColOut,grdAColIn,grdAColOut,grdBColIn,grdBColOut,grdBackground,grdA,grdB,grdC,grdBackgroundSettings,R=new Random,blocksize=8,compression=.3,sizer=1,canvas=document.createElement("canvas"),bgImage=document.createElement("img"),ctx=canvas.getContext("2d"),slices=R.rdm(100);console.log(slices);let divideTopVal,resizeTimer,divideTopVal2=0,style=document.createElement("style"),ss=e=>style.sheet.insertRule(e);function resizeEnded(){ctx.clearRect(0,0,canvas.width,canvas.height),makeCompression()}function makeGradient(e,r,t){let l;l=ctx.createLinearGradient(0,e*canvas.height,canvas.width,0);for(let e=0;e<t.length;e++)l.addColorStop(r[e],t[e]);return l}function setColors(e){console.log(e);let r=0==R.rdm(3)?"dark":"color";console.log("startcolor: "+r),grdBackgroundColIn=returnColor(r),grdBackgroundColOut=returnColor(e,grdBackgroundColIn),grdAColIn=returnColor(e,grdBackgroundColOut),grdAColOut=returnColor(e,grdAColIn),grdBColIn=returnColor(e,grdAColOut),grdBColOut=returnColor(e,grdBColIn),grdCColIn=returnColor(e,grdBColOut),grdCColOut=returnColor(e,grdCColIn)}function returnColor(e,r){let t,l,o,d,i,n;if(r){var s=r.substring(r.indexOf("(")+1,r.length-1).split(",");d=parseInt(s[0]),i=parseInt(s[1]),n=parseInt(s[2])}if("color"==e)t=R.rdm(255),l=R.rdm(255),o=R.rdm(255);else if("dark"==e)t=R.rdm(128),l=R.rdm(128),o=R.rdm(128);else if("gray"==e)t=l=o=R.rdm(255);else if("walk"==e)t=d+R.rdm(255)-128,l=i+R.rdm(255)-128,o=n+R.rdm(255)-128;else if("walkslow"==e)t=d+R.rdm(151)-75,l=i+R.rdm(151)-75,o=n+R.rdm(151)-75;else if("walkcolor"==e){let e=R.rdm(255)-128;t=d+e,l=i+e,o=n+e}return t>255&&(t-=255),l>255&&(l-=255),o>255&&(o-=255),t<0&&(t+=255),l<0&&(l+=255),o<0&&(o+=255),"rgb("+t+","+l+","+o+")"}function setBaseValues(){let e=R.rdm(40);e<=10?setColors("walkcolor"):e>10&&e<=20?setColors("walkslow"):e>20&&e<=40&&setColors("walk"),grdBackgroundSettings={dir:R.random_dec(),keys:[0,1],vals:[grdBackgroundColIn,grdBackgroundColOut]},grdASettings={dir:R.random_dec(),keys:[0,1],vals:[grdAColIn,grdAColOut]},grdBSettings={dir:R.random_dec(),keys:[0,1],vals:[grdBColIn,grdBColOut]},grdCSettings={dir:R.random_dec(),keys:[0,1],vals:[grdCColIn,grdCColOut]},divideTopVal=.05+.9*R.random_dec(),divideTopVal>=.2&&(divideTopVal2=.05+.9*R.random_dec()*divideTopVal),marginVal=R.random_dec(),spacerVal=R.rdm(4)}function makeCompression(){let e=window.innerWidth,r=window.innerHeight;2400==e?(console.log("test"),blocksize=24):(console.log("normal"),blocksize=8);let t=e/blocksize,l=r/blocksize;canvas.width=t,canvas.height=l;let o=l/200,d=Math.round(4*o+marginVal*(20*o)),i=2+spacerVal,n=l-2*d,s=t-2*d;if(grdBackground=makeGradient(grdBackgroundSettings.dir,grdBackgroundSettings.keys,grdBackgroundSettings.vals),ctx.fillStyle=grdBackground,ctx.fillRect(0,0,t,l),grdA=makeGradient(grdASettings.dir,grdASettings.keys,grdASettings.vals),grdB=makeGradient(grdBSettings.dir,grdBSettings.keys,grdBSettings.vals),grdC=makeGradient(grdCSettings.dir,grdCSettings.keys,grdCSettings.vals),slices>=0&&slices<=15&&0!=divideTopVal2){console.log("trip horizontal");let e=divideTopVal2*divideTopVal*n-i/2,r=divideTopVal*n-e-1.5*i,t=n-e-r-2*i;ctx.fillStyle=grdA,ctx.fillRect(d,d,s,e),ctx.fillStyle=grdB,ctx.fillRect(d,d+e+i,s,r),ctx.fillStyle=grdC,ctx.fillRect(d,d+e+i+r+i,s,t)}else if(slices>15&&slices<=20&&0!=divideTopVal2){console.log("trip verticle");let e=divideTopVal2*divideTopVal*s-i/2,r=divideTopVal*s-e-1.5*i,t=s-e-r-2*i;ctx.fillStyle=grdA,ctx.fillRect(d,d,e,n),ctx.fillStyle=grdB,ctx.fillRect(d+e+i,d,r,n),ctx.fillStyle=grdC,ctx.fillRect(d+e+i+r+i,d,t,n)}else if(slices>20&&slices<=40){console.log("doub verticle");let e=divideTopVal*s-i/2,r=s-e-i;ctx.fillStyle=grdA,ctx.fillRect(d,d,e,n),ctx.fillStyle=grdB,ctx.fillRect(d+e+i,d,r,n)}else if(slices>40&&slices<=80){console.log("doub horizontal");let e=divideTopVal*n-i/2,r=n-e-i;ctx.fillStyle=grdA,ctx.fillRect(d,d,s,e),ctx.fillStyle=grdB,ctx.fillRect(d,d+e+i,s,r)}else console.log("single field"),ctx.fillStyle=grdA,ctx.fillRect(d,d,s,n);let a=canvas.toDataURL("image/jpeg",compression);bgImage.setAttribute("id","landscapeImage"),bgImage.src=a}document.head.appendChild(style),ss("body { background-color: black; margin: 0; }"),ss("#landscapeImage { image-rendering: optimizeSpeed; image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: -webkit-optimize-contrast; image-rendering: pixelated; image-rendering: optimize-contrast; -ms-interpolation-mode: nearest-neighbor; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }"),window.onload=function(){document.body.appendChild(bgImage),setBaseValues(),makeCompression()},window.onresize=function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(resizeEnded,500)};