0x1bfe…71b0

All memos sent from and to 0x1bfe…71b0.

const seed=parseInt(tokenData.hash.slice(0,16),16);p5.disableFriendlyErrors=!0;let mainCanvas,g,R,params,backgroundPattern,patternSize,DEFAULT_SIZE=1600,MAX_SIZE=5e3,WIDTH=Math.min(window.innerWidth,MAX_SIZE),HEIGHT=Math.min(window.innerHeight,MAX_SIZE),DIM=Math.min(WIDTH,HEIGHT),M=DIM/DEFAULT_SIZE;function setup(){mainCanvas=createCanvas(WIDTH,HEIGHT),colorMode(HSB,360,100,100,100),R=new Random,backgroundPattern=R.random_choice(["Mameshibori","Ichimatsu","Shippo","Tatewaku","Seikaiha"]),patternSize=R.random_int(2,10),"Ichimatsu"==backgroundPattern&&patternSize%2==1&&(patternSize+=1),g=new GenerativemasksJP(!0,!0,!0),params=getParams(),console.log(params),angleMode(DEGREES),pixelDensity(1),grainBuffer=createGraphics(width,height,WEBGL),grainShader=grainBuffer.createShader(vert,frag)}function getParams(){return{seed:seed,colorSchme:g.colorScheme,backgroundPattern:backgroundPattern,patternSize:patternSize}}function draw(){clear();const e=g.createMask(seed,width),t=getTexture(width,height);push(),imageMode(CENTER),image(e,width/2,height/2);const a=window.navigator.userAgent.toLowerCase();-1!=a.indexOf("chrome")?drawingContext.globalAlpha=1:-1!=a.indexOf("safari")&&(drawingContext.globalAlpha=.2),image(t,width/2,height/2),-1!=a.indexOf("safari")&&(drawingContext.globalAlpha=1),e.remove(),t.remove(),pop(),grainBuffer.clear(),grainBuffer.reset(),grainBuffer.push(),grainBuffer.shader(grainShader),grainShader.setUniform("noiseSeed",seed),grainShader.setUniform("source",mainCanvas),grainShader.setUniform("noiseAmount",1/15*M),grainBuffer.rectMode(CENTER),grainBuffer.noStroke(),grainBuffer.rect(0,0,width,height),grainBuffer.pop(),push(),image(grainBuffer,0,0),pop(),noLoop()}class GenerativemasksJP{constructor(e,t){this.inst=createGraphics(0,0),this.inst.colorMode(RGB,255),this.cSize=DEFAULT_SIZE;const a=this.cSize/10;this.sRadius=3*(this.cSize-2*a)/4,this.needShadow=e,this.needBackdrop=t,this.defaultRGBs=[{name:"Golden Thread Butterfly",scheme:"f19b4e-7f6640-dc5845-637055-e4d6c8-929e79-472c2a"},{name:"Navy Lion Peony",scheme:"83834f-e0c786-30363d-db2f38-66989c-e9ded1-628152"},{name:"Chacoal Wind",scheme:"151015-511a28-8e563a-fcfbfa-bf9969-718282"},{name:"Wisteria Spring",scheme:"e6bc8a-da4742-202125-909062-dba380-dcc6b9"},{name:"Fragrant Ground",scheme:"73924d-eb9f48-b19564-aabcb2-f0e3d7-6b4b2b"},{name:"Lagenaria Siceraria",scheme:"f0ebe1-d8ccb3-cd2a41-8bc08f-f69fac-c4714c"},{name:"Tang grass",scheme:"f9f5ec-d8ae6a-d4824b-588c92-89bfb3-b55847"},{name:"Pearl and Dragon",scheme:"dad7c3-c7895a-343530-899c63-60827d-d6b58a"},{name:"Red Dragon",scheme:"e5e9e9-da2034-8db4bb-4f6a31-6ab26d-e4bc89"},{name:"Phoenix Peony",scheme:"3c3e46-ddded7-c07552-5b6984-809c73-c3ae98"},{name:"Kara Ori",scheme:"4d4638-f77843-fbc836-d8b85a-6c6e47-b0e3ee"},{name:"Yu-Zen Dyeing",scheme:"f5da30-338ab6-8a8740-73563f-332321-e0dfdf"},{name:"Costumes",scheme:"e84343-c38d73-b68542-bbc273-4395c7-7186c0"},{name:"Bird and Flower",scheme:"abb163-e9e1cb-9b7c4a-74a7a0-e46641-5a5925"},{name:"Dull Itchy Bird",scheme:"7aa467-695643-9a7b55-d4393a-ddb19e-394b3a"},{name:"Orange Pendulum",scheme:"f6532d-cec4a4-3d4532-5e9682-becbbc-f7ac66"},{name:"Black Linen Thread",scheme:"dd8458-76b661-ddd66d-0f0b0c-4d493b-f3f4ee"},{name:"Beginning",scheme:"ba3f4c-eb213b-e2d1a5-fccb7d-80cddd"},{name:"Asagi Red",scheme:"f7b4b3-cdd2c5-95b0a0-f9836f-6898a0"},{name:"Sarasa",scheme:"e9f1f6-db353d-6a8e89-34504a-6a87cc"},{name:"Night Blossom",scheme:"fffbf4-313f5f-cd464c-fca8bd-fa718d"},{name:"Silk Road",scheme:"ebe7e0-68bdc1-f8be44-5c6a92-a9625e"},{name:"Feast of Flags",scheme:"ff8978-fccc6f-4facc2-3292b7-7879ab"}];let r=R.random_choice(this.defaultRGBs);this.colorScheme=r.name,this.palette=this.setPalette(r.scheme)}setPalette(e){const t=e.replace(/.*\//g,"");this.chkRgbStrings(t)?this.palette=this.getPalette(t):this.setRandomPalette()}setRandomPalette(){let e=R.random_choice(this.defaultRGBs);this.palette_string=e.name_en,this.palette=this.getPalette(e.scheme)}getPalette(e){const t=e.split("-");for(let e=0;e<t.length;e++)t[e]=this.inst.color("#"+t[e]);return this.shuffle(t)}chkRgbStrings(e){const t=e.replace(/.*\//g,"");return!!new RegExp(/^(([0-9]|[a-fA-F]){6}-){2,}([0-9]|[a-fA-F]){6}$/).test(t)}createMask(e,t){this.maskCv=createGraphics(t,t),this.inst.randomSeed(e),this.inst.noiseSeed(e),this.maskCv.randomSeed(e),this.maskCv.noiseSeed(e),this.setRandomPalette();const a=this.palette[0],r=this.palette.shift();this.sw=30,this.maskCv.pixelDensity(1),this.maskCv.colorMode(RGB,255),this.maskCv.angleMode(DEGREES),this.maskCv.clear(),this.maskCv.fill(a),this.maskCv.stroke(a),this.maskCv.scale(t/this.cSize),this.maskCv.strokeWeight(this.sw);const i=this.maskCv.random(100,400)*this.maskCv.random(.5,2);this.drawShape(this.cSize/2,this.cSize/2,this.sRadius,i,this.maskCv),this.palette.push(r);const n=createGraphics(t,t);if(this.needBackdrop)for(let e=0;e<3;e++){blendMode(BURN),push();let e=R.random_num(0,width/5),t=R.random_num(0,height/5),a=sqrt(2)*max(width,height)/2,r=R.random_num(0,360),i=width/2+e+cos(r)*a,n=height/2+t+sin(r)*a,s=width/2+e+cos(r+180)*a,o=height/2+t+sin(r+180)*a,c=drawingContext.createLinearGradient(i,n,s,o),h=R.random_choice(this.palette);h.setAlpha(50);let d=R.random_choice(this.palette);h.setAlpha(0);let l=color(h),m=color(hue(d),saturation(h),constrain(brightness(h)-20,0,100));c.addColorStop(0,l),c.addColorStop(1,m),drawingContext.fillStyle=c,noStroke(),rect(0,0,width,height),pop,blendMode(BLEND)}else n.clear();return this.needShadow&&(n.drawingContext.shadowColor=this.inst.color(0,127.5),n.drawingContext.shadowBlur=t/20,n.drawingContext.shadowOffsetY=t/40),n.image(this.maskCv,0,0),this.maskCv.remove(),n}drawShape(e,t,a,r,i){const n=new Array;let s=new Array,o=this.cSize,c=0,h=this.cSize/2,d=-this.cSize,l=this.cSize,m=-this.cSize;for(let a=0;a<360;a+=1){let n=i.noise(e,t,abs(a-180)/r);o=min(n,o),c=max(n,c),s.push(n)}for(let e=0;e<s.length;e++){let t=map(s[e],0,c,0,this.cSize/2*.9-this.sw*M),a=e;t=constrain(t,this.cSize/8,this.cSize/2);let r=i.cos(a)*t,o=i.sin(a)*t;n.push(createVector(r,o)),h=min(h,r),d=max(d,r),l=min(l,o),m=max(m,o)}const p=lerp(h,d,.5),f=lerp(l,m,.5);i.push(),i.strokeWeight(this.sw),i.translate(e,t),i.rotate(90),i.beginShape();for(let e of n)i.vertex(e.x-p,e.y-f);i.endShape(CLOSE),i.pop(),i.drawingContext.clip();let u=this.createGraphic(this.cSize/2,this.cSize,2);i.push(),i.translate(this.cSize/2,0),i.image(u,0,0),i.push(),i.scale(-1,1),i.image(u,0,0),i.pop(),i.pop(),u.remove()}drawJapanesePattern(e,t,a,r,i,n){switch(i.push(),i.translate(e,t),params.backgroundPattern){case"Mameshibori":this.drawMameshibori(a,r,i,n);break;case"Ichimatsu":this.drawIchimatsu(a,r,i,n);break;case"Shippo":this.drawShippo(a,r,i,n);break;case"Tatewaku":this.drawTatewaku(a,r,i,n);break;case"Seikaiha":this.drawSeikaiha(a,r,i,n)}i.pop()}drawMameshibori(e,t,a,r){let i=color(R.random_choice(this.palette));a.fill(i);let n=e/r,s=n/R.random_num(1.5,4);for(let e=0;e<=a.height;e+=n)for(let t=0;t<=a.width;t+=n){a.push(),a.translate(t,e),a.noStroke();let r=R.random_num(0,n/20)*(R.random_num(0,1)>.5?-1:1),i=noise(t,e),o=cos(360*i)*r,c=sin(360*i)*r;a.rotate(360*i),a.shearX(15*i),a.circle(o,c,s),a.pop()}}drawIchimatsu(e,t,a,r){let i=color(R.random_choice(this.palette)),n=0,s=e/r;for(let e=0;e<=a.height;e+=s)for(let t=0;t<=a.width;t+=s)a.push(),a.translate(t,e),a.noStroke(),a.fill(i),a.rectMode(CENTER),n++%2==0&&a.rect(t,e,2*s,2*s),a.pop()}drawShippo(e,t,a,r){let i=color(R.random_choice(this.palette)),n=e/r;a.push(),a.strokeWeight(n/R.random_num(15,30));for(let e=0;e<=a.height;e+=n)for(let t=0;t<=a.width;t+=n)a.push(),a.translate(t,e),a.noFill(),a.stroke(i),a.circle(0,0,n),a.stroke(i),a.circle(n/2,n/2,n),a.pop();a.pop()}drawTatewaku(e,t,a,r){let i=color(R.random_choice(this.palette)),n=e/r;a.stroke(i),a.strokeWeight(n*M*R.random_num(1/4,2));for(let e=0;e<r;e++)for(let t=0;t<r;t++){let r=e%2==1?180:0;a.push(),a.translate(n*(e+.5),3*n*t),a.noFill(),a.beginShape();for(let e=0;e<300;e++)a.vertex(n/4*sin(1.2*e+r),3*n/300*e);a.endShape(),a.pop()}}drawSeikaiha(e,t,a,r){let i=color(R.random_choice(this.palette)),n=i;for(;i==n;)n=color(R.random_choice(this.palette));let s=0,o=e/r;for(let e=0;e<=a.height;e+=o/4){for(let t=s%2==0?-o/2:0;t<=a.width+o;t+=o){a.push(),a.translate(t,e);let r=0;for(let e=1;e>0;e-=1/8)a.fill((s+r++)%2==0?i:n),a.noStroke(),a.circle(0,0,o*e);a.pop()}s++}}createGraphic(e,t,a){let r=createGraphics(e,t);return r.colorMode(HSB,360,100,100,100),r.angleMode(DEGREES),"Seikaiha"==params.backgroundPattern?(this.drawJapanesePattern(0,0,r.width,r.height,r,params.patternSize),this.recursiveGraphic(0,0,e,t,r,a)):(this.recursiveGraphic(0,0,e,t,r,a),this.drawJapanesePattern(0,0,r.width,r.height,r,params.patternSize),this.recursiveGraphic(0,0,e,t,r,a)),r}recursiveGraphic(e,t,a,r,i,n){for(let a=0;a<n;a++){let a=int(R.random_num(3,6)),s=a,o=r/a,c=r/s;for(let r=0;r<s;r++)for(let s=0;s<a;s++){let a=e+o*s,h=t+c*r;R.random_num(0,100)<90&&min(o,c)>i.height/5&&n>0?this.recursiveGraphic(a,h,o,c,i,n-1):this.drawPatterns(a,h,o,c,i)}}}drawPatterns(e,t,a,r,i){if(dist(e,t,0,i.height/2)>sqrt(2)*max(i.height,i.width)/2)return;let n,s,o=360*int(R.random_num(0,4))/4;o%180==0?(n=a,s=r):(n=r,s=a);let c=int(R.random_num(2,7));i.push(),i.translate(e+a/2,t+r/2),i.rotate(o),i.translate(-n/2,-s/2);let h=int(R.random_num(0,9));for(let e=c;e>0;e--)i.push(),i.scale(e/c),this.drawPattern(0,0,n,s,i,h,c/e),i.pop();i.pop()}drawPattern(e,t,a,r,i,n,s){i.drawingContext.shadowColor=color(0,0,0,33),i.drawingContext.shadowBlur=width/10;let o,c=R.random_choice(this.palette),h=R.random_choice(this.palette);for(;h==c;)h=R.random_choice(this.palette);switch(o=n<4?i.drawingContext.createLinearGradient(0,0,a,r):i.drawingContext.createRadialGradient(a/2,r/2,0,a/2,r/2,max(a,r)),o.addColorStop(0,h),o.addColorStop(1,c),i.drawingContext.fillStyle=o,i.stroke(0,0,20),i.strokeWeight(.2*M),n){case 0:i.arc(0,0,2*a,2*r,0,90,PIE);break;case 1:i.triangle(0,0,0,+r,+a,0);break;case 2:i.rect(0,0,a,r/2);break;case 3:i.triangle(0,0,a,r,a,t);break;case 4:i.circle(a/2,r/2,min(a,r));break;case 5:i.rectMode(CENTER),i.rect(a/2,r/2,min(a,r)),i.rectMode(CORNER);break;case 6:i.scale(s),i.circle(a,r,1*min(a,r)/s);break;case 7:i.scale(s),i.rectMode(CORNER),i.rect(a,r,1*min(a,r)/s),i.rectMode(CORNER);break;case 8:i.arc(0,0,a,r,0,90,PIE),i.scale(s),i.arc(a,r,a,r,180,270,PIE)}}shuffle(e){for(let t=e.length-1;t>=0;t--){let a=floor(R.random_num(0,1)*(t+1));[e[t],e[a]]=[e[a],e[t]]}return e}}const vert="\nprecision highp float;\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvarying vec2 vVertTexCoord;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertTexCoord = aTexCoord;\n}\n",frag="\nprecision highp float;\nvarying vec2 vVertTexCoord;\n\nuniform sampler2D source;\nuniform float noiseSeed;\nuniform float noiseAmount;\n \nfloat rand(vec2 n) { \n return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);\n}\n\nvoid main() {\n // GorillaSun's grain algorithm\n vec4 inColor = texture2D(source, vVertTexCoord);\n gl_FragColor = clamp(inColor + vec4(\n mix(-noiseAmount, noiseAmount, fract(noiseSeed + rand(vVertTexCoord * 1234.5678))),\n mix(-noiseAmount, noiseAmount, fract(noiseSeed + rand(vVertTexCoord * 876.54321))),\n mix(-noiseAmount, noiseAmount, fract(noiseSeed + rand(vVertTexCoord * 3214.5678))),\n 0.\n ), 0., 1.);\n}\n";function getTexture(e,t){const a=createGraphics(e,t);a.randomSeed(seed),a.colorMode(HSB,360,100,100,100),a.angleMode(DEGREES),a.strokeWeight(.1*M);for(let r=0;r<e;r+=20*e/DEFAULT_SIZE)for(let i=0;i<t;i+=20*t/DEFAULT_SIZE){let n=a.random(75,105),s=max(e,t)/2;a.stroke(0,0,0,a.random(15)),a.line(r+a.cos(n)*s,i+a.sin(n)*s,r+a.cos(n+180)*s,i+a.sin(n+180)*s)}return a}class Random{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substr(0,8),16),a=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),i=parseInt(e.substr(24,8),16);return function(){t|=0,a|=0,r|=0,i|=0;let e=(t+a|0)+i|0;return i=i+1|0,t=a^a>>>9,a=r+(r<<3)|0,r=r<<21|r>>>11,r=r+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()}random_num(e,t){return e+(t-e)*this.random_dec()}random_int(e,t){return Math.floor(this.random_num(e,t+1))}random_bool(e){return this.random_dec()<e}random_choice(e){return e[this.random_int(0,e.length-1)]}}
const seed=parseInt(tokenData.hash.slice(0,16),16);p5.disableFriendlyErrors=!0;let mainCanvas,g,R,params,backgroundPattern,patternSize,DEFAULT_SIZE=1600,MAX_SIZE=5e3,WIDTH=Math.min(window.innerWidth,MAX_SIZE),HEIGHT=Math.min(window.innerHeight,MAX_SIZE),DIM=Math.min(WIDTH,HEIGHT),M=DIM/DEFAULT_SIZE;function setup(){mainCanvas=createCanvas(WIDTH,HEIGHT),colorMode(HSB,360,100,100,100),R=new Random,backgroundPattern=R.random_choice(["Mameshibori","Ichimatsu","Shippo","Tatewaku","Seikaiha"]),patternSize=R.random_int(2,10),"Ichimatsu"==backgroundPattern&&patternSize%2==1&&(patternSize+=1),g=new GenerativemasksJP(!0,!0,!0),params=getParams(),console.log(params),angleMode(DEGREES),pixelDensity(1),grainBuffer=createGraphics(width,height,WEBGL),grainShader=grainBuffer.createShader(vert,frag)}function getParams(){return{seed:seed,colorSchme:g.colorScheme,backgroundPattern:backgroundPattern,patternSize:patternSize}}function draw(){clear();const e=g.createMask(seed,width),t=getTexture(width,height);push(),imageMode(CENTER),image(e,width/2,height/2),image(t,width/2,height/2),e.remove(),t.remove(),pop(),grainBuffer.clear(),grainBuffer.reset(),grainBuffer.push(),grainBuffer.shader(grainShader),grainShader.setUniform("noiseSeed",seed),grainShader.setUniform("source",mainCanvas),grainShader.setUniform("noiseAmount",1/15*M),grainBuffer.rectMode(CENTER),grainBuffer.noStroke(),grainBuffer.rect(0,0,width,height),grainBuffer.pop(),push(),image(grainBuffer,0,0),pop(),noLoop()}class GenerativemasksJP{constructor(e,t){this.inst=createGraphics(0,0),this.inst.colorMode(RGB,255),this.cSize=DEFAULT_SIZE;const a=this.cSize/10;this.sRadius=3*(this.cSize-2*a)/4,this.needShadow=e,this.needBackdrop=t,this.defaultRGBs=[{name:"Golden Thread Butterfly",scheme:"f19b4e-7f6640-dc5845-637055-e4d6c8-929e79-472c2a"},{name:"Navy Lion Peony",scheme:"83834f-e0c786-30363d-db2f38-66989c-e9ded1-628152"},{name:"Chacoal Wind",scheme:"151015-511a28-8e563a-fcfbfa-bf9969-718282"},{name:"Wisteria Spring",scheme:"e6bc8a-da4742-202125-909062-dba380-dcc6b9"},{name:"Fragrant Ground",scheme:"73924d-eb9f48-b19564-aabcb2-f0e3d7-6b4b2b"},{name:"Lagenaria Siceraria",scheme:"f0ebe1-d8ccb3-cd2a41-8bc08f-f69fac-c4714c"},{name:"Tang grass",scheme:"f9f5ec-d8ae6a-d4824b-588c92-89bfb3-b55847"},{name:"Pearl and Dragon",scheme:"dad7c3-c7895a-343530-899c63-60827d-d6b58a"},{name:"Red Dragon",scheme:"e5e9e9-da2034-8db4bb-4f6a31-6ab26d-e4bc89"},{name:"Phoenix Peony",scheme:"3c3e46-ddded7-c07552-5b6984-809c73-c3ae98"},{name:"Kara Ori",scheme:"4d4638-f77843-fbc836-d8b85a-6c6e47-b0e3ee"},{name:"Yu-Zen Dyeing",scheme:"f5da30-338ab6-8a8740-73563f-332321-e0dfdf"},{name:"Costumes",scheme:"e84343-c38d73-b68542-bbc273-4395c7-7186c0"},{name:"Bird and Flower",scheme:"abb163-e9e1cb-9b7c4a-74a7a0-e46641-5a5925"},{name:"Dull Itchy Bird",scheme:"7aa467-695643-9a7b55-d4393a-ddb19e-394b3a"},{name:"Orange Pendulum",scheme:"f6532d-cec4a4-3d4532-5e9682-becbbc-f7ac66"},{name:"Black Linen Thread",scheme:"dd8458-76b661-ddd66d-0f0b0c-4d493b-f3f4ee"},{name:"Beginning",scheme:"ba3f4c-eb213b-e2d1a5-fccb7d-80cddd"},{name:"Asagi Red",scheme:"f7b4b3-cdd2c5-95b0a0-f9836f-6898a0"},{name:"Sarasa",scheme:"e9f1f6-db353d-6a8e89-34504a-6a87cc"},{name:"Night Blossom",scheme:"fffbf4-313f5f-cd464c-fca8bd-fa718d"},{name:"Silk Road",scheme:"ebe7e0-68bdc1-f8be44-5c6a92-a9625e"},{name:"Feast of Flags",scheme:"ff8978-fccc6f-4facc2-3292b7-7879ab"}];let r=R.random_choice(this.defaultRGBs);this.colorScheme=r.name,this.palette=this.setPalette(r.scheme)}setPalette(e){const t=e.replace(/.*\//g,"");this.chkRgbStrings(t)?this.palette=this.getPalette(t):this.setRandomPalette()}setRandomPalette(){let e=R.random_choice(this.defaultRGBs);this.palette_string=e.name_en,this.palette=this.getPalette(e.scheme)}getPalette(e){const t=e.split("-");for(let e=0;e<t.length;e++)t[e]=this.inst.color("#"+t[e]);return this.shuffle(t)}chkRgbStrings(e){const t=e.replace(/.*\//g,"");return!!new RegExp(/^(([0-9]|[a-fA-F]){6}-){2,}([0-9]|[a-fA-F]){6}$/).test(t)}createMask(e,t){this.maskCv=createGraphics(t,t),this.inst.randomSeed(e),this.inst.noiseSeed(e),this.maskCv.randomSeed(e),this.maskCv.noiseSeed(e),this.setRandomPalette();const a=this.palette[0],r=this.palette.shift();this.sw=30,this.maskCv.pixelDensity(1),this.maskCv.colorMode(RGB,255),this.maskCv.angleMode(DEGREES),this.maskCv.clear(),this.maskCv.fill(a),this.maskCv.stroke(a),this.maskCv.scale(t/this.cSize),this.maskCv.strokeWeight(this.sw);const i=this.maskCv.random(100,400)*this.maskCv.random(.5,2);this.drawShape(this.cSize/2,this.cSize/2,this.sRadius,i,this.maskCv),this.palette.push(r);const n=createGraphics(t,t);if(this.needBackdrop)for(let e=0;e<3;e++){blendMode(BURN),push();let e=R.random_num(0,width/5),t=R.random_num(0,height/5),a=sqrt(2)*max(width,height)/2,r=R.random_num(0,360),i=width/2+e+cos(r)*a,n=height/2+t+sin(r)*a,s=width/2+e+cos(r+180)*a,o=height/2+t+sin(r+180)*a,c=drawingContext.createLinearGradient(i,n,s,o),h=R.random_choice(this.palette);h.setAlpha(50);let d=R.random_choice(this.palette);h.setAlpha(0);let l=color(h),m=color(hue(d),saturation(h),constrain(brightness(h)-20,0,100));c.addColorStop(0,l),c.addColorStop(1,m),drawingContext.fillStyle=c,noStroke(),rect(0,0,width,height),pop,blendMode(BLEND)}else n.clear();return this.needShadow&&(n.drawingContext.shadowColor=this.inst.color(0,127.5),n.drawingContext.shadowBlur=t/20,n.drawingContext.shadowOffsetY=t/40),n.image(this.maskCv,0,0),this.maskCv.remove(),n}drawShape(e,t,a,r,i){const n=new Array;let s=new Array,o=this.cSize,c=0,h=this.cSize/2,d=-this.cSize,l=this.cSize,m=-this.cSize;for(let a=0;a<360;a+=1){let n=i.noise(e,t,abs(a-180)/r);o=min(n,o),c=max(n,c),s.push(n)}for(let e=0;e<s.length;e++){let t=map(s[e],0,c,0,this.cSize/2*.9-this.sw*M),a=e;t=constrain(t,this.cSize/8,this.cSize/2);let r=i.cos(a)*t,o=i.sin(a)*t;n.push(createVector(r,o)),h=min(h,r),d=max(d,r),l=min(l,o),m=max(m,o)}const p=lerp(h,d,.5),f=lerp(l,m,.5);i.push(),i.strokeWeight(this.sw),i.translate(e,t),i.rotate(90),i.beginShape();for(let e of n)i.vertex(e.x-p,e.y-f);i.endShape(CLOSE),i.pop(),i.drawingContext.clip();let u=this.createGraphic(this.cSize/2,this.cSize,2);i.push(),i.translate(this.cSize/2,0),i.image(u,0,0),i.push(),i.scale(-1,1),i.image(u,0,0),i.pop(),i.pop(),u.remove()}drawJapanesePattern(e,t,a,r,i,n){switch(i.push(),i.translate(e,t),params.backgroundPattern){case"Mameshibori":this.drawMameshibori(a,r,i,n);break;case"Ichimatsu":this.drawIchimatsu(a,r,i,n);break;case"Shippo":this.drawShippo(a,r,i,n);break;case"Tatewaku":this.drawTatewaku(a,r,i,n);break;case"Seikaiha":this.drawSeikaiha(a,r,i,n)}i.pop()}drawMameshibori(e,t,a,r){let i=color(R.random_choice(this.palette));a.fill(i);let n=e/r,s=n/R.random_num(1.5,4);for(let e=0;e<=a.height;e+=n)for(let t=0;t<=a.width;t+=n){a.push(),a.translate(t,e),a.noStroke();let r=R.random_num(0,n/20)*(R.random_num(0,1)>.5?-1:1),i=noise(t,e),o=cos(360*i)*r,c=sin(360*i)*r;a.rotate(360*i),a.shearX(15*i),a.circle(o,c,s),a.pop()}}drawIchimatsu(e,t,a,r){let i=color(R.random_choice(this.palette)),n=0,s=e/r;for(let e=0;e<=a.height;e+=s)for(let t=0;t<=a.width;t+=s)a.push(),a.translate(t,e),a.noStroke(),a.fill(i),a.rectMode(CENTER),n++%2==0&&a.rect(t,e,2*s,2*s),a.pop()}drawShippo(e,t,a,r){let i=color(R.random_choice(this.palette)),n=e/r;a.push(),a.strokeWeight(n/R.random_num(15,30));for(let e=0;e<=a.height;e+=n)for(let t=0;t<=a.width;t+=n)a.push(),a.translate(t,e),a.noFill(),a.stroke(i),a.circle(0,0,n),a.stroke(i),a.circle(n/2,n/2,n),a.pop();a.pop()}drawTatewaku(e,t,a,r){let i=color(R.random_choice(this.palette)),n=e/r;a.stroke(i),a.strokeWeight(n*M*R.random_num(1/4,2));for(let e=0;e<r;e++)for(let t=0;t<r;t++){let r=e%2==1?180:0;a.push(),a.translate(n*(e+.5),3*n*t),a.noFill(),a.beginShape();for(let e=0;e<300;e++)a.vertex(n/4*sin(1.2*e+r),3*n/300*e);a.endShape(),a.pop()}}drawSeikaiha(e,t,a,r){let i=color(R.random_choice(this.palette)),n=i;for(;i==n;)n=color(R.random_choice(this.palette));let s=0,o=e/r;for(let e=0;e<=a.height;e+=o/4){for(let t=s%2==0?-o/2:0;t<=a.width+o;t+=o){a.push(),a.translate(t,e);let r=0;for(let e=1;e>0;e-=1/8)a.fill((s+r++)%2==0?i:n),a.noStroke(),a.circle(0,0,o*e);a.pop()}s++}}createGraphic(e,t,a){let r=createGraphics(e,t);return r.colorMode(HSB,360,100,100,100),r.angleMode(DEGREES),"Seikaiha"==params.backgroundPattern?(this.drawJapanesePattern(0,0,r.width,r.height,r,params.patternSize),this.recursiveGraphic(0,0,e,t,r,a)):(this.recursiveGraphic(0,0,e,t,r,a),this.drawJapanesePattern(0,0,r.width,r.height,r,params.patternSize),this.recursiveGraphic(0,0,e,t,r,a)),r}recursiveGraphic(e,t,a,r,i,n){for(let a=0;a<n;a++){let a=int(R.random_num(3,6)),s=a,o=r/a,c=r/s;for(let r=0;r<s;r++)for(let s=0;s<a;s++){let a=e+o*s,h=t+c*r;R.random_num(0,100)<90&&min(o,c)>i.height/5&&n>0?this.recursiveGraphic(a,h,o,c,i,n-1):this.drawPatterns(a,h,o,c,i)}}}drawPatterns(e,t,a,r,i){if(dist(e,t,0,i.height/2)>sqrt(2)*max(i.height,i.width)/2)return;let n,s,o=360*int(R.random_num(0,4))/4;o%180==0?(n=a,s=r):(n=r,s=a);let c=int(R.random_num(2,7));i.push(),i.translate(e+a/2,t+r/2),i.rotate(o),i.translate(-n/2,-s/2);let h=int(R.random_num(0,9));for(let e=c;e>0;e--)i.push(),i.scale(e/c),this.drawPattern(0,0,n,s,i,h,c/e),i.pop();i.pop()}drawPattern(e,t,a,r,i,n,s){i.drawingContext.shadowColor=color(0,0,0,33),i.drawingContext.shadowBlur=width/10;let o,c=R.random_choice(this.palette),h=R.random_choice(this.palette);for(;h==c;)h=R.random_choice(this.palette);switch(o=n<4?i.drawingContext.createLinearGradient(0,0,a,r):i.drawingContext.createRadialGradient(a/2,r/2,0,a/2,r/2,max(a,r)),o.addColorStop(0,h),o.addColorStop(1,c),i.drawingContext.fillStyle=o,i.stroke(0,0,20),i.strokeWeight(.2*M),n){case 0:i.arc(0,0,2*a,2*r,0,90,PIE);break;case 1:i.triangle(0,0,0,+r,+a,0);break;case 2:i.rect(0,0,a,r/2);break;case 3:i.triangle(0,0,a,r,a,t);break;case 4:i.circle(a/2,r/2,min(a,r));break;case 5:i.rectMode(CENTER),i.rect(a/2,r/2,min(a,r)),i.rectMode(CORNER);break;case 6:i.scale(s),i.circle(a,r,1*min(a,r)/s);break;case 7:i.scale(s),i.rectMode(CORNER),i.rect(a,r,1*min(a,r)/s),i.rectMode(CORNER);break;case 8:i.arc(0,0,a,r,0,90,PIE),i.scale(s),i.arc(a,r,a,r,180,270,PIE)}}shuffle(e){for(let t=e.length-1;t>=0;t--){let a=floor(R.random_num(0,1)*(t+1));[e[t],e[a]]=[e[a],e[t]]}return e}}const vert="\nprecision highp float;\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvarying vec2 vVertTexCoord;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertTexCoord = aTexCoord;\n}\n",frag="\nprecision highp float;\nvarying vec2 vVertTexCoord;\n\nuniform sampler2D source;\nuniform float noiseSeed;\nuniform float noiseAmount;\n \nfloat rand(vec2 n) { \n return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);\n}\n\nvoid main() {\n // GorillaSun's grain algorithm\n vec4 inColor = texture2D(source, vVertTexCoord);\n gl_FragColor = clamp(inColor + vec4(\n mix(-noiseAmount, noiseAmount, fract(noiseSeed + rand(vVertTexCoord * 1234.5678))),\n mix(-noiseAmount, noiseAmount, fract(noiseSeed + rand(vVertTexCoord * 876.54321))),\n mix(-noiseAmount, noiseAmount, fract(noiseSeed + rand(vVertTexCoord * 3214.5678))),\n 0.\n ), 0., 1.);\n}\n";function getTexture(e,t){const a=createGraphics(e,t);a.randomSeed(seed),a.colorMode(HSB,360,100,100,100),a.angleMode(DEGREES),a.strokeWeight(.1*M);for(let r=0;r<e;r+=20*e/DEFAULT_SIZE)for(let i=0;i<t;i+=20*t/DEFAULT_SIZE){let n=a.random(75,105),s=max(e,t)/2;a.stroke(0,0,0,a.random(15)),a.line(r+a.cos(n)*s,i+a.sin(n)*s,r+a.cos(n+180)*s,i+a.sin(n+180)*s)}return a}class Random{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substr(0,8),16),a=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),i=parseInt(e.substr(24,8),16);return function(){t|=0,a|=0,r|=0,i|=0;let e=(t+a|0)+i|0;return i=i+1|0,t=a^a>>>9,a=r+(r<<3)|0,r=r<<21|r>>>11,r=r+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()}random_num(e,t){return e+(t-e)*this.random_dec()}random_int(e,t){return Math.floor(this.random_num(e,t+1))}random_bool(e){return this.random_dec()<e}random_choice(e){return e[this.random_int(0,e.length-1)]}}
Generativemasks Japan Edition’ is a continuation of that algorithm and a new expression based on research of Japanese colours and patterns conducted with Junya Yamamine. We developed a video expression with an awareness of colour, design, and shading, referring to traditional Japanese patterns (和柄 Wagara) such as kimonos, folding screen paintings, and woodblock prints(浮世絵 Ukiyo-e). This research led to a special edition of ‘Generativemasks’ inspired by masks as ornaments of the Web3 era. "With the spread of new information technologies such as NFT, DAO, and with PFP (Profile Picture) in the spotlight, Takawo began to gain notoriety with his ‘Generativemasks’ themed as Masks for the Web 3.0 Era. However, as mentioned above, he has appeared from within the context of Japanese media art and has also advocated and continues to practice Daily Coding as an activity to connect programming with daily life, coming, climate, and indigenous culture since 2019. This time, he uses diverse cultures as a source of inspiration in his coding flexibly, and he has created a special edition of Generativemasks based on the study of traditional Japanese patterns and colours. This is an experiment for him to further develop his coding practice and training as a visual art form." - Junya Yamamine, curator
function loadScript(e,t){var a=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.src=e,n.onreadystatechange=t,n.onload=t,a.appendChild(n)}const gw=tokenData.preferredIPFSGateway;for(let e=0;e<tokenData.externalAssetDependencies.length;e++)loadScript(`${gw}${tokenData.externalAssetDependencies[e].cid}`);const svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("viewBox","0 0 600 800"),svg.setAttribute("role","img"),svg.style.maxWidth="100vh",svg.style.maxHeight="100vh",document.body.appendChild(svg);const width=svg.viewBox.baseVal.width-20,height=svg.viewBox.baseVal.height-30;function render(e,t,a,n){e.innerHTML="";let s=chooseRnd(["GhostWhite","black"]);e.viewBox.baseVal.width,e.viewBox.baseVal.height;const d=document.createElementNS(e.namespaceURI,"rect");d.setAttribute("x",0),d.setAttribute("y",0),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.setAttribute("fill",s),e.appendChild(d),R.random_dec()<.93||"black"!=s?(drawEmotionGrid(e,t,a,n,s),drawText(e,t,a,n,s)):(drawRandomText(e,t,a,n,s),drawGlyph(e,t,a,n,s))}window.addEventListener("load",function(e){let t=Math.floor(35*R.random_dec());fetchData(t)}),window.addEventListener("keydown",function(e){"s"==e.key&&saveSVG(svg,"HYPERTYPE_"+Date.now()+".svg")});