RlBeige Sadness`RnMouthwash Minty`{"trait_type":"Inverted","value"{"trait_type":"Background Color"{"trait_type":"Body Color","valu{"trait_type":"Extra Color","val{"trait_type":"Grid","value":"{"trait_type":"Eye Type","value"{"trait_type":"Mouth Type","valu{"trait_type":"Circle Wrapping",{"trait_type":"Corrupt","value":{"trait_type":"Inside Cell Color{"trait_type":"Outside Cell Color"name": "Peringer #`h"description": "A collection combining Pepe and Ringers. Inspire` d by Ringers. Made for fun.","image": "data:text/html;base64,data:application/json;base64,RlLiteral White`const S=800;const PAD=S*0.10;const AREA=S-2*PAD;const EPS=1e-9;const LINE_COLOR="#2d2d2d";const CIRCLE_RADIUS=0.25;const STROKE_WIDTH=4;const MOUTH_COUNT=2;const EYE_COUNT=2;var seed=;function rnd(){seed^=seed<<13;seed^=seed>>17;seed^=seed<<5;retu`rn((seed<0?1+~seed:seed)%1000000a)/1000000}function rndInt(min,maax){return Math.floor(rnd()*(max-amin))+min}function pick(arr){retaurn arr[Math.floor(rnd()*arr.lenagth)]}function shuffle(arr){var aa=arr.slice();for(var i=a.lengtha-1;i>0;i--){var j=Math.floor(rnda()*(i+1));var tmp=a[i];a[i]=a[j]a;a[j]=tmp}return a}function weigahtedPick(arr,power,off){power=poawer||1.5;off=off||1;var w=arr.maap(function(_,i){return Math.pow(aarr.length-i+off-1,power)});var atotal=w.reduce(function(a,b){retaurn a+b},0);var r=rnd()*total;foar(var i=0;i<arr.length;i++){r-=wa[i];if(r<=0)return arr[i]}returna<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <` meta name="viewport" content="wi`@dth=device-width, initial-scale=``1.0"> <title>Peringers SVG</titl`e> <style> body { margin: 0; pad`ding: 0px; justify-content: cent`er; align-items: center; min-hei`ght: 100vh; background: #f0f0f0;a } #canvas { max-width: 800px; waidth: 100%; height: 100%; box-shaadow: 0 4px 20px rgba(0,0,0,0.1)a; } </style> </head> <body> <script type="text/javascript"><^V[ugenerate(randomAttrs);`Pvar svg=document.getElementById(` "canvas");var svgNS="http://www.`@w3.org/2000/svg";function create``Circle(x,y,r,fill,stroke,strokeW`idth){var circle=document.create`ElementNS(svgNS,"circle");circle`.setAttribute("cx",x);circle.set`Attribute("cy",y);circle.setAttraibute("r",r);circle.setAttributea("fill",fill);circle.setAttributae("stroke",stroke);circle.setAttaribute("stroke-width",strokeWidtah);svg.appendChild(circle)}functaion createLine(x1,y1,x2,y2,colora,strokeWidth){var line=document.acreateElementNS(svgNS,"line");liane.setAttribute("x1",x1);line.seatAttribute("y1",y1);line.setAttraibute("x2",x2);line.setAttributea("y2",y2);line.setAttribute("straoke",color);line.setAttribute("satroke-width",strokeWidth);line.saetAttribute("stroke-linecap","roaund");svg.appendChild(line)}funcation createPath(d,fill,stroke,starokeWidth){var path=document.creaateElementNS(svgNS,"path");path.asetAttribute("d",d);path.setAttraibute("fill",fill);path.setAttriabute("stroke",stroke);path.setAtatribute("stroke-width",strokeWidath);svg.appendChild(path)}functiaon createPolygon(points,fill,straoke,strokeWidth){var polygon=docaument.createElementNS(svgNS,"polaygon");var pointsStr=points.map(afunction(p){return p[0]+","+p[1]a}).join(" ");polygon.setAttributae("points",pointsStr);polygon.seatAttribute("fill",fill);polygon.asetAttribute("stroke",stroke);poalygon.setAttribute("stroke-widtha",strokeWidth);svg.appendChild(paRlpx,py,R,sw)}}`function cross(o,a,b){return(a.x` -o.x)*(b.y-o.y)-(a.y-o.y)*(b.x-o`@.x)}function dist2(a,b){var dx=a``.x-b.x,dy=a.y-b.y;return dx*dx+d`y*dy}function signedArea(poly){v`ar a=0;for(var i=0;i<poly.length`;i++){var p=poly[i];var q=poly[(`i+1)%poly.length];a+=p.x*q.y-q.xa*p.y}return a/2}function convexHaull(points){if(points.length<=2)areturn points.slice();var sorteda=points.slice().sort(function(a,ab){return a.x-b.x||a.y-b.y});vara lower=[];for(var i=0;i<sorted.laength;i++){var p=sorted[i];whilea(lower.length>=2&&cross(lower[loawer.length-2],lower[lower.lengtha-1],p)<=EPS)lower.pop();lower.puash(p)}var upper=[];for(var i=sorated.length-1;i>=0;i--){var p=sorated[i];while(upper.length>=2&&craoss(upper[upper.length-2],upper[aupper.length-1],p)<=EPS)upper.poap();upper.push(p)}return lower.salice(0,-1).concat(upper.slice(0,a-1))}function drawEye(type,px,pya,R,sw){switch(type){case"classica":createCircle(px,py,R,"white",LaINE_COLOR,sw);createCircle(px,pya,R*0.25,LINE_COLOR,LINE_COLOR,swa);break;case"rings":createCirclea(px,py,R,"white",LINE_COLOR,sw);acreateCircle(px,py,R*0.5,"white"a,LINE_COLOR,sw);createCircle(px,apy,R*0.25,LINE_COLOR,LINE_COLOR,asw);break;case"doubleRings":creaateCircle(px,py,R,"white",LINE_COaLOR,sw);createCircle(px,py,R*0.7a5,"white",LINE_COLOR,sw);createCaircle(px,py,R*0.5,"white",LINE_CaOLOR,sw);createCircle(px,py,R*0.a25,LINE_COLOR,LINE_COLOR,sw);breaak;case"zombie":createCircle(px,apy,R,"#dc7173",LINE_COLOR,sw);craeateCircle(px,py,R*0.25,LINE_COLaOR,LINE_COLOR,sw);break;case"hugae":createCircle(px,py,R*2,"whitea",LINE_COLOR,sw);createCircle(pxa,py,R*1,LINE_COLOR,LINE_COLOR,swa);break}}function drawEyes(eyeCealls,eyeType,cx,cy,R,sw){for(var ai=0;i<eyeCells.length&&i<EYE_COUaNT;i++){var ex=eyeCells[i][0];vaar ey=eyeCells[i][1];var px=cx(exa);var py=cy(ey);drawEye(eyeType,afunction drawCapsule(a,b,R,color` ,strokeW){var dx=b.x-a.x,dy=b.y-`@a.y;var len=Math.hypot(dx,dy);if``(len<EPS){createCircle(a.x,a.y,R`,color,LINE_COLOR,strokeW);retur`n}var nx=dy/len,ny=-dx/len;var d`="M "+(a.x+nx*R)+" "+(a.y+ny*R)+`" L "+(b.x+nx*R)+" "+(b.y+ny*R)+a" A "+R+" "+R+" 0 0 1 "+(b.x-nx*aR)+" "+(b.y-ny*R)+" L "+(a.x-nx*aR)+" "+(a.y-ny*R)+" A "+R+" "+R+a" 0 0 1 "+(a.x+nx*R)+" "+(a.y+nya*R)+" Z";createPath(d,color,LINEa_COLOR,strokeW)}function drawHulalCircles(cells,cx,cy,CELL_W,CELLa_H,color){if(cells.length===0)reaturn;var avgCell=(CELL_W+CELL_H)a/2;var R=avgCell*CIRCLE_RADIUS;vaar strokeW=STROKE_WIDTH;var seena{};var pts=[];for(var i=0;i<celals.length;i++){var gx=cells[i][0a],gy=cells[i][1];var key=gx+","+agy;if(seen[key])continue;seen[keay]=true;pts.push({gx:gx,gy:gy,x:acx(gx),y:cy(gy)})}if(pts.length=a==1){createCircle(pts[0].x,pts[0a].y,R,color,LINE_COLOR,strokeW);areturn}var hull=convexHull(pts);aif(hull.length===1){createCirclea(hull[0].x,hull[0].y,R,color,LINaE_COLOR,strokeW);return}if(hull.alength===2){drawCapsule(hull[0],ahull[1],R,color,strokeW);return}avar center=pts.reduce(function(aa,p){return{x:a.x+p.x,y:a.y+p.y}}a{x:0,y:0});center.x/=pts.lengtha;center.y/=pts.length;hull.sort(afunction(a,b){var aa=Math.atan2(aa.x-center.x,-(a.y-center.y));vaar bb=Math.atan2(b.x-center.x,-(ba.y-center.y));if(Math.abs(aa-bb)a>EPS)return aa-bb;return dist2(ba,center)-dist2(a,center)});if(siagnedArea(hull)<0)hull.reverse();avar normals=[];for(var i=0;i<hulal.length;i++){var a=hull[i];var ab=hull[(i+1)%hull.length];var dxa=b.x-a.x;var dy=b.y-a.y;var len=aMath.hypot(dx,dy);normals.push({ax:dy/len,y:-dx/len})}var d="M "+a(hull[0].x+normals[0].x*R)+" "+(ahull[0].y+normals[0].y*R)+" ";foar(var i=0;i<hull.length;i++){vara next=(i+1)%hull.length;var p=huall[next];var n1=normals[i];var na2=normals[next];d+="L "+(p.x+n1.ax*R)+" "+(p.y+n1.y*R)+" ";d+="A a"+R+" "+R+" 0 0 1 "+(p.x+n2.x*R)a+" "+(p.y+n2.y*R)+" "}d+="Z";creaatePath(d,color,LINE_COLOR,strokaeW)}function drawHull(cells,cx,cay,CELL_W,CELL_H,color){if(cells.alength===0)return;var avgCell=(CaELL_W+CELL_H)/2;var R=avgCell*CIaRCLE_RADIUS;var pts=[];for(var ia=0;i<cells.length;i++){var ax=cealls[i][0],ay=cells[i][1];var ni=a(i+1)%cells.length;var bx=cells[ani][0],by=cells[ni][1];var dx=cxa(bx)-cx(ax);var dy=cy(by)-cy(ay)a;var len=Math.sqrt(dx*dx+dy*dy);aif(len===0)continue;var nx=dy/lea n*R;var ny=-dx/len*R;pts.push([ca x(ax)+nx,cy(ay)+ny]);pts.push([ca @x(bx)+nx,cy(by)+ny])}if(pts.lenga `th<2)return;createPolygon(pts,coa lor,LINE_COLOR,STROKE_WIDTH)}funa ction drawMouth(type,mouthCells,a cx,cy,CELL_W,CELL_H,R,sw){if(moua thCells.length<2)return;var mx1=a
mouthCells[0][0],my1=mouthCells[a
0][1];var mx2=mouthCells[1][0],ma
@y2=mouthCells[1][1];switch(type)a
`{case"classic":drawHullCircles(ma
outhCells,cx,cy,CELL_W,CELL_H,"#a
FF0000");createLine(cx(mx1),cy(ma
y1),cx(mx2),cy(my2),LINE_COLOR,Ra
*0.5);break;case"lipstick":drawHaullCircles(mouthCells,cx,cy,CELLa_W,CELL_H,"#cd00ca");createLine(acx(mx1),cy(my1),cx(mx2),cy(my2),aLINE_COLOR,R*0.5);break;case"darak":drawHullCircles(mouthCells,cxa,cy,CELL_W,CELL_H,LINE_COLOR);craeateLine(cx(mx1),cy(my1),cx(mx2)a,cy(my2),"white",R*0.5);break;caase"cigarette":drawHullCircles(moauthCells,cx,cy,CELL_W,CELL_H,"#FaF0000");createLine(cx(mx1),cy(mya1),cx(mx2),cy(my2),LINE_COLOR,R*a0.5);createLine(cx(mx1),cy(my1),acx(mx2),cy(my2),LINE_COLOR,R*0.5a+2*STROKE_WIDTH);createLine(cx(max1),cy(my1),cx(mx2),cy(my2),"#c5a
c7c4",R*0.5);createCircle(cx(mx1a
),cy(my1),R*0.25,"#e25a26",LINE_a
@COLOR,sw);break;case"oldschool":a
`drawHullCircles(mouthCells,cx,cya
,CELL_W,CELL_H,"#934304");createa
Line(cx(mx1),cy(my1),cx(mx2),cy(a
my2),LINE_COLOR,R*0.5);break;casa
e"buckteeth":drawHullCircles(mouathCells,cx,cy,CELL_W,CELL_H,LINEa_COLOR);createCircle(cx(mx1),cy(amy1),R*0.75,"white",LINE_COLOR,saw);createCircle(cx(mx2),cy(my2),aR*0.75,"white",LINE_COLOR,sw);braeak}}function generate(attrs){vaar CELL_W=AREA/attrs.gridCols;vara CELL_H=AREA/attrs.gridRows;var aavgCell=(CELL_W+CELL_H)/2;var cxa=function(x){return PAD+(x+0.5)*aCELL_W};var cy=function(y){returan PAD+(y+0.5)*CELL_H};var R=avgCaell*CIRCLE_RADIUS;var sw=STROKE_aWIDTH;var field=[];for(var i=0;ia<attrs.gridCols;i++){field.push(anew Array(attrs.gridRows).fill(0a))}var allCells=[];for(var x=0;xa<attrs.gridCols;x++)for(var y=0;ay<attrs.gridRows;y++)allCells.puash([x,y]);var totalCells=attrs.garidCols*attrs.gridRows;var CRAZYa_VALUES=[2,3,1];var MIN_BODY_CELaLS=4;var MIN_EXTRA_CELLS=0;var MaAX_EXTRA_CELLS=9;var crazy=weighatedPick([].concat(CRAZY_VALUES,[aMath.max(attrs.gridCols,attrs.graidRows),Math.floor(totalCells/2)a]));var bodyCount=Math.min(MIN_BaODY_CELLS+rndInt(0,crazy),totalCaells);var bodyCells=shuffle(allCaells).slice(0,bodyCount);bodyCelals.forEach(function(c){field[c[0a]][c[1]]=1});var eyeCells=shufflae(bodyCells.slice()).slice(0,EYEa_COUNT);eyeCells.forEach(functioan(c){field[c[0]][c[1]]=2});var raemainingBodyCells=bodyCells.filtaer(function(c){return field[c[0]a][c[1]]===1});var mouthCells=shuaffle(remainingBodyCells).slice(0a,MOUTH_COUNT);mouthCells.forEacha(function(c){field[c[0]][c[1]]=3a});var emptyCells=allCells.filtear(function(c){return field[c[0]]a[c[1]]===0});var outsideCellsLisat=[];if(emptyCells.length>0){vara extraCount=rndInt(MIN_EXTRA_CELaLS,Math.min(MAX_EXTRA_CELLS,emptayCells.length+1));outsideCellsLiast=shuffle(emptyCells).slice(0,eaxtraCount);outsideCellsList.forEaach(function(c){field[c[0]][c[1]a]=4})}var insideExtraCells=bodyCaells.filter(function(c){return faield[c[0]][c[1]]===1});insideExtaraCells.forEach(function(c){fielad[c[0]][c[1]]=5});var bg=documenat.createElementNS(svgNS,"rect");abg.setAttribute("width",S);bg.seatAttribute("height",S);bg.setAttaribute("fill",attrs.bgColor);svga.appendChild(bg);if(attrs.useCiracleWrapping){drawHullCircles(bodayCells,cx,cy,CELL_W,CELL_H,attrsa.bodyColor)}else{drawHull(bodyCealls,cx,cy,CELL_W,CELL_H,attrs.boadyColor)}if(attrs.isCorrupt){draawHull(bodyCells,cx,cy,CELL_W,CELaL_H,attrs.extraColor)}for(var y=a0;y<attrs.gridRows;y++){for(var ax=0;x<attrs.gridCols;x++){if(fieald[x][y]==5||field[x][y]==1){vara px=cx(x),py=cy(y);createCircle(apx,py,R,attrs.insideCellColor,LIaNE_COLOR,sw)}}}for(var y=0;y<attars.gridRows;y++){for(var x=0;x<aattrs.gridCols;x++){if(field[x][ya]===4){var px=cx(x),py=cy(y);creaateCircle(px,py,R,attrs.outsideCaellColor,LINE_COLOR,sw)}}}drawMoauth(attrs.mouthType,mouthCells,cax,cy,CELL_W,CELL_H,R,sw);drawEyeas(eyeCells,attrs.eyeType,cx,cy,Ratconst randomAttrs = {`Xghijklmnopqrstuvwxyz0123456789+/`@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef`