memoscan
← all memos

Memo 0x13a132bc…e71bc9 on Ethereum

function resetValues(){let e;switch(R=new Random,stickers=!1,R.r_b(.7)?(bti=R.r_i(0,5),R.r_b(.05)&&(bti=6),1==bti&&loop(),bti<4&&(stickers=R.r_b(.444))):R.r_b(.7)?specialText=!0:splitText=!0,R.r_b(.1)?(textStyle(BOLDITALIC),stickers=!1):textStyle(BOLD),(splitText||specialText)&&(bti=0,textStyle(BOLD)),stickers&&(stickerTypeIndex=R.r_i(0,1)),bti){case 0:e=R.r_c(solidPalette),bc1=color(e.bgc),txtc=color(e.txtc),shadowColor=color(e.sdc);break;case 1:loop(),e=R.r_c(gradientPalette),createOrbs(e.gcs),setGradientColors(e);break;case 2:case 3:case 4:e=R.r_c(gradientPalette),setGradientColors(e),shadowColor=bc1;break;case 5:noLoop(),e=R.r_c(checkersPalette),txtc=color(e.txtc),bc1=color(e.bgc),bc2=color(e.ckc),shadowColor=color(e.sdc),stickers=!1,shadow=!0;break;case 6:loop(),e=R.r_c(heartPalette),txtc=color(e.txtc),shadowColor=color(e.sdc),heartColorStrings=e.hcs,stickers=!1,shadow=!0,heartRings=[];let t=0;for(i=4*WIDTH;i>0;i-=WIDTH/7){let e=color(heartColorStrings[t]),r=i;heartRings.push(new GrowingHeart(WIDTH/2,HEIGHT/2-r/2,r,e)),t=(t+1)%heartColorStrings.length}}if(specialText)switch(specialTextIndex=R.r_c([0,1,1,2,2,3,3]),loop(),specialTextIndex){case 0:textSizeVal=.088*WIDTH;let t=ns.concat(np,adj,aan,vrb),r=R.r_c(t);for(;r.split(" ").length>=2||r.length<=8||r.length>=14;)r=R.r_c(t);let c="";for(let e=0;e<7;e++)c=c+r+" ";newString=c.toUpperCase();break;case 1:specialTextWavy=R.r_b(.5),newString=createNewString();let n=WIDTH;WIDTH=1e3,textSizeVal=.038*WIDTH;let s=60;specialTextWavy&&(s=36),textSize(textSizeVal);let i=!1,a=textSizeVal,o=ctx.font.split(" ");for(let e=0;e<o.length;e++){let t=o[e],r=t.indexOf("px");r>=0&&(a=Number(t.substr(0,r)))}let l=textWidth(newString);for(a-Math.floor(a)==0&&(i=!0,l=ctx.measureText(newString).width*textSizeVal/Math.round(textSizeVal));l>=.7*WIDTH||newString.length<32||newString.length>s;)newString=createNewString(),l=i?ctx.measureText(newString).width*textSizeVal/Math.round(textSizeVal):textWidth(newString);WIDTH=n,textSizeVal=.038*WIDTH;break;case 2:candyHearts=[];let p=R.r_c(["flower","heart","star"]),d=e.sdc;if(R.r_b(.5)){for(let e=0;e<9;e++){let e=np.concat(ns),t=R.r_c(e);t=t.charAt(0).toUpperCase()+t.slice(1),candyHearts.push(new CandyHeart(t,d,p))}newString=R.r_c(invitations)}else{for(let e=0;e<9;e++){let e=adj.concat(aan);candyHearts.push(new CandyHeart("I am "+R.r_c(e),d,p))}newString=R.r_c(affirmations)}textSizeVal=.0555*WIDTH,noLoop();break;case 3:let x="",g=27;for(let e=0;e<g;e++){let t=R.r_c(instructions);x=e<g-1?x+t.charAt(0).toUpperCase()+t.slice(1)+". ":x+t.charAt(0).toUpperCase()+t.slice(1)+"."}newString=x,textSizeVal=.0444*WIDTH,textSize(textSizeVal),noLoop()}else{newString=createNewString(),txtsi=textSizeOptions.length-1,idw=newString.split(" ");let e=findLongestWord(idw);if(numWords=idw.length,splitText){for(centerSticker=R.r_i(0,2),smileyType=R.r_i(0,2),stickers=!1,noLoop();numWords<=4||numWords>=10||e.length>=8;)newString=createNewString(),idw=newString.split(" "),e=findLongestWord(idw),numWords=idw.length;textSizeVal=.0777*WIDTH}else e.length>=13&&12==bti?txtsi=0:e.length>=13?txtsi=1:e.length>=12||numWords>=10?txtsi=2:e.length>=9||numWords>=8?txtsi=3:numWords>=7||e.length>=8||e>=8&&""!=punctuation?txtsi=4:numWords>=6?(txtsi=5,stickers=!1):e.length>=7||numWords>=5?(txtsi=6,stickers=!1):e.length>=6&&(txtsi=7,stickers=!1),e.length>=10&&(stickers=!1),textSizeVal=textSizeOptions[txtsi]*WIDTH}}function setGradientColors(e){txtc=color(e.txtc),R.r_b(.5)?(bc1=color(e.gcs[0]),bc2=color(e.gcs[1])):(bc1=color(e.gcs[1]),bc2=color(e.gcs[0]))}function drawCharacter(e,t,r,c){push(),fill(c),stroke(c),strokeWeight(.03*textSizeVal),textAlign(CENTER),text(e,t,r),pop()}function setGradient(e,t,r,c,n,s){noFill();for(let i=t;i<=t+c;i++){let a=map(i,t,t+c,0,1),o=lerpColor(n,s,a);stroke(o),line(e,i,e+r,i)}}function setRadialGradient(e,t,r,c,n,s){background(s),noFill();for(let i=0;i<=1.5*r;i++){let r=map(i,t,t+c,0,1),a=lerpColor(n,s,r);stroke(a),circle(e,t,i)}}function setRadialHeart(e,t,r,c,n,s,i){noFill();let a=.4;for(let c=0;c<=r*a;c++){let i=map(c,0,r*a,0,1),o=lerpColor(n,s,i);stroke(o),strokeWeight(5),heart1(e,t-c/2,c)}for(let c=r*a;c<=2*r;c++){let i=map(c,r*a,1.5*r,0,1),o=lerpColor(s,n,i);stroke(o),strokeWeight(5),heart1(e,t-c/2,c)}}function star(e,t,r,c,n){angleMode(RADIANS);let s=TWO_PI/n,i=s/2;beginShape();for(let n=0;n<TWO_PI;n+=s){let s=e+cos(n)*c,a=t+sin(n)*c;vertex(s,a),s=e+cos(n+i)*r,a=t+sin(n+i)*r,vertex(s,a)}endShape(CLOSE)}function sparkle(e,t,r,c){angleMode(RADIANS);let n=TWO_PI/4,s=n/2;beginShape();let i=.888*c,a=e+cos(0)*i,o=t+sin(0)*i;curveVertex(a,o),a=e+cos(0+s)*r,o=t+sin(0+s)*r,curveVertex(a,o),a=a=e+cos(n)*c,o=t+sin(n)*c,curveVertex(a,o),a=e+cos(n+s)*r,o=t+sin(n+s)*r,curveVertex(a,o),a=e+cos(2*n)*i,o=t+sin(2*n)*i,curveVertex(a,o),a=e+cos(2*n+s)*r,o=t+sin(2*n+s)*r,curveVertex(a,o),a=a=e+cos(3*n)*c,o=t+sin(3*n)*c,curveVertex(a,o),a=e+cos(3*n+s)*r,o=t+sin(3*n+s)*r,curveVertex(a,o),a=a=e+cos(4*n)*i,o=t+sin(4*n)*i,curveVertex(a,o),a=e+cos(4*n+s)*r,o=t+sin(4*n+s)*r,curveVertex(a,o),a=a=e+cos(5*n)*c,o=t+sin(5*n)*c,curveVertex(a,o),endShape()}function heart1(e,t,r){beginShape(),vertex(e,t+.1*r),bezierVertex(e-.35*r,t-.45*r,e-1.25*r,t+.2*r,e,t+1.05*r),bezierVertex(e+1.25*r,t+.2*r,e+.35*r,t-.45*r,e,t+.1*r),endShape(CLOSE)}function heart2(e,t,r){push();let c=0,n=[];for(angleMode(RADIANS);c<TWO_PI;){beginShape();for(let e of n)vertex(e.x,e.y);endShape();const s=r,i=16*s*pow(sin(c),3),a=-s*(13*cos(c)-5*cos(2*c)-2*cos(3*c)-cos(4*c));n.push(createVector(e+i,t+a)),c+=.01}pop()}function heart3(e,t,r){beginShape(),vertex(e,t),bezierVertex(e-r/2,t-.55*r,e-1.25*r,t+.3*r,e,t+r),bezierVertex(e+1.25*r,t+.3*r,e+r/2,t-.55*r,e,t),endShape(CLOSE)}function cuteFace(e,t,r,c,n){angleMode(RADIANS);var s=.1*PI,i=.9*PI,a=.04*r;stroke(c),strokeWeight(.04*textSizeVal),noFill(),arc(e,t,a,a,s,i);var o=.027*r,l=.016*r;if(0==n||1==n)fill(c),ellipse(e-o,t-o,l,1*l);else{var p=0,d=PI;noFill(),arc(e-o,t-o,l,l,d,p)}if(0==n||2==n)fill(c),ellipse(e+o,t-o,l,1*l);else{p=0,d=PI;noFill(),arc(e+o,t-o,l,l,d,p)}}function flower5Cutout(e,t,r,c,n){push(),angleMode(RADIANS),strokeWeight(.05*textSizeVal),fill(n),flower5(e,t,r),fill(c),circle(e,t,1.3*r),pop()}function flower5(e,t,r){push(),angleMode(RADIANS),translate(e,t);for(let e=0;e<6;e++)ellipse(0,r,1.1*r,1.2*r),rotate(PI/3);pop()}function findLongestWord(e){let t=e[0];for(let r=0;r<e.length;r++)e[r].length>t.length&&(t=e[r]);return t}function createNewString(){let e=R.r_c(punctuationOptions);stickers&&(e="");let t=R.r_c(sentenceStructures),r="";interjection=R.r_b(.1),interjection&&(t.splice(0,0,","),t.splice(0,0,"intrj"));for(let e=0;e<t.length;e++){let c=!0,n="";switch(t[e]){case"np":n=R.r_c(np);break;case"ns":n=R.r_c(ns);break;case"nouns_mixed":let r=np.concat(ns);n=R.r_c(r);break;case"wp":n=R.r_c(wp);break;case"ws":n=R.r_c(ws);break;case"adv":n=R.r_c(adv);break;case"adj":n=R.r_c(adj);break;case"aan":n=R.r_c(aan);break;case"amx":let c=adj.concat(aan);n=R.r_c(c);break;case"vrb":n=R.r_c(vrb);break;case"ving":n=R.r_c(ving);break;case"ved":n=R.r_c(ved);break;case"vs":n=R.r_c(vs);break;case"instructions":n=R.r_c(instructions);break;case"dobj":n=R.r_c(dobj);break;case"tms":n=R.r_c(tms);break;case"dtm":n=R.r_c(dtm);break;case"intrj":n=R.r_c(intrj);break;case"aer":n=R.r_c(aer);break;case"as":n=R.r_c(as);break;default:n=t[e]}r+=n,nspc&&nspc.indexOf(t[e+1])>=0&&(c=!1),e<t.length-1&&c&&(r+=" ")}return r+=e,r=r.toUpperCase(),r=r.replace(/i /g,"I "),r=r.replace(/i'/g,"I'"),r}function createOrbs(e){let t=0;particles=[];let r=.9*WIDTH,c=.4*WIDTH;for(let n=0;n<11;n++){const s=new Orb(R.r_d()*WIDTH,R.r_d()*HEIGHT,R.r_d()*(r-c)+c,e[t]);++t>=e.length&&(t=0),particles[n]=s}}function genNote(){let e=adj.concat(aan);return R.r_c(intrj)+", u are "+R.r_c(e)+" <3"}