-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpigeon-widget.js
More file actions
72 lines (60 loc) · 16.7 KB
/
Copy pathpigeon-widget.js
File metadata and controls
72 lines (60 loc) · 16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var PigeonWidget=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=class{constructor(e){this.setSeed(e)}setSeed(e){if(typeof e==`string`){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);this.seed=t>>>0}else typeof e==`number`?this.seed=Math.floor(e)>>>0:this.seed=Math.floor(Math.random()*4294967295);this.initialSeed=this.seed}random(){let e=this.seed+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}range(e,t){return e+this.random()*(t-e)}int(e,t){return Math.floor(this.range(e,t+1))}choice(e){return e[Math.floor(this.random()*e.length)]}boolean(e=.5){return this.random()<e}};function n(e,t,n){e=(e%360+360)%360,t=Math.min(1,Math.max(0,t)),n=Math.min(1,Math.max(0,n));let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;e<60?[o,s,c]=[r,i,0]:e<120?[o,s,c]=[i,r,0]:e<180?[o,s,c]=[0,r,i]:e<240?[o,s,c]=[0,i,r]:e<300?[o,s,c]=[i,0,r]:[o,s,c]=[r,0,i];let l=e=>Math.round((e+a)*255).toString(16).padStart(2,`0`);return`#${l(o)}${l(s)}${l(c)}`}var r=[{name:`Blue Bar`,w:5,hue:[226,258],sat:[.1,.19],light:[.6,.7]},{name:`Slate`,w:3,hue:[212,246],sat:[.06,.14],light:[.45,.56]},{name:`Pearl`,w:2.5,hue:[228,272],sat:[.05,.13],light:[.79,.87]},{name:`Ash Rose`,w:2,hue:[298,342],sat:[.08,.17],light:[.62,.72]},{name:`Toasted`,w:2,hue:[16,34],sat:[.16,.29],light:[.54,.66]},{name:`Charcoal`,w:1.5,hue:[216,250],sat:[.05,.12],light:[.34,.43]},{name:`Cream`,w:1.5,hue:[34,52],sat:[.17,.31],light:[.78,.86]}];function i(e){let t=r.reduce((e,t)=>e+t.w,0),n=e.random()*t;for(let e of r)if(n-=e.w,n<=0)return e;return r[0]}function a(e){let t=i(e),r=e.range(t.hue[0],t.hue[1]),a=e.range(t.sat[0],t.sat[1]),o=e.range(t.light[0],t.light[1]),s=Math.min(.13,o*.28),c=e.range(14,30),l=e.range(18,34),u=e.range(288,322),d=e.range(138,168);return{name:t.name,hue:Math.round(r),body:n(r,a,o),bodyLight:n(r,a*.85,Math.min(.95,o+s*.55)),head:n(r+3,a*1.08,o-s*.35),wing:n(r-5,a*1.12,o-s),wingEdge:n(r-6,a*1.15,o-s*1.9),bar:n(r-8,a*1.2,Math.max(.13,o-s*2.4)),chest:n(c,e.range(.3,.46),Math.min(.88,o*.28+.6)),chestDeep:n(c-4,e.range(.34,.5),Math.min(.82,o*.24+.53)),beak:n(r,a*.7,Math.max(.28,o-s*1.6)),cere:n(r,.08,Math.min(.96,o*.15+.84)),foot:n(l,e.range(.68,.86),e.range(.52,.61)),footShade:n(l-6,e.range(.66,.82),e.range(.38,.45)),irid1:n(u,e.range(.45,.62),e.range(.4,.5)),irid2:n(d,e.range(.4,.58),e.range(.36,.46)),ink:n(r,Math.min(.3,a+.12),Math.max(.13,o-.4)),eye:n(r,.22,.11)}}function o(e,t,n){if(n<=0)return Math.min(e,t);let r=Math.max(n-Math.abs(e-t),0)/n;return Math.min(e,t)-r*r*n*.25}function s(e,t,n){let r=e-n.cx,i=t-n.cy;if(n.rot){let e=Math.cos(-n.rot),t=Math.sin(-n.rot),a=r*e-i*t;i=r*t+i*e,r=a}return(Math.hypot(r/n.rx,i/n.ry)-1)*Math.min(n.rx,n.ry)}function c(e,t=24){return(n,r)=>{let i=s(n,r,e[0]);for(let a=1;a<e.length;a++){let c=e[a];i=o(i,s(n,r,c),c.blend??t)}return i}}function l(e,t,n,r,i,a=420,o=200,s=22){let c=a/o,l=a,u=-1;for(let o=a;o>0;o-=c){if(e(t+r*o,n+i*o)<0){u=o;break}l=o}if(u<0)return null;for(let a=0;a<s;a++){let a=(u+l)*.5;e(t+r*a,n+i*a)<0?u=a:l=a}return(u+l)*.5}function u(e,t,n,{samples:r=96,rMax:i=420,wobble:a=null}={}){let o=[];for(let s=0;s<r;s++){let c=s/r*Math.PI*2,u=Math.cos(c),d=Math.sin(c),f=l(e,t,n,u,d,i);f!==null&&(a&&(f*=a(c)),o.push({x:t+u*f,y:n+d*f,t:c,r:f}))}return o}function d(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>r&&(r=a.x),a.y>i&&(i=a.y);return{minX:t,minY:n,maxX:r,maxY:i}}var f=1/6,p=e=>(Math.round(e*10)/10).toString();function m(e,t=f){if(!e||e.length<3)return``;let n=e.length,r=`M${p(e[0].x)} ${p(e[0].y)}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n];r+=`C${p(o.x+(s.x-a.x)*t)} ${p(o.y+(s.y-a.y)*t)} ${p(s.x-(c.x-o.x)*t)} ${p(s.y-(c.y-o.y)*t)} ${p(s.x)} ${p(s.y)}`}return r+`Z`}function h(e,t=f){if(!e||e.length<2)return``;if(e.length===2)return`M${p(e[0].x)} ${p(e[0].y)}L${p(e[1].x)} ${p(e[1].y)}`;let n=e.length,r=`M${p(e[0].x)} ${p(e[0].y)}`;for(let i=0;i<n-1;i++){let a=e[Math.max(i-1,0)],o=e[i],s=e[i+1],c=e[Math.min(i+2,n-1)];r+=`C${p(o.x+(s.x-a.x)*t)} ${p(o.y+(s.y-a.y)*t)} ${p(s.x-(c.x-o.x)*t)} ${p(s.y-(c.y-o.y)*t)} ${p(s.x)} ${p(s.y)}`}return r}function g(e){let t=e*Math.PI/180;return{x:Math.cos(t),y:Math.sin(t)}}function ee(e,t,n){let r=n*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=e.x-t.x,s=e.y-t.y;return{x:t.x+o*i-s*a,y:t.y+o*a+s*i}}function _(e){return{x:e.y,y:-e.x}}function v(e,t,n){return e+(t-e)*n}var te=Math.PI/180,y=e=>(Math.round(e*10)/10).toString();function b(e){let n=new t(e),r=n.range(.9,1.12),i=n.range(-1,1),o=n.boolean(.42),s=n.range(33,44)*r;return{seed:e,palette:a(n),scale:r,bodyRX:n.range(68,84)*r*(1+i*.1),bodyRY:n.range(76,94)*r*(1-i*.1),blend:n.range(26,40),neckBlend:n.range(11,18),tailBlend:n.range(8,14),chestPuff:n.range(.88,1.18),chestDrop:n.range(-.04,.16),headR:s,headRise:n.range(20,38),headDX:o?n.range(8,24):n.range(24,42),headTilt:n.range(-13,13),threeQuarter:o,beakAngle:o?n.range(34,58):n.range(-2,18),hasCrest:n.boolean(.2),crestSize:n.range(.3,.44),tailLen:n.range(52,82)*r,tailW:n.range(.2,.3),tailAngle:n.range(154,180),tailFeathers:n.int(3,5),wingSpan:n.range(.88,1.06),wingH:n.range(.34,.44),wingShoulder:n.range(-68,-40),bars:n.int(2,3),checkered:n.boolean(.28),beakLen:n.range(.54,.7),beakThick:n.range(.21,.27),eyeStyle:n.choice([`bead`,`bead`,`bead`,`bead`,`sleepy`,`content`,`wink`,`derp`]),eyeR:n.range(.155,.205),legSpread:n.range(11,25),legLen:n.range(17,30)*r,legThick:n.range(4.6,6.4),footLen:n.range(13,20)*r,toeSpread:n.range(20,32),seam:n.boolean(.55),wobbleAmp:n.range(.004,.013),wobblePhase:n.range(0,Math.PI*2)}}function x(e){let t={x:0,y:25},n=[{cx:t.x,cy:t.y,rx:e.bodyRX,ry:e.bodyRY},{cx:t.x+e.bodyRX*.46,cy:t.y+e.bodyRY*e.chestDrop,rx:e.bodyRX*.56*e.chestPuff,ry:e.bodyRY*.54*e.chestPuff}],r={x:t.x,y:t.y-e.bodyRY*.35},i=ee({x:t.x+e.headDX,y:t.y-e.bodyRY*.92-e.headRise},r,e.headTilt);n.push({cx:i.x,cy:i.y,rx:e.headR,ry:e.headR,blend:e.neckBlend});let a=e.beakAngle+e.headTilt,o=g(a),s=_(o);if(e.hasCrest){let t=g(a+196);n.push({cx:i.x+t.x*e.headR*.82,cy:i.y+t.y*e.headR*.82,rx:e.headR*e.crestSize,ry:e.headR*e.crestSize*.78,blend:9})}let f=g(e.tailAngle),p={x:t.x+f.x*e.bodyRX*.62,y:t.y+f.y*e.bodyRY*.52},b={x:p.x+f.x*e.tailLen,y:p.y+f.y*e.tailLen};n.push({cx:(p.x+b.x)/2,cy:(p.y+b.y)/2,rx:e.tailLen*.62,ry:e.tailLen*e.tailW,rot:e.tailAngle*te,blend:e.tailBlend});let x=c(n,e.blend),S=u(x,t.x,t.y,{samples:132,wobble:t=>1+e.wobbleAmp*Math.sin(5*t+e.wobblePhase)+e.wobbleAmp*.7*Math.sin(9*t+e.wobblePhase*1.7)}),C=m(S),w=d(S),T=g(e.wingShoulder),E={x:t.x+T.x*e.bodyRX*.5,y:t.y+T.y*e.bodyRY*.5},D={x:v(E.x,p.x,e.wingSpan)+f.x*e.bodyRX*.16,y:v(E.y,p.y,e.wingSpan)+f.y*e.bodyRY*.16},O=Math.hypot(D.x-E.x,D.y-E.y),k=Math.atan2(D.y-E.y,D.x-E.x),A=e.bodyRY*e.wingH,j={x:Math.cos(k),y:Math.sin(k)},M={x:(E.x+D.x)/2,y:(E.y+D.y)/2},ne=m(u(c([{cx:M.x-j.x*O*.12,cy:M.y-j.y*O*.12,rx:O*.46,ry:A,rot:k},{cx:M.x+j.x*O*.34,cy:M.y+j.y*O*.34,rx:O*.26,ry:A*.5,rot:k}],24),M.x,M.y,{samples:64,rMax:320})),re=[],N=_(j);for(let t=0;t<e.bars;t++){let e=.2+t*.16,n={x:M.x+j.x*O*e,y:M.y+j.y*O*e},r=A*1.6;re.push(h([{x:n.x-N.x*r,y:n.y-N.y*r},{x:n.x+j.x*O*.03,y:n.y+j.y*O*.03},{x:n.x+N.x*r,y:n.y+N.y*r}]))}let P=[];if(e.checkered)for(let e=-3;e<=3;e++)for(let t=-2;t<=2;t++){let n=(e*.5+(t%2?.25:0))*O*.26,r=t*A*.5;P.push({x:M.x+j.x*n+N.x*r,y:M.y+j.y*n+N.y*r})}let F=[];for(let t=1;t<e.tailFeathers;t++){let n=t/e.tailFeathers-.5,r=_(f),i={x:p.x+r.x*e.tailLen*e.tailW*n*.7,y:p.y+r.y*e.tailLen*e.tailW*n*.7},a={x:b.x+r.x*e.tailLen*e.tailW*n*2.1,y:b.y+r.y*e.tailLen*e.tailW*n*2.1};F.push(h([i,{x:(i.x+a.x)/2,y:(i.y+a.y)/2},a]))}let I={x:i.x+o.x*e.headR*.9,y:i.y+o.y*e.headR*.9},L=e.headR*e.beakLen,R=e.headR*e.beakThick,z=g(a+62),B={x:I.x+o.x*L+z.x*L*.16,y:I.y+o.y*L+z.y*L*.16},ie=`M${y(I.x+s.x*R)} ${y(I.y+s.y*R)}C${y(I.x+o.x*L*.5+s.x*R*.78)} ${y(I.y+o.y*L*.5+s.y*R*.78)} ${y(B.x-o.x*L*.22+s.x*R*.24)} ${y(B.y-o.y*L*.22+s.y*R*.24)} ${y(B.x)} ${y(B.y)}C${y(B.x-o.x*L*.3-s.x*R*.3)} ${y(B.y-o.y*L*.3-s.y*R*.3)} ${y(I.x+o.x*L*.34-s.x*R*.88)} ${y(I.y+o.y*L*.34-s.y*R*.88)} ${y(I.x-s.x*R)} ${y(I.y-s.y*R)}Z`,ae=h([{x:I.x+o.x*L*.1,y:I.y+o.y*L*.1},{x:I.x+o.x*L*.55-s.x*R*.1,y:I.y+o.y*L*.55-s.y*R*.1},{x:B.x-o.x*L*.06,y:B.y-o.y*L*.06}]),V={x:I.x-o.x*R*.15+s.x*R*.72,y:I.y-o.y*R*.15+s.y*R*.72,rx:R*.62,ry:R*.42},H=e.headR*e.eyeR,U=g(e.headTilt),W=_(U),G=[{x:i.x+U.x*e.headR*.4+W.x*e.headR*.14,y:i.y+U.y*e.headR*.4+W.y*e.headR*.14,r:H}];e.threeQuarter&&G.push({x:i.x-U.x*e.headR*.33+W.x*e.headR*.16,y:i.y-U.y*e.headR*.33+W.y*e.headR*.16,r:H*.88});let K=[],q=w.maxY+e.legLen;for(let n of[-1,1]){let r=g(90+n*e.legSpread),i=l(x,t.x,t.y,r.x,r.y);if(i===null)continue;let a={x:t.x+r.x*(i-6),y:t.y+r.y*(i-6)},o={x:a.x+n*3,y:q};K.push({hip:a,ankle:o,side:n})}K.sort((e,t)=>e.side-t.side);let oe=(t,n)=>{let r=e.footLen*(n>0?1:.92),i=[];for(let n of[-e.toeSpread,0,e.toeSpread]){let e=g(n*.5),a={x:t.x+e.x*r*.55,y:t.y+e.y*r*.55+2},o={x:t.x+e.x*r,y:t.y+e.y*r};i.push(h([t,a,o]))}let a=g(178);return i.push(h([t,{x:t.x+a.x*r*.3,y:t.y+a.y*r*.3+1},{x:t.x+a.x*r*.5,y:t.y+a.y*r*.5}])),i},J={x:t.x+e.bodyRX*.5,y:t.y+e.bodyRY*(e.chestDrop+.1)},se={cx:J.x+e.bodyRX*.16,cy:J.y+e.bodyRY*.22,rx:e.bodyRX*.62*e.chestPuff,ry:e.bodyRY*.58*e.chestPuff},Y={x:v(i.x,J.x,.34),y:v(i.y,J.y,.3)+e.headR*.3},ce={cx:Y.x,cy:Y.y,rx:e.headR*.78,ry:e.headR*.56,rot:-28},le=[];for(let t=0;t<3;t++){let n=[];for(let r=0;r<=10;r++){let i=r/10,a=(i-.5)*e.headR*1.3,o=(t-1)*e.headR*.24+Math.sin(i*Math.PI*2.2+t)*e.headR*.05;n.push({x:Y.x+a*.88+o*.47,y:Y.y+a*.47-o*.88})}le.push(h(n))}let X=[];for(let e=0;e<=10;e++){let n=g(v(-18,86,e/10)),r=l(x,t.x,t.y,n.x,n.y);r!==null&&X.push({x:t.x+n.x*(r-6),y:t.y+n.y*(r-6)})}let ue=X.length>2?h(X):``,Z=d(S.concat([B,{x:V.x,y:V.y}],K.flatMap(t=>[{x:t.ankle.x-e.footLen*.6,y:q+6},{x:t.ankle.x+e.footLen,y:q+6}]))),Q=Z.maxX-Z.minX+44,de=Z.maxY-Z.minY+44,$=Math.max(Q,de);return{bodyPath:C,outline:S,box:w,view:{x:Z.minX-22-($-Q)/2,y:Z.minY-22-($-de)/2,size:$},groundY:q,bodyC:t,wingPath:ne,barPaths:re,checkers:P,checkerR:A*.16,tailLines:F,beakPath:ie,gapePath:ae,cere:V,eyes:G,legs:K,footPath:oe,chestPatch:se,neckPatch:ce,sheen:le,seamPath:ue,headC:i,u:o,n:s,beakDeg:a}}function S(e,t,n,r,i,a){let o=n.ink,s={x:-i.x,y:-i.y};if(t===`content`||t===`wink`&&!a){let t={x:e.x-r.x*e.r*1.5,y:e.y-r.y*e.r*1.5},n={x:e.x+r.x*e.r*1.5,y:e.y+r.y*e.r*1.5},i={x:e.x-s.x*e.r*1.5,y:e.y-s.y*e.r*1.5};return`<path d="M${y(t.x)} ${y(t.y)}Q${y(i.x)} ${y(i.y)} ${y(n.x)} ${y(n.y)}" fill="none" stroke="${o}" stroke-width="${y(e.r*.72)}" stroke-linecap="round"/>`}if(t===`sleepy`){let t={x:e.x-r.x*e.r*1.4,y:e.y-r.y*e.r*1.4},n={x:e.x+r.x*e.r*1.4,y:e.y+r.y*e.r*1.4},i={x:e.x+s.x*e.r*1.3,y:e.y+s.y*e.r*1.3};return`<path d="M${y(t.x)} ${y(t.y)}Q${y(i.x)} ${y(i.y)} ${y(n.x)} ${y(n.y)}" fill="none" stroke="${o}" stroke-width="${y(e.r*.66)}" stroke-linecap="round"/>`}return t===`derp`?`<g>
<circle cx="${y(e.x)}" cy="${y(e.y)}" r="${y(e.r*1.35)}" fill="#fff" stroke="${o}" stroke-width="${y(e.r*.34)}"/>
<circle cx="${y(e.x+r.x*e.r*.4)}" cy="${y(e.y+r.y*e.r*.4-e.r*.3)}" r="${y(e.r*.62)}" fill="${n.eye}"/>
</g>`:`<g>
<circle cx="${y(e.x)}" cy="${y(e.y)}" r="${y(e.r*1.28)}" fill="${n.chestDeep}" opacity="0.5"/>
<circle cx="${y(e.x)}" cy="${y(e.y)}" r="${y(e.r)}" fill="${n.eye}"/>
<circle cx="${y(e.x-e.r*.32)}" cy="${y(e.y-e.r*.36)}" r="${y(e.r*.36)}" fill="#fff" opacity="0.92"/>
<circle cx="${y(e.x+e.r*.34)}" cy="${y(e.y+e.r*.3)}" r="${y(e.r*.17)}" fill="#fff" opacity="0.6"/>
</g>`}function C(e,t={}){let{width:n=360,height:r=360,uid:i=`pigeon`,background:a=`none`}=t,o=e,s=o.palette,c=x(o),l=`pg-${i}`,u=Math.max(2.4,3.4*o.scale),d=c.checkers.map(e=>`<circle cx="${y(e.x)}" cy="${y(e.y)}" r="${y(c.checkerR)}" fill="${s.bar}" opacity="0.5"/>`).join(``),f=c.legs.map(e=>`<path d="M${y(e.hip.x)} ${y(e.hip.y)}L${y(e.ankle.x)} ${y(e.ankle.y)}" stroke="${e.side>0?s.foot:s.footShade}" stroke-width="${y(o.legThick)}" stroke-linecap="round" fill="none"/>`).join(``),p=c.legs.map(e=>{let t=e.side>0?s.foot:s.footShade;return c.footPath(e.ankle,e.side).map(e=>`<path d="${e}" fill="none" stroke="${t}" stroke-width="${y(o.legThick*.92)}" stroke-linecap="round"/>`).join(``)}).join(``);return`<svg id="${l}" viewBox="${y(c.view.x)} ${y(c.view.y)} ${y(c.view.size)} ${y(c.view.size)}" width="${n}" height="${r}" xmlns="http://www.w3.org/2000/svg" style="display:block;overflow:visible;background:${a}">
<defs>
<clipPath id="${l}-body"><path d="${c.bodyPath}"/></clipPath>
<clipPath id="${l}-wing"><path d="${c.wingPath}"/></clipPath>
<clipPath id="${l}-neck"><ellipse cx="${y(c.neckPatch.cx)}" cy="${y(c.neckPatch.cy)}" rx="${y(c.neckPatch.rx*.94)}" ry="${y(c.neckPatch.ry*.94)}" transform="rotate(${y(c.neckPatch.rot)} ${y(c.neckPatch.cx)} ${y(c.neckPatch.cy)})"/></clipPath>
<radialGradient id="${l}-irid" cx="0.42" cy="0.4" r="0.62">
<stop offset="0%" stop-color="${s.irid1}" stop-opacity="0.62"/>
<stop offset="58%" stop-color="${s.irid2}" stop-opacity="0.44"/>
<stop offset="100%" stop-color="${s.irid2}" stop-opacity="0"/>
</radialGradient>
<radialGradient id="${l}-chest" cx="0.5" cy="0.44" r="0.58">
<stop offset="0%" stop-color="${s.chest}" stop-opacity="0.98"/>
<stop offset="52%" stop-color="${s.chest}" stop-opacity="0.86"/>
<stop offset="100%" stop-color="${s.chestDeep}" stop-opacity="0"/>
</radialGradient>
<radialGradient id="${l}-lift" cx="0.34" cy="0.2" r="0.8">
<stop offset="0%" stop-color="#fff" stop-opacity="0.2"/>
<stop offset="100%" stop-color="#fff" stop-opacity="0"/>
</radialGradient>
<radialGradient id="${l}-ao" cx="0.5" cy="0.95" r="0.55">
<stop offset="0%" stop-color="${s.ink}" stop-opacity="0.30"/>
<stop offset="100%" stop-color="${s.ink}" stop-opacity="0"/>
</radialGradient>
</defs>
<ellipse cx="${y(c.bodyC.x+o.bodyRX*.1)}" cy="${y(c.groundY+o.legThick*.6)}" rx="${y(o.bodyRX*.78)}" ry="${y(Math.max(7,o.bodyRX*.11))}" fill="${s.ink}" opacity="0.16"/>
<g>${f}${p}</g>
<path d="${c.bodyPath}" fill="${s.body}"/>
<g clip-path="url(#${l}-body)">
<ellipse cx="${y(c.chestPatch.cx)}" cy="${y(c.chestPatch.cy)}" rx="${y(c.chestPatch.rx)}" ry="${y(c.chestPatch.ry)}" fill="url(#${l}-chest)" opacity="0.95"/>
${c.tailLines.map(e=>`<path d="${e}" fill="none" stroke="${s.wingEdge}" stroke-width="${y(u*.5)}" stroke-linecap="round" opacity="0.55"/>`).join(``)}
<g transform="rotate(${y(c.neckPatch.rot)} ${y(c.neckPatch.cx)} ${y(c.neckPatch.cy)})">
<ellipse cx="${y(c.neckPatch.cx)}" cy="${y(c.neckPatch.cy)}" rx="${y(c.neckPatch.rx)}" ry="${y(c.neckPatch.ry)}" fill="url(#${l}-irid)"/>
</g>
<g clip-path="url(#${l}-neck)">
${c.sheen.map((e,t)=>`<path d="${e}" fill="none" stroke="${t===1?`#fff`:s.irid1}" stroke-width="${y(u*.5)}" stroke-linecap="round" opacity="${t===1?.34:.26}"/>`).join(``)}
</g>
<path d="${c.wingPath}" fill="${s.wing}"/>
<g clip-path="url(#${l}-wing)">
${c.barPaths.map(e=>`<path d="${e}" fill="none" stroke="${s.bar}" stroke-width="${y(u*1.5)}" stroke-linecap="round" opacity="0.85"/>`).join(``)}
${d}
</g>
<path d="${c.wingPath}" fill="none" stroke="${s.ink}" stroke-width="${y(u*.86)}" stroke-linejoin="round" opacity="0.9"/>
<rect x="${y(c.view.x)}" y="${y(c.view.y)}" width="${y(c.view.size)}" height="${y(c.view.size)}" fill="url(#${l}-lift)"/>
<rect x="${y(c.view.x)}" y="${y(c.view.y)}" width="${y(c.view.size)}" height="${y(c.view.size)}" fill="url(#${l}-ao)"/>
${o.seam&&c.seamPath?`<path d="${c.seamPath}" fill="none" stroke="${s.ink}" stroke-width="${y(u*.3)}" stroke-dasharray="3 6" stroke-linecap="round" opacity="0.22"/>`:``}
</g>
<path d="${c.bodyPath}" fill="none" stroke="${s.ink}" stroke-width="${y(u)}" stroke-linejoin="round"/>
<path d="${c.beakPath}" fill="${s.beak}" stroke="${s.ink}" stroke-width="${y(u*.66)}" stroke-linejoin="round"/>
<path d="${c.gapePath}" fill="none" stroke="${s.ink}" stroke-width="${y(u*.36)}" stroke-linecap="round" opacity="0.7"/>
<ellipse cx="${y(c.cere.x)}" cy="${y(c.cere.y)}" rx="${y(c.cere.rx)}" ry="${y(c.cere.ry)}" transform="rotate(${y(c.beakDeg)} ${y(c.cere.x)} ${y(c.cere.y)})" fill="${s.cere}" stroke="${s.ink}" stroke-width="${y(u*.44)}"/>
${c.eyes.map((e,t)=>S(e,o.eyeStyle,s,c.u,c.n,t>0)).join(``)}
</svg>`}function w(e=new Date){return`DAILY-${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function T(e){let t=e.querySelector(`[data-pigeon-slot]`)||e,n=e.dataset.pigeonSeed||w(),r=Number(e.dataset.pigeonSize)||150;t.innerHTML=C(b(n),{width:r,height:r,uid:e.dataset.pigeonUid||`daily`});let i=e.getAttribute(`href`);i&&!i.includes(`#`)&&e.setAttribute(`href`,`${i}#seed=${encodeURIComponent(n)}`),e.dataset.pigeonMounted=`1`}function E(){document.querySelectorAll(`[data-daily-pigeon]:not([data-pigeon-mounted])`).forEach(T)}return document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,E):E(),e.dailySeed=w,e.mountDailyPigeon=T,e.renderPigeonSVG=C,e.seedToParams=b,e})({});