0x18b75119…b783sent to0x381233d5…7acd·#19,616,091·view on Etherscan
[1,()=>{console.log("Artist 52. A-Mashiro x NIINOMI -- platform 1");function calculateFeatures(tokenData){class Random{constructor(hash){this.useA=false;let sfc32=function(uint128Hex){let a=parseInt(uint128Hex.substr(0,8),16);let b=parseInt(uint128Hex.substr(8,8),16);let c=parseInt(uint128Hex.substr(16,8),16);let d=parseInt(uint128Hex.substr(24,8),16);return function(){a|=0;b|=0;c|=0;d|=0;let t=(a+b|0)+d|0;d=d+1|0;a=b^b>>>9;b=c+(c<<3)|0;c=c<<21|c>>>11;c=c+t|0;return(t>>>0)/4294967296}};this.prngA=new sfc32(hash.substr(2,32));this.prngB=new sfc32(hash.substr(34,32));for(let i=0;i<1e6;i+=2){this.prngA();this.prngB()}}random_dec(){this.useA=!this.useA;return this.useA?this.prngA():this.prngB()}random_num(a,b){return a+(b-a)*this.random_dec()}random_int(a,b){return Math.floor(this.random_num(a,b+1))}random_bool(p){return this.random_dec()<p}random_choice(list){return list[this.random_int(0,list.length-1)]}shuffleWithSeed(array){let m=array.length;while(m){const i=Math.floor(this.random_dec()*m--);const t=array[m];array[m]=array[i];array[i]=t}return array}}const getHexColors=palette=>palette.split("-").map((c=>`#${c}`));palettes={spring:{day:getHexColors("3a5d74-69a0b5-9bbbae-eadd7a-f1ceca-ddb1b6-c78ea4"),night:getHexColors("a57aa2-044047-06679a-022c2c-1179ac-02374c-044b68")},summer:{day:getHexColors("fbe8bc-1895b8-7fc2c2-b1c969-8ead3d-546e35-335032"),night:getHexColors("1f61ad-4a84b1-4d748d-3894d4-1e242a-3e6990-d3cb47")},autumn:{day:getHexColors("f4481a-e8af55-978f90-e78430-d62821-673f2d-56606a"),night:getHexColors("474134-d6705b-152a22-80645a-0c2118-384b53-b86650")},winter:{day:getHexColors("5e7a8a-70b0c0-dddece-0a1a4f-0d85b2-2c6c8b-9dc3cb"),night:getHexColors("232a2b-475b64-bdc6c9-7c8b8e-556a6c-495d5e-a1aaad")}};patterns={seigaiha:1,asanoha:2,sayagata:3,shippou:4};random=new Random(tokenData.hash);randomChoice=list=>random.random_choice(list);randomNum=(v1,v2)=>random.random_num(v1,v2);randomInt=(v1,v2)=>random.random_int(v1,v2);randomDec=()=>random.random_dec();randomBool=p=>random.random_bool(p);const pattern1=random.random_choice(Object.keys(patterns));const pattern2=random.random_choice(Object.keys(patterns).filter((p=>p!==pattern1)));attributes={palette:random.random_choice(Object.keys(palettes)),cloud:random.random_bool(1),line:random.random_bool(1),rain:random.random_bool(.3),pattern1:pattern1,pattern2:pattern2};console.log(attributes);return attributes}(()=>{"use strict";const t=(t,s)=>!(t.x+t.w<=s.x||t.x>=s.x+s.w||t.y+t.h<=s.y||t.y>=s.y+s.h),s="first",e="second";class n{#t;#s;#e;#n;#i=1;#a;#o=!1;#r;constructor(t,s){this.#t=t,this.#s=s,this.#e={canvas:t},this.#n={canvas:s}}getRight(t){const s=t.style.right;return s?parseInt(s.replace("px","")):0}getCurrentScrollTop(){return this.#a}isActiveCanvas(t){return this.#r===t}updateActiveCanvas(t){this.#r=t||(this.#r===s?e:s)}updateCanvases(t,s){this.#e={canvas:t},this.#n={canvas:s}}update(){const t=this.getRight(this.#e.canvas)-this.#i;let n=(i=t,a=0,o=-window.innerWidth,(r=0)+(i-a)/(o-a)*(1-r));var i,a,o,r;n<0?(n+=1,this.updateActiveCanvas(s)):this.#o||this.updateActiveCanvas(e),this.#a=n,this.#e.canvas.style.right=`${t}px`,this.#n.canvas.style.right=`${t+this.#e.canvas.offsetWidth}px`,this.getRight(this.#e.canvas)<=-window.innerWidth&&(this.#o=!0,this.updateActiveCanvas(),this.#e.canvas.style.right=`${window.innerWidth}px`,this.#e.canvas===this.#t?this.updateCanvases(this.#s,this.#t):this.#e.canvas===this.#s&&this.updateCanvases(this.#t,this.#s))}}class i{id;canvasName;p;scroller;lastActiveState;constructor(t,s,e,n){this.id=t,this.canvasName=s,this.p=e,this.scroller=n}updateLastActiveState(){this.lastActiveState=this.scroller.isActiveCanvas(this.canvasName)}}let a;const o={init:()=>{const t=palettes[attributes.palette];a={day:random.shuffleWithSeed(t.day.concat()),night:random.shuffleWithSeed(t.night.concat())}},currentHours:()=>(new Date).getHours(),dayOrNight:()=>{const t=o.currentHours();return t>=6&&t<18?"day":"night"},getPaletteColors:()=>a[o.dayOrNight()],getRandomPaletteColors:()=>random.shuffleWithSeed(a[o.dayOrNight()].concat()),getPatternValues:()=>[patterns[attributes.pattern1],patterns[attributes.pattern2]]};class r{p;pos;size;#h;#l;#d;#i;#c;#p;constructor(t,s,e){this.p=t,this.pos=s,this.size=e,this.#h=o.getRandomPaletteColors();const n=randomInt(8,15);this.#l={w:n,h:n},this.#d=Math.floor(randomInt(3,10)),this.#i=randomNum(.1,.4),this.#c=randomBool(.3),this.startAnimation=!1,this.#p=1}update(t,s){if(s&&(this.startAnimation=!0),this.#c&&this.startAnimation&&t>.7){const t=this.pos.x+this.#i*this.#p,s=this.pos.y;t<0?this.pos.y=s:t+this.size.w>this.p.width?(this.pos.x=this.p.width-this.size.w,this.pos.y=s):(this.pos.x=t,this.pos.y=s)}}draw(t,s){const e=this.p,n=this.size.w,i=this.size.h;e.push(),e.translate(this.pos.x,this.pos.y);for(let s=this.#d;s<n;s+=this.#l.w+this.#d){const a=this.#c?e.map(e.sin(e.radians(360*t)),-1,1,n/2,n):n,o=e.drawingContext.createLinearGradient(0,0,a,0);for(let t=0;t<this.#h.length;t++){const s=e.map(t,0,this.#h.length-1,0,1);o.addColorStop(s,this.#h[t])}e.drawingContext.fillStyle=o;for(let t=this.#d;t<i;t+=this.#l.h+this.#d){e.fill(this.#h[0]);const a=Math.sqrt(Math.pow(s-n/2,2)+Math.pow(t-i/2,2))/Math.max(n,i),o=e.map(e.noise(s,t),0,1,-1,1);t<i/2+o*i*.1&&a<.3+.1*o&&e.ellipse(s,t,this.#l.w,this.#l.h)}}e.pop()}}const h=Object.freeze({ELLIPSE:1,BLOCK:2});class l{p;pos;size;drawable;#v;#m;#f;#u;#g;#x;#y;constructor(t,s,e){this.p=t,this.init(s,e)}init(t,s){this.pos=t,this.size=s,this.#v=o.getRandomPaletteColors()[0],this.#m=randomInt(3,4),this.#f=randomChoice(o.getPatternValues()),this.#u=randomChoice([h.ELLIPSE,h.BLOCK]),this.#x&&(this.#x.remove(),this.#x.canvas.remove()),this.#x=this.p.createGraphics(this.size.w,this.size.h,this.p.WEBGL),this.#g=this.#x.createShader("precision mediump float;\n\nattribute vec3 aPosition;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n // positionVec4.xy * 2.0 - 1.0;\n gl_Position = positionVec4;\n}","precision mediump float;\n\nuniform vec2 resolution;\nuniform float time;\nuniform vec3 color1;\nuniform float type;\nuniform float shape;\nuniform float offset;\n\nconst float PI = 3.1415926535897932384626433832795;\n\nfloat map(float value, float beforeMin, float beforeMax, float afterMin, float afterMax) {\n return afterMin + (afterMax - afterMin) * ((value - beforeMin) / (beforeMax - beforeMin));\n}\n\nvec2 rotate2d(vec2 st, float ang){\n mat2 rot_mat = mat2(\n cos(ang), -sin(ang),\n sin(ang), cos(ang)\n );\n st = rot_mat * st;\n return st;\n}\n\nvec2 skew2(vec2 st) {\n vec2 r = vec2(st.x, rotate2d(st, -PI / 6.0).y);\n return r;\n}\n\nvec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }\n\nfloat snoise(vec2 v){\n const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0));\n vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy),\n dot(x12.zw, x12.zw)), 0.0);\n m = m*m;\n m = m*m;\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nvec3 simplexGrid(vec2 st) {\n vec3 xyz = vec3(0.0);\n\n vec2 p = fract(skew2(st));\n if (p.x > p.y) {\n xyz.x = 1.0 - p.x;\n xyz.y = 1.0 - (p.y - p.x);\n xyz.z = p.y;\n } else {\n xyz.x = p.x;\n xyz.y = 1.0 - (p.x - p.y);\n xyz.z = 1.0 - p.y;\n }\n\n return fract(xyz);\n}\n\nfloat shippo(vec2 uv) {\n float num = 0.85;\n float size = 0.5;\n float boldness = 0.012;\n\n vec2 uv1 = uv * num;\n uv1 = fract(uv1) - 0.5;\n float l1 = length(uv1) - size;\n float val1 = 1.0 - step(boldness, abs(l1));\n\n vec2 uv2 = uv * num;\n uv2 = fract(uv2 + 0.5) - 0.5;\n float l2 = length(uv2) - size;\n float val2 = 1.0 - step(boldness, abs(l2));\n\n return val1 + val2;\n}\n\nfloat sayagata(vec2 uv) {\n vec2 gd[4];\n gd[0] = mod(floor(vec2(uv.x, uv.y)), 10.0);\n gd[1] = mod(floor(vec2(uv.x, uv.y) + 5.0), 10.0);\n gd[2] = mod(floor(vec2(uv.y, uv.x + 5.0)), 10.0);\n gd[3] = mod(floor(vec2(uv.y, uv.x + 5.0) + 5.0), 10.0);\n\n float val = 0.0;\n for (int i = 0; i < 4; i++) {\n if (gd[i].x == 4.0 && gd[i].y >= 0.0 && gd[i].y <= 8.0) { val = float(i); }\n if (gd[i].y == 0.0 && gd[i].x >= 1.0 && gd[i].x <= 7.0) { val = float(i); }\n if (gd[i].y == 8.0 && gd[i].x >= 1.0 && gd[i].x <= 7.0) { val = float(i); }\n if (gd[i] == vec2(2.0, 1.0)\n || gd[i] == vec2(2.0, 7.0)\n || gd[i] == vec2(6.0, 1.0)\n || gd[i] == vec2(6.0, 7.0)) { val = float(i); }\n }\n\n return val;\n}\n\nfloat asanoha(vec2 st) {\n vec3 sg = simplexGrid(st);\n\n float val1 = 1.0;\n val1 = min(val1, sg.x);\n val1 = min(val1, sg.y);\n val1 = min(val1, sg.z);\n\n vec2 st1 = fract(skew2(rotate2d(st, PI / 3.0 * 1.0)));\n vec2 st2 = fract(skew2(rotate2d(st, PI / 3.0 * 0.0)));\n vec2 st3 = fract(skew2(rotate2d(st, PI / 3.0 * 2.0)));\n vec3 tg = vec3(st1.x + st1.y, st2.x + st2.y, st3.x + st3.y) * 0.5 - 0.5;\n\n float val2 = 0.0;\n if (val1 == sg.x) { val2 = min(abs(tg.y), abs(tg.z)); }\n if (val1 == sg.y) { val2 = min(abs(tg.z), abs(tg.x)); }\n if (val1 == sg.z) { val2 = min(abs(tg.x), abs(tg.y)); }\n\n return step(0.989, 1.0 - min(val1, val2));\n}\n\nfloat seigaiha(vec2 uv) {\n float val = 0.0;\n for (int i = 0; i < 4; i++) {\n float sx = float(i) * 0.5;\n float sy = float(i) * 0.25;\n vec2 st = fract(vec2(uv.x + sx, uv.y + sy)) * 2.0 - 1.0;\n float v = (1.0 - step(1.0, length(st))) * st.y;\n v -= step(1.0, length(st)) * 2.0;\n val = max(val, v);\n }\n\n // wave\n for (int i = 0; i < 4; i++) {\n float sx = float(i) * 0.5;\n float sy = float(i) * 0.25;\n vec2 st = fract(vec2(uv.x + sx, uv.y + sy)) * 2.0 - 1.0;\n float v = (1.0 - step(1.0, length(st))) * st.y;\n v -= step(1.0, length(st)) * 2.0;\n\n float wav = 1.0 - step(1.0, length(st));\n wav = wav * smoothstep(0.0, 0.5, sin(8.0 * length(st) * PI));\n if (val == v) { val = wav; }\n }\n\n return val;\n}\n\nvoid main() {\n vec2 uv = (gl_FragCoord.xy * 2.0 - resolution.xy) / min(resolution.x, resolution.y);\n\n if (shape == 1.0) {\n // Ellipse\n float alpha = 1.0 - step(1.0, length(uv));\n if (alpha == 0.0) {\n discard;\n }\n } else if (shape == 2.0) {\n // Block\n float mosaic = 7.0;\n vec2 uv2 = (gl_FragCoord.xy * 2.0 - resolution.xy) / max(resolution.x, resolution.y);\n uv2 = floor(uv2 * mosaic) / mosaic;\n float n = snoise(uv2 + offset);\n float f = 1.0 - step(0.7 + map(n, 0.0, 1.0, -0.1, 0.1), length(uv2));\n if (f == 0.0) {\n discard;\n }\n }\n\n uv *= offset;\n\n float p = 0.0;\n\n if (type == 1.0) {\n p = seigaiha(uv);\n } else if (type == 2.0) {\n p = asanoha(uv);\n } else if (type == 3.0) {\n vec2 st = uv * 5.0;\n st = rotate2d(st, PI / 4.0);\n st.y = rotate2d(st, -PI / 8.0).y;\n float d = 0.05;\n vec2 dx = vec2(d, 0.0);\n vec2 dy = vec2(0.0, d);\n float diffX = abs((sayagata(st + dx) - sayagata(st - dx)) / (2.0 * d));\n float diffY = abs((sayagata(st + dy) - sayagata(st - dy)) / (2.0 * d));\n float diffXY = abs((sayagata(st + d) - sayagata(st - d)) / (2.0 * d));\n p = max(diffXY, max(diffX, diffY));\n } else if (type == 4.0) {\n p = shippo(uv);\n }\n\n if (p == 0.0) {\n discard;\n }\n\n gl_FragColor = vec4(color1, 1.0);\n}"),this.#y=this.#x.pixelDensity(),this.drawable=!0}update(t,s){}updateDrawable(t){this.drawable=t}draw(t,s){if(!this.drawable)return;const e=this.p;e.push(),e.translate(this.pos.x,this.pos.y);const n=this.#g,i=this.#x,a=this.size.w,o=this.size.h,r=e.color(this.#v)._array;n.setUniform("resolution",[a*this.#y,o*this.#y]),n.setUniform("time",this.p.millis()/1e3),n.setUniform("color1",[r[0],r[1],r[2]]),n.setUniform("offset",this.#m),n.setUniform("type",this.#f),n.setUniform("shape",this.#u),i.shader(n),i.clear(),i.noStroke(),i.quad(-1,-1,1,-1,1,1,-1,1),e.image(i,0,0,a,o),e.pop()}}class d{p;pos;size;drawable;#h;#w;#p;#d;#C;constructor(t,s,e){this.p=t,this.pos=s,this.size=e,this.#h=o.getRandomPaletteColors(),this.#w=randomNum(.4,.9),this.#d=randomInt(0,.15*t.width),this.drawable=!0,this.updateStep()}update(){(this.p.frameCount+Math.floor(500*this.#w))%200==0&&this.updateStep(),this.pos.x<this.p.width-this.#d?(this.pos.x+=this.#C.x*this.#p.x,this.pos.y+=this.#C.y*this.#p.y):this.drawable=!1}updateStep(){this.#C=(()=>{const t=randomInt(1,2),s=randomChoice([0,1]);return{x:t*this.#w,y:s*this.#w}})(),this.#p={x:1,y:randomChoice([-1,1])}}draw(){if(!this.drawable)return;const t=this.p,s=this.size.w,e=this.size.h;t.fill(this.#h[0]),t.push(),t.translate(this.pos.x,this.pos.y),t.ellipse(0,0,s,e),t.pop()}}const c=Object.freeze({VERTICAL:"vertical",HORIZONTAL:"horizontal"});class p{points=[];constructor(t){this.points=t}}class v{pos;size;colors;velocity;#p;constructor(t,s,e,n,i){this.pos=t,this.size=s,this.colors=e,this.velocity=n,this.#p=i}isVertical(){return this.#p===c.VERTICAL}}class m{p;#z=[];#b=[];#I=[];#E=[];#R;#P=!0;#N;#S=!0;#A=!0;#L;#M=[];constructor(t,s,e){this.p=t,this.#R={x:s,y:e},this.#N=o.getPaletteColors(),this.#L=randomInt(5,12)}generateRects(t){this.#z=[],this.#b=[],this.#M=[],this.#N=o.getPaletteColors(),this.generateElements();const s=this.p,e=this.#R.y,n=this.#R.x,i=s.width/(n+1),a=s.height/(e+2);for(let o=1;o<=e+1;o++){const r=[];let h=0,l=0;for(let s=0;s<n+2;s++){const e=0===s,d=s===n+1,c=e||d,p=randomBool(.5)?randomBool(.5)?-a/2:a/2:0,v=s*i;let m=0,f=!0;1===l?(m=h,f=!1,l=0):m=a*o+(c?0:p),t&&d&&(m=t[o-1].y),r.push({x:v,y:m,isEdge:c,isFirstEdge:e}),f&&l++,h=m}if(this.#M.push(r),1===o){const t=[];t.push({x:0,y:0,isEdge:!0,isFirstEdge:!0}),t.push({x:s.width,y:0,isEdge:!0,isFirstEdge:!1});for(let s=r.length-1;s>=0;s--){const e=r[s];t.push(e)}this.#z.push(new p(t))}if(o>=2){const t=[];for(let s=0;s<this.#M[o-2].length;s++){const e=this.#M[o-2][s];t.push(e)}for(let s=r.length-1;s>=0;s--){const e=r[s];t.push(e)}this.#z.push(new p(t))}if(o===e+1){const t=[];for(const s of r)t.push(s);t.push({x:s.width,y:a*(o+1),isEdge:!0,isFirstEdge:!1}),t.push({x:0,y:a*(o+1),isEdge:!0,isFirstEdge:!0}),this.#z.push(new p(t))}}this.#A=!0;for(let t=0;t<this.#z.length;t++){const e=this.#z[t];let n={x:0,y:0};for(const t of e.points){const e=t.x,i=t.y;if(e>n.x&&i===n.y){const t=randomChoice([c.VERTICAL,c.HORIZONTAL]),i=0,r={x:.1*s.width,y:.1*s.height},h={x:randomInt(-r.x,r.x),y:randomInt(-r.y,r.y)};let l=n.x+i+randomChoice([0,h.x]);l=l<=0?randomInt(0,r.x):l;let d=e-n.x-2*i;randomBool(.9)&&(d=l+d>=s.width?d*randomNum(.6,.9):d),this.#b.push(new v({x:l,y:n.y+i+randomChoice([0,h.y])},{w:d,h:a-2*i},o.getRandomPaletteColors(),randomDec(),t))}n={x:e,y:i}}}}generateElements(){const s=this.p,e=window.innerHeight>window.innerWidth;this.#I=[];for(const t of this.#E)t.updateDrawable(!1);const n=e?2:randomInt(2,3);for(let i=0;i<n;i++)if(0===i||randomBool(.5)){const n=randomBool(.5),a=.5625;let o;o=n?e?s.width*randomNum(.5,.75):.25*s.width:e?s.width*randomNum(.5,.8):.6*s.width;const r=3;let h=0;const d=(e,n)=>{const i=randomInt(0,s.width-e),a=randomInt(-n/2,s.height-n/2);let o=!0;for(let s=0;s<this.#E.length;s++){const r=this.#E[s];if(r.drawable&&(o=!t({x:i,y:a,w:e,h:n},{x:r.pos.x,y:r.pos.y,w:r.size.w,h:r.size.h}),!o))break}return o?{x:i,y:a}:h<r?(h++,d(e,n)):null},c=n?o/a:o*a,p=d(o,c);if(!p)continue;let v=this.#E[i];v?v.init({x:p.x,y:p.y},{w:o,h:c}):(v=new l(s,{x:p.x,y:p.y},{w:o,h:c}),this.#E.push(v)),this.#I.push(v)}if(attributes.cloud){const n=[],i=e?1:2;let a=0,o=3;for(let h=0;h<i;h++){const i=e?.9*s.width:s.width*randomNum(.5,.85),h=e?s.height*randomNum(.7,.95):randomNum(i,2*i),l=(e,i)=>{const r=randomInt(0,s.width-e),h=randomInt(-i/3,s.height-i/3);let d=!0;for(let s=0;s<n.length;s++){const a=n[s];if(d=!t({x:r,y:h,w:e,h:i},{x:a.pos.x,y:a.pos.y,w:a.size.w,h:a.size.h}),!d)break}return d?{x:r,y:h}:a<o?(a++,l(e,i)):null},d=l(i,h);if(!d)continue;const c=new r(s,{x:d.x,y:d.y},{w:i,h});this.#I.push(c),n.push(c)}}if(attributes.line)for(let t=0;t<this.#L;t++){const t=randomInt(2,4),e=t,n=new d(s,{x:randomInt(0,.2*s.width),y:randomInt(0,s.height-e)},{w:t,h:e});this.#I.push(n)}}getLastPoints(){return this.#M.map((t=>{for(let s=0;s<t.length;s++){const e=t[s];if(e.isFirstEdge)return e}return arr}))}updateDrawable(t){this.#P=t}draw(t,s){const e=this.p;if(this.#P){if(e.noStroke(),e.push(),this.#S&&this.#A){let t=0;for(const s of this.#z){const n=this.#N[t%this.#N.length];e.fill(n),e.push(),e.beginShape();const i=s.points;for(let t=0;t<i.length;t++){const s=i[t];e.vertex(s.x,s.y)}e.endShape(e.CLOSE),e.pop(),t++}this.#A=!1}for(const t of this.#b){if(e.push(),t.velocity>.5?e.fill(e.frameCount%Math.floor(35*e.noise(e.frameCount*t.velocity))==0?randomChoice([t.colors[1],t.colors[2]]):t.colors[0]):e.fill(t.colors[0]),e.noStroke(),t.isVertical()){const s=.1*t.size.w,n=e.map(.005*e.frameCount*t.velocity%1,0,1,0,t.size.w);e.rect(t.pos.x+n,t.pos.y,s,t.size.h)}else{const s=.1*t.size.h+e.sin(.1*e.frameCount+8*e.noise(e.frameCount)),n=e.sin(.02*e.frameCount*t.velocity+1e3*t.velocity)*s*6*t.velocity;e.rect(t.pos.x,t.pos.y+n,t.size.w,s)}e.pop()}for(const e of this.#I)e&&(e.update(t,s),e.draw(t,s))}}}class f extends i{#B;#D;setup(t){const s=this.p;this.#B=o.getPaletteColors()[0],s.createCanvas(s.windowWidth,s.windowHeight),this.#D=new m(s,t.horizontalNum,t.verticalNum),this.#D.generateRects()}draw(t){const s=this.p,e=this.scroller,n=e.isActiveCanvas(this.canvasName);if(n&&!this.lastActiveState){let e;s.background(this.#B),t&&(e=t.getGrid().getLastPoints()),this.#D.generateRects(e),this.#D.updateDrawable(!0)}const i=e.getCurrentScrollTop();this.#D.draw(i,n),this.updateLastActiveState()}resize(){const t=this.p;t.resizeCanvas(t.windowWidth,t.windowHeight),this.#D.generateRects()}getGrid(){return this.#D}}class u{p;pos;size;removable=!1;#i;#h;#k=0;#O;#F;constructor(t,s,e){this.p=t,this.pos=s,this.size=e,this.#i=1,this.#h=o.getRandomPaletteColors(),this.#O=randomInt(0,50),this.#F=randomInt(.3*e.w,.4*e.w)}update(){this.#k++,this.pos.x+=this.#i}draw(){const t=this.p;if(t.push(),t.translate(this.pos.x,this.pos.y),this.#k>=this.#O){const s=this.#F,e=this.#k-this.#O;t.stroke(this.#h[0]),t.strokeWeight(3*(1-e/s)),t.noFill();const n=t.map(t.min(e,s),0,s,0,1);e<s?t.ellipse(0,0,this.size.w*n,this.size.h*n):this.removable=!0}t.pop()}}class g extends i{#I=[];#W=0;#T=!1;#H=randomInt(3,6);#V=randomInt(30,50);#_=!1;#U=randomChoice([5e3,6e3]);setup(){const t=this.p;t.createCanvas(t.windowWidth,t.windowHeight).id(`canvas_${this.id}`),this.createElements(this.#H)}createElements(t){for(let t=0;t<this.#I.length;t++)this.#I[t]=null;this.#I.length=0;for(let s=0;s<t;s++)this.createElement()}createElement(){const t=this.p,s=.3*t.min(t.width,t.height),e=randomInt(.5*s,randomBool(.1)?4*s:s),n=randomInt(0,t.width),i=new u(t,{x:n,y:randomInt(0,t.height)},{w:e,h:e});this.#I.push(i)}update(){const t=this.p;t.frameCount%this.#U==0&&(this.#W=0,this.#T=!0),this.#W!==this.#U-Math.floor(.1*this.#U)||this.#T||(this.#_=!0),this.#_&&t.frameCount%5==0&&(this.#I.length<this.#V?this.createElement():this.#_=!1);for(const s of this.#I){const e=t=>{const s=this.#I.indexOf(t);-1!==s&&(this.#T?(this.#I.splice(s,1),randomBool(.5)&&this.createElement()):(this.#I.splice(s,1),this.createElement()))};(s.pos.x-s.size.w>t.width||s.removable)&&e(s)}this.#T&&this.#I.length===this.#H&&(this.#T=!1),this.#W++}draw(){const t=this.p;t.clear(),t.push();for(const t of this.#I)t.update(),t.draw();t.pop()}resize(){const t=this.p;t.resizeCanvas(t.windowWidth,t.windowHeight)}}document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementsByTagName("body")[0],i=document.createElement("div");i.classList.add("container"),i.setAttribute("id","container1");const a=document.createElement("div");a.classList.add("container"),a.setAttribute("id","container2"),t.appendChild(i),t.appendChild(a);const r=document.createElement("style");r.textContent="\n body, html {\n position: relative;\n margin: 0;\n padding: 0;\n overflow: hidden;\n height: 100%;\n }\n .container {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n #canvas_3, #canvas_4 {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 10;\n }\n ",document.head.appendChild(r);const h=new n(i,a),l={hash:(()=>{let t="0x";for(let s=0;s<64;s++)t+=Math.floor(16*Math.random()).toString(16);return t})()},d="undefined"!=typeof tokenData;calculateFeatures(d?tokenData:l),o.init();const c={horizontalNum:3,verticalNum:randomInt(1,4)};let p,v;new p5((t=>{p=new f(1,s,t,h),t.setup=()=>{p.setup(c)},t.draw=()=>{h.update(),p.draw(v)},t.windowResized=()=>{p.resize()}}),"container1"),new p5((t=>{v=new f(2,e,t,h),t.setup=()=>{v.setup(c)},t.draw=()=>{v.draw(p)},t.windowResized=()=>{v.resize()}}),"container2"),attributes.rain&&new p5((t=>{const e=new g(3,s,t,h);t.setup=()=>{e.setup()},t.draw=()=>{e.update(),e.draw()},t.windowResized=()=>{e.resize()}}),"body")}))})();
}],