0xf94e…c3f2

All memos sent from and to 0xf94e…c3f2.

var s,layout,dome,blobs,blobs2,dark,light,base,today,uH,uD,uM,fastForwardRate,randomMonth,colGap,gR,version=3.9,nBlob=6,nCol=8,uDmaxTimeRange=31,uMmaxTimeRange=12,uHmaxTimeRange=24,rarr=[],rarro=[];function calculateFeatures($){let o=new class o{constructor(){this.useA=!1;let o=function($){let o=parseInt($.substr(0,8),16),l=parseInt($.substr(8,8),16),n=parseInt($.substr(16,8),16),e=parseInt($.substr(24,8),16);return function(){n|=0;let $=((o|=0)+(l|=0)|0)+(e|=0)|0;return e=e+1|0,o=l^l>>>9,l=n+(n<<3)|0,n=(n=n<<21|n>>>11)+$|0,($>>>0)/4294967296}};this.prngA=new o($.hash.substr(2,32)),this.prngB=new o($.hash.substr(34,32));for(let l=0;l<1e6;l+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_int($,o){return Math.floor($+(o+1-$)*this.random_dec())}random_choice($){return $[this.random_int(0,$.length-1)]}wRand($){let o,l=0,n=this.random_dec();for(o in $)if(n<=(l+=$[o]))return o}};var l={};return l.layout=o.wRand({ichi:.02,companion:.08,duo:.15,fountain:.75}),l.nBlob="ichi"==l.layout?1:"companion"==l.layout?o.wRand({1:.7,2:.3}):"duo"==l.layout?2:o.random_int(3,7),l.monotone=o.wRand({0:0,1:1}),l.bg=-1!=["ichi","companion","duo"].indexOf(l.layout)?"mountain":o.random_choice(["moor","mountain"]),l.bgCol=-1!=["ichi","companion"].indexOf(l.layout)?["#222","#fff","#111"]:o.random_choice([["#1E0E2D","#07f49e","#111"],["#111","#fff","#111"],["#00113D","#edb144","#051132"],]),l}var features=calculateFeatures(tokenData);function setup(){createCanvas((s=min(windowWidth*(16/9),windowHeight))*(9/16),s,WEBGL);for(let $=0;$<nBlob+1;$++){let o=tokenData.hash.slice(2*$+2,2*$+4);rarro.push(parseInt(o,16)%100/100)}gR=(rarr=scaleArray(rarro))[0],[dark,light,base]=features.bgCol,nBlob=int(features.nBlob),blobs2=selectBlob(features.layout,rarr,nBlob)}function draw(){pixelDensity(2),background(base),angleMode(DEGREES),blendMode(ADD);let $=new Date;uD=$.getDate(),uH=$.getHours(),uM=$.getMonth(),push();let o=.7*s/(.6+nBlob),l=.15*s+o*nBlob;firstBlobCol=drawPal(initAng=round(300*gR)%360,monotone=int(features.monotone),0,nCol)[0][0],drawEarth(features.bg,l,tones=[dark,firstBlobCol]),fill("#208bff00"),"companion"==features.layout?asawa0(nBlob,blobs2,monotone,rarr,uM,o):asawa(nBlob,blobs2,monotone,rarr,uM,o),pop()}function asawa0($,o,l,n,e,b){push(),rotateY(30*gR),gR<.5?rotateY(10*e):rotateY(-(10*e)),j=0,push(),asawa($,o,l,n,e,b),pop(),b/=5,push();let t=gR<.1||2==$?s/5:s/10;translate(-s/5,t),asawa($,o,features.monotone,n,e,b),pop(),push();let a=gR<.1||2==$?0:s/5;translate(2*s/5,a),asawa($,o,features.monotone,n,e,b),pop(),pop()}function asawa($,o,l,n,e,b){push(),translate(0,-s/2);let t=.15*s;for(let a=0;a<$;a++){let _=n[a]<.15?30*e:n[a]<.35?-30*e:0;[pal,innerPal]=drawPal(initAng+_,l,a,nCol);let i=wRand({slice:.75,full:.25},n[a]),u=t+b*a;if(push(),isPolarBlob(o[a]))blobbyBifoliumHeart(o,a,0,u,pal,innerPal,b,e);else for(let f=0;f<2;f++)blobby(f+0,u,o,a,pal,innerPal,b,angIncre=3,dome=i,n[a],e);pop()}}function blobbyBifoliumHeart($,o,l,n,e,b,t,a){push(),translate(l,n),blobi=$[o],o>1&&($[o-1]==blob0||$[o-1]==blob3)&&(a=0);for(let _=30;_<120;_+=2)strokeWeight(sw=selectStroke(_)),push(),rotateY(-(2*_)),stroke(200,200,0),blobi(e,b,o,t,a),pop();for(let i=-60;i<20;i+=2)strokeWeight(sw=selectStroke(i)),push(),rotateY(2*i),stroke(e[0]),blobi(e,b,o,t,a),pop();pop()}function blobby($,o,l,n,e,b,t,a,_,i,u){[ang,span,rot]=drawDome(features.layout,_,i,uH),angLst=[ang,ang+rot];let f=Array(nCol).fill(color(200,200,0));pals=gR<.09?[e,f]:[e,e];let m=2;isPolarBlob(l[n])&&(rot=0,m=1,span=90);for(let g=0;g<m;g++)push(),rotateY(angLst[g]),blobLayer($+(xdispAdj=i<.25&&l.length>2?t/16:0),o,l,n,pals[g],b,t,angLst[g],span,a,i,u),pop()}function isPolarBlob($){return $==blob7}function selectStroke($){return sw=$%5<2?.6:.1618,s>1600&&(sw*=map(s,800,8e3,1,6)),sw}function blobLayer($,o,l,n,e,b,t,a=0,_=180,i=2,u,f){f=int(f),push(),translate($,o);let m=max(0,f-(randomMonth=int(12*u))),g=5+5*sin((m+uD/uDmaxTimeRange/2+gR/2)/uMmaxTimeRange*90);rotateX(0==n&&l.length>1?0:u<.1&&0!=n?g:u<.7?-g:0);for(let h=0;h<_;h+=i)stroke(e[h%nCol]),strokeWeight(sw=selectStroke(h)),push(),rotateY(h),"ichi"==layout&&scale(2.88),l[n]==blob0&&scale(.8),u<.3&&!isPolarBlob(blobs2[n])&&l.length>3||"duo"==features.layout&&0==n||3==l.length&&0==n?(push(),translate(0,t,0),2==l.length&&0==n?scale(.86,-.86,1):scale(1,-1,1),blobs2[n](e,b,h,n,t,u,f),pop()):blobs2[n](e,b,h,n,t,u,f),pop();pop()}function blob0($,o,l,n,e,b=.2,t){stroke($[l%nCol]),push(),rotateY(20*n);let a=2.68*(e*=.8),_=1.88*e,i=.03*e,u=1.43*e;bezier(0,0,a,_,i,u,0,e),b<.2&&n!=nBlob-1?scale(.618,.9):(translate(0,.3*e),scale(.618)),b<.5&&stroke(o[l%nCol]),bezier(0,0,a,_,i,u,0,e),b>.25&&(scale(.5),b<.5&&stroke($[l%nCol]),translate(0,e/2),bezier(0,0,a,_,i,u,0,e)),pop()}function blob1($,o,l,n,e=200,b,t){stroke($[l%nCol]);let a=(.3+.6*b)*e,_=b*e*1.1;bezier(0,0,0,0,a,_,0,e);let i=normaSin(t/uMmaxTimeRange*90),u=i*e*.6,f=i*e*.1;a=f+i*e*.2,_=u+.3*i*e,push(),stroke(o[l%nCol]),scale(.5,.5+.3*b,1),bezier(0,u,f,u,a,_,0,e),pop()}function blob2($,o,l,n,e=200,b,t){stroke($[l%nCol]),push();let a=-(.3*normaSin(t/uMmaxTimeRange*90))+.8,_=.3*normaSin(t/uMmaxTimeRange*90)+.2,i=e*a,u=e*(.2+.4*b),f=e*_,m=u+e*(.1*b+.2);bezier(0,0,i,u,f,m,0,.96*e),push(),b<.5?(translate(0,.2*e),scale(.618)):scale(.618,1),b>.5&&stroke(o[l%nCol]),bezier(0,0,i,u,f,m,0,.96*e),pop(),push(),b<.5?(translate(0,e/4),scale(.36)):scale(.36,1),b>.75&&stroke($[l%nCol]),bezier(0,0,i,u,f,m,0,.96*e),pop(),b<.6&&(push(),b<.5?(translate(0,.275*e),scale(.2)):scale(.2,1),b>.75&&stroke($[l%nCol]),bezier(0,0,i,u,f,m,0,.96*e),pop(),push(),b<.5?(translate(0,.295*e),scale(.1)):scale(.1,1),b>.75&&stroke($[l%nCol]),bezier(0,0,i,u,f,m,0,.96*e),pop()),pop()}function blob3($,o,l,n,e=200,b,t){stroke($[l%nCol]);let a=(.1+1.3*b)*e,_=(.1+b)*e,i=.5*e;push(),rotateY(25*n),bezier(0,0,a,0,_,i,0,e);let u=normaSin((gR+t)/uMmaxTimeRange*90);translate(0,.19*e),scale(.182*u+.2,.182*u+.2,1*u),bezier(0,0,a,0,_,i,0,e),pop()}function blob4($,o,l,n,e=200,b=.2,t){stroke($[l%nCol]);let a=e*(.33*b+.3),_=a/4,i=a/3,u=a/1;push(),bezier(0,0,a,_,i,u,0,e),push(),scale(.618-.15*sin(t/uMmaxTimeRange*90),.618-.15*sin(t/uMmaxTimeRange*90),1),stroke(o[l%nCol]),bezier(0,0,a,_,i,u,0,e),pop(),translate(0,e*(.618-.15*sin(t/uMmaxTimeRange*90))),scale(.2,.382+.15*sin(t/uMmaxTimeRange*90),1),stroke(o[(l+1)%nCol]),bezier(0,0,a,_,i,u,0,e),pop()}function normaSin($){return sin($)/2+.5}function blob5($,o,l,n,e=200,b=.2,t){noiseSeed(1);for(let a=0;a<3;a++){stroke(0==a?$[l%nCol]:o[l%nCol]);let _=normaSin(max(0,t-(randomMonth=int(12*b)))/uMmaxTimeRange*90),i=_*e*(.6+.2*_),u=a*(_*e)*.01,f=i+.118*e+_*e*.22*a,m=u+e/8,g=.8*e-_*e*.5,h=(u+e/8+e)/2;bezier(i,u,f,m,g,h,0,e)}}function blob7($,o,l,n=200,e){push(),rotateY(20*l);let b=1.8,t=1;0==e?(b=.88,t=1.4):(5==e||e>=9)&&(b=1,t=1.5),1!=t?(push(),translate(0,n/2),bifolium(n,b,t),pop()):bifolium(n,b,t),pop()}function bifolium($,o,l){beginShape();for(let n=0;n<90;n+=.2)vertex(x=(r=$*o*pow(sin(n),.618)*cos(pow(n,l)))*sin(n),y=r*cos(n));endShape()}function drawEarth($,o,l){push();let[n,e]=l;if(blendMode(BLEND),"moor"==$){beginShape(),noStroke(),fill(n),vertex(-s*(9/16)/2,o-s/2),vertex(s*(9/16)/2,o-s/2),fill(e),vertex(s*(9/16)/2,o-s/2+s/28),vertex(-s*(9/16)/2,o-s/2+s/28),endShape(CLOSE),beginShape();for(let b=0;b<11;b++){fill(base);let t=o-s/2-(1.6*normaSin(frameCount/2%180)+1)*abs(b-5)**2;vertex(lerp(-s*(9/16)/2,s*(9/16)/2,b/10),t+s/28)}vertex(s*(9/16)/2,o-s/2),vertex(-s*(9/16)/2,o-s/2),endShape(CLOSE)}else if("mountain"==$){beginShape(),noStroke();for(let a=0;a<11;a++){fill(n);let _=max(o-s/2+s/32+s/32*normaSin(frameCount/2%180),o-s/2+s/32+s/32*normaSin(frameCount/8%180)+2*abs(a-5)**2);vertex(lerp(-s*(9/16)/2,s*(9/16)/2,a/10),_)}fill(e),vertex(s*(9/16)/2,.6*s),vertex(-s*(9/16)/2,.6*s),endShape()}pop()}function drawDome($,o,l,n){if(angAdj=l<.8?sin((uD+n)/(uDmaxTimeRange+uHmaxTimeRange)*90):sin(uD/uDmaxTimeRange*90),!("slice"==o&"ichi"!=$))return[-90*l,span=constrain(180-80*angAdj,5,178),rot=180];{let e=100*l+80;return[-60+40*l,span=constrain(e+(179-e)*angAdj,5,178),rot=180]}}function rand_choice($,o){return $[idx=Math.floor(0+($.length-1+1-0)*o)]}function selectBlob($,o,l){if("ichi"==$)blobs2=[rand_choice(blobs=[blob1,blob2],gR)];else if("fountain"==$){blobs=[blob0,blob1,blob2,blob3,blob4,blob5,blob7],blobs2=[];for(let n=0;n<l;n++)blobs2.push(rand_choice(blobs,o[n]))}else if("duo"==$||"companion"==$&&2==l)blobs2=rand_choice([[blob2,blob0],[blob4,blob0],[blob5,blob0],[blob1,blob1],[blob1,blob3],[blob1,blob4],[blob1,blob5],[blob2,blob2],[blob2,blob3],[blob2,blob4],[blob2,blob5],[blob3,blob2],[blob3,blob3],[blob3,blob4],[blob3,blob5],[blob5,blob1],[blob5,blob2],[blob5,blob3],[blob5,blob5],],gR);else if("companion"==$)blobs2=[rand_choice(blobs=[blob1,blob2,blob4],gR)];else{blobs2=[];for(let e=0;e<7;e++)blobs2.push(rand_choice([blob1,blob2,blob3,blob4,blob5],o[e]))}return blobs2}function drawPal($,o,l,n){return[pal=cubeHelixPal(n=10,abs($-(colGap=1==o?15:gR<.46?map(gR,0,1,20,36):gR<.6?120:180)*l)%360,-.35,.82,.7,[.28,.8],.5),innerPal=cubeHelixPal(n,abs($-colGap*l+180)%360,-.35,.8,.7,[.28,.8],.5)]}function cubeHelixPal($,o,l,n,e,b,t){let a=[];for(let _=0;_<$;_++)o-=2*_,a.push(color((c=cubeHelix(o,l,n,e,b,t))[0],c[1],c[2]));return a}function cubeHelix($,o,l,n,e,b){$=void 0!==$?$:300,o=void 0!==o?o:-1.5,l=void 0!==l?l:1,n=void 0!==n?n:1;let t=(e=void 0!==e?e:[0,1])[1]-e[0],a=2*Math.PI*($/360+o*b),_=Math.pow(e[0]+t*b,n),i=l*_*(1-_)/2,u=_+i*(-.14861*Math.cos(a)+1.78277*Math.sin(a)),f=_+i*(-.29227*Math.cos(a)-.90649*Math.sin(a)),m=_+i*(1.97294*Math.cos(a));return u=Math.floor(255*Math.max(0,Math.min(1,u))),f=Math.floor(255*Math.max(0,Math.min(1,f))),m=Math.floor(255*Math.max(0,Math.min(1,m))),[u,f,m]}function wRand($,o){let l,n=0;for(l in $)if(o<=(n+=$[l]))return l}function scaleArray($){for(var o=Math.min.apply(null,$),l=Math.max.apply(null,$),n=[],e=0;e<$.length;e++)n[e]=($[e]-o)/(l-o+1e-7);return n}function windowResized(){resizeCanvas((s=min(windowWidth*(16/9),windowHeight))*(9/16),s),redraw()}function keyTyped(){text=tokenData.hash,"s"===key?saveCanvas("sketch_",text+".png"):"w"===key&&(resizeCanvas((s=7680)/16*9,s),redraw(),saveCanvas("sketch_big.png"))}
var s, layout, dome, blobs, blobs2, dark, light, base, today, uH, uD, uM, fastForwardRate, randomMonth, colGap, gR, version = 3.8, nBlob = 6, nCol = 8, uDmaxTimeRange = 31, uMmaxTimeRange = 12, uHmaxTimeRange = 24, rarr = [], rarro = []; function calculateFeatures($) { let o = new (class o { constructor() { this.useA = !1; let o = function ($) { let o = parseInt($.substr(0, 8), 16), l = parseInt($.substr(8, 8), 16), n = parseInt($.substr(16, 8), 16), e = parseInt($.substr(24, 8), 16); return function () { n |= 0; let $ = ((((o |= 0) + (l |= 0)) | 0) + (e |= 0)) | 0; return ( (e = (e + 1) | 0), (o = l ^ (l >>> 9)), (l = (n + (n << 3)) | 0), (n = ((n = (n << 21) | (n >>> 11)) + $) | 0), ($ >>> 0) / 4294967296 ); }; }; (this.prngA = new o($.hash.substr(2, 32))), (this.prngB = new o($.hash.substr(34, 32))); for (let l = 0; l < 1e6; l += 2) this.prngA(), this.prngB(); } random_dec() { return (this.useA = !this.useA), this.useA ? this.prngA() : this.prngB(); } random_int($, o) { return Math.floor($ + (o + 1 - $) * this.random_dec()); } random_choice($) { return $[this.random_int(0, $.length - 1)]; } wRand($) { let o, l = 0, n = this.random_dec(); for (o in $) if (n <= (l += $[o])) return o; } })(); var l = {}; return ( (l.layout = o.wRand({ ichi: 0.02, companion: 0.08, duo: 0.2, fountain: 0.7, })), (l.nBlob = "ichi" == l.layout ? 1 : "companion" == l.layout ? o.wRand({ 1: 0.7, 2: 0.3 }) : "duo" == l.layout ? 2 : o.random_int(3, 7)), (l.monotone = o.wRand({ 0: 0, 1: 1 })), (l.bg = -1 != ["ichi", "companion", "duo"].indexOf(l.layout) ? "mountain" : o.random_choice(["moor", "mountain"])), (l.bgCol = -1 != ["ichi", "companion"].indexOf(l.layout) ? ["#222", "#fff", "#111"] : o.random_choice([ ["#1E0E2D", "#07f49e", "#111"], ["#111", "#fff", "#111"], ["#00113D", "#edb144", "#051132"], ])), l ); } var features = calculateFeatures(tokenData); function setup() { createCanvas( (s = min(windowWidth * (16 / 9), windowHeight)) * (9 / 16), s, WEBGL ); for (let $ = 0; $ < nBlob + 1; $++) { let o = tokenData.hash.slice(2 * $ + 2, 2 * $ + 4); rarro.push((parseInt(o, 16) % 100) / 100); } (gR = (rarr = scaleArray(rarro))[0]), ([dark, light, base] = features.bgCol), (nBlob = int(features.nBlob)), (blobs2 = selectBlob(features.layout, rarr, nBlob)); } function draw() { background(base), angleMode(DEGREES), blendMode(ADD); let $ = new Date(); (uD = $.getDate()), (uH = $.getHours()), (uM = $.getMonth()), push(); let o = (0.7 * s) / (0.6 + nBlob), l = 0.15 * s + o * nBlob; (firstBlobCol = drawPal( (initAng = round(300 * gR) % 360), (monotone = int(features.monotone)), 0, nCol )[0][0]), drawEarth(features.bg, l, (tones = [dark, firstBlobCol])), fill("#208bff00"), "companion" == features.layout ? asawa0(nBlob, blobs2, monotone, rarr, uM, o) : asawa(nBlob, blobs2, monotone, rarr, uM, o), pop(), (text = tokenData.hash); } function asawa0($, o, l, n, e, b) { push(), rotateY(30 * gR), gR < 0.5 ? rotateY(10 * e) : rotateY(-(10 * e)), (j = 0), push(), asawa($, o, l, n, e, b), pop(), (b /= 5), push(); let t = gR < 0.1 || 2 == $ ? s / 5 : s / 10; translate(-s / 5, t), asawa($, o, features.monotone, n, e, b), pop(), push(); let a = gR < 0.1 || 2 == $ ? 0 : s / 5; translate((2 * s) / 5, a), asawa($, o, features.monotone, n, e, b), pop(), pop(); } function asawa($, o, l, n, e, b) { push(), translate(0, -s / 2); let t = 0.15 * s; for (let a = 0; a < $; a++) { let _ = n[a] < 0.15 ? 30 * e : n[a] < 0.35 ? -30 * e : 0; [pal, innerPal] = drawPal(initAng + _, l, a, nCol); let i = wRand({ slice: 0.75, full: 0.25 }, n[a]), u = t + b * a; if ((push(), isPolarBlob(o[a]))) blobbyBifoliumHeart(o, a, 0, u, pal, innerPal, b, e); else for (let f = 0; f < 2; f++) blobby( f + 0, u, o, a, pal, innerPal, b, (angIncre = 3), (dome = i), n[a], e ); pop(); } } function blobbyBifoliumHeart($, o, l, n, e, b, t, a) { push(), translate(l, n), (blobi = $[o]), o > 1 && ($[o - 1] == blob0 || $[o - 1] == blob3) && (a = 0); for (let _ = 30; _ < 120; _ += 2) strokeWeight((sw = selectStroke(_))), push(), rotateY(-(2 * _)), stroke(200, 200, 0), blobi(e, b, o, t, a), pop(); for (let i = -60; i < 20; i += 2) strokeWeight((sw = selectStroke(i))), push(), rotateY(2 * i), stroke(e[0]), blobi(e, b, o, t, a), pop(); pop(); } function blobby($, o, l, n, e, b, t, a, _, i, u) { ([ang, span, rot] = drawDome(features.layout, _, i, uH)), (angLst = [ang, ang + rot]); let f = Array(nCol).fill(color(200, 200, 0)); pals = gR < 0.09 ? [e, f] : [e, e]; let m = 2; isPolarBlob(l[n]) && ((rot = 0), (m = 1), (span = 90)); for (let h = 0; h < m; h++) push(), rotateY(angLst[h]), blobLayer( $ + (xdispAdj = i < 0.25 && l.length > 2 ? t / 16 : 0), o, l, n, pals[h], b, t, angLst[h], span, a, i, u ), pop(); } function isPolarBlob($) { return $ == blob7; } function selectStroke($) { return ( (sw = $ % 5 < 2 ? 0.6 : 0.1618), s > 1600 && (sw *= map(s, 800, 8e3, 1, 6)), sw ); } function blobLayer($, o, l, n, e, b, t, a = 0, _ = 180, i = 2, u, f) { (f = int(f)), push(), translate($, o); let m = max(0, f - (randomMonth = int(12 * u))), h = 5 + 5 * sin(((m + uD / uDmaxTimeRange / 2 + gR / 2) / uMmaxTimeRange) * 90); rotateX( 0 == n && l.length > 1 ? 0 : u < 0.1 && 0 != n ? h : u < 0.7 ? -h : 0 ); for (let d = 0; d < _; d += i) stroke(e[d % nCol]), strokeWeight((sw = selectStroke(d))), push(), rotateY(d), "ichi" == layout && scale(2.88), (u < 0.3 && !isPolarBlob(blobs2[n]) && l.length > 3) || ("duo" == features.layout && 0 == n) || (3 == l.length && 0 == n) ? (push(), translate(0, t, 0), 2 == l.length && 0 == n ? scale(0.86, -0.86, 1) : scale(1, -1, 1), blobs2[n](e, b, d, n, t, u, f), pop()) : blobs2[n](e, b, d, n, t, u, f), pop(); pop(); } function blob0($, o, l, n, e, b = 0.2, t) { stroke($[l % nCol]), push(), rotateY(20 * n); let a = 2.68 * (e *= 0.8), _ = 1.88 * e, i = 0.03 * e, u = 1.43 * e; bezier(0, 0, a, _, i, u, 0, e), b < 0.2 && n != nBlob - 1 ? scale(0.618, 0.9) : (translate(0, 0.3 * e), scale(0.618)), b < 0.5 && stroke(o[l % nCol]), bezier(0, 0, a, _, i, u, 0, e), b > 0.25 && (scale(0.5), b < 0.5 && stroke($[l % nCol]), translate(0, e / 2), bezier(0, 0, a, _, i, u, 0, e)), pop(); } function blob1($, o, l, n, e = 200, b, t) { stroke($[l % nCol]); let a = (0.3 + 0.6 * b) * e, _ = b * e * 1.1; bezier(0, 0, 0, 0, a, _, 0, e); let i = normaSin((t / uMmaxTimeRange) * 90), u = i * e * 0.6, f = i * e * 0.1; (a = f + i * e * 0.2), (_ = u + 0.3 * i * e), push(), stroke(o[l % nCol]), scale(0.5, 0.3 + 0.6 * b, 1), bezier(0, u, f, u, a, _, 0, e), pop(); } function blob2($, o, l, n, e = 200, b, t) { stroke($[l % nCol]), push(); let a = -(0.3 * normaSin((t / uMmaxTimeRange) * 90)) + 0.8, _ = 0.3 * normaSin((t / uMmaxTimeRange) * 90) + 0.2, i = e * a, u = e * (0.2 + 0.4 * b), f = e * _, m = u + e * (0.1 * b + 0.2); bezier(0, 0, i, u, f, m, 0, 0.96 * e), push(), b < 0.5 ? (translate(0, 0.2 * e), scale(0.618)) : scale(0.618, 1), b > 0.5 && stroke(o[l % nCol]), bezier(0, 0, i, u, f, m, 0, 0.96 * e), pop(), push(), b < 0.5 ? (translate(0, e / 4), scale(0.36)) : scale(0.36, 1), b > 0.75 && stroke($[l % nCol]), bezier(0, 0, i, u, f, m, 0, 0.96 * e), pop(), b < 0.6 && (push(), b < 0.5 ? (translate(0, 0.275 * e), scale(0.2)) : scale(0.2, 1), b > 0.75 && stroke($[l % nCol]), bezier(0, 0, i, u, f, m, 0, 0.96 * e), pop(), push(), b < 0.5 ? (translate(0, 0.295 * e), scale(0.1)) : scale(0.1, 1), b > 0.75 && stroke($[l % nCol]), bezier(0, 0, i, u, f, m, 0, 0.96 * e), pop()), pop(); } function blob3($, o, l, n, e = 200, b, t) { stroke($[l % nCol]); let a = (0.1 + 1.3 * b) * e, _ = (0.1 + b) * e, i = 0.5 * e; push(), rotateY(25 * n), bezier(0, 0, a, 0, _, i, 0, e); let u = normaSin(((gR + t) / uMmaxTimeRange) * 90); translate(0, 0.19 * e), scale(0.182 * u + 0.2, 0.182 * u + 0.2, 1 * u), bezier(0, 0, a, 0, _, i, 0, e), pop(); } function blob4($, o, l, n, e = 200, b = 0.2, t) { stroke($[l % nCol]); let a = e * (0.33 * b + 0.3), _ = a / 4, i = a / 3, u = a / 1; push(), bezier(0, 0, a, _, i, u, 0, e), push(), scale( 0.618 - 0.15 * sin((t / uMmaxTimeRange) * 90), 0.618 - 0.15 * sin((t / uMmaxTimeRange) * 90), 1 ), stroke(o[l % nCol]), bezier(0, 0, a, _, i, u, 0, e), pop(), translate(0, e * (0.618 - 0.15 * sin((t / uMmaxTimeRange) * 90))), scale(0.2, 0.382 + 0.15 * sin((t / uMmaxTimeRange) * 90), 1), stroke(o[(l + 1) % nCol]), bezier(0, 0, a, _, i, u, 0, e), pop(); } function normaSin($) { return sin($) / 2 + 0.5; } function blob5($, o, l, n, e = 200, b = 0.2, t) { noiseSeed(1); for (let a = 0; a < 3; a++) { stroke(0 == a ? $[l % nCol] : o[l % nCol]); let _ = normaSin( (max(0, t - (randomMonth = int(12 * b))) / uMmaxTimeRange) * 90 ), i = _ * e * (0.6 + 0.2 * _), u = a * (_ * e) * 0.01, f = i + 0.118 * e + _ * e * 0.22 * a, m = u + e / 8, h = 0.8 * e - _ * e * 0.5, d = (u + e / 8 + e) / 2; bezier(i, u, f, m, h, d, 0, e); } } function blob7($, o, l, n = 200, e) { push(), rotateY(20 * l); let b = 1.8, t = 1; 0 == e ? ((b = 0.88), (t = 1.4)) : (5 == e || e >= 9) && ((b = 1), (t = 1.5)), 1 != t ? (push(), translate(0, n / 2), bifolium(n, b, t), pop()) : bifolium(n, b, t), pop(); } function bifolium($, o, l) { beginShape(); for (let n = 0; n < 90; n += 0.2) vertex( (x = (r = $ * o * pow(sin(n), 0.618) * cos(pow(n, l))) * sin(n)), (y = r * cos(n)) ); endShape(); } function drawEarth($, o, l) { push(); let [n, e] = l; if ((blendMode(BLEND), "moor" == $)) { beginShape(), noStroke(), fill(n), vertex((-s * (9 / 16)) / 2, o - s / 2), vertex((s * (9 / 16)) / 2, o - s / 2), fill(e), vertex((s * (9 / 16)) / 2, o - s / 2 + s / 28), vertex((-s * (9 / 16)) / 2, o - s / 2 + s / 28), endShape(CLOSE), beginShape(); for (let b = 0; b < 11; b++) { fill(base); let t = o - s / 2 - (1.6 * normaSin((frameCount / 2) % 180) + 1) * abs(b - 5) ** 2; vertex(lerp((-s * (9 / 16)) / 2, (s * (9 / 16)) / 2, b / 10), t + s / 28); } vertex((s * (9 / 16)) / 2, o - s / 2), vertex((-s * (9 / 16)) / 2, o - s / 2), endShape(CLOSE); } else if ("mountain" == $) { beginShape(), noStroke(); for (let a = 0; a < 11; a++) { fill(n); let _ = max( o - s / 2 + s / 32 + (s / 32) * normaSin((frameCount / 2) % 180), o - s / 2 + s / 32 + (s / 32) * normaSin((frameCount / 8) % 180) + 2 * abs(a - 5) ** 2 ); vertex(lerp((-s * (9 / 16)) / 2, (s * (9 / 16)) / 2, a / 10), _); } fill(e), vertex((s * (9 / 16)) / 2, 0.6 * s), vertex((-s * (9 / 16)) / 2, 0.6 * s), endShape(); } pop(); } function drawDome($, o, l, n) { if (!(("slice" == o) & ("ichi" != $))) return [ -90, (span = 180 - 60 * sin((n / uHmaxTimeRange) * 90)), (rot = 180), ]; { let e = 100 * l + 80; return [ -60 + 40 * l, (span = e + (179 - e) * sin((n / uHmaxTimeRange) * 90)), (rot = 180), ]; } } function rand_choice($, o) { return $[(idx = Math.floor(0 + ($.length - 1 + 1 - 0) * o))]; } function selectBlob($, o, l) { if ("ichi" == $) blobs2 = [rand_choice((blobs = [blob1, blob2]), gR)]; else if ("fountain" == $) { (blobs = [blob0, blob1, blob2, blob3, blob4, blob5, blob7]), (blobs2 = []); for (let n = 0; n < l; n++) blobs2.push(rand_choice(blobs, o[n])); } else if ("duo" == $ || ("companion" == $ && 2 == l)) blobs2 = rand_choice( [ [blob2, blob0], [blob4, blob0], [blob5, blob0], [blob1, blob1], [blob1, blob3], [blob1, blob4], [blob1, blob5], [blob2, blob2], [blob2, blob3], [blob2, blob4], [blob2, blob5], [blob3, blob2], [blob3, blob3], [blob3, blob4], [blob3, blob5], [blob5, blob1], [blob5, blob2], [blob5, blob3], [blob5, blob5], ], gR ); else if ("companion" == $) blobs2 = [rand_choice((blobs = [blob1, blob2, blob4]), gR)]; else { blobs2 = []; for (let e = 0; e < 7; e++) blobs2.push(rand_choice([blob1, blob2, blob3, blob4, blob5], o[e])); } return blobs2; } function drawPal($, o, l, n) { return [ (pal = cubeHelixPal( (n = 10), abs( $ - (colGap = 1 == o ? 15 : gR < 0.46 ? map(gR, 0, 1, 20, 36) : gR < 0.6 ? 120 : 180) * l ) % 360, -0.35, 0.82, 0.7, [0.28, 0.8], 0.5 )), (innerPal = cubeHelixPal( n, abs($ - colGap * l + 180) % 360, -0.35, 0.8, 0.7, [0.28, 0.8], 0.5 )), ]; } function cubeHelixPal($, o, l, n, e, b, t) { let a = []; for (let _ = 0; _ < $; _++) (o -= 2 * _), a.push(color((c = cubeHelix(o, l, n, e, b, t))[0], c[1], c[2])); return a; } function cubeHelix($, o, l, n, e, b) { ($ = void 0 !== $ ? $ : 300), (o = void 0 !== o ? o : -1.5), (l = void 0 !== l ? l : 1), (n = void 0 !== n ? n : 1); let t = (e = void 0 !== e ? e : [0, 1])[1] - e[0], a = 2 * Math.PI * ($ / 360 + o * b), _ = Math.pow(e[0] + t * b, n), i = (l * _ * (1 - _)) / 2, u = _ + i * (-0.14861 * Math.cos(a) + 1.78277 * Math.sin(a)), f = _ + i * (-0.29227 * Math.cos(a) - 0.90649 * Math.sin(a)), m = _ + i * (1.97294 * Math.cos(a)); return ( (u = Math.floor(255 * Math.max(0, Math.min(1, u)))), (f = Math.floor(255 * Math.max(0, Math.min(1, f)))), (m = Math.floor(255 * Math.max(0, Math.min(1, m)))), [u, f, m] ); } function wRand($, o) { let l, n = 0; for (l in $) if (o <= (n += $[l])) return l; } function scaleArray($) { for ( var o = Math.min.apply(null, $), l = Math.max.apply(null, $), n = [], e = 0; e < $.length; e++ ) n[e] = ($[e] - o) / (l - o + 1e-7); return n; } function windowResized() { resizeCanvas((s = min(windowWidth * (16 / 9), windowHeight)) * (9 / 16), s), redraw(); } function keyTyped() { (text = tokenData.hash), "s" === key ? saveCanvas("sketch_", text + ".png") : "w" === key && (resizeCanvas(((s = 7680) / 16) * 9, s), redraw(), saveCanvas("large_sketch.png")); }
Transcendence artworks are part of the Future Reflections generative art collection presented by Shiseido. The collection consists of 1,872 unique generative artworks created in partnership with leading contemporary artists, powered by Art Blocks Engine. Celebrating the parallel processes of generative, code-based art creation and the art and science of beauty product innovation, Future Reflections draws inspiration from Shiseido’s 150 years of Japanese heritage - past, present, and future - along with nutrient-rich ingredients in the brand’s Future Solution LX skincare collection. The Transcendence artworks draw inspiration from artist Ruth Asawa’s woven sculptures, seeds from various plants, and the curvature found in futuristic architecture. The artworks are dynamic, changing over time, and capture the raw vitality of life force and reflect on the serene and delicate meditative nature of interconnectedness.
let x = 0, y = 0.01, a = 2, b = -1.8, c = 1.6, d = 1.6; var cs, nd, layout, angle, showBite, textures, gradient, h, w, gR, fg_cs_dct, rarr = []; function calculateFeatures(e) { fg_cs_dct = { base: ["#F1E9DA", "#FFD400", "#541388", "#D90368", "#2E294E"], flame: ["#e60707", "#c80000", "#FFADAD", "#a20606", "#7b0c00", "#5f0701"], beach: ["#f24088", "#ed555d", "#fd894a", "#ffc12e", "#fff23f"], timhorton: ["#94165c", "#f90062", "#3ec2fa", "#054ba8"], centralpark: ["#490a3d", "#bd1550", "#e97f02", "#f8ca00", "#8a9b0f"], judd: ["#f6bc12", "#1477bb", "#41bb9b", "#ff4242", "#fec101"], autumn: [ "#705f84", "#687d99", "#6c843e", "#fc9a1a", "#dc383a", "#aa3a33", "#9c4257", ], olympia: ["#ff3250", "#ffb33a", "#008c36", "#0085c6", "#4c4c4c"], comets: ["#FFA0FF", "#0364FC", "#41CA7C", "#FDBC28", "#9EA1F8"], lajolla: ["#EFE5D1", "#F09BC4", "#F54034", "#1F43B1", "#02ADDC"], cranberrysauce: ["#ffbbee", "#cc3300", "#7799dd", "#991100", "#6600bb"], candiedapple: ["#e8165b", "#401e38", "#66c3b4", "#ee7724", "#584098"], frozenrose: ["#29368f", "#e9697b", "#1b164d", "#f7d996"], lego: ["#f1594a", "#f5b50e", "#14a160", "#2969de", "#4c4c4c"], amaretto: [ "#811e18", "#4c6216", "#c88a2c", "#9e4013", "#b04948", "#1a472a", ], choco: ["#8d1c06", "#e67424", "#f5c34d", "#3c0d03", "#ed9b49"], irishcream: [ "#ef8a47", "#376795", "#f7aa58", "#72bcd5", "#e76254", "#1e466e", "#ffd06f", "#528fad", ], Marfa: [ "#792504", "#527baa", "#bc7524", "#8dadca", "#082844", "#421600", "#104839", ], koloocheh: [ "#8cc8bc", "#b83326", "#7da7ea", "#1d4497", "#c8570d", "#5773c0", "#edb144", "#dd7867", ], bonito: [ "#b36c06", "#65150b", "#c0431f", "#f19425", "#961f1f", "#533d14", "#c59349", ], mixedberry: [ "#2f357c", "#b0799a", "#e69b00", "#355828", "#6c5d9e", "#bf3729", "#e48171", "#f5bb50", "#9d9cd5", "#17154f", "#f6b3b0", "#ada43b", ], pistachio: [ "#ba5c3f", "#307d7f", "#598c4c", "#a13213", "#042e4e", "#470c00", ], edibleflower: ["#eab1c6", "#e18a1f", "#d35e17", "#829d44", "#e9b109"], dango: [ "#4457a5", "#c44d76", "#7caf5c", "#59386c", "#b24422", "#13315f", "#447861", "#b1a1cc", ], honey: [ "#802417", "#c06636", "#17486f", "#e8b960", "#ce9344", "#646e3b", "#508ea2", "#2b5851", ], bluecorn: [ "#6c1d0e", "#235070", "#c27668", "#7ba0b4", "#421401", "#0a2d46", "#8b3a2b", "#44728c", ], lavendar: [ "#2673a3", "#582310", "#473d7d", "#318f49", "#582310", "#0cb4bb", "#82c45f", ], cremebrulee: [ "#bd3106", "#5b7314", "#454b87", "#d9700e", "#89a6bb", "#eebe04", "#c3d6ce", "#e9a00e", ], forest: ["#7c291e", "#ba7233", "#2d5380", "#3a4421", "#4b1d0d"], }; let t = new (class { constructor() { this.useA = !1; let t = function (e) { let t = parseInt(e.substr(0, 8), 16), a = parseInt(e.substr(8, 8), 16), i = parseInt(e.substr(16, 8), 16), n = parseInt(e.substr(24, 8), 16); return function () { (t |= 0), (a |= 0), (i |= 0), (n |= 0); let e = (((t + a) | 0) + n) | 0; return ( (n = (n + 1) | 0), (t = a ^ (a >>> 9)), (a = (i + (i << 3)) | 0), (i = (i << 21) | (i >>> 11)), (i = (i + e) | 0), (e >>> 0) / 4294967296 ); }; }; (this.prngA = new t(e.hash.substr(2, 32))), (this.prngB = new t(e.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_int(e, t) { return Math.floor(e + (t + 1 - e) * this.random_dec()); } random_choice(e) { return e[this.random_int(0, e.length - 1)]; } wRand(e) { let t, a = 0, i = this.random_dec(); for (t in e) if (((a += e[t]), i <= a)) return t; } })(); var a = Object.keys(fg_cs_dct), i = {}; return ( (i.palette = t.random_choice(a)), (i.nd = t.random_dec() < 0.04 ? 1 : t.random_dec() < 0.08 ? 3 : t.random_dec() < 0.16 ? 2 : t.random_int(4, 10)), (i.bg = t.random_choice(["#222", "#00113D"])), (i.textures = t.random_dec() < 0.2 ? "original-mochi" : t.random_choice([ "original", "waffle", "satellite", "oldFashioned", "original-oldFashioned", "original-satellite", "mochi-satellite", "mochi-oldFashioned", "oldFashioned-waffle", ])), (i.fillType = t.wRand({ original: 0.2, gradient: 0.5, rim: 0.3 })), (i.layout = 1 == i.nd ? "uno" : 2 == i.nd ? t.random_choice(["stack", "cairn"]) : 3 == i.nd && -1 != ["oldFashioned", "satellite"].indexOf(i.textures) ? "radiate" : -1 != ["original", "waffle", "satellite", "mochi", "oldFashioned"].indexOf( i.textures ) ? t.wRand({ stack: 0.15, melt: 0.15, radiate: 0.7 }) : 3 == i.nd ? "stack" : t.wRand({ stack: 0.7, grow: 0.3 })), i ); } var features = calculateFeatures(tokenData); function setup() { pixelDensity(2), (h = windowHeight), (w = (9 * h) / 16), createCanvas(w, h), (nd = features.nd); for (let e = 0; e < nd; e++) { let t = tokenData.hash.slice(2 * e + 2, 2 * e + 4); rarr.push((parseInt(t, 16) % 100) / 100); } (gR = rarr[0]), (angle = TAU * gR), noiseSeed(gR), (showBite = gR > 0.08), (initCol = fg_cs_dct[features.palette]), (cs = gR > 0.5 ? initCol : initCol.reverse().slice(0, 4)), (layout = features.layout), (textures = features.textures), (fillType = features.fillType), (gradient = features.gradient), (donut = new Donut( a, b, c, d, nd, cs, textures, fillType, (half = "all"), (dilute = "no"), rarr )), noStroke(), background(features.bg); } function draw() { (curtainCall = 9), frameCount > curtainCall && noLoop(), "cairn" == layout ? (donut.calc(), donut.show("cairn")) : donut.show(layout); } function calcSize(e, t) { return e > 3 ? (0.8 * h) / e / t / 3 : (0.8 * h) / e / t / 4; } function calcD(e, t = 0.8) { return (e > 3) & (gR > t) ? 2.7 : 1.6; } function calcVarSize(e, t, a, i = 0.05) { return gR > i || 2 == e ? a * map(noise(t), 0, 1, 0.8, 1.35) : a; } function calcBite(e, t, a) { return e & ((a > 3) & (a < t - 2) || (2 == t) & (gR > 0.5)) ? 1 + a / 4 : 0; } function calcYpos(e, t, a) { return e > 2 ? 0.05 * t + ((0.8 * t) / e) * (1 + a) : 0.05 * -t + ((0.8 * t) / e) * (1 + a); } function keyTyped() { "s" === key && saveCanvas("TOT.png"); } function textureRec(e, t, a, i, n, s, s) { if ("waffle" == e) return ( !!((dist(t, a, 0, 0) < 2.3) & (dist(t, a, 0, 0) > 1)) && ((g = s < 15 ? int(((i - t) * s) / 10) % 2 == 0 ? 1 : 0.5 : int(((i - t) * s) / 10) % 2 == 0 ? 2.8 : 0.9), !((abs(int((i - t) * s) % 10) > g) & (abs(int((n - a) * s)) % 10 > g))) ); if ("satellite" == e) { let e = 3 * gR; return ( (a / t > -0.05 + e) & (a / t < 0.25 + e) || (a / t > 1.5 + e) & (a / t < 2 + e) || (a / t > 5 + e) & (a / t < 6 + e) ); } if ("mochi" == e) { let e = dist(0, 0, t, a), i = atan2(a, t + 1e-4); return ( (e > 2 + 0.5 * abs(cos((9 * i) / 2))) | (e < 1.18 - 0.2 * abs(cos((9 * i) / 2))) ); } if ("oldFashioned" == e) { let e = atan2(a, t + 1e-4), i = 1.86 + abs(cos(4 * e)) / 2 + abs(cos(5 * e)) / 2; return dist(0, 0, t, a) > i; } return !1; } function fillByType(e, t, a, i, n, s, r) { if ("original" == s) fill(i); else if ("gradient" == s) { let e = constrain(map(t, -a, a, 0, 1), 0, 1); fill(lerpColor(color(i), color(n), e)); } else if ("rim" == s) { let s = gR > 0.5 ? (a * cos(r)) / 2 : 0, c = map(dist(e, t, s, 0) / a, 0, 1, 0, 0.618); fill(lerpColor(color(i), color(n), c)); } } function doeDilute(e, t, a, i, n, s, r, c, o, l, d, f, h, u, b, g = "all", p) { let w = "on" == b ? 2 : 1; for (let b = 0; b < w; b++) { (currD = ("flat" == p) & (1 == b) ? 2.7 : s), doe( e, t, a, i, n, currD, 0 == b ? r : c, o, l, d, f, h, u, g, 0 == b ? "no" : "yes" ); } } function doe( e, t, a, n, s, r, c, o, l = "#fff", d, f, u, b, g = "all", p = "no" ) { push(), translate(e, t), noStroke(); let m = h < 300 ? int(pow(5.2 * c, 2)) : h < 500 ? int(pow(3.95 * c, 2)) : h < 770 ? int(pow(3.6 * c, 2)) : h < 3e3 ? int(pow(2 * c, 2)) : int(pow(c, 2)); for ( maxIter = m, "yes" == p && (maxIter = m / 10), "mochi" == u && (maxIter = 1.1 * m), "cairn" == layout && (maxIter = 2 * m), i = maxIter; i > 0; i-- ) { (newx = r * sin(a * x) - sin(n * y)), (newy = s * cos(a * x) + cos(n * y)), (x = newx), (y = newy), fillByType(x, y, s, o, l, b, f), blendMode(ADD); let i = (d > 0) & (s == r) & (dist(x, y, 1.8 * s * cos(f), 1.8 * s * sin(f)) < 3 * max(0.5, gR)), p = ("left" == g) & (x > 0) || ("right" == g) & (x < 0), m = 1 ==
Totem of Taste is all about the donuts. More than donuts, it is about taste buds. It celebrates the delightful, sweet, and mysterious flavors that the tip of your tongue wants to remember but cannot disentangle. In a bite, one sense ignites another. On the palette, a color blends with its ethereal neighbor. A point moves in tandem with millions of other points to reflect the monumental presence of food in our lives in real-time. The donuts are made with strange attractors – dynamic systems that are extremely sensitive to initial conditions. The algorithm guides the trajectories of the points until they settle into deterministic shapes to naturally form textures. [Minimal interaction involved. Press 's' to save to the current screen size.]
Totem of Taste is about the donuts. Even more so, it is about taste buds. It's the delightful, sweet, mystic flavors the tip of your tongue wants to remember but cannot disentangle. In a bite, one sense ignites another. On the palette, a color blends with its ethereal neighbor. A point moves in tandem with millions of other points to shape the towering presence of food in real time. The donuts are made with strange attractors, which are dynamic systems. The algorithm guides the trajectories of points until they settle into deterministic shapes and naturally-formed textures. [Minimal interaction involved. Press 's' to save to the current screen size. ]
textureRec(u, x, y, w, h, c, c), R = x + e < 0 || x + e > w || y + t < 0 || y + t > h; if (!(i || p || m || R) && 0 != c) { let e = max(0.1, (0.8 * height) / 1500); circle(x * c, y * c, e); } } pop(); } function multiTexture(e, t, a) { if (-1 != e.indexOf("-")) { let [i, n] = e.split("-"); return 1 == a ? n : 0 == a || t < 0.2 ? i : n; } return e; } class Donut { constructor(e, t, a, i, n, s, r, c, o = "all", l = "no", d) { (this.a = e), (this.b = t), (this.c = a), (this.d = i), (this.nd = n), (this.cs = s), (this.textures = r), (this.fillType = c), (this.half = o), (this.dilute = l), (this.rarr = d), (this.cpoints = []), (this.radii = []); } calc() { let e = [], t = (0.7 * h) / this.nd; this.cpoints[0] = [w / 2, 0.85 * h - t / 2]; for (let a = 0; a < nd; a++) this.cpoints.push([ w / 2 + (max(this.rarr[a], 0.2) * w) / 18 - w / 36, 0.85 * h - t * (a + 1) - t / 2, ]), e.push( dist( this.cpoints[a][0], this.cpoints[a][1], this.cpoints[a + 1][0], this.cpoints[a + 1][1] ) ); this.radii[0] = e[0] * constrain(gR, 0.68, 1); for (let t = 0; t < nd; t++) this.radii[t + 1] = e[t] - this.radii[t]; } show(e) { let t = calcSize(this.nd, c); for (let i = 0; i < this.nd; i++) { let n = i == nd - 1 ? a + 0.5 + i : a, s = calcBite(showBite, this.nd, i), r = calcYpos(this.nd, h, i), o = this.cs[(i + 1) % this.cs.length], l = gR < 0.5 ? (i * TAU) / 8 / nd : TAU / 2 - (i * TAU) / 8 / nd, d = max(3, int(10 * gR)), f = multiTexture(this.textures, rarr[i], i), u = calcVarSize(nd, i, t); if ("cairn" == e) { let e = max((0.6 * this.radii[i]) / c, 8); doe( this.cpoints[i][0], this.cpoints[i][1], n, this.b, this.c, this.d, (nd > d) & (i > nd - d) ? e * map(i - nd + d, 0, 3, 1, 1.45) : e, cs[i % cs.length], o, s, l, f, this.fillType, "all", "yes" ); } else if ("grow" == e) { let e = (0.8 * h) / nd / c / 4, t = (0.7 * w) / nd, a = (0.8 * h) / pow((0.7 * (nd - 0.5) * w) / nd, 2), r = pow(t * i + t / 2 - 0.8 * w * (gR / 5), 2) * a; doe( t * i + t / 2, 0.95 * h - r - t, n, this.b, this.c, (nd > d) & (i > nd - d) & (rarr[i] > 0.3) ? this.d + exp(i / 15) : this.d, e * sqrt((t * (i + 0.5) * nd) / w / 1.5), cs[int((t * i * nd) / w) % cs.length], o, s, angle * sin(i) * cos(i), f, this.fillType ); } else if ("radiate" == e || "uno" == e || "stack" == e) { let n = ("stack" == e) & !((this.nd > 2) & (i % 3 == 1)) ? "off" : "on", d = i % 2 == 0 ? 1.5 * t : 0, g = i % 3 == 0 ? 2.5 * t : i % int(3 * gR + 2) == 1 ? 4 * t : t, p = w / 8, m = w / 2, y = (gR > 0.6) & ("on" == n) ? u / 2 : u, x = 2.6 * u, R = "stack" == e ? (this.nd > 5) & (gR > 0.5) ? 0.5 * w + (w / 12) * sin(this.nd + i * map(gR, 0, 1, 0.5, 1)) * sqrt(i) : 0.5 * w : w / 2, F = "uno" == e ? h / 2 : r, _ = "radiate" == e ? d : "stack" == e ? y : p, k = "radiate" == e ? g : "stack" == e ? x : m, D = "uno" == e ? "flat" : "round", T = ("stack" == e) & (nd > 2) & (rarr[i] > 0.6) ? 2.7 : 1.6; doeDilute( R, F, i != nd - 1 ? a + 0.5 + i : a, b, c, T, _, k, 1 == nd ? cs[0] : cs[i % cs.length], 1 == nd ? cs[0] : o, s, l, f, fillType, n, "all", D ); } else if ("melt" == e) { let e = 0.526; for (let a = 0; a < 2; a++) { let n = 0 == a ? "left" : "right"; doe( 0 == a ? 0.5 * w : w * e, 0 == a ? r : r - 1.1 * t, 0 == a ? rarr[i] > 0.6 ? this.d + 2.1 * noise(i) : this.d : (rarr[i] < 0.4) & (i != this.nd - 1) ? this.d + 2.1 * noise(i) : this.d, this.b, this.c, rarr[i] < 0.6 || 0 == i || i == nd - 1 ? this.d : this.d + 2 * noise(i), u, cs[i % cs.length], o, s, l, f, this.fillType, n ); } strokeWeight((0.2 * height) / 1500); for (let e = 0; e < 6; e++) { let a = (u * c) / 2 + (e * (u * c)) / 5; for (let e = 0; e < 2; e++) { let n = 0 == e ? 0 - a : a, s = "gradient" == fillType ? (0 == e ? i : i + 1) : i, c = color(cs[s % cs.length]); c.setAlpha(230), stroke(c), line( 0.5 * w, r + n - 15 * gR, 0.526 * w, r - 1.1 * t + n - 15 * gR ); } } } } } }
let x = 0, y = 0.01, a = 2, b = -1.8, c = 1.6, d = 1.6; var cs, nd, layout, angle, showBite, textures, gradient, h, w, gR, fg_cs_dct, rarr = []; function calculateFeatures(e) { fg_cs_dct = { base: ["#F1E9DA", "#FFD400", "#541388", "#D90368", "#2E294E"], flame: ["#e60707", "#c80000", "#FFADAD", "#a20606", "#7b0c00", "#5f0701"], beach: ["#f24088", "#ed555d", "#fd894a", "#ffc12e", "#fff23f"], timhorton: ["#94165c", "#f90062", "#3ec2fa", "#054ba8"], centralpark: ["#490a3d", "#bd1550", "#e97f02", "#f8ca00", "#8a9b0f"], judd: ["#f6bc12", "#1477bb", "#41bb9b", "#ff4242", "#fec101"], autumn: [ "#705f84", "#687d99", "#6c843e", "#fc9a1a", "#dc383a", "#aa3a33", "#9c4257", ], olympia: ["#ff3250", "#ffb33a", "#008c36", "#0085c6", "#4c4c4c"], comets: ["#FFA0FF", "#0364FC", "#41CA7C", "#FDBC28", "#9EA1F8"], lajolla: ["#EFE5D1", "#F09BC4", "#F54034", "#1F43B1", "#02ADDC"], cranberrysauce: ["#ffbbee", "#cc3300", "#7799dd", "#991100", "#6600bb"], candiedapple: ["#e8165b", "#401e38", "#66c3b4", "#ee7724", "#584098"], frozenrose: ["#29368f", "#e9697b", "#1b164d", "#f7d996"], lego: ["#f1594a", "#f5b50e", "#14a160", "#2969de", "#4c4c4c"], amaretto: [ "#811e18", "#4c6216", "#c88a2c", "#9e4013", "#b04948", "#1a472a", ], choco: ["#8d1c06", "#e67424", "#f5c34d", "#3c0d03", "#ed9b49"], irishcream: [ "#ef8a47", "#376795", "#f7aa58", "#72bcd5", "#e76254", "#1e466e", "#ffd06f", "#528fad", ], Marfa: [ "#792504", "#527baa", "#bc7524", "#8dadca", "#082844", "#421600", "#104839", ], koloocheh: [ "#8cc8bc", "#b83326", "#7da7ea", "#1d4497", "#c8570d", "#5773c0", "#edb144", "#dd7867", ], bonito: [ "#b36c06", "#65150b", "#c0431f", "#f19425", "#961f1f", "#533d14", "#c59349", ], mixedberry: [ "#2f357c", "#b0799a", "#e69b00", "#355828", "#6c5d9e", "#bf3729", "#e48171", "#f5bb50", "#9d9cd5", "#17154f", "#f6b3b0", "#ada43b", ], pistachio: [ "#ba5c3f", "#307d7f", "#598c4c", "#a13213", "#042e4e", "#470c00", ], edibleflower: ["#eab1c6", "#e18a1f", "#d35e17", "#829d44", "#e9b109"], dango: [ "#4457a5", "#c44d76", "#7caf5c", "#59386c", "#b24422", "#13315f", "#447861", "#b1a1cc", ], honey: [ "#802417", "#c06636", "#17486f", "#e8b960", "#ce9344", "#646e3b", "#508ea2", "#2b5851", ], bluecorn: [ "#6c1d0e", "#235070", "#c27668", "#7ba0b4", "#421401", "#0a2d46", "#8b3a2b", "#44728c", ], lavendar: [ "#2673a3", "#582310", "#473d7d", "#318f49", "#582310", "#0cb4bb", "#82c45f", ], cremebrulee: [ "#bd3106", "#5b7314", "#454b87", "#d9700e", "#89a6bb", "#eebe04", "#c3d6ce", "#e9a00e", ], forest: ["#7c291e", "#ba7233", "#2d5380", "#3a4421", "#4b1d0d"], }; let t = new (class { constructor() { this.useA = !1; let t = function (e) { let t = parseInt(e.substr(0, 8), 16), a = parseInt(e.substr(8, 8), 16), i = parseInt(e.substr(16, 8), 16), n = parseInt(e.substr(24, 8), 16); return function () { (t |= 0), (a |= 0), (i |= 0), (n |= 0); let e = (((t + a) | 0) + n) | 0; return ( (n = (n + 1) | 0), (t = a ^ (a >>> 9)), (a = (i + (i << 3)) | 0), (i = (i << 21) | (i >>> 11)), (i = (i + e) | 0), (e >>> 0) / 4294967296 ); }; }; (this.prngA = new t(e.hash.substr(2, 32))), (this.prngB = new t(e.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_int(e, t) { return Math.floor(e + (t + 1 - e) * this.random_dec()); } random_choice(e) { return e[this.random_int(0, e.length - 1)]; } wRand(e) { let t, a = 0, i = this.random_dec(); for (t in e) if (((a += e[t]), i <= a)) return t; } })(); var a = Object.keys(fg_cs_dct), i = {}; return ( (i.palette = t.random_choice(a)), (i.nd = t.random_dec() < 0.04 ? 1 : t.random_dec() < 0.08 ? 3 : t.random_dec() < 0.16 ? 2 : t.random_int(4, 10)), (i.bg = t.random_choice(["#222", "#00113D"])), (i.textures = t.random_dec() < 0.2 ? "original-mochi" : t.random_choice([ "original", "waffle", "satellite", "oldFashioned", "original-oldFashioned", "original-satellite", "mochi-satellite", "mochi-oldFashioned", "oldFashioned-waffle", ])), (i.fillType = t.wRand({ original: 0.2, gradient: 0.5, rim: 0.3 })), (i.layout = 1 == i.nd ? "uno" : 2 == i.nd ? t.random_choice(["stack", "cairn"]) : 3 == i.nd && -1 != ["oldFashioned", "satellite"].indexOf(i.textures) ? "radiate" : -1 != ["original", "waffle", "satellite", "mochi", "oldFashioned"].indexOf( i.textures ) ? t.wRand({ stack: 0.15, melt: 0.15, radiate: 0.7 }) : 3 == i.nd ? "stack" : t.wRand({ stack: 0.7, grow: 0.3 })), i ); } var features = calculateFeatures(tokenData); function setup() { pixelDensity(2), (h = windowHeight), (w = (9 * h) / 16), createCanvas(w, h), (nd = features.nd); for (let e = 0; e < nd; e++) { let t = tokenData.hash.slice(2 * e + 2, 2 * e + 4); rarr.push((parseInt(t, 16) % 100) / 100); } (gR = rarr[0]), (angle = TAU * gR), noiseSeed(gR), (showBite = gR > 0.08), (initCol = fg_cs_dct[features.palette]), (cs = gR > 0.5 ? initCol : initCol.reverse().slice(0, 4)), (layout = features.layout), (textures = features.textures), (fillType = features.fillType), (gradient = features.gradient), (donut = new Donut( a, b, c, d, nd, cs, textures, fillType, (half = "all"), (dilute = "no"), rarr )), noStroke(), background(features.bg); } function draw() { (curtainCall = 8), frameCount > curtainCall && noLoop(), "cairn" == layout ? (donut.calc(), donut.show("cairn")) : donut.show(layout); } function calcSize(e, t) { return e > 3 ? (0.8 * h) / e / t / 3 : (0.8 * h) / e / t / 4; } function calcD(e, t = 0.8) { return (e > 3) & (gR > t) ? 2.7 : 1.6; } function calcVarSize(e, t, a, i = 0.05) { return gR > i || 2 == e ? a * map(noise(t), 0, 1, 0.8, 1.35) : a; } function calcBite(e, t, a) { return e & ((a > 3) & (a < t - 2) || (2 == t) & (gR > 0.5)) ? 1 + a / 4 : 0; } function calcYpos(e, t, a) { return e > 2 ? 0.05 * t + ((0.8 * t) / e) * (1 + a) : 0.05 * -t + ((0.8 * t) / e) * (1 + a); } function keyTyped() { "s" === key && saveCanvas("TOT.png"); } function textureRec(e, t, a, i, n, s, s) { if ("waffle" == e) return ( !!((dist(t, a, 0, 0) < 2.3) & (dist(t, a, 0, 0) > 1)) && ((g = s < 15 ? int(((i - t) * s) / 10) % 2 == 0 ? 1 : 0.5 : int(((i - t) * s) / 10) % 2 == 0 ? 2.8 : 0.9), !((abs(int((i - t) * s) % 10) > g) & (abs(int((n - a) * s)) % 10 > g))) ); if ("satellite" == e) { let e = 3 * gR; return ( (a / t > -0.05 + e) & (a / t < 0.25 + e) || (a / t > 1.5 + e) & (a / t < 2 + e) || (a / t > 5 + e) & (a / t < 6 + e) ); } if ("mochi" == e) { let e = dist(0, 0, t, a), i = atan2(a, t + 1e-4); return ( (e > 2 + 0.5 * abs(cos((9 * i) / 2))) | (e < 1.18 - 0.2 * abs(cos((9 * i) / 2))) ); } if ("oldFashioned" == e) { let e = atan2(a, t + 1e-4), i = 1.86 + abs(cos(4 * e)) / 2 + abs(cos(5 * e)) / 2; return dist(0, 0, t, a) > i; } return !1; } function fillByType(e, t, a, i, n, s, r) { if ("original" == s) fill(i); else if ("gradient" == s) { let e = constrain(map(t, -a, a, 0, 1), 0, 1); fill(lerpColor(color(i), color(n), e)); } else if ("rim" == s) { let s = gR > 0.5 ? (a * cos(r)) / 2 : 0, c = map(dist(e, t, s, 0) / a, 0, 1, 0, 0.618); fill(lerpColor(color(i), color(n), c)); } } function doeDilute(e, t, a, i, n, s, r, c, o, l, d, f, h, u, b, g = "all", p) { let w = "on" == b ? 2 : 1; for (let b = 0; b < w; b++) { (currD = ("flat" == p) & (1 == b) ? 2.7 : s), doe( e, t, a, i, n, currD, 0 == b ? r : c, o, l, d, f, h, u, g, 0 == b ? "no" : "yes" ); } } function doe( e, t, a, n, s, r, c, o, l = "#fff", d, f, u, b, g = "all", p = "no" ) { push(), translate(e, t), noStroke(); let m = h < 300 ? int(pow(5.2 * c, 2)) : h < 500 ? int(pow(3.95 * c, 2)) : h < 770 ? int(pow(3.6 * c, 2)) : h < 3e3 ? int(pow(2 * c, 2)) : int(pow(c, 2)); for ( maxIter = m, "yes" == p && (maxIter = m / 10), "mochi" == u && (maxIter = 1.1 * m), "cairn" == layout && (maxIter = 2 * m), i = maxIter; i > 0; i-- ) { (newx = r * sin(a * x) - sin(n * y)), (newy = s * cos(a * x) + cos(n * y)), (x = newx), (y = newy), fillByType(x, y, s, o, l, b, f), blendMode(ADD); let i = (d > 0) & (s == r) & (dist(x, y, 1.8 * s * cos(f), 1.8 * s * sin(f)) < 3 * max(0.5, gR)), p = ("left" == g) & (x > 0) || ("right" == g) & (x < 0), m = 1 ==