memoscan
← all memos

Memo 0xdc162626…5c48a9 on Ethereum

[1,()=>{console.log("Artist 48. fingacode -- platform 1");var G=Object.defineProperty;var V=(o,t,e)=>t in o?G(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var C=(o,t,e)=>(V(o,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const r of n.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function e(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(i){if(i.ep)return;i.ep=!0;const n=e(i);fetch(i.href,n)}})();class w{constructor(){this.useA=!1;let t=function(e){let s=parseInt(e.substring(0,8),16),i=parseInt(e.substring(8,16),16),n=parseInt(e.substring(16,24),16),r=parseInt(e.substring(24,32),16);return function(){s|=0,i|=0,n|=0,r|=0;let a=(s+i|0)+r|0;return r=r+1|0,s=i^i>>>9,i=n+(n<<3)|0,n=n<<21|n>>>11,n=n+a|0,(a>>>0)/4294967296}};this.prngA=new t(tokenData.hash.substring(2,34)),this.prngB=new t(tokenData.hash.substring(34,66));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()}random_num(t,e){return t+(e-t)*this.random_dec()}random_int(t,e){return Math.floor(this.random_num(t,e+1))}random_bool(t){return this.random_dec()<t}random_choice(t){return t[this.random_int(0,t.length-1)]}}const u=[0],f=[240],B={bw:{background:f,outline:u,colors:[[240],[80]]},invert:{background:u,outline:f,colors:[u]},one:{background:f,outline:u,colors:[[53],[60,110,113],[200],[40,75,99]]},two:{background:f,outline:u,colors:[[222,162,71],[14,57,144],[146,101,49],[225,216,196]]},three:{background:f,outline:u,colors:[[0,122,94],[252,209,22],[206,17,38]]},four:{background:f,outline:u,colors:[[207,219,213],[232,237,223],[245,203,92],[51,53,51]]},five:{background:f,outline:u,colors:[[150,3,26],[250,169,22],[109,103,110]]},six:{background:f,outline:u,colors:[[142,202,230],[33,158,188],[2,48,71],[255,183,3],[251,133,0]]},eight:{background:f,outline:u,colors:[[1,38,34],[0,59,54],[236,229,240],[233,138,21]]}},_=new w,j=_.random_choice(Object.keys(B)),H={name:j,palette:B[j]},z={width:1080*3,height:1920*3},W=_.random_int(5,15),c={canvas:z,grid:{width:z.width,height:z.height,margin:{x:-50,y:-50},padding:{x:0,y:0},cascade:_.random_bool(0),isEvenSplit:_.random_bool(0),x:W,y:W},style:H,borderThickness:100,isBorderRect:_.random_bool(1)},I=new w;class ${constructor({width:t=0,height:e=0,x:s=0,y:i=0,margin:n={x:0,y:0},padding:r={x:0,y:0},cascade:a=!1,isEvenSplit:d=!0,visibleProbability:g=1}){C(this,"generate",()=>{let t=[];const i=this.y,n=this.height/(this.y*4),r=this.height/(this.y/1),a=this.splitNumber(this.height,n,r,i,!0),d=this.x,g=this.width/(this.x*4),y=this.width/(this.x/1);let v=this.margin.y,F=1,L=1;for(let l=0;l<i;l++){let b=this.margin.x,R=!1,A=!1;const x=this.splitNumber(this.width,g,y,d,this.isEvenSplit);for(let h=0;h<d;h++){let O=!1,T=!1,D=!1,S=!1;l==0&&(R=!0),l==i-1&&(A=!0),h==0&&(D=!0),h==d-1&&(S=!0),h==0&&(O=!0),h==d-1&&(T=!0);let M=h+1;t.push({id:F,randSort:I.random_dec(),colId:this.cascade?L:M,rowId:this.cascade?M:L,isFirstBlock:O,isLastBlock:T,isFirstCol:this.cascade?R:D,isFirstRow:this.cascade?D:R,isLastCol:this.cascade?A:S,isLastRow:this.cascade?S:A,width:this.cascade?a[l]-this.padding.y*2:x[h]-this.padding.x*2,height:this.cascade?x[h]-this.padding.x*2:a[l]-this.padding.y*2,x:this.cascade?v+this.padding.y+(a[l]-this.padding.y*2)/2:b+this.padding.x+(x[h]-this.padding.x*2)/2,y:this.cascade?b+this.padding.x+(x[h]-this.padding.x*2)/2:v+this.padding.y+(a[l]-this.padding.y*2)/2,isVisible:I.random_bool(this.visProb),style:void 0,colour:void 0,_width:this.cascade?a[l]:x[h],_height:this.cascade?x[h]:a[l],_x:this.cascade?v:b,_y:this.cascade?b:v}),b+=x[h],F++}v+=a[l],L++}return t});C(this,"splitNumber",(t,e,s,i,n=!1)=>{if(t<=0||e<=0||s<=0||e>s||i<=0)throw new Error("Invalid input values. Ensure all inputs are positive and minSize is less than or equal to maxSize.");const r=i,a=[];let d=t;for(let g=0;g<r;g++){let y;n?y=Math.min(s,d/(r-g)):y=Math.min(s,I.random_dec()*(d-e*(r-g))+e);const v=Math.max(e,y);a.push(v),d-=v}return a[a.length-1]+=Math.max(0,d),a});return this.width=t-n.x*2,this.height=e-n.y*2,this.x=s,this.y=i,this.cascade=a,this.margin=n,this.padding=r,this.isEvenSplit=d,this.visProb=g,this.cascade&&(this.width=e-n.y*2,this.height=t-n.x*2,this.y=s,this.x=i,this.margin={x:n.y,y:n.x},this.padding={x:r.y,y:r.x}),this.blocks=this.generate(),this}}new w;const U=new w;class X{constructor(t={id:0,colId:0,rowId:0,isFirstBlock:!1,isLastBlock:!1,isFirstCol:!1,isFirstRow:!1,isLastCol:!1,isLastRow:!1,width:0,height:0,x:0,y:0},e={name:"",palette:{background:[0,0,0],colors:[[255,255,255]]}}){C(this,"rndColor",()=>U.random_choice(this.palette.colors));this.id=t.id,this.colId=t.colId,this.rowId=t.rowId,this.isFirstBlock=t.isFirstBlock,this.isLastBlock=t.isLastBlock,this.isFirstCol=t.isFirstCol,this.isFirstRow=t.isFirstRow,this.isLastCol=t.isLastCol,this.isLastRow=t.isLastRow,this.width=t.width,this.height=t.height,this.x=t.x,this.y=t.y,this.palette=e.palette,this.paletteName=e.name}}const m=new w;class q extends X{generate(){this.rot=m.random_bool(.5),this.piType=m.random_choice([PI*m.random_num(1,10)]),this.col=this.rndColor(),this.loopCount=m.random_int(25,100),this.offset=m.random_int(10,this.loopCount/2),this.sizeMult=m.random_num(1,1.5),this.warpX=m.random_int(-25,25),this.warpY=m.random_int(-25,25),this.isDashed=m.random_bool(.5),this.strokeStep=m.random_int(5,this.offset/2);const t=100;this.strokeSize={bottom:t,middle:t/1.5,top:t/6,default:15}}show(t){noFill(),noStroke();const e=this.width*this.sizeMult,s=this.height*this.sizeMult;let i=0;for(let n=this.loopCount;n>this.offset;n--){const r=n/this.loopCount;if(push(),rotate(i),shearX(this.warpX),shearY(this.warpY),scale(r),fill(this.col),n%this.strokeStep==0||n==this.loopCount?(stroke(this.palette.outline),strokeWeight(this.strokeSize.bottom*t),this.drawShape(n,e,s,t),stroke(this.palette.background),strokeWeight(this.strokeSize.middle*t),this.isDashed&&drawingContext.setLineDash([this.strokeSize.default/4*t,this.strokeSize.middle*t,0])):(stroke(this.palette.outline),strokeWeight(this.strokeSize.default*t)),this.drawShape(n,e,s,t),(n%this.strokeStep==0||n==this.loopCount)&&(stroke(this.palette.outline),strokeWeight(this.strokeSize.top*t),drawingContext.setLineDash([0]),this.drawShape(n,e,s,t)),n!=this.offset+1){push();let a=.9;this.paletteName!="invert"?(translate(0,100*t),fill(0,40)):(translate(0,100*t),a=.75,fill(...this.palette.outline,100)),noStroke(),this.drawShape(n*a,e*a,s*a,t),pop()}this.rot?i-=this.piType:i+=this.piType,pop()}}drawShape(t,e,s,i){const n=t/this.loopCount;rect(sin(radians(t))*e/2*i,cos(radians(t))*s/2*i,e*n*i,s*n*i,s*i,s*i,s*i,s*i)}}const Y=new w;class Z{constructor({width:t,height:e,circles:s,lineSpacing:i,bufferZone:n,invert:r=!1}){this.width=t,this.height=e,this.circles=s,this.lineSpacing=i,this.bufferZone=n,this.invert=r}isPointInsideOrCloseToAnyCircle(t,e){for(let s of this.circles){const i=s.r/2+this.bufferZone;if(dist(t,e,s.x,s.y)<i)return!0}return!1}show(t,e){strokeWeight(this.lineSpacing/4*t),push();for(let s=0;s<this.height;s+=this.lineSpacing){let i=0;for(let n=0;n<=this.width;n++)(this.invert?!this.isPointInsideOrCloseToAnyCircle(n,s):this.isPointInsideOrCloseToAnyCircle(n,s))&&(n-i>1&&this.drawLine(i*t,s*t,n*t,e),i=n+1);this.width-i>1&&this.drawLine(i*t,s*t,this.width*t,e)}pop()}drawLine(t,e,s,i=""){beginShape(i);for(let n=t;n<s;n+=10)vertex(n,e+Y.random_dec());endShape()}}const K=`#ifdef GL_ES precision mediump float; #endif varying vec2 vTexCoord; uniform vec2 u_resolution; uniform sampler2D u_texture; uniform float u_time; const int radius = 2; vec3 saturate(vec3 a){return clamp(a,0.,1.);} #define NUM_OCTAVES 5 float rand(vec2 n) { return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453); } float noise(vec2 p){ vec2 ip = floor(p); vec2 u = fract(p); u = u*u*(3.0-2.0*u); float res = mix( mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x), mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y); return res*res; } float fbm(vec2 x) { float v = 0.0; float a = 0.5; vec2 shift = vec2(100); // Rotate to reduce axial bias mat2 rot = mat2(cos(0.5), sin(0.5), -sin(0.5), cos(0.50)); for (int i = 0; i < NUM_OCTAVES; ++i) { v += a * noise(x); x = rot * x * 2.0 + shift; a *= 0.5; } return v; } vec2 mod289(vec2 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } vec3 permute(vec3 x) { return mod289((( x * 34.0) + 1.0) * x); } float snoise(vec2 v) { const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0 0.366025403784439, // 0.5*(sqrt(3.0)-1.0) -0.577350269189626, // -1.0 + 2.0 * C.x 0.024390243902439); // 1.0 / 41.0 // First corner vec2 i = floor(v + dot(v, C.yy) ); vec2 x0 = v - i + dot(i, C.xx); // Other corners vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0); vec4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; // Permutations i = mod289(i); // Avoid truncation effects in permutation vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 )); vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0); m = m*m; m = m*m; // Gradients vec3 x = 2.0 * fract(p * C.www) - 1.0; vec3 h = abs(x) - 0.5; vec3 a0 = x - floor(x + 0.5); // Normalise gradients implicitly by scaling m m *= 1.792843 - 0.853735 * ( a0*a0 + h*h ); // Compute final noise value at P vec3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot(m, g); } void main() { vec2 uv = vTexCoord; // the texture is loaded upside down and backwards by default so lets flip it uv.y = 1.0 - uv.y; // Sample the texture at a random offset vec2 randomOffset = vec2( fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453), fract(sin(dot(gl_FragCoord.xy, vec2(94.324, 47.623))) * 23453.6547) ); float strength = smoothstep(-1.0, 1.0, uv.x); vec2 surface = strength * vec2( mix(-0.005, 0.005, fbm(20.0 * uv + 0.1 * u_time) ), mix(-0.005, 0.005, fbm(20.0 * uv + 0.2 * u_time) ) ); uv += randomOffset * 0.0005; uv += refract(vec2(0.0), surface, 1.0 / 1.133); vec4 orig = texture2D(u_texture, uv); vec4 finalOut = vec4(0); // start vec2 src_size = vec2 (2.05 / u_resolution.x, 2.01 / u_resolution.y); float n = float((radius + 1) * (radius + 1)); int i; int j; vec3 m0 = vec3(0.0); vec3 m1 = vec3(0.0); vec3 m2 = vec3(0.0); vec3 m3 = vec3(0.0); vec3 s0 = vec3(0.0); vec3 s1 = vec3(0.0); vec3 s2 = vec3(0.0); vec3 s3 = vec3(0.0); vec3 c; for (int j = -radius; j <= 0; ++j) { for (int i = -radius; i <= 0; ++i) { c = texture2D(u_texture, uv + vec2(i,j) * src_size).rgb; m0 += c; s0 += c * c; } } for (int j = -radius; j <= 0; ++j) { for (int i = 0; i <= radius; ++i) { c = texture2D(u_texture, uv + vec2(i,j) * src_size).rgb; m1 += c; s1 += c * c; } } for (int j = 0; j <= radius; ++j) { for (int i = 0; i <= radius; ++i) { c = texture2D(u_texture, uv + vec2(i,j) * src_size).rgb; m2 += c; s2 += c * c; } } for (int j = 0; j <= radius; ++j) { for (int i = -radius; i <= 0; ++i) { c = texture2D(u_texture, uv + vec2(i,j) * src_size).rgb; m3 += c; s3 += c * c; } } float min_sigma2 = 1e+2; m0 /= n; s0 = abs(s0 / n - m0 * m0); float sigma2 = s0.r + s0.g + s0.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; finalOut = vec4(m0,1.0); } m1 /= n; s1 = abs(s1 / n - m1 * m1); sigma2 = s1.r + s1.g + s1.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; finalOut = vec4(m1*1.0, 1.0); } m2 /= n; s2 = abs(s2 / n - m2 * m2); sigma2 = s2.r + s2.g + s2.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; finalOut = vec4(m2, 1.0); } m3 /= n; s3 = abs(s3 / n - m3 * m3); sigma2 = s3.r + s3.g + s3.b; if (sigma2 < min_sigma2) { min_sigma2 = sigma2; finalOut = vec4(m3, 1.0); } vec4 col = mix(finalOut, orig, 0.85); gl_FragColor = orig; }`,J=`// our vertex data attribute vec3 aPosition; attribute vec2 aTexCoord; varying vec2 vTexCoord; void main() { // copy the texcoords vTexCoord = aTexCoord; // copy the position data into a vec4, using 1.0 as the w component vec4 positionVec4 = vec4(aPosition, 1.0); positionVec4.xy = positionVec4.xy * 2.0 - 1.0; // send the vertex information on to the fragment shader gl_Position = positionVec4; }`,Q=new w,k=c.canvas.width/c.canvas.height;let p,P,E,N;window.setup=()=>{const o=windowHeight*k,t=windowWidth/k;window.innerHeight>window.innerWidth?p=createCanvas(window.innerWidth,t):p=createCanvas(o,window.innerHeight),p.elt.style.display="none",noLoop(),noStroke(),noFill(),angleMode(DEGREES),rectMode(CENTER),N=new Z({width:c.canvas.width,height:c.canvas.height,circles:[],lineSpacing:Q.random_int(30,90),bufferZone:0}),E=new $(c.grid);const e=(s,i)=>s.randSort-i.randSort;E.blocks.sort(e).forEach(s=>{s.style=new q(s,c.style),s.style.generate()})};window.draw=()=>{const o=width/c.canvas.width;background(...c.style.palette.background),stroke(c.style.palette.outline),N.show(o),E.blocks.forEach((t,e)=>{push(),translate(t.x*o,t.y*o),t.style.show(o),pop()}),(()=>{noStroke(),push();const t=c.canvas.width/2,e=c.canvas.height/2,s=c.borderThickness,i=c.borderThickness*3;fill(...c.style.palette.background),push(),translate(t*o,e*o),beginShape(),vertex(-t*o,-e*o),vertex(t*o,-e*o),vertex(t*o,e*o),vertex(-t*o,e*o),beginContour(),vertex(-(t-s)*o,-(e-i)*o),vertex(-(t-s)*o,(e-i)*o),vertex((t-s)*o,(e-i)*o),vertex((t-s)*o,-(e-i)*o),endContour(),endShape(CLOSE),pop()})(),P=new p5(tt)};window.windowResized=()=>{const o=windowHeight*k,t=windowWidth/k;P.remove(),windowHeight>windowWidth?resizeCanvas(windowWidth,t):resizeCanvas(o,windowHeight)};const tt=o=>{let t,e=!1;o.setup=function(){o.createCanvas(p.width,p.height,WEBGL),o.colorMode(RGB,255,255,255,1),o.noLoop(),t=o.createShader(J,K)},o.draw=function(){o.shader(t),t.setUniform("u_resolution",[p.width,p.height]),t.setUniform("u_texture",p),t.setUniform("u_time",o.frameCount/40),o.rect(0,0,width,height)},document.body.onkeyup=function(s){(s.key==" "||s.code=="Space")&&(e?o.noLoop():o.loop(),e=!e)}};console.log(tokenData);console.log(c); }],