domma-cms 0.108.0 → 0.109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import R from"./christmas.js";export default{name:"guy-fawkes",displayName:"Guy Fawkes Night",emoji:"\u{1F386}",intensityConfig:{light:{count:60,initialParticleRatio:.25,speedRange:[.5,1.5],sizeRange:[2,4],bonfires:1,fireworkChance:9e-4,rocketChance:7e-4,burstChance:.0012},medium:{count:120,initialParticleRatio:.25,speedRange:[.5,2],sizeRange:[2,5],bonfires:2,fireworkChance:.0011,rocketChance:9e-4,burstChance:.0015},heavy:{count:200,initialParticleRatio:.25,speedRange:[.5,2.5],sizeRange:[3,6],bonfires:3,fireworkChance:.0014,rocketChance:.0012,burstChance:.0018}},particles:["ember","firework","spark","rocket","burst","trail"],decorations:["bonfire","guy-effigy","catherine-wheel","roman-candle","sparkler-bundle","moon"],colors:{primary:"#ff4500",secondary:"#ffd700",accent:"#8b0000",fire:["#ff4500","#ffa500","#ffff00","#ff0000"],firework:["#ff0000","#ffff00","#00ff00","#0000ff","#ff00ff","#00ffff","#ffffff"]},lightningChance:5e-4,lightningDuration:200,lightningTimer:0,lightningActive:!1,lightningColor:"#fefefe",drawLightning(o,e,n,r,l,a,t,f,i,s,h){if(a<1)return;const d=(e+r)/2,y=(n+l)/2,g=Math.atan2(l-n,r-e),b=g+Math.PI/2,S=(Math.random()-.5)*t,M=d+Math.cos(b)*S,m=y+Math.sin(b)*S,u=a-1,w=t*f,C=s*.8;if(o.strokeStyle=h,o.lineWidth=s,o.lineCap="round",o.lineJoin="round",o.beginPath(),o.moveTo(e,n),o.lineTo(M,m),o.lineTo(r,l),o.stroke(),u>0&&(this.drawLightning(o,e,n,M,m,u,w,f,i,C,h),this.drawLightning(o,M,m,r,l,u,w,f,i,C,h),Math.random()<i&&u>1)){const P=Math.random()*t*.5,v=(Math.random()-.5)*Math.PI/3,k=M+Math.cos(g+v)*P,z=m+Math.sin(g+v)*P;this.drawLightning(o,M,m,k,z,u-1,w*.5,f,i*.5,C*.6,h)}},createEmber(o,e,n){const r=n?.sizeRange||[2,4],l=n?.speedRange||[.5,1.5],a=this.colors.firework,t=Math.random()*o,f=e-50,i=100+Math.random()*300;return{type:"ember",x:t,y:f,vx:(Math.random()-.5)*1.5,vy:-2-Math.random()*2,targetY:i,size:r[0]+Math.random()*(r[1]-r[0]),speed:l[0]+Math.random()*(l[1]-l[0]),opacity:1,color:a[Math.floor(Math.random()*a.length)],trailColor:a[Math.floor(Math.random()*a.length)],glowPhase:Math.random()*Math.PI*2,exploded:!1,explosionParticles:[],active:!0}},createBonfire(o,e,n={}){return{type:"bonfire",x:n.x!==void 0?n.x:Math.random()*o*.6+o*.2,y:n.y!==void 0?n.y:e-60,size:30+Math.random()*20,opacity:1,flames:[],logs:[],embers:[],time:0,cracklePhase:0,active:!0,static:!0}},createGuyEffigy(o,e,n,r){return{type:"guy-effigy",x:n,y:r-50,size:20+Math.random()*10,opacity:.8,burning:!1,burnProgress:0,active:!0,static:!0}},createCatherineWheel(o,e,n={}){return{type:"catherine-wheel",x:n.x!==void 0?n.x:Math.random()*o,y:n.y!==void 0?n.y:100+Math.random()*200,size:15+Math.random()*10,opacity:1,rotation:0,rotationSpeed:.05+Math.random()*.1,sparks:[],sparkTimer:0,sparkInterval:50,time:0,duration:5e3+Math.random()*3e3,active:!0,static:!0}},createRomanCandle(o,e,n={}){return{type:"roman-candle",x:n.x!==void 0?n.x:Math.random()*o,y:n.y!==void 0?n.y:e-30,size:8+Math.random()*4,opacity:1,shots:[],shotInterval:800+Math.random()*400,lastShotTime:0,shotCount:0,maxShots:5+Math.floor(Math.random()*5),time:0,active:!0,static:!0}},createRocket(o,e,n){const r=n?.sizeRange||[2,4],l=50+Math.random()*(o-100),a=80+Math.random()*150;return{type:"rocket",x:l,y:e-20,vx:(Math.random()-.5)*.5,vy:-3-Math.random()*2,targetY:a,size:r[0]+Math.random()*(r[1]-r[0]),opacity:1,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],trail:[],exploded:!1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,active:!0}},createBurst(o,e,n,r){const l=n?.sizeRange||[1,3],a=Math.random()*Math.PI*2,t=1+Math.random()*4;return{type:"burst",x:r?.x||o/2,y:r?.y||e/2,vx:Math.cos(a)*t,vy:Math.sin(a)*t,size:l[0]+Math.random()*(l[1]-l[0]),opacity:1,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],life:1,fadeRate:.015+Math.random()*.015,gravity:.05,sparkle:Math.random()<.3,active:!0}},createTrail(o,e,n,r){const l=n?.sizeRange||[1,2];return{type:"trail",x:r?.x||o/2,y:r?.y||e/2,vx:(Math.random()-.5)*.3,vy:(Math.random()-.5)*.3,size:l[0]+Math.random()*(l[1]-l[0]),opacity:.8,color:r?.color||"#ffd700",life:1,fadeRate:.03+Math.random()*.02,active:!0}},createSpark(o,e,n,r){const l=n?.sizeRange||[.5,1.5],a=Math.random()*Math.PI*2,t=.5+Math.random()*2;return{type:"spark",x:r?.x||Math.random()*o,y:r?.y||Math.random()*e,vx:Math.cos(a)*t,vy:Math.sin(a)*t,size:l[0]+Math.random()*(l[1]-l[0]),opacity:1,color:this.colors.secondary,life:1,fadeRate:.02+Math.random()*.02,active:!0}},createFallingParticle(o,e,n){return this.createEmber(o,e,n)},createInitialDecorations(o,e,n){const r=[],l=n.bonfires||2;for(let i=0;i<l;i++){const s=o/(l+1)*(i+1),h=e-60;r.push(this.createBonfire(o,e,{x:s,y:h})),r.push(this.createGuyEffigy(o,e,s,h))}const a=Math.min(l,2);for(let i=0;i<a;i++){const s=i%2===0?"left":"right";r.push(this.createCatherineWheel(o,e,{x:s==="left"?100:o-100,y:150+i*100}))}const t=Math.min(l,2);for(let i=0;i<t;i++)r.push(this.createRomanCandle(o,e,{x:150+i*((o-300)/t),y:e-30}));const f=Math.min(l+1,3);for(let i=0;i<f;i++)r.push({type:"sparkler-bundle",x:80+i*((o-160)/(f-1)),y:e-20,size:12+Math.random()*4,opacity:.85,sparklePhase:Math.random()*Math.PI*2,active:!0,static:!0});return r.push({type:"moon",x:o-120,y:100,size:60+Math.random()*20,opacity:.75,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0}),r},spawnSpecialParticle(o,e,n,r){const l=Math.random();if(l<r.fireworkChance){const a=n*(.2+Math.random()*.5),t=n,f=t-a,i=40+Math.random()*20,s=-(f/i);return{type:"firework",x:Math.random()*e,y:t,targetY:a,vx:(Math.random()-.5)*3,vy:s,size:2+Math.random()*2,opacity:1,active:!0,static:!1,time:0,exploded:!1,explosionTime:i,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)]}}return l<3e-4&&o.filter(t=>t.type==="bonfire").length<r.bonfires?this.createBonfire(e,n):l<5e-4?this.createCatherineWheel(e,n):l<8e-4?this.createRomanCandle(e,n):null},updateSpecialParticles(o,e){this.lightningActive?(this.lightningTimer+=e,this.lightningTimer>=this.lightningDuration&&(this.lightningActive=!1,this.lightningTimer=0)):Math.random()<this.lightningChance&&(this.lightningActive=!0,this.lightningTimer=0);for(const n of o){if(n.time!==void 0&&n.time++,n.type==="firework"&&!n.exploded){const r=n.targetY&&n.y<=n.targetY,l=n.time>=n.explosionTime;(r||l)&&(n.exploded=!0,this.explodeFirework(n,o),n.active=!1)}if(n.type==="spark"&&(n.opacity-=.015,n.vy+=.15,n.opacity<=0&&(n.active=!1)),n.type==="catherine-wheel"){if(n.rotation+=n.rotationSpeed*(e/16),n.time+=e,n.time>n.duration&&(n.active=!1),n.sparkTimer+=e,n.sparkTimer>=n.sparkInterval){n.sparkTimer=0;const r=2+Math.floor(Math.random()*3);for(let l=0;l<r;l++){const a=Math.random()*Math.PI*2,t=1+Math.random()*3;n.sparks.push({x:0,y:0,vx:Math.cos(a)*t,vy:Math.sin(a)*t,size:1+Math.random()*1.5,opacity:1,life:1,fadeRate:.05+Math.random()*.03,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)]})}}n.sparks=n.sparks.filter(r=>(r.x+=r.vx,r.y+=r.vy,r.life-=r.fadeRate,r.opacity=Math.max(0,r.life),r.life>0))}}},drawEmber(o,e,n){if(!isFinite(e.x)||!isFinite(e.y)||!isFinite(e.size)||!isFinite(e.vx)||!isFinite(e.vy)){console.warn("[Guy Fawkes] Invalid ember particle values, deactivating:",e),e.active=!1;return}if(!e.exploded){if(e.x+=e.vx,e.y+=e.vy,e.vy+=.02,!isFinite(e.x)||!isFinite(e.y)){console.warn("[Guy Fawkes] Ember particle became non-finite after update, deactivating"),e.active=!1;return}if(e.y<=e.targetY){e.exploded=!0;const t=50+Math.floor(Math.random()*40);for(let f=0;f<t;f++){const i=f/t*Math.PI*2,s=2+Math.random()*5,h=f%5===0;e.explosionParticles.push({x:e.x,y:e.y,vx:Math.cos(i)*s,vy:Math.sin(i)*s,size:h?2+Math.random()*2:.8+Math.random()*2,color:h?"#ffffff":this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],opacity:1,life:1,trail:[]})}}}const r=e.x,l=e.y,a=e.size;if(o.save(),e.exploded)e.explosionParticles=e.explosionParticles.filter(t=>(t.x+=t.vx,t.y+=t.vy,t.vy+=.05,t.life-=.015,t.opacity=t.life,t.life<=0?!1:(o.globalAlpha=t.opacity,o.fillStyle=t.color,o.shadowColor=t.color,o.shadowBlur=t.size*3,o.beginPath(),o.arc(t.x,t.y,t.size,0,Math.PI*2),o.fill(),!0))),e.explosionParticles.length===0&&(e.active=!1);else{const t=.8+(Math.sin(n*.01+e.glowPhase)+1)*.2;o.globalAlpha=.3,o.strokeStyle=e.trailColor,o.lineWidth=a*.8,o.lineCap="round",o.beginPath(),o.moveTo(r,l),o.lineTo(r-e.vx*5,l-e.vy*5),o.stroke();const f=o.createRadialGradient(r,l,0,r,l,a*4);f.addColorStop(0,e.color),f.addColorStop(.5,`${e.color}80`),f.addColorStop(1,"rgba(255, 69, 0, 0)"),o.globalAlpha=t,o.fillStyle=f,o.fillRect(r-a*4,l-a*4,a*8,a*8),o.globalAlpha=1,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=a*2,o.beginPath(),o.arc(r,l,a,0,Math.PI*2),o.fill()}o.restore()},drawBonfire(o,e,n){const r=e.x,l=e.y,a=e.size;o.save(),o.translate(r,l),o.fillStyle="#8B4513",o.strokeStyle="#654321",o.lineWidth=2,o.fillRect(-a*.8,a*.3,a*1.6,a*.3),o.strokeRect(-a*.8,a*.3,a*1.6,a*.3),o.save(),o.rotate(-.3),o.fillRect(-a*.7,a*.1,a*1.4,a*.25),o.strokeRect(-a*.7,a*.1,a*1.4,a*.25),o.restore(),o.save(),o.rotate(.3),o.fillRect(-a*.7,a*.1,a*1.4,a*.25),o.strokeRect(-a*.7,a*.1,a*1.4,a*.25),o.restore();const t=12;for(let i=0;i<t;i++){const s=-a*.6+i/t*a*1.2,h=a*(1.2+Math.sin(n*.006+i)*.5),d=a*(.2+Math.sin(n*.01+i*.5)*.12),y=o.createLinearGradient(s,0,s,-h);y.addColorStop(0,"#ffffff"),y.addColorStop(.15,"#ffff00"),y.addColorStop(.4,"#ffa500"),y.addColorStop(.7,"#ff4500"),y.addColorStop(.85,"#ff0000"),y.addColorStop(1,"rgba(139, 0, 0, 0)"),o.fillStyle=y,o.globalAlpha=.85,o.shadowColor="#ff6600",o.shadowBlur=a*.3,o.beginPath(),o.moveTo(s,0),o.bezierCurveTo(s-d,-h*.4,s-d*.6,-h*.7,s,-h),o.bezierCurveTo(s+d*.6,-h*.7,s+d,-h*.4,s,0),o.closePath(),o.fill()}o.shadowBlur=0,o.globalAlpha=1;const f=o.createRadialGradient(0,0,0,0,0,a*2);f.addColorStop(0,"rgba(255, 165, 0, 0.4)"),f.addColorStop(.5,"rgba(255, 69, 0, 0.2)"),f.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=f,o.fillRect(-a*2,-a*2,a*4,a*2);for(let i=0;i<5;i++){const s=(Math.random()-.5)*a*.8,h=-a*Math.random()*1.5,d=1+Math.random()*2;o.fillStyle=Math.random()<.5?"#ffa500":"#ffff00",o.globalAlpha=Math.random()*.8,o.beginPath(),o.arc(s,h,d,0,Math.PI*2),o.fill()}o.restore()},drawGuyEffigy(o,e,n){const r=e.x,l=e.y,a=e.size;if(o.save(),o.globalAlpha=e.opacity*(1-e.burnProgress),o.translate(r,l),o.fillStyle="#8B7355",o.fillRect(-a*.4,0,a*.8,a*1.5),o.fillRect(-a*.9,a*.3,a*.5,a*.2),o.fillRect(a*.4,a*.3,a*.5,a*.2),o.fillStyle="#D2B48C",o.beginPath(),o.arc(0,-a*.3,a*.5,0,Math.PI*2),o.fill(),o.fillStyle="#4a4a4a",o.fillRect(-a*.6,-a*.8,a*1.2,a*.2),o.fillRect(-a*.4,-a*1.2,a*.8,a*.4),o.fillStyle="#000000",o.fillRect(-a*.25,-a*.4,a*.15,a*.2),o.fillRect(a*.1,-a*.4,a*.15,a*.2),o.beginPath(),o.arc(0,-a*.1,a*.25,0,Math.PI),o.fill(),e.burning){o.globalAlpha=1;const t=o.createRadialGradient(0,0,0,0,0,a*2);t.addColorStop(0,"rgba(255, 255, 0, 0.8)"),t.addColorStop(.5,"rgba(255, 69, 0, 0.5)"),t.addColorStop(1,"rgba(255, 0, 0, 0)"),o.fillStyle=t,o.fillRect(-a*2,-a*2,a*4,a*4)}o.restore()},drawCatherineWheel(o,e,n){const r=e.x,l=e.y,a=e.size;o.save(),o.translate(r,l),o.rotate(e.rotation),o.fillStyle="#654321",o.beginPath(),o.arc(0,0,a*.1,0,Math.PI*2),o.fill(),o.strokeStyle="#8B4513",o.lineWidth=a*.15,o.beginPath(),o.arc(0,0,a*.6,0,Math.PI*2),o.stroke(),o.strokeStyle="#cc6600",o.lineWidth=a*.1,o.beginPath(),o.arc(0,0,a*.4,0,Math.PI*2),o.stroke();const t=8;for(let s=0;s<t;s++){const h=s/t*Math.PI*2,d=Math.cos(h)*a*.7,y=Math.sin(h)*a*.7;o.fillStyle="#444444",o.strokeStyle="#222222",o.lineWidth=1,o.beginPath(),o.arc(d,y,a*.15,0,Math.PI*2),o.fill(),o.stroke()}e.sparks.forEach(s=>{o.save(),o.translate(s.x,s.y);const h=o.createRadialGradient(0,0,0,0,0,s.size*5);h.addColorStop(0,s.color),h.addColorStop(.5,`${s.color}80`),h.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=h,o.globalAlpha=s.opacity*.6,o.fillRect(-s.size*5,-s.size*5,s.size*10,s.size*10),o.globalAlpha=s.opacity,o.fillStyle=s.color,o.shadowColor=s.color,o.shadowBlur=s.size*3,o.beginPath(),o.arc(0,0,s.size,0,Math.PI*2),o.fill(),o.restore()});const f=.6+Math.sin(n*.01)*.4;o.globalAlpha=f*e.opacity;const i=o.createRadialGradient(0,0,0,0,0,a);i.addColorStop(0,"rgba(255, 200, 0, 0.7)"),i.addColorStop(.5,"rgba(255, 100, 0, 0.4)"),i.addColorStop(1,"rgba(255, 0, 0, 0)"),o.fillStyle=i,o.beginPath(),o.arc(0,0,a,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawRomanCandle(o,e,n){const r=e.x,l=e.y,a=e.size;if(o.save(),o.translate(r,l),o.fillStyle="#c00",o.strokeStyle="#800",o.lineWidth=2,o.fillRect(-a*.4,0,a*.8,a*2),o.strokeRect(-a*.4,0,a*.8,a*2),o.fillStyle="#ffd700",o.fillRect(-a*.3,a*.8,a*.6,a*.5),o.fillStyle="#654321",o.fillRect(-a*.2,-a*.3,a*.4,a*.3),e.shotCount<e.maxShots){const t=Math.sin(n*.05)*.5+.5;o.fillStyle=`rgba(255, 255, 0, ${t})`,o.shadowColor="#ffff00",o.shadowBlur=15,o.beginPath(),o.arc(0,-a*.2,a*.3,0,Math.PI*2),o.fill()}o.shadowBlur=0,o.restore(),e.shots.forEach(t=>{o.save(),o.globalAlpha=t.opacity,o.strokeStyle=t.color,o.lineWidth=3,o.shadowColor=t.color,o.shadowBlur=10,o.beginPath(),o.moveTo(t.x,t.y),o.lineTo(t.x,t.y+10),o.stroke(),o.fillStyle=t.color,o.beginPath(),o.arc(t.x,t.y,t.size,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()})},drawSparklerBundle(o,e,n){const r=e.x,l=e.y,a=e.size;o.save(),o.globalAlpha=e.opacity,o.translate(r,l);const t=5,f=a*.15;for(let i=0;i<t;i++){const s=(i-2)*f,h=(i-2)*.05;o.save(),o.translate(s,0),o.rotate(h),o.strokeStyle="#888888",o.lineWidth=a*.08,o.lineCap="round",o.beginPath(),o.moveTo(0,0),o.lineTo(0,-a*1.8),o.stroke();const d=Math.sin(n*.01+e.sparklePhase+i*.5)*.5+.5,y=o.createRadialGradient(0,-a*1.8,0,0,-a*1.8,a*.5);y.addColorStop(0,`rgba(255, 255, 255, ${d})`),y.addColorStop(.4,`rgba(255, 215, 0, ${d*.8})`),y.addColorStop(.7,`rgba(255, 140, 0, ${d*.5})`),y.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=y,o.beginPath(),o.arc(0,-a*1.8,a*.5,0,Math.PI*2),o.fill();const g=3;for(let b=0;b<g;b++){const S=Math.random()*Math.PI*2,M=a*(.6+Math.random()*.4),m=Math.cos(S)*M,u=-a*1.8+Math.sin(S)*M,w=a*(.05+Math.random()*.08);o.fillStyle=Math.random()<.5?"#ffffff":"#ffd700",o.shadowColor=o.fillStyle,o.shadowBlur=a*.3,o.globalAlpha=e.opacity*Math.random()*.8,o.beginPath(),o.arc(m,u,w,0,Math.PI*2),o.fill()}o.restore()}o.fillStyle="#654321",o.fillRect(-a*.5,-a*.2,a,a*.4),o.shadowBlur=0,o.restore()},drawFirework(o,e){return R.drawFirework(o,e)},explodeFirework(o,e){const n=60+Math.random()*60,r=this.colors.firework;for(let l=0;l<n;l++){const a=Math.random()*Math.PI*2,t=Math.random()*6+3;e.push({type:"spark",x:o.x,y:o.y,vx:Math.cos(a)*t,vy:Math.sin(a)*t,size:2+Math.random()*2.5,opacity:1,active:!0,static:!1,color:r[Math.floor(Math.random()*r.length)],trail:[]})}},drawMoon(o,e,n){const r=e.x,l=e.y,a=e.size;o.save(),o.globalAlpha=e.opacity,o.translate(r,l);const t=o.createRadialGradient(-a*.2,-a*.2,0,0,0,a);t.addColorStop(0,"#ffb6a0"),t.addColorStop(.5,"#ff8c66"),t.addColorStop(1,"#cc6644"),o.fillStyle=t,o.beginPath(),o.arc(0,0,a,0,Math.PI*2),o.fill(),o.fillStyle="rgba(120, 50, 40, 0.25)",o.beginPath(),o.arc(-a*.3,-a*.2,a*.15,0,Math.PI*2),o.fill(),o.beginPath(),o.arc(a*.25,a*.1,a*.2,0,Math.PI*2),o.fill(),o.beginPath(),o.arc(a*.1,-a*.4,a*.12,0,Math.PI*2),o.fill(),o.strokeStyle="rgba(100, 60, 50, 0.15)",o.lineWidth=a*.08,o.lineCap="round";const f=Math.sin(n*.001+e.glowPhase)*a*.3;for(let h=0;h<3;h++){o.beginPath();const d=-a*.4+h*a*.4;o.moveTo(-a*.8,d+f*(h%2===0?1:-1)),o.bezierCurveTo(-a*.3,d+f*.5,a*.3,d-f*.5,a*.8,d+f*(h%2===0?-1:1)),o.stroke()}const i=.25+Math.sin(n*.0015+e.glowPhase)*.1;o.globalAlpha=i;const s=o.createRadialGradient(0,0,a*.8,0,0,a*2);s.addColorStop(0,"rgba(255, 140, 100, 0.6)"),s.addColorStop(.5,"rgba(255, 100, 80, 0.3)"),s.addColorStop(1,"rgba(255, 80, 60, 0)"),o.fillStyle=s,o.beginPath(),o.arc(0,0,a*2,0,Math.PI*2),o.fill(),o.restore()},drawRocket(o,e,n){if(o.save(),e.exploded)e.explosionParticles=e.explosionParticles.filter(r=>{if(r.x+=r.vx,r.y+=r.vy,r.vy+=r.gravity,r.life-=.012,r.opacity=r.life,r.life<=0)return!1;o.globalAlpha=r.opacity*.6;const l=o.createRadialGradient(r.x,r.y,0,r.x,r.y,r.size*4);return l.addColorStop(0,r.color),l.addColorStop(.5,`${r.color}60`),l.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=l,o.fillRect(r.x-r.size*4,r.y-r.size*4,r.size*8,r.size*8),o.globalAlpha=r.opacity,o.fillStyle=r.color,o.shadowColor=r.color,o.shadowBlur=r.size*3,r.sparkle&&Math.random()<.3&&(o.shadowBlur=r.size*5,o.fillStyle="#ffffff"),o.beginPath(),o.arc(r.x,r.y,r.size,0,Math.PI*2),o.fill(),!0}),e.explosionParticles.length===0&&(e.active=!1);else{if(e.x+=e.vx,e.y+=e.vy,e.rotation+=e.rotationSpeed,e.y<=e.targetY){e.exploded=!0;const s=80+Math.floor(Math.random()*60);e.explosionParticles=[];for(let h=0;h<s;h++){const d=h/s*Math.PI*2,y=2+Math.random()*6,g=h%6===0;e.explosionParticles.push({x:e.x,y:e.y,vx:Math.cos(d)*y,vy:Math.sin(d)*y,size:g?2.5+Math.random()*2:1+Math.random()*2,color:g?"#ffffff":this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],opacity:1,life:1,gravity:.05,sparkle:Math.random()<.3})}}const r=e.x,l=e.y,a=e.size,t=15;o.globalAlpha=.6;const f=o.createLinearGradient(r,l,r-e.vx*t,l-e.vy*t);f.addColorStop(0,e.color),f.addColorStop(.5,`${e.color}80`),f.addColorStop(1,"rgba(255, 69, 0, 0)"),o.strokeStyle=f,o.lineWidth=a*1.5,o.lineCap="round",o.beginPath(),o.moveTo(r,l),o.lineTo(r-e.vx*t,l-e.vy*t),o.stroke(),o.globalAlpha=.8;const i=o.createRadialGradient(r,l,0,r,l,a*5);i.addColorStop(0,e.color),i.addColorStop(.5,`${e.color}60`),i.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=i,o.fillRect(r-a*5,l-a*5,a*10,a*10),o.globalAlpha=1,o.fillStyle="#ffffff",o.shadowColor=e.color,o.shadowBlur=a*3,o.beginPath(),o.arc(r,l,a*1.2,0,Math.PI*2),o.fill(),o.fillStyle=e.color,o.shadowBlur=a*2,o.beginPath(),o.arc(r,l,a*.8,0,Math.PI*2),o.fill()}o.shadowBlur=0,o.restore()},drawBurst(o,e){const n=e.x,r=e.y,l=e.size;if(o.save(),e.x+=e.vx,e.y+=e.vy,e.vy+=e.gravity,e.life-=e.fadeRate,e.opacity=Math.max(0,e.life),e.life<=0){e.active=!1,o.restore();return}o.globalAlpha=e.opacity*.6;const a=o.createRadialGradient(n,r,0,n,r,l*4);a.addColorStop(0,e.color),a.addColorStop(.5,`${e.color}60`),a.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=a,o.fillRect(n-l*4,r-l*4,l*8,l*8),o.globalAlpha=e.opacity,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=l*2,e.sparkle&&Math.random()<.3&&(o.shadowBlur=l*4,o.fillStyle="#ffffff"),o.beginPath(),o.arc(n,r,l,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawTrail(o,e){const n=e.x,r=e.y,l=e.size;if(o.save(),e.x+=e.vx,e.y+=e.vy,e.life-=e.fadeRate,e.opacity=Math.max(0,e.life*.8),e.life<=0){e.active=!1,o.restore();return}o.globalAlpha=e.opacity*.4;const a=o.createRadialGradient(n,r,0,n,r,l*3);a.addColorStop(0,e.color),a.addColorStop(.6,`${e.color}40`),a.addColorStop(1,"rgba(255, 215, 0, 0)"),o.fillStyle=a,o.fillRect(n-l*3,r-l*3,l*6,l*6),o.globalAlpha=e.opacity,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=l*1.5,o.beginPath(),o.arc(n,r,l,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawSpark(o,e){const n=e.x,r=e.y,l=e.size;if(o.save(),e.x+=e.vx,e.y+=e.vy,e.life-=e.fadeRate,e.opacity=Math.max(0,e.life),e.life<=0){e.active=!1,o.restore();return}o.globalAlpha=e.opacity*.5;const a=o.createRadialGradient(n,r,0,n,r,l*3);a.addColorStop(0,e.color),a.addColorStop(.5,`${e.color}60`),a.addColorStop(1,"rgba(255, 215, 0, 0)"),o.fillStyle=a,o.fillRect(n-l*3,r-l*3,l*6,l*6),o.globalAlpha=e.opacity,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=l*2,o.beginPath(),o.arc(n,r,l*.8,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawGlobalEffects(o,e,n,r){if(this.lightningActive){o.save(),o.globalAlpha=.8+Math.sin(this.lightningTimer*.01)*.2,o.shadowColor=this.lightningColor,o.shadowBlur=20;const l=n*(.4+Math.random()*.2),a=0,t=n*Math.random(),f=r;this.drawLightning(o,l,a,t,f,5+Math.floor(Math.random()*3),50+Math.random()*50,.7,.3,3+Math.random()*2,this.lightningColor),o.restore()}}};
1
+ import{drawBonfire as R,drawGuyEffigy as c,drawCatherineWheel as I,drawRomanCandle as T,drawSparklerBundle as A}from"./bonfire-drawing.js";import G from"./christmas.js";export default{name:"guy-fawkes",displayName:"Guy Fawkes Night",emoji:"\u{1F386}",intensityConfig:{light:{count:60,initialParticleRatio:.25,speedRange:[.5,1.5],sizeRange:[2,4],bonfires:1,fireworkChance:9e-4,rocketChance:7e-4,burstChance:.0012},medium:{count:120,initialParticleRatio:.25,speedRange:[.5,2],sizeRange:[2,5],bonfires:2,fireworkChance:.0011,rocketChance:9e-4,burstChance:.0015},heavy:{count:200,initialParticleRatio:.25,speedRange:[.5,2.5],sizeRange:[3,6],bonfires:3,fireworkChance:.0014,rocketChance:.0012,burstChance:.0018}},particles:["ember","firework","spark","rocket","burst","trail"],decorations:["bonfire","guy-effigy","catherine-wheel","roman-candle","sparkler-bundle","moon"],colors:{primary:"#ff4500",secondary:"#ffd700",accent:"#8b0000",fire:["#ff4500","#ffa500","#ffff00","#ff0000"],firework:["#ff0000","#ffff00","#00ff00","#0000ff","#ff00ff","#00ffff","#ffffff"]},lightningChance:5e-4,lightningDuration:200,lightningTimer:0,lightningActive:!1,lightningColor:"#fefefe",drawLightning(o,e,r,a,t,n,i,l,s,f,h){if(n<1)return;const d=(e+a)/2,u=(r+t)/2,y=Math.atan2(t-r,a-e),b=y+Math.PI/2,C=(Math.random()-.5)*i,g=d+Math.cos(b)*C,M=u+Math.sin(b)*C,m=n-1,w=i*l,v=f*.8;if(o.strokeStyle=h,o.lineWidth=f,o.lineCap="round",o.lineJoin="round",o.beginPath(),o.moveTo(e,r),o.lineTo(g,M),o.lineTo(a,t),o.stroke(),m>0&&(this.drawLightning(o,e,r,g,M,m,w,l,s,v,h),this.drawLightning(o,g,M,a,t,m,w,l,s,v,h),Math.random()<s&&m>1)){const k=Math.random()*i*.5,P=(Math.random()-.5)*Math.PI/3,S=g+Math.cos(y+P)*k,z=M+Math.sin(y+P)*k;this.drawLightning(o,g,M,S,z,m-1,w*.5,l,s*.5,v*.6,h)}},createEmber(o,e,r){const a=r?.sizeRange||[2,4],t=r?.speedRange||[.5,1.5],n=this.colors.firework,i=Math.random()*o,l=e-50,s=100+Math.random()*300;return{type:"ember",x:i,y:l,vx:(Math.random()-.5)*1.5,vy:-2-Math.random()*2,targetY:s,size:a[0]+Math.random()*(a[1]-a[0]),speed:t[0]+Math.random()*(t[1]-t[0]),opacity:1,color:n[Math.floor(Math.random()*n.length)],trailColor:n[Math.floor(Math.random()*n.length)],glowPhase:Math.random()*Math.PI*2,exploded:!1,explosionParticles:[],active:!0}},createBonfire(o,e,r={}){return{type:"bonfire",x:r.x!==void 0?r.x:Math.random()*o*.6+o*.2,y:r.y!==void 0?r.y:e-60,size:30+Math.random()*20,opacity:1,flames:[],logs:[],embers:[],time:0,cracklePhase:0,active:!0,static:!0}},createGuyEffigy(o,e,r,a){return{type:"guy-effigy",x:r,y:a-50,size:20+Math.random()*10,opacity:.8,burning:!1,burnProgress:0,active:!0,static:!0}},createCatherineWheel(o,e,r={}){return{type:"catherine-wheel",x:r.x!==void 0?r.x:Math.random()*o,y:r.y!==void 0?r.y:100+Math.random()*200,size:15+Math.random()*10,opacity:1,rotation:0,rotationSpeed:.05+Math.random()*.1,sparks:[],sparkTimer:0,sparkInterval:50,time:0,duration:5e3+Math.random()*3e3,active:!0,static:!0}},createRomanCandle(o,e,r={}){return{type:"roman-candle",x:r.x!==void 0?r.x:Math.random()*o,y:r.y!==void 0?r.y:e-30,size:8+Math.random()*4,opacity:1,shots:[],shotInterval:800+Math.random()*400,lastShotTime:0,shotCount:0,maxShots:5+Math.floor(Math.random()*5),time:0,active:!0,static:!0}},createRocket(o,e,r){const a=r?.sizeRange||[2,4],t=50+Math.random()*(o-100),n=80+Math.random()*150;return{type:"rocket",x:t,y:e-20,vx:(Math.random()-.5)*.5,vy:-3-Math.random()*2,targetY:n,size:a[0]+Math.random()*(a[1]-a[0]),opacity:1,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],trail:[],exploded:!1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,active:!0}},createBurst(o,e,r,a){const t=r?.sizeRange||[1,3],n=Math.random()*Math.PI*2,i=1+Math.random()*4;return{type:"burst",x:a?.x||o/2,y:a?.y||e/2,vx:Math.cos(n)*i,vy:Math.sin(n)*i,size:t[0]+Math.random()*(t[1]-t[0]),opacity:1,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],life:1,fadeRate:.015+Math.random()*.015,gravity:.05,sparkle:Math.random()<.3,active:!0}},createTrail(o,e,r,a){const t=r?.sizeRange||[1,2];return{type:"trail",x:a?.x||o/2,y:a?.y||e/2,vx:(Math.random()-.5)*.3,vy:(Math.random()-.5)*.3,size:t[0]+Math.random()*(t[1]-t[0]),opacity:.8,color:a?.color||"#ffd700",life:1,fadeRate:.03+Math.random()*.02,active:!0}},createSpark(o,e,r,a){const t=r?.sizeRange||[.5,1.5],n=Math.random()*Math.PI*2,i=.5+Math.random()*2;return{type:"spark",x:a?.x||Math.random()*o,y:a?.y||Math.random()*e,vx:Math.cos(n)*i,vy:Math.sin(n)*i,size:t[0]+Math.random()*(t[1]-t[0]),opacity:1,color:this.colors.secondary,life:1,fadeRate:.02+Math.random()*.02,active:!0}},createFallingParticle(o,e,r){return this.createEmber(o,e,r)},createInitialDecorations(o,e,r){const a=[],t=r.bonfires||2;for(let s=0;s<t;s++){const f=o/(t+1)*(s+1),h=e-60;a.push(this.createBonfire(o,e,{x:f,y:h})),a.push(this.createGuyEffigy(o,e,f,h))}const n=Math.min(t,2);for(let s=0;s<n;s++){const f=s%2===0?"left":"right";a.push(this.createCatherineWheel(o,e,{x:f==="left"?100:o-100,y:150+s*100}))}const i=Math.min(t,2);for(let s=0;s<i;s++)a.push(this.createRomanCandle(o,e,{x:150+s*((o-300)/i),y:e-30}));const l=Math.min(t+1,3);for(let s=0;s<l;s++)a.push({type:"sparkler-bundle",x:80+s*((o-160)/(l-1)),y:e-20,size:12+Math.random()*4,opacity:.85,sparklePhase:Math.random()*Math.PI*2,active:!0,static:!0});return a.push({type:"moon",x:o-120,y:100,size:60+Math.random()*20,opacity:.75,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0}),a},spawnSpecialParticle(o,e,r,a){const t=Math.random();if(t<a.fireworkChance){const n=r*(.2+Math.random()*.5),i=r,l=i-n,s=40+Math.random()*20,f=-(l/s);return{type:"firework",x:Math.random()*e,y:i,targetY:n,vx:(Math.random()-.5)*3,vy:f,size:2+Math.random()*2,opacity:1,active:!0,static:!1,time:0,exploded:!1,explosionTime:s,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)]}}return t<3e-4&&o.filter(i=>i.type==="bonfire").length<a.bonfires?this.createBonfire(e,r):t<5e-4?this.createCatherineWheel(e,r):t<8e-4?this.createRomanCandle(e,r):null},updateSpecialParticles(o,e){this.lightningActive?(this.lightningTimer+=e,this.lightningTimer>=this.lightningDuration&&(this.lightningActive=!1,this.lightningTimer=0)):Math.random()<this.lightningChance&&(this.lightningActive=!0,this.lightningTimer=0);for(const r of o){if(r.time!==void 0&&r.time++,r.type==="firework"&&!r.exploded){const a=r.targetY&&r.y<=r.targetY,t=r.time>=r.explosionTime;(a||t)&&(r.exploded=!0,this.explodeFirework(r,o),r.active=!1)}if(r.type==="spark"&&(r.opacity-=.015,r.vy+=.15,r.opacity<=0&&(r.active=!1)),r.type==="catherine-wheel"){if(r.rotation+=r.rotationSpeed*(e/16),r.time+=e,r.time>r.duration&&(r.active=!1),r.sparkTimer+=e,r.sparkTimer>=r.sparkInterval){r.sparkTimer=0;const a=2+Math.floor(Math.random()*3);for(let t=0;t<a;t++){const n=Math.random()*Math.PI*2,i=1+Math.random()*3;r.sparks.push({x:0,y:0,vx:Math.cos(n)*i,vy:Math.sin(n)*i,size:1+Math.random()*1.5,opacity:1,life:1,fadeRate:.05+Math.random()*.03,color:this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)]})}}r.sparks=r.sparks.filter(a=>(a.x+=a.vx,a.y+=a.vy,a.life-=a.fadeRate,a.opacity=Math.max(0,a.life),a.life>0))}}},drawEmber(o,e,r){if(!isFinite(e.x)||!isFinite(e.y)||!isFinite(e.size)||!isFinite(e.vx)||!isFinite(e.vy)){console.warn("[Guy Fawkes] Invalid ember particle values, deactivating:",e),e.active=!1;return}if(!e.exploded){if(e.x+=e.vx,e.y+=e.vy,e.vy+=.02,!isFinite(e.x)||!isFinite(e.y)){console.warn("[Guy Fawkes] Ember particle became non-finite after update, deactivating"),e.active=!1;return}if(e.y<=e.targetY){e.exploded=!0;const i=50+Math.floor(Math.random()*40);for(let l=0;l<i;l++){const s=l/i*Math.PI*2,f=2+Math.random()*5,h=l%5===0;e.explosionParticles.push({x:e.x,y:e.y,vx:Math.cos(s)*f,vy:Math.sin(s)*f,size:h?2+Math.random()*2:.8+Math.random()*2,color:h?"#ffffff":this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],opacity:1,life:1,trail:[]})}}}const a=e.x,t=e.y,n=e.size;if(o.save(),e.exploded)e.explosionParticles=e.explosionParticles.filter(i=>(i.x+=i.vx,i.y+=i.vy,i.vy+=.05,i.life-=.015,i.opacity=i.life,i.life<=0?!1:(o.globalAlpha=i.opacity,o.fillStyle=i.color,o.shadowColor=i.color,o.shadowBlur=i.size*3,o.beginPath(),o.arc(i.x,i.y,i.size,0,Math.PI*2),o.fill(),!0))),e.explosionParticles.length===0&&(e.active=!1);else{const i=.8+(Math.sin(r*.01+e.glowPhase)+1)*.2;o.globalAlpha=.3,o.strokeStyle=e.trailColor,o.lineWidth=n*.8,o.lineCap="round",o.beginPath(),o.moveTo(a,t),o.lineTo(a-e.vx*5,t-e.vy*5),o.stroke();const l=o.createRadialGradient(a,t,0,a,t,n*4);l.addColorStop(0,e.color),l.addColorStop(.5,`${e.color}80`),l.addColorStop(1,"rgba(255, 69, 0, 0)"),o.globalAlpha=i,o.fillStyle=l,o.fillRect(a-n*4,t-n*4,n*8,n*8),o.globalAlpha=1,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=n*2,o.beginPath(),o.arc(a,t,n,0,Math.PI*2),o.fill()}o.restore()},drawBonfire:R,drawGuyEffigy:c,drawCatherineWheel:I,drawRomanCandle:T,drawSparklerBundle:A,drawFirework(o,e){return G.drawFirework(o,e)},explodeFirework(o,e){const r=60+Math.random()*60,a=this.colors.firework;for(let t=0;t<r;t++){const n=Math.random()*Math.PI*2,i=Math.random()*6+3;e.push({type:"spark",x:o.x,y:o.y,vx:Math.cos(n)*i,vy:Math.sin(n)*i,size:2+Math.random()*2.5,opacity:1,active:!0,static:!1,color:a[Math.floor(Math.random()*a.length)],trail:[]})}},drawMoon(o,e,r){const a=e.x,t=e.y,n=e.size;o.save(),o.globalAlpha=e.opacity,o.translate(a,t);const i=o.createRadialGradient(-n*.2,-n*.2,0,0,0,n);i.addColorStop(0,"#ffb6a0"),i.addColorStop(.5,"#ff8c66"),i.addColorStop(1,"#cc6644"),o.fillStyle=i,o.beginPath(),o.arc(0,0,n,0,Math.PI*2),o.fill(),o.fillStyle="rgba(120, 50, 40, 0.25)",o.beginPath(),o.arc(-n*.3,-n*.2,n*.15,0,Math.PI*2),o.fill(),o.beginPath(),o.arc(n*.25,n*.1,n*.2,0,Math.PI*2),o.fill(),o.beginPath(),o.arc(n*.1,-n*.4,n*.12,0,Math.PI*2),o.fill(),o.strokeStyle="rgba(100, 60, 50, 0.15)",o.lineWidth=n*.08,o.lineCap="round";const l=Math.sin(r*.001+e.glowPhase)*n*.3;for(let h=0;h<3;h++){o.beginPath();const d=-n*.4+h*n*.4;o.moveTo(-n*.8,d+l*(h%2===0?1:-1)),o.bezierCurveTo(-n*.3,d+l*.5,n*.3,d-l*.5,n*.8,d+l*(h%2===0?-1:1)),o.stroke()}const s=.25+Math.sin(r*.0015+e.glowPhase)*.1;o.globalAlpha=s;const f=o.createRadialGradient(0,0,n*.8,0,0,n*2);f.addColorStop(0,"rgba(255, 140, 100, 0.6)"),f.addColorStop(.5,"rgba(255, 100, 80, 0.3)"),f.addColorStop(1,"rgba(255, 80, 60, 0)"),o.fillStyle=f,o.beginPath(),o.arc(0,0,n*2,0,Math.PI*2),o.fill(),o.restore()},drawRocket(o,e,r){if(o.save(),e.exploded)e.explosionParticles=e.explosionParticles.filter(a=>{if(a.x+=a.vx,a.y+=a.vy,a.vy+=a.gravity,a.life-=.012,a.opacity=a.life,a.life<=0)return!1;o.globalAlpha=a.opacity*.6;const t=o.createRadialGradient(a.x,a.y,0,a.x,a.y,a.size*4);return t.addColorStop(0,a.color),t.addColorStop(.5,`${a.color}60`),t.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=t,o.fillRect(a.x-a.size*4,a.y-a.size*4,a.size*8,a.size*8),o.globalAlpha=a.opacity,o.fillStyle=a.color,o.shadowColor=a.color,o.shadowBlur=a.size*3,a.sparkle&&Math.random()<.3&&(o.shadowBlur=a.size*5,o.fillStyle="#ffffff"),o.beginPath(),o.arc(a.x,a.y,a.size,0,Math.PI*2),o.fill(),!0}),e.explosionParticles.length===0&&(e.active=!1);else{if(e.x+=e.vx,e.y+=e.vy,e.rotation+=e.rotationSpeed,e.y<=e.targetY){e.exploded=!0;const f=80+Math.floor(Math.random()*60);e.explosionParticles=[];for(let h=0;h<f;h++){const d=h/f*Math.PI*2,u=2+Math.random()*6,y=h%6===0;e.explosionParticles.push({x:e.x,y:e.y,vx:Math.cos(d)*u,vy:Math.sin(d)*u,size:y?2.5+Math.random()*2:1+Math.random()*2,color:y?"#ffffff":this.colors.firework[Math.floor(Math.random()*this.colors.firework.length)],opacity:1,life:1,gravity:.05,sparkle:Math.random()<.3})}}const a=e.x,t=e.y,n=e.size,i=15;o.globalAlpha=.6;const l=o.createLinearGradient(a,t,a-e.vx*i,t-e.vy*i);l.addColorStop(0,e.color),l.addColorStop(.5,`${e.color}80`),l.addColorStop(1,"rgba(255, 69, 0, 0)"),o.strokeStyle=l,o.lineWidth=n*1.5,o.lineCap="round",o.beginPath(),o.moveTo(a,t),o.lineTo(a-e.vx*i,t-e.vy*i),o.stroke(),o.globalAlpha=.8;const s=o.createRadialGradient(a,t,0,a,t,n*5);s.addColorStop(0,e.color),s.addColorStop(.5,`${e.color}60`),s.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=s,o.fillRect(a-n*5,t-n*5,n*10,n*10),o.globalAlpha=1,o.fillStyle="#ffffff",o.shadowColor=e.color,o.shadowBlur=n*3,o.beginPath(),o.arc(a,t,n*1.2,0,Math.PI*2),o.fill(),o.fillStyle=e.color,o.shadowBlur=n*2,o.beginPath(),o.arc(a,t,n*.8,0,Math.PI*2),o.fill()}o.shadowBlur=0,o.restore()},drawBurst(o,e){const r=e.x,a=e.y,t=e.size;if(o.save(),e.x+=e.vx,e.y+=e.vy,e.vy+=e.gravity,e.life-=e.fadeRate,e.opacity=Math.max(0,e.life),e.life<=0){e.active=!1,o.restore();return}o.globalAlpha=e.opacity*.6;const n=o.createRadialGradient(r,a,0,r,a,t*4);n.addColorStop(0,e.color),n.addColorStop(.5,`${e.color}60`),n.addColorStop(1,"rgba(255, 69, 0, 0)"),o.fillStyle=n,o.fillRect(r-t*4,a-t*4,t*8,t*8),o.globalAlpha=e.opacity,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=t*2,e.sparkle&&Math.random()<.3&&(o.shadowBlur=t*4,o.fillStyle="#ffffff"),o.beginPath(),o.arc(r,a,t,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawTrail(o,e){const r=e.x,a=e.y,t=e.size;if(o.save(),e.x+=e.vx,e.y+=e.vy,e.life-=e.fadeRate,e.opacity=Math.max(0,e.life*.8),e.life<=0){e.active=!1,o.restore();return}o.globalAlpha=e.opacity*.4;const n=o.createRadialGradient(r,a,0,r,a,t*3);n.addColorStop(0,e.color),n.addColorStop(.6,`${e.color}40`),n.addColorStop(1,"rgba(255, 215, 0, 0)"),o.fillStyle=n,o.fillRect(r-t*3,a-t*3,t*6,t*6),o.globalAlpha=e.opacity,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=t*1.5,o.beginPath(),o.arc(r,a,t,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawSpark(o,e){const r=e.x,a=e.y,t=e.size;if(o.save(),e.x+=e.vx,e.y+=e.vy,e.life-=e.fadeRate,e.opacity=Math.max(0,e.life),e.life<=0){e.active=!1,o.restore();return}o.globalAlpha=e.opacity*.5;const n=o.createRadialGradient(r,a,0,r,a,t*3);n.addColorStop(0,e.color),n.addColorStop(.5,`${e.color}60`),n.addColorStop(1,"rgba(255, 215, 0, 0)"),o.fillStyle=n,o.fillRect(r-t*3,a-t*3,t*6,t*6),o.globalAlpha=e.opacity,o.fillStyle=e.color,o.shadowColor=e.color,o.shadowBlur=t*2,o.beginPath(),o.arc(r,a,t*.8,0,Math.PI*2),o.fill(),o.shadowBlur=0,o.restore()},drawGlobalEffects(o,e,r,a){if(this.lightningActive){o.save(),o.globalAlpha=.8+Math.sin(this.lightningTimer*.01)*.2,o.shadowColor=this.lightningColor,o.shadowBlur=20;const t=r*(.4+Math.random()*.2),n=0,i=r*Math.random(),l=a;this.drawLightning(o,t,n,i,l,5+Math.floor(Math.random()*3),50+Math.random()*50,.7,.3,3+Math.random()*2,this.lightningColor),o.restore()}}};
@@ -1 +1 @@
1
- export default{name:"st-andrews",displayName:"St Andrew's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",intensityConfig:{light:{count:50,speedRange:[.5,1.5],sizeRange:[2,4],thistles:4,bagpiperChance:2e-4,twinklingStars:12},medium:{count:100,speedRange:[.6,2],sizeRange:[2,5],thistles:6,bagpiperChance:4e-4,twinklingStars:20},heavy:{count:200,speedRange:[.8,2.5],sizeRange:[3,6],thistles:8,bagpiperChance:6e-4,twinklingStars:30}},particles:["heather-petal","heather","saltire-sparkle"],decorations:["thistle-plant","bagpiper","saltire-flag","tartan-pattern","highland-scene","twinkling-star"],colors:{primary:"#0065BD",secondary:"#FFFFFF",accent:"#8B008B",tartan:["#0065BD","#006400","#8B0000","#FFDD00"]},createHeatherPetal(e,n,l){const s=["#9370DB","#BA55D3","#DA70D6","#DDA0DD","#8B008B"];return{type:"heather-petal",x:-30,y:Math.random()*n,vx:l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0]),size:(l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:s[Math.floor(Math.random()*s.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createThistle(e,n,l){const s=Math.random()<.5,a=s?"#FFFFFF":"#0065BD",o=s?["#FFFFFF","#f0f0f0","#e0e0e0"]:["#0065BD","#1a7dd4","#3399ee"];return{type:"thistle",x:-30,y:Math.random()*n,vx:l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0])*.7,size:l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.7+Math.random()*.3,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,flowerColor:a,petalColors:o,active:!0}},createHeather(e,n,l){const s=Math.random();let a;return s<.5?a="#9370DB":s<.8?a="#BA55D3":a="#DA70D6",{type:"heather",x:-30,y:Math.random()*n,vx:(l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0]))*.6,size:l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:a,sway:Math.random()*Math.PI*2,swaySpeed:.02+Math.random()*.02,bellCount:3+Math.floor(Math.random()*3),active:!0}},createSaltireSparkle(e,n,l){const s=["#0065BD","#FFFFFF"];return{type:"saltire-sparkle",x:-20,y:Math.random()*n,vx:(l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0]))*.8,size:l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:s[Math.floor(Math.random()*s.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,n,l){const s=Math.random();return s<.6?this.createHeatherPetal(e,n,l):s<.8?this.createHeather(e,n,l):s<.95?this.createSaltireSparkle(e,n,l):this.createThistle(e,n,l)},createThistlePlant(e,n,l={}){return{type:"thistle-plant",x:l.x!==void 0?l.x:Math.random()*e,y:l.y!==void 0?l.y:n-40,size:15+Math.random()*10,opacity:.8+Math.random()*.2,swayPhase:Math.random()*Math.PI*2,active:!0,static:!0}},createInitialDecorations(e,n,l){const s=[],a=l.thistles??5;for(let r=0;r<a;r++)s.push(this.createThistlePlant(e,n,{x:80+r/(a-1)*(e-160),y:n-60-Math.random()*30}));s.push({type:"bagpiper",x:150,y:n-60,baseY:n-60,vx:0,size:30+Math.random()*8,opacity:1,time:0,legPhase:0,bagInflate:.5,active:!0,static:!0}),s.push({type:"saltire-flag",x:e-100,y:80,size:60,opacity:1,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0}),s.push({type:"tartan-pattern",x:e*.5,y:n-80,size:80+Math.random()*20,opacity:.9,active:!0,static:!0}),s.push({type:"highland-scene",x:e-200,y:n-150,size:100,opacity:.7,active:!0,static:!0});const o=l.twinklingStars??20;for(let r=0;r<o;r++)s.push(this.createTwinklingStar(e,n));return s},createTwinklingStar(e,n){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(n*.6),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,n,l,s){const a=Math.random();if(a<s.bagpiperChance){if(e.some(r=>r.type==="bagpiper"))return null;const o=Math.random()<.5;return{type:"bagpiper",x:o?-60:n+60,y:l-50,vx:o?.8+Math.random()*.5:-(.8+Math.random()*.5),size:18+Math.random()*8,opacity:.9,time:0,marchPhase:Math.random()*Math.PI*2,active:!0,static:!1}}return a<4e-4&&e.filter(r=>r.type==="saltire-flag").length<2?{type:"saltire-flag",x:Math.random()*n*.6+n*.2,y:50+Math.random()*100,size:40+Math.random()*20,opacity:.8,waveOffset:Math.random()*Math.PI*2,time:0,active:!0,static:!1}:a<.01?this.createSaltireSparkle(n,l,s):null},drawHeatherPetal(e,n,l){const s=n.x,a=n.y,o=n.size,r=Math.sin(l*n.flutterSpeed+n.flutter)*.3;e.save(),e.globalAlpha=n.opacity,e.translate(s,a),e.rotate(n.rotation+r),e.fillStyle=n.color,e.strokeStyle="#6A0DAD",e.lineWidth=o*.08,e.beginPath(),e.moveTo(0,-o*.6),e.bezierCurveTo(o*.4,-o*.5,o*.5,o*.2,o*.3,o*.8),e.lineTo(-o*.3,o*.8),e.bezierCurveTo(-o*.5,o*.2,-o*.4,-o*.5,0,-o*.6),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(106, 13, 173, 0.3)",e.lineWidth=o*.04;for(let t=0;t<4;t++){const i=-o*.5+t*o*.35;e.beginPath(),e.moveTo(-o*.25,i),e.lineTo(o*.25,i),e.stroke()}e.restore()},drawHeather(e,n){const l=n.x,s=n.y,a=n.size,o=Math.sin(n.sway)*a*.4;e.save(),e.globalAlpha=n.opacity,e.translate(l+o,s),e.rotate(n.rotation),e.strokeStyle="#6b5c4d",e.lineWidth=a*.12,e.lineCap="round",e.beginPath(),e.moveTo(0,a*.6),e.lineTo(0,-a*.8),e.stroke();const r=n.bellCount||4;for(let t=0;t<r;t++){const i=-a*.7+t/r*a*1.2,h=a*(.18+Math.random()*.08),d=t%2===0?1:-1;e.save(),e.translate(d*a*.15,i),e.rotate(d*.3);const y=e.createLinearGradient(0,-h,0,h*.3);y.addColorStop(0,n.color),y.addColorStop(.6,n.color),y.addColorStop(1,`${n.color}CC`),e.fillStyle=y,e.beginPath(),e.ellipse(0,0,h*.4,h,0,0,Math.PI*2),e.fill(),e.strokeStyle=`${n.color}AA`,e.lineWidth=h*.1,e.beginPath(),e.ellipse(0,h*.7,h*.35,h*.15,0,0,Math.PI*2),e.stroke(),e.strokeStyle="#8B7355",e.lineWidth=h*.08,e.beginPath(),e.moveTo(0,h*.8),e.lineTo(0,h*1.1),e.stroke(),e.restore()}e.fillStyle="#6b8b6b";for(let t=0;t<3;t++){const i=t/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(i),e.beginPath(),e.ellipse(0,a*.5,a*.1,a*.25,0,0,Math.PI*2),e.fill(),e.restore()}e.restore()},drawThistle(e,n){const l=n.x,s=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(l,s),e.rotate(n.rotation),e.strokeStyle="#5a704a",e.lineWidth=a*.1,e.lineCap="round",e.beginPath(),e.moveTo(0,a*2),e.quadraticCurveTo(a*.1,a*1.2,0,a*.5),e.stroke();const o=16;e.strokeStyle="#4a7a3a",e.fillStyle="#5a8a4a",e.lineWidth=a*.06,e.lineCap="round";for(let i=0;i<o;i++){const h=i/o*Math.PI*2,d=a*(.35+Math.random()*.15),y=h+(Math.random()-.5)*.3;e.save(),e.rotate(h),e.beginPath(),e.moveTo(0,-a*.2);const M=a*.15,f=-a*.3,m=Math.sin(.4)*d,p=-Math.cos(.4)*d-a*.2;e.quadraticCurveTo(M,f,m,p),e.stroke();for(let S=0;S<3;S++){const b=(S+1)/4,g=b*m,P=-a*.2+b*(p+a*.2);e.beginPath(),e.moveTo(g,P),e.lineTo(g+a*.08,P-a*.06),e.stroke()}e.restore()}e.fillStyle="#6a8a5a",e.beginPath(),e.ellipse(0,-a*.15,a*.28,a*.35,0,0,Math.PI*2),e.fill();const r=3,t=n.petalColors||["#9b59b6","#b980d1","#d4a5e3"];for(let i=0;i<r;i++){const h=a*(.25+i*.08),d=8+i*4,y=t[i];e.fillStyle=y;for(let M=0;M<d;M++){const f=M/d*Math.PI*2+i*.15,m=Math.cos(f)*h,p=Math.sin(f)*h-a*.15;e.save(),e.translate(m,p),e.rotate(f),e.beginPath(),e.moveTo(0,0),e.lineTo(0,-a*(.2+i*.05)),e.lineWidth=a*.02,e.strokeStyle=y,e.stroke(),e.restore()}}e.fillStyle="#4a6a3a",e.strokeStyle="#3a5a2a",e.lineWidth=1;for(let i=0;i<2;i++){const h=a*(.8+i*.6),d=i%2===0?1:-1;e.save(),e.translate(0,h),e.beginPath(),e.moveTo(0,0);const y=5,M=a*.15;for(let f=0;f<=y;f++){const m=f/y,p=a*.25*Math.sin(m*Math.PI);f<y?(e.lineTo(d*p*.3,-M*m),e.lineTo(d*(p+a*.08),-M*(m+.05)),e.lineTo(d*p*.7,-M*(m+.1))):e.lineTo(0,-M)}e.quadraticCurveTo(d*a*.05,-M*.5,0,0),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#2a4a1a",e.lineWidth=.5,e.beginPath(),e.moveTo(0,0),e.lineTo(0,-M),e.stroke(),e.restore()}e.restore()},drawThistlePlant(e,n,l){const s=n.x,a=n.y,o=n.size,r=Math.sin(l*.001+n.swayPhase)*.1;e.save(),e.globalAlpha=n.opacity,e.translate(s,a),e.rotate(r);for(let t=0;t<3;t++){const i=(t-1)*o*.4,h=o*(1.5+t*.3);e.strokeStyle="#8B4513",e.lineWidth=o*.1,e.beginPath(),e.moveTo(i,0),e.quadraticCurveTo(i+r*o,-h*.5,i,-h),e.stroke(),e.fillStyle="#8B008B",e.beginPath(),e.arc(i,-h,o*.4,0,Math.PI*2),e.fill();const d=8;e.strokeStyle="#8B008B",e.lineWidth=o*.05;for(let y=0;y<d;y++){const M=y/d*Math.PI*2;e.beginPath(),e.moveTo(i,-h),e.lineTo(i+Math.cos(M)*o*.6,-h+Math.sin(M)*o*.6),e.stroke()}}e.restore()},drawBagpiper(e,n,l){const s=n.x,a=n.y,o=n.size,r=n.vx>0?1:-1;e.save(),e.translate(s,a),r===-1&&e.scale(-1,1);const t=Math.sin(l*.015+n.marchPhase)*(Math.PI/6);e.strokeStyle="#000080",e.lineWidth=o*.15,e.beginPath(),e.moveTo(-o*.2,o*.6),e.lineTo(-o*.3,o*1.4+Math.sin(t)*o*.15),e.stroke(),e.beginPath(),e.moveTo(o*.2,o*.6),e.lineTo(o*.3,o*1.4+Math.sin(t+Math.PI)*o*.15),e.stroke(),e.fillStyle="#000080",e.fillRect(-o*.45,o*.2,o*.9,o*.5),e.fillStyle="#8B4513",e.fillRect(-o*.25,o*.5,o*.5,o*.25),e.fillStyle="#8B0000",e.fillRect(-o*.4,-o*.2,o*.8,o*.5),e.strokeStyle="#FFD7BA",e.lineWidth=o*.12,e.beginPath(),e.moveTo(-o*.3,0),e.lineTo(-o*.6,o*.3),e.stroke(),e.beginPath(),e.moveTo(o*.3,0),e.lineTo(o*.7,o*.2),e.stroke(),e.fillStyle="#654321",e.beginPath(),e.ellipse(o*.1,o*.25,o*.35,o*.25,0,0,Math.PI*2),e.fill(),e.strokeStyle="#654321",e.lineWidth=o*.08,e.beginPath(),e.moveTo(o*.15,o*.05),e.lineTo(o*.15,-o*.7),e.stroke(),e.beginPath(),e.moveTo(o*.3,o*.1),e.lineTo(o*.3,-o*.6),e.stroke(),e.beginPath(),e.moveTo(o*.55,o*.2),e.lineTo(o*.65,o*.7),e.stroke(),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(0,-o*.45,o*.35,0,Math.PI*2),e.fill(),e.fillStyle="#000080",e.fillRect(-o*.4,-o*.8,o*.8,o*.15),e.beginPath(),e.moveTo(-o*.35,-o*.8),e.lineTo(0,-o*1.1),e.lineTo(o*.35,-o*.8),e.closePath(),e.fill(),e.strokeStyle="#ff0000",e.lineWidth=2,e.beginPath(),e.moveTo(0,-o*1.1),e.quadraticCurveTo(o*.2,-o*1.3,o*.3,-o*1.4),e.stroke(),e.restore()},drawSaltireFlag(e,n,l){const s=n.x,a=n.y,o=n.size,r=l*.002+n.waveOffset;e.save(),e.globalAlpha=n.opacity,e.translate(s,a),e.fillStyle="#654321",e.fillRect(-o*.05,0,o*.1,o*1.5);const t=10,i=o*1.2,h=o*.8;e.fillStyle="#0065BD";for(let d=0;d<t;d++){const y=i/t,M=d*y,f=(d+1)*y,m=Math.sin(r+d*.3)*o*.1,p=Math.sin(r+(d+1)*.3)*o*.1;e.beginPath(),e.moveTo(M,m),e.lineTo(f,p),e.lineTo(f,h+p),e.lineTo(M,h+m),e.closePath(),e.fill()}e.strokeStyle="#FFFFFF",e.lineWidth=o*.12,e.shadowColor="rgba(255, 255, 255, 0.5)",e.shadowBlur=5;for(let d=0;d<t;d++){const y=i/t,M=d*y,f=(d+1)*y,m=Math.sin(r+d*.3)*o*.1,p=Math.sin(r+(d+1)*.3)*o*.1;e.beginPath(),e.moveTo(M,m),e.lineTo(f,h+p),e.stroke(),e.beginPath(),e.moveTo(M,h+m),e.lineTo(f,p),e.stroke()}e.shadowBlur=0,e.restore()},drawSaltireSparkle(e,n,l){const s=n.x,a=n.y,o=n.size,r=.6+Math.sin(l*.004+n.twinklePhase)*.4;e.save(),e.globalAlpha=n.opacity*r,e.translate(s,a),e.rotate(n.rotation),e.fillStyle=n.color,e.shadowColor=n.color,e.shadowBlur=o*2,e.beginPath(),e.moveTo(0,-o),e.lineTo(o*.3,-o*.3),e.lineTo(o,0),e.lineTo(o*.3,o*.3),e.lineTo(0,o),e.lineTo(-o*.3,o*.3),e.lineTo(-o,0),e.lineTo(-o*.3,-o*.3),e.closePath(),e.fill(),e.restore()},drawTartanPattern(e,n){const l=n.x,s=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(l,s);const o=120,r=document.createElement("canvas");r.width=o,r.height=o;const t=r.getContext("2d"),i="#1a237e",h="#c62828",d="#1b5e20",y="#f9a825",M="#ffffff",f="#000000",m=[[4,h],[2,f],[2,h],[2,f],[4,h],[8,i],[2,f],[2,i],[2,f],[8,i],[2,d],[2,y],[2,d],[8,i],[2,f],[2,i],[2,f],[8,i],[4,h],[2,f],[2,h],[2,f],[4,h]];let p=0;for(let g=0;g<2;g++)for(const[P,T]of m)t.fillStyle=T,t.fillRect(0,p,o,P),p+=P;t.globalCompositeOperation="multiply",t.globalAlpha=.8;let S=0;for(let g=0;g<2;g++)for(const[P,T]of m)t.fillStyle=T,t.fillRect(S,0,P,o),S+=P;t.globalCompositeOperation="lighten",t.globalAlpha=.15,S=0;for(let g=0;g<2;g++)for(const[P,T]of m)(T===y||T===M)&&(t.fillStyle=M,t.fillRect(S,0,P,o)),S+=P;t.globalCompositeOperation="source-over",t.globalAlpha=1;const b=e.createPattern(r,"repeat");e.fillStyle=b,e.fillRect(-a/2,-a/2,a,a),e.strokeStyle="#2a2a2a",e.lineWidth=a*.03,e.strokeRect(-a/2,-a/2,a,a),e.strokeStyle="#e0e0e0",e.lineWidth=a*.015,e.strokeRect(-a/2+a*.04,-a/2+a*.04,a-a*.08,a-a*.08),e.strokeStyle="rgba(255, 255, 255, 0.1)",e.lineWidth=.5;for(let g=-a;g<a;g+=4)e.beginPath(),e.moveTo(-a/2+g,-a/2),e.lineTo(-a/2+g+a,a/2),e.stroke();e.save(),e.translate(-a*.35,-a*.35),e.fillStyle="#c0c0c0",e.strokeStyle="#808080",e.lineWidth=2,e.beginPath(),e.arc(0,0,a*.08,0,Math.PI*2),e.fill(),e.stroke(),e.scale(.06,.06),e.fillStyle="#8B008B",e.strokeStyle="#6A006A",e.lineWidth=2;for(let g=0;g<6;g++){const P=g/6*Math.PI*2;e.beginPath(),e.moveTo(0,0),e.lineTo(Math.cos(P)*a*.4,Math.sin(P)*a*.4),e.stroke()}e.beginPath(),e.arc(0,0,a*.15,0,Math.PI*2),e.fill(),e.restore(),e.restore()},drawHighlandScene(e,n){const l=n.x,s=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(l,s);const o=e.createLinearGradient(0,-a,0,a*.5);o.addColorStop(0,"#4a7ba7"),o.addColorStop(1,"#b0c4de"),e.fillStyle=o,e.fillRect(-a,-a,a*2,a*1.5),e.fillStyle="rgba(80, 100, 130, 0.6)",e.beginPath(),e.moveTo(-a,a*.3),e.lineTo(-a*.6,-a*.3),e.lineTo(-a*.2,a*.1),e.lineTo(a*.2,-a*.5),e.lineTo(a*.6,a*.2),e.lineTo(a,a*.3),e.closePath(),e.fill(),e.fillStyle="rgba(60, 80, 100, 0.8)",e.beginPath(),e.moveTo(-a,a*.4),e.lineTo(-a*.7,a*.1),e.lineTo(-a*.3,-a*.1),e.lineTo(a*.1,-a*.2),e.lineTo(a*.5,a*.15),e.lineTo(a,a*.4),e.closePath(),e.fill(),e.fillStyle="#2a3a4a",e.fillRect(-a*.15,a*.25,a*.3,a*.2),e.fillRect(-a*.2,a*.15,a*.1,a*.15),e.fillRect(a*.1,a*.15,a*.1,a*.15),e.fillRect(-a*.06,a*.05,a*.12,a*.25);for(let t=0;t<5;t++)t%2===0&&e.fillRect(-a*.06+t*a*.06,a*.02,a*.03,a*.03);const r=e.createLinearGradient(0,a*.45,0,a*.6);r.addColorStop(0,"#1e3a5f"),r.addColorStop(1,"#0a1f3d"),e.fillStyle=r,e.fillRect(-a,a*.45,a*2,a*.15),e.globalAlpha=n.opacity*.3,e.fillStyle="#4a6a8a",e.fillRect(-a*.15,a*.48,a*.3,a*.08),e.globalAlpha=n.opacity*.2,e.fillStyle="#d0e0f0",e.fillRect(-a,a*.5,a*2,a*.05),e.restore()},drawTwinklingStar(e,n,l){const s=n.x,a=n.y,o=n.size,r=.5+Math.sin(l*n.twinkleSpeed+n.twinklePhase)*.5,t=`rgba(200, 220, 255, ${r})`,i=`rgba(150, 180, 255, ${r*.4})`;e.save(),e.translate(s,a),e.shadowColor=i,e.shadowBlur=o*3*r,e.fillStyle=t,e.beginPath();for(let h=0;h<4;h++){const d=h*Math.PI/2,y=Math.cos(d)*o,M=Math.sin(d)*o,f=d+Math.PI/4,m=Math.cos(f)*(o*.3),p=Math.sin(f)*(o*.3);h===0?e.moveTo(y,M):e.lineTo(y,M),e.lineTo(m,p)}e.closePath(),e.fill(),e.shadowBlur=o*2*r,e.beginPath(),e.arc(0,0,o*.25,0,Math.PI*2),e.fill(),e.restore()}};
1
+ import{drawBagpiper as T}from"./character-drawing.js";export default{name:"st-andrews",displayName:"St Andrew's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",intensityConfig:{light:{count:50,speedRange:[.5,1.5],sizeRange:[2,4],thistles:4,bagpiperChance:2e-4,twinklingStars:12},medium:{count:100,speedRange:[.6,2],sizeRange:[2,5],thistles:6,bagpiperChance:4e-4,twinklingStars:20},heavy:{count:200,speedRange:[.8,2.5],sizeRange:[3,6],thistles:8,bagpiperChance:6e-4,twinklingStars:30}},particles:["heather-petal","heather","saltire-sparkle"],decorations:["thistle-plant","bagpiper","saltire-flag","tartan-pattern","highland-scene","twinkling-star"],colors:{primary:"#0065BD",secondary:"#FFFFFF",accent:"#8B008B",tartan:["#0065BD","#006400","#8B0000","#FFDD00"]},createHeatherPetal(e,o,n){const l=["#9370DB","#BA55D3","#DA70D6","#DDA0DD","#8B008B"];return{type:"heather-petal",x:-30,y:Math.random()*o,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:(n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:l[Math.floor(Math.random()*l.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createThistle(e,o,n){const l=Math.random()<.5,a=l?"#FFFFFF":"#0065BD",t=l?["#FFFFFF","#f0f0f0","#e0e0e0"]:["#0065BD","#1a7dd4","#3399ee"];return{type:"thistle",x:-30,y:Math.random()*o,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0])*.7,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.7+Math.random()*.3,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,flowerColor:a,petalColors:t,active:!0}},createHeather(e,o,n){const l=Math.random();let a;return l<.5?a="#9370DB":l<.8?a="#BA55D3":a="#DA70D6",{type:"heather",x:-30,y:Math.random()*o,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.6,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:a,sway:Math.random()*Math.PI*2,swaySpeed:.02+Math.random()*.02,bellCount:3+Math.floor(Math.random()*3),active:!0}},createSaltireSparkle(e,o,n){const l=["#0065BD","#FFFFFF"];return{type:"saltire-sparkle",x:-20,y:Math.random()*o,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:l[Math.floor(Math.random()*l.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,o,n){const l=Math.random();return l<.6?this.createHeatherPetal(e,o,n):l<.8?this.createHeather(e,o,n):l<.95?this.createSaltireSparkle(e,o,n):this.createThistle(e,o,n)},createThistlePlant(e,o,n={}){return{type:"thistle-plant",x:n.x!==void 0?n.x:Math.random()*e,y:n.y!==void 0?n.y:o-40,size:15+Math.random()*10,opacity:.8+Math.random()*.2,swayPhase:Math.random()*Math.PI*2,active:!0,static:!0}},createInitialDecorations(e,o,n){const l=[],a=n.thistles??5;for(let h=0;h<a;h++)l.push(this.createThistlePlant(e,o,{x:80+h/(a-1)*(e-160),y:o-60-Math.random()*30}));l.push({type:"bagpiper",x:150,y:o-60,baseY:o-60,vx:0,size:30+Math.random()*8,opacity:1,time:0,legPhase:0,bagInflate:.5,active:!0,static:!0}),l.push({type:"saltire-flag",x:e-100,y:80,size:60,opacity:1,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0}),l.push({type:"tartan-pattern",x:e*.5,y:o-80,size:80+Math.random()*20,opacity:.9,active:!0,static:!0}),l.push({type:"highland-scene",x:e-200,y:o-150,size:100,opacity:.7,active:!0,static:!0});const t=n.twinklingStars??20;for(let h=0;h<t;h++)l.push(this.createTwinklingStar(e,o));return l},createTwinklingStar(e,o){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(o*.6),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,o,n,l){const a=Math.random();if(a<l.bagpiperChance){if(e.some(h=>h.type==="bagpiper"))return null;const t=Math.random()<.5;return{type:"bagpiper",x:t?-60:o+60,y:n-50,vx:t?.8+Math.random()*.5:-(.8+Math.random()*.5),size:18+Math.random()*8,opacity:.9,time:0,marchPhase:Math.random()*Math.PI*2,active:!0,static:!1}}return a<4e-4&&e.filter(h=>h.type==="saltire-flag").length<2?{type:"saltire-flag",x:Math.random()*o*.6+o*.2,y:50+Math.random()*100,size:40+Math.random()*20,opacity:.8,waveOffset:Math.random()*Math.PI*2,time:0,active:!0,static:!1}:a<.01?this.createSaltireSparkle(o,n,l):null},drawHeatherPetal(e,o,n){const l=o.x,a=o.y,t=o.size,h=Math.sin(n*o.flutterSpeed+o.flutter)*.3;e.save(),e.globalAlpha=o.opacity,e.translate(l,a),e.rotate(o.rotation+h),e.fillStyle=o.color,e.strokeStyle="#6A0DAD",e.lineWidth=t*.08,e.beginPath(),e.moveTo(0,-t*.6),e.bezierCurveTo(t*.4,-t*.5,t*.5,t*.2,t*.3,t*.8),e.lineTo(-t*.3,t*.8),e.bezierCurveTo(-t*.5,t*.2,-t*.4,-t*.5,0,-t*.6),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(106, 13, 173, 0.3)",e.lineWidth=t*.04;for(let s=0;s<4;s++){const r=-t*.5+s*t*.35;e.beginPath(),e.moveTo(-t*.25,r),e.lineTo(t*.25,r),e.stroke()}e.restore()},drawHeather(e,o){const n=o.x,l=o.y,a=o.size,t=Math.sin(o.sway)*a*.4;e.save(),e.globalAlpha=o.opacity,e.translate(n+t,l),e.rotate(o.rotation),e.strokeStyle="#6b5c4d",e.lineWidth=a*.12,e.lineCap="round",e.beginPath(),e.moveTo(0,a*.6),e.lineTo(0,-a*.8),e.stroke();const h=o.bellCount||4;for(let s=0;s<h;s++){const r=-a*.7+s/h*a*1.2,i=a*(.18+Math.random()*.08),d=s%2===0?1:-1;e.save(),e.translate(d*a*.15,r),e.rotate(d*.3);const y=e.createLinearGradient(0,-i,0,i*.3);y.addColorStop(0,o.color),y.addColorStop(.6,o.color),y.addColorStop(1,`${o.color}CC`),e.fillStyle=y,e.beginPath(),e.ellipse(0,0,i*.4,i,0,0,Math.PI*2),e.fill(),e.strokeStyle=`${o.color}AA`,e.lineWidth=i*.1,e.beginPath(),e.ellipse(0,i*.7,i*.35,i*.15,0,0,Math.PI*2),e.stroke(),e.strokeStyle="#8B7355",e.lineWidth=i*.08,e.beginPath(),e.moveTo(0,i*.8),e.lineTo(0,i*1.1),e.stroke(),e.restore()}e.fillStyle="#6b8b6b";for(let s=0;s<3;s++){const r=s/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(r),e.beginPath(),e.ellipse(0,a*.5,a*.1,a*.25,0,0,Math.PI*2),e.fill(),e.restore()}e.restore()},drawThistle(e,o){const n=o.x,l=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,l),e.rotate(o.rotation),e.strokeStyle="#5a704a",e.lineWidth=a*.1,e.lineCap="round",e.beginPath(),e.moveTo(0,a*2),e.quadraticCurveTo(a*.1,a*1.2,0,a*.5),e.stroke();const t=16;e.strokeStyle="#4a7a3a",e.fillStyle="#5a8a4a",e.lineWidth=a*.06,e.lineCap="round";for(let r=0;r<t;r++){const i=r/t*Math.PI*2,d=a*(.35+Math.random()*.15),y=i+(Math.random()-.5)*.3;e.save(),e.rotate(i),e.beginPath(),e.moveTo(0,-a*.2);const f=a*.15,M=-a*.3,m=Math.sin(.4)*d,g=-Math.cos(.4)*d-a*.2;e.quadraticCurveTo(f,M,m,g),e.stroke();for(let P=0;P<3;P++){const b=(P+1)/4,p=b*m,u=-a*.2+b*(g+a*.2);e.beginPath(),e.moveTo(p,u),e.lineTo(p+a*.08,u-a*.06),e.stroke()}e.restore()}e.fillStyle="#6a8a5a",e.beginPath(),e.ellipse(0,-a*.15,a*.28,a*.35,0,0,Math.PI*2),e.fill();const h=3,s=o.petalColors||["#9b59b6","#b980d1","#d4a5e3"];for(let r=0;r<h;r++){const i=a*(.25+r*.08),d=8+r*4,y=s[r];e.fillStyle=y;for(let f=0;f<d;f++){const M=f/d*Math.PI*2+r*.15,m=Math.cos(M)*i,g=Math.sin(M)*i-a*.15;e.save(),e.translate(m,g),e.rotate(M),e.beginPath(),e.moveTo(0,0),e.lineTo(0,-a*(.2+r*.05)),e.lineWidth=a*.02,e.strokeStyle=y,e.stroke(),e.restore()}}e.fillStyle="#4a6a3a",e.strokeStyle="#3a5a2a",e.lineWidth=1;for(let r=0;r<2;r++){const i=a*(.8+r*.6),d=r%2===0?1:-1;e.save(),e.translate(0,i),e.beginPath(),e.moveTo(0,0);const y=5,f=a*.15;for(let M=0;M<=y;M++){const m=M/y,g=a*.25*Math.sin(m*Math.PI);M<y?(e.lineTo(d*g*.3,-f*m),e.lineTo(d*(g+a*.08),-f*(m+.05)),e.lineTo(d*g*.7,-f*(m+.1))):e.lineTo(0,-f)}e.quadraticCurveTo(d*a*.05,-f*.5,0,0),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#2a4a1a",e.lineWidth=.5,e.beginPath(),e.moveTo(0,0),e.lineTo(0,-f),e.stroke(),e.restore()}e.restore()},drawThistlePlant(e,o,n){const l=o.x,a=o.y,t=o.size,h=Math.sin(n*.001+o.swayPhase)*.1;e.save(),e.globalAlpha=o.opacity,e.translate(l,a),e.rotate(h);for(let s=0;s<3;s++){const r=(s-1)*t*.4,i=t*(1.5+s*.3);e.strokeStyle="#8B4513",e.lineWidth=t*.1,e.beginPath(),e.moveTo(r,0),e.quadraticCurveTo(r+h*t,-i*.5,r,-i),e.stroke(),e.fillStyle="#8B008B",e.beginPath(),e.arc(r,-i,t*.4,0,Math.PI*2),e.fill();const d=8;e.strokeStyle="#8B008B",e.lineWidth=t*.05;for(let y=0;y<d;y++){const f=y/d*Math.PI*2;e.beginPath(),e.moveTo(r,-i),e.lineTo(r+Math.cos(f)*t*.6,-i+Math.sin(f)*t*.6),e.stroke()}}e.restore()},drawBagpiper:T,drawSaltireFlag(e,o,n){const l=o.x,a=o.y,t=o.size,h=n*.002+o.waveOffset;e.save(),e.globalAlpha=o.opacity,e.translate(l,a),e.fillStyle="#654321",e.fillRect(-t*.05,0,t*.1,t*1.5);const s=10,r=t*1.2,i=t*.8;e.fillStyle="#0065BD";for(let d=0;d<s;d++){const y=r/s,f=d*y,M=(d+1)*y,m=Math.sin(h+d*.3)*t*.1,g=Math.sin(h+(d+1)*.3)*t*.1;e.beginPath(),e.moveTo(f,m),e.lineTo(M,g),e.lineTo(M,i+g),e.lineTo(f,i+m),e.closePath(),e.fill()}e.strokeStyle="#FFFFFF",e.lineWidth=t*.12,e.shadowColor="rgba(255, 255, 255, 0.5)",e.shadowBlur=5;for(let d=0;d<s;d++){const y=r/s,f=d*y,M=(d+1)*y,m=Math.sin(h+d*.3)*t*.1,g=Math.sin(h+(d+1)*.3)*t*.1;e.beginPath(),e.moveTo(f,m),e.lineTo(M,i+g),e.stroke(),e.beginPath(),e.moveTo(f,i+m),e.lineTo(M,g),e.stroke()}e.shadowBlur=0,e.restore()},drawSaltireSparkle(e,o,n){const l=o.x,a=o.y,t=o.size,h=.6+Math.sin(n*.004+o.twinklePhase)*.4;e.save(),e.globalAlpha=o.opacity*h,e.translate(l,a),e.rotate(o.rotation),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=t*2,e.beginPath(),e.moveTo(0,-t),e.lineTo(t*.3,-t*.3),e.lineTo(t,0),e.lineTo(t*.3,t*.3),e.lineTo(0,t),e.lineTo(-t*.3,t*.3),e.lineTo(-t,0),e.lineTo(-t*.3,-t*.3),e.closePath(),e.fill(),e.restore()},drawTartanPattern(e,o){const n=o.x,l=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,l);const t=120,h=document.createElement("canvas");h.width=t,h.height=t;const s=h.getContext("2d"),r="#1a237e",i="#c62828",d="#1b5e20",y="#f9a825",f="#ffffff",M="#000000",m=[[4,i],[2,M],[2,i],[2,M],[4,i],[8,r],[2,M],[2,r],[2,M],[8,r],[2,d],[2,y],[2,d],[8,r],[2,M],[2,r],[2,M],[8,r],[4,i],[2,M],[2,i],[2,M],[4,i]];let g=0;for(let p=0;p<2;p++)for(const[u,S]of m)s.fillStyle=S,s.fillRect(0,g,t,u),g+=u;s.globalCompositeOperation="multiply",s.globalAlpha=.8;let P=0;for(let p=0;p<2;p++)for(const[u,S]of m)s.fillStyle=S,s.fillRect(P,0,u,t),P+=u;s.globalCompositeOperation="lighten",s.globalAlpha=.15,P=0;for(let p=0;p<2;p++)for(const[u,S]of m)(S===y||S===f)&&(s.fillStyle=f,s.fillRect(P,0,u,t)),P+=u;s.globalCompositeOperation="source-over",s.globalAlpha=1;const b=e.createPattern(h,"repeat");e.fillStyle=b,e.fillRect(-a/2,-a/2,a,a),e.strokeStyle="#2a2a2a",e.lineWidth=a*.03,e.strokeRect(-a/2,-a/2,a,a),e.strokeStyle="#e0e0e0",e.lineWidth=a*.015,e.strokeRect(-a/2+a*.04,-a/2+a*.04,a-a*.08,a-a*.08),e.strokeStyle="rgba(255, 255, 255, 0.1)",e.lineWidth=.5;for(let p=-a;p<a;p+=4)e.beginPath(),e.moveTo(-a/2+p,-a/2),e.lineTo(-a/2+p+a,a/2),e.stroke();e.save(),e.translate(-a*.35,-a*.35),e.fillStyle="#c0c0c0",e.strokeStyle="#808080",e.lineWidth=2,e.beginPath(),e.arc(0,0,a*.08,0,Math.PI*2),e.fill(),e.stroke(),e.scale(.06,.06),e.fillStyle="#8B008B",e.strokeStyle="#6A006A",e.lineWidth=2;for(let p=0;p<6;p++){const u=p/6*Math.PI*2;e.beginPath(),e.moveTo(0,0),e.lineTo(Math.cos(u)*a*.4,Math.sin(u)*a*.4),e.stroke()}e.beginPath(),e.arc(0,0,a*.15,0,Math.PI*2),e.fill(),e.restore(),e.restore()},drawHighlandScene(e,o){const n=o.x,l=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,l);const t=e.createLinearGradient(0,-a,0,a*.5);t.addColorStop(0,"#4a7ba7"),t.addColorStop(1,"#b0c4de"),e.fillStyle=t,e.fillRect(-a,-a,a*2,a*1.5),e.fillStyle="rgba(80, 100, 130, 0.6)",e.beginPath(),e.moveTo(-a,a*.3),e.lineTo(-a*.6,-a*.3),e.lineTo(-a*.2,a*.1),e.lineTo(a*.2,-a*.5),e.lineTo(a*.6,a*.2),e.lineTo(a,a*.3),e.closePath(),e.fill(),e.fillStyle="rgba(60, 80, 100, 0.8)",e.beginPath(),e.moveTo(-a,a*.4),e.lineTo(-a*.7,a*.1),e.lineTo(-a*.3,-a*.1),e.lineTo(a*.1,-a*.2),e.lineTo(a*.5,a*.15),e.lineTo(a,a*.4),e.closePath(),e.fill(),e.fillStyle="#2a3a4a",e.fillRect(-a*.15,a*.25,a*.3,a*.2),e.fillRect(-a*.2,a*.15,a*.1,a*.15),e.fillRect(a*.1,a*.15,a*.1,a*.15),e.fillRect(-a*.06,a*.05,a*.12,a*.25);for(let s=0;s<5;s++)s%2===0&&e.fillRect(-a*.06+s*a*.06,a*.02,a*.03,a*.03);const h=e.createLinearGradient(0,a*.45,0,a*.6);h.addColorStop(0,"#1e3a5f"),h.addColorStop(1,"#0a1f3d"),e.fillStyle=h,e.fillRect(-a,a*.45,a*2,a*.15),e.globalAlpha=o.opacity*.3,e.fillStyle="#4a6a8a",e.fillRect(-a*.15,a*.48,a*.3,a*.08),e.globalAlpha=o.opacity*.2,e.fillStyle="#d0e0f0",e.fillRect(-a,a*.5,a*2,a*.05),e.restore()},drawTwinklingStar(e,o,n){const l=o.x,a=o.y,t=o.size,h=.5+Math.sin(n*o.twinkleSpeed+o.twinklePhase)*.5,s=`rgba(200, 220, 255, ${h})`,r=`rgba(150, 180, 255, ${h*.4})`;e.save(),e.translate(l,a),e.shadowColor=r,e.shadowBlur=t*3*h,e.fillStyle=s,e.beginPath();for(let i=0;i<4;i++){const d=i*Math.PI/2,y=Math.cos(d)*t,f=Math.sin(d)*t,M=d+Math.PI/4,m=Math.cos(M)*(t*.3),g=Math.sin(M)*(t*.3);i===0?e.moveTo(y,f):e.lineTo(y,f),e.lineTo(m,g)}e.closePath(),e.fill(),e.shadowBlur=t*2*h,e.beginPath(),e.arc(0,0,t*.25,0,Math.PI*2),e.fill(),e.restore()}};
@@ -1 +1 @@
1
- export default{name:"st-davids",displayName:"St David's Day",emoji:"\u{1F33B}",intensityConfig:{light:{count:50,speedRange:[.4,1.2],sizeRange:[2,4],daffodilFields:2,dragonChance:2e-4,twinklingStars:10},medium:{count:100,speedRange:[.5,1.5],sizeRange:[2,5],daffodilFields:3,dragonChance:4e-4,twinklingStars:18},heavy:{count:150,speedRange:[.6,1.8],sizeRange:[3,6],daffodilFields:4,dragonChance:6e-4,twinklingStars:25}},particles:["daffodil-petal","daffodil","spring-sparkle"],decorations:["daffodil-field","welsh-dragon","flag","harp","leek-bundle","twinkling-star"],colors:{primary:"#FFDD00",secondary:"#228B22",accent:"#DC143C",white:"#FFFFFF"},createDaffodilPetal(e,l,i){const r=["#FFDD00","#FFE135","#FFED4E","#FFF68F"];return{type:"daffodil-petal",x:-30,y:Math.random()*l,vx:i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]),size:(i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:r[Math.floor(Math.random()*r.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createDaffodil(e,l,i){return{type:"daffodil",x:-30,y:Math.random()*l,vx:i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]),size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]),speed:.1,opacity:.8+Math.random()*.2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,active:!0}},createLeek(e,l,i){return{type:"leek",x:-30,y:Math.random()*l,vx:(i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]))*.8,size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*1.2,speed:.15,opacity:.7+Math.random()*.3,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.03,active:!0}},createSpringSparkle(e,l,i){const r=["#FFD700","#FFFFFF","#90EE90","#98FB98"];return{type:"spring-sparkle",x:-20,y:Math.random()*l,vx:(i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]))*.8,size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:r[Math.floor(Math.random()*r.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,l,i){const r=Math.random();return r<.6?this.createDaffodilPetal(e,l,i):r<.8?this.createDaffodil(e,l,i):r<.95?this.createSpringSparkle(e,l,i):this.createLeek(e,l,i)},createDaffodilField(e,l,i={}){const r=[],o=15+Math.floor(Math.random()*10);for(let a=0;a<o;a++)r.push({x:Math.random()*e*.3,y:Math.random()*40,size:5+Math.random()*8,swayPhase:Math.random()*Math.PI*2});return{type:"daffodil-field",x:i.x!==void 0?i.x:Math.random()*e*.7,y:i.y!==void 0?i.y:l-50,flowers:r,opacity:.9,time:0,active:!0,static:!0}},createInitialDecorations(e,l,i){const r=[],o=i.daffodilFields??3;for(let n=0;n<o;n++)r.push(this.createDaffodilField(e,l,{x:e/(o+1)*(n+1),y:l-50}));r.push({type:"welsh-dragon",x:150,y:l-80,baseY:l-80,vx:0,size:35+Math.random()*10,opacity:1,time:0,wingPhase:Math.random()*Math.PI*2,breatheFirePhase:Math.random()*Math.PI*2,active:!0,static:!0}),r.push({type:"harp",x:e-200,y:l-90,size:40+Math.random()*10,opacity:1,glintPhase:Math.random()*Math.PI*2,active:!0,static:!0}),r.push({type:"leek-bundle",x:e*.3,y:l-40,size:25+Math.random()*5,opacity:1,active:!0,static:!0}),r.push({type:"flag",x:e-100,y:80,size:50,opacity:1,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0});const a=i.twinklingStars??18;for(let n=0;n<a;n++)r.push(this.createTwinklingStar(e,l));return r},createTwinklingStar(e,l){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(l*.5),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,l,i,r){const o=Math.random();if(o<r.dragonChance){if(e.some(n=>n.type==="welsh-dragon"))return null;const a=Math.random()<.5;return{type:"welsh-dragon",x:a?-100:l+100,y:Math.random()*i*.4+50,baseY:Math.random()*i*.4+50,vx:a?2+Math.random()*1:-(2+Math.random()*1),size:25+Math.random()*15,opacity:1,waveAmplitude:25+Math.random()*20,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,wingPhase:Math.random()*Math.PI*2,breatheFirePhase:Math.random()*Math.PI*2,fireParticles:[],active:!0,static:!1}}return o<4e-4&&e.filter(n=>n.type==="daffodil-field").length<r.daffodilFields?this.createDaffodilField(l,i):null},drawDaffodilPetal(e,l,i){const r=l.x,o=l.y,a=l.size,n=Math.sin(i*l.flutterSpeed+l.flutter)*.3;e.save(),e.globalAlpha=l.opacity,e.translate(r,o),e.rotate(l.rotation+n),e.fillStyle=l.color,e.strokeStyle="#FFB700",e.lineWidth=a*.08,e.beginPath(),e.ellipse(0,0,a*.6,a*1.2,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="rgba(255, 200, 0, 0.4)",e.lineWidth=a*.06,e.beginPath(),e.moveTo(0,-a*1.1),e.lineTo(0,a*1.1),e.stroke(),e.restore()},drawDaffodil(e,l){const i=l.x,r=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(i,r),e.rotate(l.rotation),e.fillStyle="#FFA500",e.strokeStyle="#FF8C00",e.lineWidth=o*.08,e.beginPath(),e.moveTo(-o*.25,0),e.lineTo(-o*.3,o*.3),e.lineTo(o*.3,o*.3),e.lineTo(o*.25,0),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#FFDD00",e.strokeStyle="#FFC700",e.lineWidth=o*.06;for(let a=0;a<6;a++){const n=a/6*Math.PI*2-Math.PI/2;e.save(),e.rotate(n),e.translate(0,-o*.7),e.beginPath(),e.ellipse(0,0,o*.4,o*.6,0,0,Math.PI*2),e.fill(),e.stroke(),e.restore()}e.strokeStyle="#228B22",e.lineWidth=o*.12,e.beginPath(),e.moveTo(0,o*.3),e.lineTo(0,o*1.5),e.stroke(),e.restore()},drawLeek(e,l){const i=l.x,r=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(i,r),e.rotate(l.rotation),e.fillStyle="#F5F5F5",e.strokeStyle="#DCDCDC",e.lineWidth=o*.08,e.beginPath(),e.ellipse(0,o*1.2,o*.4,o*.5,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#228B22",e.strokeStyle="#006400",e.lineWidth=o*.05,e.beginPath(),e.moveTo(-o*.3,o*1.2),e.quadraticCurveTo(-o*.25,o*.5,-o*.15,0),e.quadraticCurveTo(0,-o*.2,o*.15,0),e.quadraticCurveTo(o*.25,o*.5,o*.3,o*1.2),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(-o*.15,0),e.quadraticCurveTo(-o*.6,-o*.3,-o*.8,0),e.stroke(),e.beginPath(),e.moveTo(o*.15,0),e.quadraticCurveTo(o*.6,-o*.3,o*.8,0),e.stroke(),e.strokeStyle="#D2B48C",e.lineWidth=o*.05;for(let a=0;a<5;a++){const n=(a-2)*o*.15;e.beginPath(),e.moveTo(n,o*1.5),e.lineTo(n+Math.sin(a*1.7)*o*.15,o*1.8),e.stroke()}e.restore()},drawSpringSparkle(e,l,i){const r=l.x,o=l.y,a=l.size,n=.6+Math.sin(i*.004+l.twinklePhase)*.4;e.save(),e.globalAlpha=l.opacity*n,e.translate(r,o),e.rotate(l.rotation),e.fillStyle=l.color,e.shadowColor=l.color,e.shadowBlur=a*2,e.beginPath(),e.moveTo(0,-a),e.lineTo(a*.3,-a*.3),e.lineTo(a,0),e.lineTo(a*.3,a*.3),e.lineTo(0,a),e.lineTo(-a*.3,a*.3),e.lineTo(-a,0),e.lineTo(-a*.3,-a*.3),e.closePath(),e.fill(),e.restore()},drawDaffodilField(e,l,i){const r=l.x,o=l.y;e.save(),e.globalAlpha=l.opacity,l.flowers.forEach(a=>{const n=Math.sin(i*.001+a.swayPhase)*a.size*.2;e.save(),e.translate(r+a.x,o-a.y),e.rotate(n*.1),e.strokeStyle="#228B22",e.lineWidth=a.size*.08,e.beginPath(),e.moveTo(0,0),e.lineTo(n,-a.size*2),e.stroke(),e.fillStyle="#FFDD00",e.shadowColor="#FFDD00",e.shadowBlur=a.size*.5,e.beginPath(),e.arc(n,-a.size*2,a.size*.5,0,Math.PI*2),e.fill(),e.shadowBlur=0,e.fillStyle="#FFA500",e.beginPath(),e.arc(n,-a.size*2,a.size*.25,0,Math.PI*2),e.fill(),e.restore()}),e.restore()},drawWelshDragon(e,l,i){const r=l.x,o=l.y,a=l.size,n=l.vx>0?1:-1;e.save(),e.translate(r,o),n===-1&&e.scale(-1,1);const d=Math.sin(i*.012+l.wingPhase)*(Math.PI/3);e.fillStyle="#DC143C",e.strokeStyle="#8B0000",e.lineWidth=2,e.save(),e.translate(-a*.3,-a*.3),e.rotate(-d*.9),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-a*1.2,-a*.8,-a*1.5,-a*.3,-a*1.3,a*.3),e.bezierCurveTo(-a*.8,a*.2,-a*.3,0,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.save(),e.translate(a*.3,-a*.3),e.rotate(d),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(a*1.2,-a*.8,a*1.5,-a*.3,a*1.3,a*.3),e.bezierCurveTo(a*.8,a*.2,a*.3,0,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.fillStyle="#DC143C",e.strokeStyle="#8B0000",e.lineWidth=2,e.beginPath(),e.ellipse(0,0,a*.7,a*.5,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="#DC143C",e.lineWidth=a*.25,e.beginPath(),e.moveTo(-a*.5,0),e.quadraticCurveTo(-a*1.2,-a*.3,-a*1.5,0),e.stroke(),e.fillStyle="#FFD700";for(let s=0;s<3;s++){const h=-a*(.8+s*.25);e.beginPath(),e.moveTo(h-a*.1,-a*.2),e.lineTo(h,-a*.5),e.lineTo(h+a*.1,-a*.2),e.closePath(),e.fill()}if(e.fillStyle="#DC143C",e.beginPath(),e.ellipse(a*.8,-a*.2,a*.4,a*.35,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#DC143C",e.beginPath(),e.moveTo(a*1.1,-a*.2),e.quadraticCurveTo(a*1.4,-a*.15,a*1.3,0),e.quadraticCurveTo(a*1.4,.1,a*1.1,-a*.2),e.closePath(),e.fill(),e.fillStyle="#FFD700",e.beginPath(),e.arc(a*.9,-a*.3,a*.12,0,Math.PI*2),e.fill(),e.fillStyle="#000000",e.beginPath(),e.arc(a*.95,-a*.3,a*.06,0,Math.PI*2),e.fill(),e.strokeStyle="#FFD700",e.lineWidth=a*.1,e.beginPath(),e.moveTo(a*.7,-a*.5),e.lineTo(a*.65,-a*.8),e.stroke(),e.beginPath(),e.moveTo(a*.9,-a*.5),e.lineTo(a*.95,-a*.8),e.stroke(),Math.sin(i*.005+l.breatheFirePhase)>.5){const s=e.createLinearGradient(a*1.3,-a*.1,a*2,-a*.1);s.addColorStop(0,"#FF6600"),s.addColorStop(.5,"#FFA500"),s.addColorStop(1,"rgba(255, 255, 0, 0)"),e.fillStyle=s,e.globalAlpha=.8,e.beginPath(),e.moveTo(a*1.3,-a*.1),e.bezierCurveTo(a*1.6,-a*.3,a*1.8,-a*.2,a*2,-a*.1),e.bezierCurveTo(a*1.8,0,a*1.6,.1,a*1.3,-a*.1),e.closePath(),e.fill()}e.restore()},drawHarp(e,l,i){const r=l.x,o=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(r,o),e.strokeStyle="#8b4513",e.lineWidth=a*.08,e.lineCap="round",e.beginPath(),e.moveTo(-a*.3,a*.5),e.bezierCurveTo(-a*.5,a*.1,-a*.4,-a*.4,-a*.2,-a*.7),e.stroke(),e.beginPath(),e.moveTo(-a*.2,-a*.7),e.lineTo(a*.4,-a*.5),e.stroke(),e.beginPath(),e.moveTo(a*.4,-a*.5),e.lineTo(-a*.3,a*.5),e.stroke(),e.strokeStyle="#FFD700",e.lineWidth=a*.02;const n=12;for(let d=0;d<n;d++){const s=d/(n-1),h=-a*.3+s*a*.65,t=a*.5-s*a*1,f=-a*.25+s*a*.55,P=-a*.65+s*a*.15,T=Math.sin(i*.003+d*.3+l.glintPhase)*a*.02;e.beginPath(),e.moveTo(h+T,t),e.lineTo(f+T,P),e.stroke()}e.strokeStyle="#654321",e.lineWidth=a*.03,e.globalAlpha=.6;for(let d=0;d<4;d++){const s=a*.3-d*a*.25;e.beginPath(),e.arc(-a*.35,s,a*.08,0,Math.PI*2),e.stroke()}e.restore()},drawLeekBundle(e,l){const i=l.x,r=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(i,r);for(let a=0;a<5;a++){e.save();const n=(a-2)*o*.15,d=(a-2)*.1;e.translate(n,0),e.rotate(d),e.fillStyle="#f5f5dc",e.strokeStyle="#d3d3c0",e.lineWidth=1,e.fillRect(-o*.08,o*.2,o*.16,o*.6),e.strokeRect(-o*.08,o*.2,o*.16,o*.6),e.fillStyle="#228B22",e.strokeStyle="#1a6b1a",e.beginPath(),e.moveTo(-o*.08,o*.2),e.lineTo(-o*.12,-o*.5),e.lineTo(0,-o*.7),e.lineTo(o*.12,-o*.5),e.lineTo(o*.08,o*.2),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#1a5a1a",e.lineWidth=.5,e.beginPath(),e.moveTo(0,o*.2),e.lineTo(0,-o*.65),e.stroke(),e.restore()}e.fillStyle="#DC143C",e.fillRect(-o*.5,o*.4,o,o*.12),e.beginPath(),e.ellipse(-o*.6,o*.46,o*.12,o*.08,0,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(o*.6,o*.46,o*.12,o*.08,0,0,Math.PI*2),e.fill(),e.restore()},drawFlag(e,l,i){const r=l.x,o=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(r,o),e.strokeStyle="#654321",e.lineWidth=a*.04,e.beginPath(),e.moveTo(0,0),e.lineTo(0,a*1.5),e.stroke();const n=Math.sin(i*.003+l.wavePhase)*a*.08;e.fillStyle="#FFFFFF",e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(a*.3,0+n*.5,a*.6,0-n*.5,a*.9,0+n),e.lineTo(a*.9,a*.3+n),e.bezierCurveTo(a*.6,a*.3-n*.5,a*.3,a*.3+n*.5,0,a*.3),e.closePath(),e.fill(),e.fillStyle="#00B140",e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(a*.3,a*.3+n*.5,a*.6,a*.3-n*.5,a*.9,a*.3+n),e.lineTo(a*.9,a*.6+n),e.bezierCurveTo(a*.6,a*.6-n*.5,a*.3,a*.6+n*.5,0,a*.6),e.closePath(),e.fill(),e.fillStyle="#DC143C",e.save(),e.translate(a*.45,a*.3),e.scale(.28,.28),e.beginPath(),e.ellipse(a*.1,0,a*.45,a*.3,-.2,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.4,-a*.25,a*.22,a*.15,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(-a*.25,a*.1,a*.35,a*.28,.1,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.65,-a*.28,a*.2,a*.12,0,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(a*.55,-a*.32),e.bezierCurveTo(a*.7,-a*.38,a*.85,-a*.35,a*.88,-a*.28),e.lineTo(a*.82,-a*.25),e.bezierCurveTo(a*.78,-a*.28,a*.65,-a*.3,a*.55,-a*.28),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.58,-a*.24),e.bezierCurveTo(a*.72,-a*.22,a*.84,-a*.24,a*.87,-a*.28),e.lineTo(a*.82,-a*.3),e.bezierCurveTo(a*.75,-a*.27,a*.65,-a*.26,a*.58,-a*.27),e.closePath(),e.fill(),e.fillStyle="#FFFF00",e.beginPath(),e.ellipse(a*.58,-a*.32,a*.04,a*.05,.2,0,Math.PI*2),e.fill(),e.fillStyle="#DC143C",e.beginPath(),e.moveTo(a*.5,-a*.38),e.bezierCurveTo(a*.48,-a*.55,a*.52,-a*.65,a*.58,-a*.68),e.lineTo(a*.62,-a*.64),e.bezierCurveTo(a*.58,-a*.62,a*.54,-a*.52,a*.54,-a*.38),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.48,-a*.4),e.bezierCurveTo(a*.42,-a*.58,a*.38,-a*.68,a*.35,-a*.72),e.lineTo(a*.38,-a*.74),e.bezierCurveTo(a*.42,-a*.7,a*.46,-a*.58,a*.5,-a*.42),e.closePath(),e.fill(),e.globalAlpha=.9,e.beginPath(),e.moveTo(-a*.1,-a*.15),e.bezierCurveTo(-a*.3,-a*.5,-a*.35,-a*.75,-a*.25,-a*.85),e.lineTo(-a*.22,-a*.82),e.bezierCurveTo(-a*.1,-a*.85,0,-a*.9,a*.1,-a*.88),e.lineTo(a*.12,-a*.84),e.bezierCurveTo(a*.2,-a*.8,a*.28,-a*.72,a*.3,-a*.62),e.lineTo(a*.25,-a*.58),e.bezierCurveTo(a*.22,-a*.5,a*.18,-a*.35,a*.1,-a*.25),e.lineTo(0,-a*.2),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.15,-a*.2),e.bezierCurveTo(a*.3,-a*.55,a*.45,-a*.78,a*.6,-a*.82),e.lineTo(a*.62,-a*.78),e.bezierCurveTo(a*.7,-a*.75,a*.8,-a*.68,a*.85,-a*.58),e.lineTo(a*.82,-a*.54),e.bezierCurveTo(a*.75,-a*.52,a*.68,-a*.45,a*.6,-a*.38),e.lineTo(a*.55,-a*.35),e.bezierCurveTo(a*.45,-a*.3,a*.32,-a*.25,a*.2,-a*.22),e.closePath(),e.fill(),e.globalAlpha=1,e.beginPath(),e.ellipse(a*.25,a*.15,a*.12,a*.25,.5,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(a*.32,a*.35),e.lineTo(a*.38,a*.55),e.lineTo(a*.42,a*.57),e.lineTo(a*.36,a*.37),e.closePath(),e.fill();for(let s=0;s<3;s++){e.beginPath();const h=a*.36+s*a*.04;e.moveTo(h,a*.55),e.lineTo(h+a*.02,a*.63),e.lineTo(h+a*.04,a*.55),e.closePath(),e.fill()}e.globalAlpha=.85,e.beginPath(),e.ellipse(a*.15,a*.12,a*.1,a*.22,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(a*.18,a*.3),e.lineTo(a*.2,a*.48),e.lineTo(a*.24,a*.5),e.lineTo(a*.22,a*.32),e.closePath(),e.fill(),e.globalAlpha=1,e.beginPath(),e.ellipse(-a*.15,a*.25,a*.15,a*.28,.8,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(-a*.08,a*.48),e.lineTo(-a*.02,a*.65),e.lineTo(a*.02,a*.67),e.lineTo(-a*.04,a*.5),e.closePath(),e.fill();for(let s=0;s<3;s++){e.beginPath();const h=-a*.04+s*a*.04;e.moveTo(h,a*.65),e.lineTo(h+a*.02,a*.72),e.lineTo(h+a*.04,a*.65),e.closePath(),e.fill()}e.globalAlpha=.85,e.beginPath(),e.ellipse(-a*.28,a*.22,a*.13,a*.25,.6,0,Math.PI*2),e.fill(),e.globalAlpha=1,e.beginPath(),e.moveTo(-a*.5,a*.05),e.bezierCurveTo(-a*.75,a*.15,-a*.95,0,-a*1.05,-a*.3),e.bezierCurveTo(-a*1.1,-a*.45,-a*1.05,-a*.6,-a*.95,-a*.68),e.lineTo(-a*.88,-a*.72),e.lineTo(-a*.92,-a*.65),e.bezierCurveTo(-a*1,-a*.56,-a*1.02,-a*.42,-a*.98,-a*.28),e.bezierCurveTo(-a*.88,0,-a*.68,a*.1,-a*.48,a*.08),e.closePath(),e.fill();const d=5;for(let s=0;s<d;s++){const h=s/(d-1),t=-a*.6-h*a*.4,f=a*.1-h*a*.7+Math.sin(h*Math.PI)*a*.15,P=a*.12*(1-h*.5);e.beginPath(),e.moveTo(t,f),e.lineTo(t-P*.3,f-P),e.lineTo(t+P*.3,f-P*.8),e.closePath(),e.fill()}e.restore(),e.restore()},drawTwinklingStar(e,l,i){const r=l.x,o=l.y,a=l.size,n=.5+Math.sin(i*l.twinkleSpeed+l.twinklePhase)*.5,d=`rgba(255, 240, 200, ${n})`,s=`rgba(255, 220, 150, ${n*.4})`;e.save(),e.translate(r,o),e.shadowColor=s,e.shadowBlur=a*3*n,e.fillStyle=d,e.beginPath();for(let h=0;h<4;h++){const t=h*Math.PI/2,f=Math.cos(t)*a,P=Math.sin(t)*a,T=t+Math.PI/4,M=Math.cos(T)*(a*.3),y=Math.sin(T)*(a*.3);h===0?e.moveTo(f,P):e.lineTo(f,P),e.lineTo(M,y)}e.closePath(),e.fill(),e.shadowBlur=a*2*n,e.beginPath(),e.arc(0,0,a*.25,0,Math.PI*2),e.fill(),e.restore()}};
1
+ import{drawWelshDragon as y}from"./character-drawing.js";export default{name:"st-davids",displayName:"St David's Day",emoji:"\u{1F33B}",intensityConfig:{light:{count:50,speedRange:[.4,1.2],sizeRange:[2,4],daffodilFields:2,dragonChance:2e-4,twinklingStars:10},medium:{count:100,speedRange:[.5,1.5],sizeRange:[2,5],daffodilFields:3,dragonChance:4e-4,twinklingStars:18},heavy:{count:150,speedRange:[.6,1.8],sizeRange:[3,6],daffodilFields:4,dragonChance:6e-4,twinklingStars:25}},particles:["daffodil-petal","daffodil","spring-sparkle"],decorations:["daffodil-field","welsh-dragon","flag","harp","leek-bundle","twinkling-star"],colors:{primary:"#FFDD00",secondary:"#228B22",accent:"#DC143C",white:"#FFFFFF"},createDaffodilPetal(e,l,i){const r=["#FFDD00","#FFE135","#FFED4E","#FFF68F"];return{type:"daffodil-petal",x:-30,y:Math.random()*l,vx:i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]),size:(i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:r[Math.floor(Math.random()*r.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createDaffodil(e,l,i){return{type:"daffodil",x:-30,y:Math.random()*l,vx:i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]),size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]),speed:.1,opacity:.8+Math.random()*.2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,active:!0}},createLeek(e,l,i){return{type:"leek",x:-30,y:Math.random()*l,vx:(i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]))*.8,size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*1.2,speed:.15,opacity:.7+Math.random()*.3,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.03,active:!0}},createSpringSparkle(e,l,i){const r=["#FFD700","#FFFFFF","#90EE90","#98FB98"];return{type:"spring-sparkle",x:-20,y:Math.random()*l,vx:(i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0]))*.8,size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:r[Math.floor(Math.random()*r.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,l,i){const r=Math.random();return r<.6?this.createDaffodilPetal(e,l,i):r<.8?this.createDaffodil(e,l,i):r<.95?this.createSpringSparkle(e,l,i):this.createLeek(e,l,i)},createDaffodilField(e,l,i={}){const r=[],o=15+Math.floor(Math.random()*10);for(let a=0;a<o;a++)r.push({x:Math.random()*e*.3,y:Math.random()*40,size:5+Math.random()*8,swayPhase:Math.random()*Math.PI*2});return{type:"daffodil-field",x:i.x!==void 0?i.x:Math.random()*e*.7,y:i.y!==void 0?i.y:l-50,flowers:r,opacity:.9,time:0,active:!0,static:!0}},createInitialDecorations(e,l,i){const r=[],o=i.daffodilFields??3;for(let n=0;n<o;n++)r.push(this.createDaffodilField(e,l,{x:e/(o+1)*(n+1),y:l-50}));r.push({type:"welsh-dragon",x:150,y:l-80,baseY:l-80,vx:0,size:35+Math.random()*10,opacity:1,time:0,wingPhase:Math.random()*Math.PI*2,breatheFirePhase:Math.random()*Math.PI*2,active:!0,static:!0}),r.push({type:"harp",x:e-200,y:l-90,size:40+Math.random()*10,opacity:1,glintPhase:Math.random()*Math.PI*2,active:!0,static:!0}),r.push({type:"leek-bundle",x:e*.3,y:l-40,size:25+Math.random()*5,opacity:1,active:!0,static:!0}),r.push({type:"flag",x:e-100,y:80,size:50,opacity:1,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0});const a=i.twinklingStars??18;for(let n=0;n<a;n++)r.push(this.createTwinklingStar(e,l));return r},createTwinklingStar(e,l){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(l*.5),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,l,i,r){const o=Math.random();if(o<r.dragonChance){if(e.some(n=>n.type==="welsh-dragon"))return null;const a=Math.random()<.5;return{type:"welsh-dragon",x:a?-100:l+100,y:Math.random()*i*.4+50,baseY:Math.random()*i*.4+50,vx:a?2+Math.random()*1:-(2+Math.random()*1),size:25+Math.random()*15,opacity:1,waveAmplitude:25+Math.random()*20,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,wingPhase:Math.random()*Math.PI*2,breatheFirePhase:Math.random()*Math.PI*2,fireParticles:[],active:!0,static:!1}}return o<4e-4&&e.filter(n=>n.type==="daffodil-field").length<r.daffodilFields?this.createDaffodilField(l,i):null},drawDaffodilPetal(e,l,i){const r=l.x,o=l.y,a=l.size,n=Math.sin(i*l.flutterSpeed+l.flutter)*.3;e.save(),e.globalAlpha=l.opacity,e.translate(r,o),e.rotate(l.rotation+n),e.fillStyle=l.color,e.strokeStyle="#FFB700",e.lineWidth=a*.08,e.beginPath(),e.ellipse(0,0,a*.6,a*1.2,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="rgba(255, 200, 0, 0.4)",e.lineWidth=a*.06,e.beginPath(),e.moveTo(0,-a*1.1),e.lineTo(0,a*1.1),e.stroke(),e.restore()},drawDaffodil(e,l){const i=l.x,r=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(i,r),e.rotate(l.rotation),e.fillStyle="#FFA500",e.strokeStyle="#FF8C00",e.lineWidth=o*.08,e.beginPath(),e.moveTo(-o*.25,0),e.lineTo(-o*.3,o*.3),e.lineTo(o*.3,o*.3),e.lineTo(o*.25,0),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#FFDD00",e.strokeStyle="#FFC700",e.lineWidth=o*.06;for(let a=0;a<6;a++){const n=a/6*Math.PI*2-Math.PI/2;e.save(),e.rotate(n),e.translate(0,-o*.7),e.beginPath(),e.ellipse(0,0,o*.4,o*.6,0,0,Math.PI*2),e.fill(),e.stroke(),e.restore()}e.strokeStyle="#228B22",e.lineWidth=o*.12,e.beginPath(),e.moveTo(0,o*.3),e.lineTo(0,o*1.5),e.stroke(),e.restore()},drawLeek(e,l){const i=l.x,r=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(i,r),e.rotate(l.rotation),e.fillStyle="#F5F5F5",e.strokeStyle="#DCDCDC",e.lineWidth=o*.08,e.beginPath(),e.ellipse(0,o*1.2,o*.4,o*.5,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#228B22",e.strokeStyle="#006400",e.lineWidth=o*.05,e.beginPath(),e.moveTo(-o*.3,o*1.2),e.quadraticCurveTo(-o*.25,o*.5,-o*.15,0),e.quadraticCurveTo(0,-o*.2,o*.15,0),e.quadraticCurveTo(o*.25,o*.5,o*.3,o*1.2),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(-o*.15,0),e.quadraticCurveTo(-o*.6,-o*.3,-o*.8,0),e.stroke(),e.beginPath(),e.moveTo(o*.15,0),e.quadraticCurveTo(o*.6,-o*.3,o*.8,0),e.stroke(),e.strokeStyle="#D2B48C",e.lineWidth=o*.05;for(let a=0;a<5;a++){const n=(a-2)*o*.15;e.beginPath(),e.moveTo(n,o*1.5),e.lineTo(n+Math.sin(a*1.7)*o*.15,o*1.8),e.stroke()}e.restore()},drawSpringSparkle(e,l,i){const r=l.x,o=l.y,a=l.size,n=.6+Math.sin(i*.004+l.twinklePhase)*.4;e.save(),e.globalAlpha=l.opacity*n,e.translate(r,o),e.rotate(l.rotation),e.fillStyle=l.color,e.shadowColor=l.color,e.shadowBlur=a*2,e.beginPath(),e.moveTo(0,-a),e.lineTo(a*.3,-a*.3),e.lineTo(a,0),e.lineTo(a*.3,a*.3),e.lineTo(0,a),e.lineTo(-a*.3,a*.3),e.lineTo(-a,0),e.lineTo(-a*.3,-a*.3),e.closePath(),e.fill(),e.restore()},drawDaffodilField(e,l,i){const r=l.x,o=l.y;e.save(),e.globalAlpha=l.opacity,l.flowers.forEach(a=>{const n=Math.sin(i*.001+a.swayPhase)*a.size*.2;e.save(),e.translate(r+a.x,o-a.y),e.rotate(n*.1),e.strokeStyle="#228B22",e.lineWidth=a.size*.08,e.beginPath(),e.moveTo(0,0),e.lineTo(n,-a.size*2),e.stroke(),e.fillStyle="#FFDD00",e.shadowColor="#FFDD00",e.shadowBlur=a.size*.5,e.beginPath(),e.arc(n,-a.size*2,a.size*.5,0,Math.PI*2),e.fill(),e.shadowBlur=0,e.fillStyle="#FFA500",e.beginPath(),e.arc(n,-a.size*2,a.size*.25,0,Math.PI*2),e.fill(),e.restore()}),e.restore()},drawWelshDragon:y,drawHarp(e,l,i){const r=l.x,o=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(r,o),e.strokeStyle="#8b4513",e.lineWidth=a*.08,e.lineCap="round",e.beginPath(),e.moveTo(-a*.3,a*.5),e.bezierCurveTo(-a*.5,a*.1,-a*.4,-a*.4,-a*.2,-a*.7),e.stroke(),e.beginPath(),e.moveTo(-a*.2,-a*.7),e.lineTo(a*.4,-a*.5),e.stroke(),e.beginPath(),e.moveTo(a*.4,-a*.5),e.lineTo(-a*.3,a*.5),e.stroke(),e.strokeStyle="#FFD700",e.lineWidth=a*.02;const n=12;for(let t=0;t<n;t++){const s=t/(n-1),h=-a*.3+s*a*.65,d=a*.5-s*a*1,P=-a*.25+s*a*.55,f=-a*.65+s*a*.15,M=Math.sin(i*.003+t*.3+l.glintPhase)*a*.02;e.beginPath(),e.moveTo(h+M,d),e.lineTo(P+M,f),e.stroke()}e.strokeStyle="#654321",e.lineWidth=a*.03,e.globalAlpha=.6;for(let t=0;t<4;t++){const s=a*.3-t*a*.25;e.beginPath(),e.arc(-a*.35,s,a*.08,0,Math.PI*2),e.stroke()}e.restore()},drawLeekBundle(e,l){const i=l.x,r=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(i,r);for(let a=0;a<5;a++){e.save();const n=(a-2)*o*.15,t=(a-2)*.1;e.translate(n,0),e.rotate(t),e.fillStyle="#f5f5dc",e.strokeStyle="#d3d3c0",e.lineWidth=1,e.fillRect(-o*.08,o*.2,o*.16,o*.6),e.strokeRect(-o*.08,o*.2,o*.16,o*.6),e.fillStyle="#228B22",e.strokeStyle="#1a6b1a",e.beginPath(),e.moveTo(-o*.08,o*.2),e.lineTo(-o*.12,-o*.5),e.lineTo(0,-o*.7),e.lineTo(o*.12,-o*.5),e.lineTo(o*.08,o*.2),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#1a5a1a",e.lineWidth=.5,e.beginPath(),e.moveTo(0,o*.2),e.lineTo(0,-o*.65),e.stroke(),e.restore()}e.fillStyle="#DC143C",e.fillRect(-o*.5,o*.4,o,o*.12),e.beginPath(),e.ellipse(-o*.6,o*.46,o*.12,o*.08,0,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(o*.6,o*.46,o*.12,o*.08,0,0,Math.PI*2),e.fill(),e.restore()},drawFlag(e,l,i){const r=l.x,o=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(r,o),e.strokeStyle="#654321",e.lineWidth=a*.04,e.beginPath(),e.moveTo(0,0),e.lineTo(0,a*1.5),e.stroke();const n=Math.sin(i*.003+l.wavePhase)*a*.08;e.fillStyle="#FFFFFF",e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(a*.3,0+n*.5,a*.6,0-n*.5,a*.9,0+n),e.lineTo(a*.9,a*.3+n),e.bezierCurveTo(a*.6,a*.3-n*.5,a*.3,a*.3+n*.5,0,a*.3),e.closePath(),e.fill(),e.fillStyle="#00B140",e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(a*.3,a*.3+n*.5,a*.6,a*.3-n*.5,a*.9,a*.3+n),e.lineTo(a*.9,a*.6+n),e.bezierCurveTo(a*.6,a*.6-n*.5,a*.3,a*.6+n*.5,0,a*.6),e.closePath(),e.fill(),e.fillStyle="#DC143C",e.save(),e.translate(a*.45,a*.3),e.scale(.28,.28),e.beginPath(),e.ellipse(a*.1,0,a*.45,a*.3,-.2,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.4,-a*.25,a*.22,a*.15,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(-a*.25,a*.1,a*.35,a*.28,.1,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.65,-a*.28,a*.2,a*.12,0,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(a*.55,-a*.32),e.bezierCurveTo(a*.7,-a*.38,a*.85,-a*.35,a*.88,-a*.28),e.lineTo(a*.82,-a*.25),e.bezierCurveTo(a*.78,-a*.28,a*.65,-a*.3,a*.55,-a*.28),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.58,-a*.24),e.bezierCurveTo(a*.72,-a*.22,a*.84,-a*.24,a*.87,-a*.28),e.lineTo(a*.82,-a*.3),e.bezierCurveTo(a*.75,-a*.27,a*.65,-a*.26,a*.58,-a*.27),e.closePath(),e.fill(),e.fillStyle="#FFFF00",e.beginPath(),e.ellipse(a*.58,-a*.32,a*.04,a*.05,.2,0,Math.PI*2),e.fill(),e.fillStyle="#DC143C",e.beginPath(),e.moveTo(a*.5,-a*.38),e.bezierCurveTo(a*.48,-a*.55,a*.52,-a*.65,a*.58,-a*.68),e.lineTo(a*.62,-a*.64),e.bezierCurveTo(a*.58,-a*.62,a*.54,-a*.52,a*.54,-a*.38),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.48,-a*.4),e.bezierCurveTo(a*.42,-a*.58,a*.38,-a*.68,a*.35,-a*.72),e.lineTo(a*.38,-a*.74),e.bezierCurveTo(a*.42,-a*.7,a*.46,-a*.58,a*.5,-a*.42),e.closePath(),e.fill(),e.globalAlpha=.9,e.beginPath(),e.moveTo(-a*.1,-a*.15),e.bezierCurveTo(-a*.3,-a*.5,-a*.35,-a*.75,-a*.25,-a*.85),e.lineTo(-a*.22,-a*.82),e.bezierCurveTo(-a*.1,-a*.85,0,-a*.9,a*.1,-a*.88),e.lineTo(a*.12,-a*.84),e.bezierCurveTo(a*.2,-a*.8,a*.28,-a*.72,a*.3,-a*.62),e.lineTo(a*.25,-a*.58),e.bezierCurveTo(a*.22,-a*.5,a*.18,-a*.35,a*.1,-a*.25),e.lineTo(0,-a*.2),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.15,-a*.2),e.bezierCurveTo(a*.3,-a*.55,a*.45,-a*.78,a*.6,-a*.82),e.lineTo(a*.62,-a*.78),e.bezierCurveTo(a*.7,-a*.75,a*.8,-a*.68,a*.85,-a*.58),e.lineTo(a*.82,-a*.54),e.bezierCurveTo(a*.75,-a*.52,a*.68,-a*.45,a*.6,-a*.38),e.lineTo(a*.55,-a*.35),e.bezierCurveTo(a*.45,-a*.3,a*.32,-a*.25,a*.2,-a*.22),e.closePath(),e.fill(),e.globalAlpha=1,e.beginPath(),e.ellipse(a*.25,a*.15,a*.12,a*.25,.5,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(a*.32,a*.35),e.lineTo(a*.38,a*.55),e.lineTo(a*.42,a*.57),e.lineTo(a*.36,a*.37),e.closePath(),e.fill();for(let s=0;s<3;s++){e.beginPath();const h=a*.36+s*a*.04;e.moveTo(h,a*.55),e.lineTo(h+a*.02,a*.63),e.lineTo(h+a*.04,a*.55),e.closePath(),e.fill()}e.globalAlpha=.85,e.beginPath(),e.ellipse(a*.15,a*.12,a*.1,a*.22,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(a*.18,a*.3),e.lineTo(a*.2,a*.48),e.lineTo(a*.24,a*.5),e.lineTo(a*.22,a*.32),e.closePath(),e.fill(),e.globalAlpha=1,e.beginPath(),e.ellipse(-a*.15,a*.25,a*.15,a*.28,.8,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(-a*.08,a*.48),e.lineTo(-a*.02,a*.65),e.lineTo(a*.02,a*.67),e.lineTo(-a*.04,a*.5),e.closePath(),e.fill();for(let s=0;s<3;s++){e.beginPath();const h=-a*.04+s*a*.04;e.moveTo(h,a*.65),e.lineTo(h+a*.02,a*.72),e.lineTo(h+a*.04,a*.65),e.closePath(),e.fill()}e.globalAlpha=.85,e.beginPath(),e.ellipse(-a*.28,a*.22,a*.13,a*.25,.6,0,Math.PI*2),e.fill(),e.globalAlpha=1,e.beginPath(),e.moveTo(-a*.5,a*.05),e.bezierCurveTo(-a*.75,a*.15,-a*.95,0,-a*1.05,-a*.3),e.bezierCurveTo(-a*1.1,-a*.45,-a*1.05,-a*.6,-a*.95,-a*.68),e.lineTo(-a*.88,-a*.72),e.lineTo(-a*.92,-a*.65),e.bezierCurveTo(-a*1,-a*.56,-a*1.02,-a*.42,-a*.98,-a*.28),e.bezierCurveTo(-a*.88,0,-a*.68,a*.1,-a*.48,a*.08),e.closePath(),e.fill();const t=5;for(let s=0;s<t;s++){const h=s/(t-1),d=-a*.6-h*a*.4,P=a*.1-h*a*.7+Math.sin(h*Math.PI)*a*.15,f=a*.12*(1-h*.5);e.beginPath(),e.moveTo(d,P),e.lineTo(d-f*.3,P-f),e.lineTo(d+f*.3,P-f*.8),e.closePath(),e.fill()}e.restore(),e.restore()},drawTwinklingStar(e,l,i){const r=l.x,o=l.y,a=l.size,n=.5+Math.sin(i*l.twinkleSpeed+l.twinklePhase)*.5,t=`rgba(255, 240, 200, ${n})`,s=`rgba(255, 220, 150, ${n*.4})`;e.save(),e.translate(r,o),e.shadowColor=s,e.shadowBlur=a*3*n,e.fillStyle=t,e.beginPath();for(let h=0;h<4;h++){const d=h*Math.PI/2,P=Math.cos(d)*a,f=Math.sin(d)*a,M=d+Math.PI/4,T=Math.cos(M)*(a*.3),m=Math.sin(M)*(a*.3);h===0?e.moveTo(P,f):e.lineTo(P,f),e.lineTo(T,m)}e.closePath(),e.fill(),e.shadowBlur=a*2*n,e.beginPath(),e.arc(0,0,a*.25,0,Math.PI*2),e.fill(),e.restore()}};
@@ -1 +1 @@
1
- export default{name:"st-georges",displayName:"St George's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",intensityConfig:{light:{count:40,speedRange:[.3,1],sizeRange:[2,4],roses:3,knightChance:2e-4,twinklingStars:10},medium:{count:80,speedRange:[.4,1.3],sizeRange:[2,5],roses:5,knightChance:4e-4,twinklingStars:18},heavy:{count:120,speedRange:[.5,1.6],sizeRange:[3,6],roses:8,knightChance:6e-4,twinklingStars:25}},particles:["rose-petal","tudor-rose","oak-leaf","sparkle"],decorations:["english-rose","st-georges-cross","knight","dragon","shield","castle","twinkling-star"],colors:{primary:"#C8102E",secondary:"#FFFFFF",tertiary:"#012169",accent:"#FFD700",greenStem:"#228B22"},createRosePetal(e,l,n){const a=Math.random()<.7?["#C8102E","#DC143C","#B91C1C","#991B1B"]:["#FFFFFF","#FFF5F5","#FECACA","#FEE2E2"];return{type:"rose-petal",x:-30,y:Math.random()*l,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:(n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:a[Math.floor(Math.random()*a.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createTudorRose(e,l,n){return{type:"tudor-rose",x:-30,y:Math.random()*l,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.8+Math.random()*.2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,petalCount:5,active:!0}},createOakLeaf(e,l,n){const s=Math.random();let a;return s<.6?a="#2d5016":s<.85?a="#6b8e23":a="#8b4513",{type:"oak-leaf",x:-30,y:Math.random()*l,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.03,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:a,flutter:Math.random()*Math.PI*2,flutterSpeed:.03+Math.random()*.02,active:!0}},createSparkle(e,l,n){const s=["#FFD700","#FFFFFF","#C8102E"];return{type:"sparkle",x:-20,y:Math.random()*l,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:s[Math.floor(Math.random()*s.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,l,n){const s=Math.random();return s<.6?this.createRosePetal(e,l,n):s<.8?this.createTudorRose(e,l,n):s<.95?this.createSparkle(e,l,n):this.createOakLeaf(e,l,n)},createEnglishRose(e,l,n={}){return{type:"english-rose",x:n.x!==void 0?n.x:Math.random()*e*.8+e*.1,y:n.y!==void 0?n.y:l-60-Math.random()*100,size:15+Math.random()*10,opacity:1,color:Math.random()<.7?"#C8102E":"#FFFFFF",bloomPhase:Math.random()*Math.PI*2,petalCount:8+Math.floor(Math.random()*5),active:!0,static:!0}},createStGeorgesCross(e,l,n={}){return{type:"st-georges-cross",x:n.x!==void 0?n.x:e*.1+Math.random()*e*.8,y:n.y!==void 0?n.y:50+Math.random()*100,size:40+Math.random()*20,opacity:1,waveOffset:Math.random()*Math.PI*2,waveSpeed:.001+Math.random()*.001,active:!0,static:!0}},createKnight(e,l){const n=Math.random()<.5;return{type:"knight",x:n?-80:e+80,y:l-50,baseY:l-50,vx:n?.8+Math.random()*.4:-(.8+Math.random()*.4),size:20+Math.random()*10,opacity:1,marchPhase:Math.random()*Math.PI*2,marchSpeed:.015,active:!0,static:!1}},createDragon(e,l,n={}){const s=Math.random()<.5;return{type:"dragon",x:s?-100:e+100,y:l*.3+Math.random()*l*.2,baseY:l*.3+Math.random()*l*.2,vx:s?1.5+Math.random()*.5:-(1.5+Math.random()*.5),size:30+Math.random()*15,opacity:1,wingPhase:Math.random()*Math.PI*2,wingSpeed:.012,breatheFirePhase:Math.random()*Math.PI*2,active:!0,static:!1}},createShield(e,l,n={}){return{type:"shield",x:n.x!==void 0?n.x:e*.2+Math.random()*e*.6,y:n.y!==void 0?n.y:l-80-Math.random()*150,size:20+Math.random()*10,opacity:1,rotation:-Math.PI/12+Math.random()*(Math.PI/6),glintPhase:Math.random()*Math.PI*2,active:!0,static:!0}},createInitialDecorations(e,l,n){const s=[];s.push({type:"castle",x:150,y:l-100,size:80+Math.random()*20,opacity:1,active:!0,static:!0}),s.push({type:"dragon",x:e-200,y:l-60,baseY:l-60,vx:0,size:25+Math.random()*10,opacity:1,time:0,wingPhase:Math.random()*Math.PI*2,breathePhase:Math.random()*Math.PI*2,active:!0,static:!0}),s.push({type:"knight",x:e*.4,y:l-45,baseY:l-45,vx:0,size:20+Math.random()*5,opacity:1,time:0,legPhase:0,weaponRaised:!0,active:!0,static:!0}),s.push(this.createStGeorgesCross(e,l,{x:150,y:l-180,size:30})),s.push(this.createShield(e,l,{x:e*.15,y:l-60}));const a=n.twinklingStars??18;for(let o=0;o<a;o++)s.push(this.createTwinklingStar(e,l));return s},createTwinklingStar(e,l){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(l*.5),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,l,n,s){const a=Math.random();return a<s.knightChance?e.some(o=>o.type==="knight")?null:this.createKnight(l,n):a<s.knightChance*1.2?e.some(o=>o.type==="dragon")?null:this.createDragon(l,n):a<5e-4&&e.filter(r=>r.type==="english-rose").length<s.roses?this.createEnglishRose(l,n):a<3e-4&&e.filter(r=>r.type==="st-georges-cross").length<2?this.createStGeorgesCross(l,n):a<4e-4&&e.filter(r=>r.type==="shield").length<3?this.createShield(l,n):null},drawRosePetal(e,l,n){const s=l.x,a=l.y,o=l.size,r=Math.sin(n*l.flutterSpeed+l.flutter)*.3;e.save(),e.globalAlpha=l.opacity,e.translate(s,a),e.rotate(l.rotation+r);const h=l.color.includes("FFF")||l.color.includes("fff");e.fillStyle=l.color,e.strokeStyle=h?"#FFE6E6":"#8B0000",e.lineWidth=o*.08,e.beginPath(),e.moveTo(0,-o*.4),e.bezierCurveTo(o*.6,-o*.8,o*.8,-o*.2,o*.4,o*.2),e.lineTo(0,o*1),e.lineTo(-o*.4,o*.2),e.bezierCurveTo(-o*.8,-o*.2,-o*.6,-o*.8,0,-o*.4),e.closePath(),e.fill(),e.stroke(),e.strokeStyle=h?"rgba(255, 182, 193, 0.5)":"rgba(139, 0, 0, 0.4)",e.lineWidth=o*.06,e.beginPath(),e.moveTo(0,-o*.3),e.lineTo(0,o*.9),e.stroke(),e.restore()},drawEnglishRose(e,l,n){const s=l.x,a=l.y,o=l.size,r=.8+(Math.sin(n*.002+l.bloomPhase)+1)*.1;e.save(),e.translate(s,a),e.strokeStyle=this.colors.greenStem,e.lineWidth=o*.12,e.beginPath(),e.moveTo(0,0),e.quadraticCurveTo(-o*.2,o*.8,0,o*1.5),e.stroke(),e.fillStyle="#2D5016",[-1,1].forEach(h=>{e.save(),e.translate(h*o*.15,o*.8),e.rotate(h*Math.PI/6),e.beginPath(),e.ellipse(0,0,o*.3,o*.15,0,0,Math.PI*2),e.fill(),e.restore()}),e.fillStyle=l.color,e.strokeStyle=l.color==="#FFFFFF"?"#FFE6E6":"#8B0000",e.lineWidth=1;for(let h=0;h<l.petalCount;h++){const t=h/l.petalCount*Math.PI*2;e.save(),e.rotate(t),e.translate(0,-o*.4*r),e.beginPath(),e.moveTo(0,o*.25),e.bezierCurveTo(-o*.25,-o*.1,-o*.15,-o*.35,0,-o*.25),e.bezierCurveTo(o*.15,-o*.35,o*.25,-o*.1,0,o*.25),e.closePath(),e.fill(),e.stroke(),e.restore()}e.globalAlpha=.9;for(let h=0;h<l.petalCount-2;h++){const t=h/(l.petalCount-2)*Math.PI*2+Math.PI/l.petalCount;e.save(),e.rotate(t),e.translate(0,-o*.25*r),e.beginPath(),e.moveTo(0,o*.15),e.bezierCurveTo(-o*.15,-o*.05,-o*.1,-o*.2,0,-o*.15),e.bezierCurveTo(o*.1,-o*.2,o*.15,-o*.05,0,o*.15),e.closePath(),e.fill(),e.restore()}e.globalAlpha=1,e.fillStyle="#FFD700",e.beginPath(),e.arc(0,0,o*.15*r,0,Math.PI*2),e.fill(),e.fillStyle="#FFA500";for(let h=0;h<8;h++){const t=h/8*Math.PI*2,i=o*.08*r;e.beginPath(),e.arc(Math.cos(t)*i,Math.sin(t)*i,o*.03,0,Math.PI*2),e.fill()}e.restore()},drawStGeorgesCross(e,l,n){const s=l.x,a=l.y,o=l.size,r=n*l.waveSpeed+l.waveOffset;e.save(),e.translate(s,a);const h=e.createLinearGradient(-o*.64,0,-o*.56,0);h.addColorStop(0,"#5a4a3a"),h.addColorStop(.5,"#8B4513"),h.addColorStop(1,"#6a5343"),e.fillStyle=h,e.fillRect(-o*.64,-o*.35,o*.08,o*1.9),e.strokeStyle="#9a6333",e.lineWidth=1,e.beginPath(),e.moveTo(-o*.64,-o*.35),e.lineTo(-o*.64,o*1.55),e.stroke(),e.strokeStyle="#3a2a1a",e.beginPath(),e.moveTo(-o*.56,-o*.35),e.lineTo(-o*.56,o*1.55),e.stroke(),e.fillStyle="#FFD700",e.beginPath(),e.arc(-o*.6,-o*.4,o*.06,0,Math.PI*2),e.fill(),e.strokeStyle="#DAA520",e.lineWidth=1.5,e.stroke();const t=o*1.5,i=o*1,f=12;for(let y=0;y<f;y++){const g=-o*.5+y/f*t,P=-o*.5+(y+1)/f*t,z=P-g,T=Math.sin(r+y*.4)*o*.12,S=Math.sin(r+(y+1)*.4)*o*.12,k=(g+z/2+o*.5)/t,u=k>.4&&k<.6;e.save(),e.fillStyle="#FFFFFF",e.beginPath(),e.moveTo(g,-i/2+T),e.lineTo(P,-i/2+S),e.lineTo(P,i/2+S),e.lineTo(g,i/2+T),e.closePath(),e.fill(),e.fillStyle="#C8102E",u&&(e.beginPath(),e.moveTo(g,-i/2+T),e.lineTo(P,-i/2+S),e.lineTo(P,i/2+S),e.lineTo(g,i/2+T),e.closePath(),e.fill()),e.beginPath(),e.moveTo(g,-i*.15+T),e.lineTo(P,-i*.15+S),e.lineTo(P,i*.15+S),e.lineTo(g,i*.15+T),e.closePath(),e.fill();const C=Math.sin(r+y*.4)*.15;C>0?e.fillStyle=`rgba(255, 255, 255, ${C*.3})`:e.fillStyle=`rgba(0, 0, 0, ${-C*.2})`,e.beginPath(),e.moveTo(g,-i/2+T),e.lineTo(P,-i/2+S),e.lineTo(P,i/2+S),e.lineTo(g,i/2+T),e.closePath(),e.fill(),e.strokeStyle="rgba(0, 0, 0, 0.1)",e.lineWidth=.5,e.beginPath(),e.moveTo(P,-i/2+S),e.lineTo(P,i/2+S),e.stroke(),e.restore()}e.strokeStyle="rgba(0, 0, 0, 0.25)",e.lineWidth=1.5,e.beginPath(),e.moveTo(-o*.5,-i/2+Math.sin(r)*o*.12);for(let y=1;y<=f;y++){const g=-o*.5+y/f*t,P=Math.sin(r+y*.4)*o*.12;e.lineTo(g,-i/2+P)}e.lineTo(-o*.5+t,i/2+Math.sin(r+f*.4)*o*.12);for(let y=f;y>=0;y--){const g=-o*.5+y/f*t,P=Math.sin(r+y*.4)*o*.12;e.lineTo(g,i/2+P)}e.closePath(),e.stroke(),e.fillStyle="#A9A9A9";for(let y=0;y<3;y++){const g=-i/2+y/2*i,P=Math.sin(r)*o*.12;e.beginPath(),e.arc(-o*.48,g+P,o*.03,0,Math.PI*2),e.fill(),e.strokeStyle="#696969",e.lineWidth=1,e.stroke()}e.restore()},drawKnight(e,l,n){const s=l.x,a=l.y,o=l.size,r=l.vx>0?1:-1,h=Math.sin(n*l.marchSpeed+l.marchPhase)*(Math.PI/8);e.save(),e.translate(s,a),r===-1&&e.scale(-1,1),e.strokeStyle="#C0C0C0",e.lineWidth=o*.15,e.beginPath(),e.moveTo(-o*.15,o*.5),e.lineTo(-o*.2,o*1.2+Math.sin(h)*o*.15),e.stroke(),e.beginPath(),e.moveTo(o*.15,o*.5),e.lineTo(o*.2,o*1.2+Math.sin(h+Math.PI)*o*.15),e.stroke(),e.fillStyle="#2F4F4F",e.fillRect(-o*.25,o*1.15,o*.2,o*.2),e.fillRect(o*.05,o*1.15,o*.2,o*.2),e.fillStyle="#C0C0C0",e.fillRect(-o*.4,0,o*.8,o*.6),e.fillStyle="#FFFFFF",e.fillRect(-o*.35,o*.05,o*.7,o*.5),e.fillStyle="#C8102E",e.fillRect(-o*.1,o*.05,o*.2,o*.5),e.fillRect(-o*.35,o*.2,o*.7,o*.2),e.save(),e.translate(-o*.5,o*.3),e.rotate(-Math.PI/6),e.fillStyle="#FFFFFF",e.strokeStyle="#FFD700",e.lineWidth=2,e.beginPath(),e.moveTo(0,-o*.4),e.lineTo(o*.25,-o*.3),e.lineTo(o*.25,o*.2),e.lineTo(0,o*.4),e.lineTo(-o*.25,o*.2),e.lineTo(-o*.25,-o*.3),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#C8102E",e.fillRect(-o*.05,-o*.3,o*.1,o*.6),e.fillRect(-o*.2,-o*.05,o*.4,o*.1),e.restore(),e.strokeStyle="#708090",e.lineWidth=o*.1,e.beginPath(),e.moveTo(o*.4,-o*.2),e.lineTo(o*.6,-o*.8),e.stroke(),e.lineWidth=o*.15,e.beginPath(),e.moveTo(o*.3,-o*.3),e.lineTo(o*.5,-o*.3),e.stroke(),e.fillStyle="#FFD700",e.beginPath(),e.arc(o*.4,-o*.15,o*.08,0,Math.PI*2),e.fill(),e.fillStyle="#708090",e.beginPath(),e.arc(0,-o*.3,o*.35,0,Math.PI*2),e.fill(),e.fillStyle="#000000",e.fillRect(-o*.25,-o*.35,o*.5,o*.1),e.fillStyle="#C8102E",e.beginPath(),e.moveTo(0,-o*.65),e.bezierCurveTo(-o*.15,-o*.85,-o*.1,-o*1,0,-o*.95),e.bezierCurveTo(o*.1,-o*1,o*.15,-o*.85,0,-o*.65),e.closePath(),e.fill(),e.restore()},drawDragon(e,l,n){const s=l.x,a=l.y,o=l.size,r=l.vx>0?1:-1,h=Math.sin(n*l.wingSpeed+l.wingPhase)*(Math.PI/3);e.save(),e.translate(s,a),r===-1&&e.scale(-1,1),e.fillStyle="#2F4F2F",e.strokeStyle="#1C3020",e.lineWidth=2,e.save(),e.translate(-o*.3,-o*.2),e.rotate(h),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-o*.4,-o*.3,-o*.6,-o*.2,-o*.7,0),e.bezierCurveTo(-o*.6,o*.1,-o*.4,o*.05,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.save(),e.translate(o*.3,-o*.2),e.rotate(-h),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(o*.4,-o*.3,o*.6,-o*.2,o*.7,0),e.bezierCurveTo(o*.6,o*.1,o*.4,o*.05,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.fillStyle="#556B2F",e.strokeStyle="#2F4F2F",e.lineWidth=2,e.beginPath(),e.ellipse(0,0,o*.5,o*.3,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="#556B2F",e.lineWidth=o*.2,e.lineCap="round",e.beginPath(),e.moveTo(-o*.4,0),e.quadraticCurveTo(-o*.8,o*.2,-o*1.2,0),e.stroke(),e.strokeStyle="#8B0000",e.lineWidth=2;for(let t=0;t<3;t++){const i=-o*.6-t*o*.2,f=o*.1;e.beginPath(),e.moveTo(i,f),e.lineTo(i,f-o*.15),e.stroke()}if(e.fillStyle="#556B2F",e.beginPath(),e.moveTo(o*.3,-o*.1),e.lineTo(o*.5,-o*.4),e.lineTo(o*.5,-o*.2),e.closePath(),e.fill(),e.fillStyle="#6B8E23",e.beginPath(),e.ellipse(o*.65,-o*.35,o*.25,o*.2,-Math.PI/6,0,Math.PI*2),e.fill(),e.stroke(),e.beginPath(),e.moveTo(o*.75,-o*.35),e.lineTo(o*.95,-o*.35),e.lineTo(o*.85,-o*.25),e.closePath(),e.fill(),e.strokeStyle="#8B4513",e.lineWidth=3,[o*.55,o*.65].forEach(t=>{e.beginPath(),e.moveTo(t,-o*.5),e.lineTo(t,-o*.7),e.stroke()}),e.fillStyle="#FF0000",e.shadowBlur=8,e.shadowColor="#FF0000",e.beginPath(),e.arc(o*.7,-o*.4,o*.05,0,Math.PI*2),e.fill(),e.shadowBlur=0,Math.sin(n*.005+l.breatheFirePhase)>.7){const t=e.createLinearGradient(o*.95,-o*.35,o*1.5,-o*.35);t.addColorStop(0,"rgba(255, 100, 0, 0.8)"),t.addColorStop(.5,"rgba(255, 200, 0, 0.5)"),t.addColorStop(1,"rgba(255, 255, 0, 0)"),e.fillStyle=t,e.beginPath(),e.moveTo(o*.95,-o*.35),e.lineTo(o*1.5,-o*.45),e.lineTo(o*1.5,-o*.25),e.closePath(),e.fill();for(let i=0;i<5;i++){const f=o*1+Math.random()*o*.5,y=-o*.35+(Math.random()-.5)*o*.3;e.fillStyle=`rgba(255, ${100+Math.random()*100}, 0, ${Math.random()*.8})`,e.beginPath(),e.arc(f,y,o*.05,0,Math.PI*2),e.fill()}}e.fillStyle="#9ACD32";for(let t=0;t<3;t++)e.beginPath(),e.arc(-o*.2+t*o*.2,o*.1,o*.08,0,Math.PI*2),e.fill();e.restore()},drawShield(e,l,n){const s=l.x,a=l.y,o=l.size,r=(Math.sin(n*.003+l.glintPhase)+1)*.5;e.save(),e.translate(s,a),e.rotate(l.rotation),e.fillStyle="#FFFFFF",e.strokeStyle="#FFD700",e.lineWidth=2,e.beginPath(),e.moveTo(0,-o*.7),e.lineTo(o*.5,-o*.5),e.lineTo(o*.5,o*.3),e.lineTo(0,o*.7),e.lineTo(-o*.5,o*.3),e.lineTo(-o*.5,-o*.5),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#C8102E",e.fillRect(-o*.1,-o*.6,o*.2,o*1.2),e.fillRect(-o*.45,-o*.1,o*.9,o*.2),e.strokeStyle=`rgba(255, 215, 0, ${r*.8})`,e.lineWidth=3,e.beginPath(),e.moveTo(0,-o*.7),e.lineTo(o*.5,-o*.5),e.lineTo(o*.5,o*.3),e.stroke(),e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=1,e.beginPath(),e.arc(0,0,o*.15,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle=`rgba(255, 255, 255, ${r*.6})`,e.beginPath(),e.arc(-o*.05,-o*.05,o*.06,0,Math.PI*2),e.fill(),e.restore()},drawCastle(e,l){const n=l.x,s=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(n,s);const o="#9a958f",r="#6a655f",h="#4a4540",t="#b5b0aa",i=a*1.4,f=a*1;e.fillStyle=h,e.fillRect(-i/2+a*.05,-f+a*.05,i,f);const y=e.createLinearGradient(-i/2,-f,i/2,-f);y.addColorStop(0,r),y.addColorStop(.5,o),y.addColorStop(1,r),e.fillStyle=y,e.fillRect(-i/2,-f,i,f),e.strokeStyle=h,e.lineWidth=2,e.strokeRect(-i/2,-f,i,f),e.strokeStyle="rgba(74, 69, 64, 0.4)",e.lineWidth=1;const g=a*.12,P=a*.18;for(let d=0;d<8;d++){const M=-f+d*g,R=d%2*(P/2);for(let B=0;B<8;B++){const E=-i/2+B*P+R;e.strokeRect(E,M,P,g)}}e.fillStyle=o;const z=a*.15,T=a*.12;for(let d=0;d<9;d++)if(d%2===0){const M=-i/2+d*(i/8);e.fillRect(M,-f-T,z,T),e.strokeRect(M,-f-T,z,T),e.fillStyle=h,e.fillRect(M+z/2-a*.015,-f-T+a*.02,a*.03,T-a*.04),e.fillStyle=o}const S=a*.22,m=a*1.2,k=-a*.85,u=-m/2;e.fillStyle=h,e.beginPath(),e.ellipse(k+a*.03,u+a*.03,S,m/2,0,0,Math.PI*2),e.fill();const C=e.createRadialGradient(k-S*.3,u,0,k,u,S);C.addColorStop(0,t),C.addColorStop(.5,o),C.addColorStop(1,r),e.fillStyle=C,e.beginPath(),e.ellipse(k,u,S,m/2,0,0,Math.PI*2),e.fill(),e.strokeStyle=h,e.lineWidth=2,e.stroke(),e.fillStyle=o;for(let d=0;d<6;d++)if(d%2===0){const M=d/6*Math.PI,R=Math.cos(M)*S;e.fillRect(k+R-a*.06,-m-a*.1,a*.12,a*.1),e.strokeRect(k+R-a*.06,-m-a*.1,a*.12,a*.1)}e.fillStyle="#1a1510";for(let d=0;d<3;d++){const M=u-m*.2+d*m*.25;e.fillRect(k-a*.02,M,a*.04,a*.15),e.beginPath(),e.moveTo(k-a*.02,M+a*.15),e.lineTo(k-a*.06,M+a*.18),e.lineTo(k+a*.06,M+a*.18),e.lineTo(k+a*.02,M+a*.15),e.fill()}const F=a*.85;e.fillStyle=h,e.beginPath(),e.ellipse(F+a*.03,u+a*.03,S,m/2,0,0,Math.PI*2),e.fill();const p=e.createRadialGradient(F+S*.3,u,0,F,u,S);p.addColorStop(0,t),p.addColorStop(.5,o),p.addColorStop(1,r),e.fillStyle=p,e.beginPath(),e.ellipse(F,u,S,m/2,0,0,Math.PI*2),e.fill(),e.strokeStyle=h,e.lineWidth=2,e.stroke(),e.fillStyle=o;for(let d=0;d<6;d++)if(d%2===0){const M=d/6*Math.PI,R=Math.cos(M)*S;e.fillRect(F+R-a*.06,-m-a*.1,a*.12,a*.1),e.strokeRect(F+R-a*.06,-m-a*.1,a*.12,a*.1)}e.fillStyle="#1a1510";for(let d=0;d<3;d++){const M=u-m*.2+d*m*.25;e.fillRect(F-a*.02,M,a*.04,a*.15),e.beginPath(),e.moveTo(F-a*.02,M+a*.15),e.lineTo(F-a*.06,M+a*.18),e.lineTo(F+a*.06,M+a*.18),e.lineTo(F+a*.02,M+a*.15),e.fill()}const b=a*.35,v=a*.5;e.fillStyle=h,e.beginPath(),e.moveTo(-b,-a*.05),e.lineTo(-b,-v),e.arc(0,-v,b,Math.PI,0,!1),e.lineTo(b,-a*.05),e.closePath(),e.fill(),e.strokeStyle=r,e.lineWidth=a*.06,e.beginPath(),e.arc(0,-v,b-a*.03,Math.PI,0,!1),e.stroke(),e.strokeStyle="rgba(74, 69, 64, 0.6)",e.lineWidth=2;for(let d=0;d<9;d++){const M=Math.PI+d/8*Math.PI;e.beginPath(),e.moveTo(0,-v),e.lineTo(Math.cos(M)*b,-v+Math.sin(M)*b),e.stroke()}e.fillStyle="#0a0a08",e.beginPath(),e.moveTo(-b+a*.1,-a*.05),e.lineTo(-b+a*.1,-v+a*.05),e.arc(0,-v+a*.05,b-a*.1,Math.PI,0,!1),e.lineTo(b-a*.1,-a*.05),e.closePath(),e.fill(),e.strokeStyle="#2a2520",e.lineWidth=4;const D=7;for(let d=0;d<D;d++){const M=-b+a*.15+d/(D-1)*(b*2-a*.3);e.beginPath(),e.moveTo(M,-a*.05),e.lineTo(M,-v+a*.15),e.stroke()}e.lineWidth=3;for(let d=0;d<4;d++){const M=-a*.1-d*a*.12;e.beginPath(),e.moveTo(-b+a*.15,M),e.lineTo(b-a*.15,M),e.stroke()}e.fillStyle=r,e.beginPath(),e.moveTo(-i/2,0),e.lineTo(-i/2-a*.08,0),e.lineTo(-i/2-a*.05,-f*.6),e.lineTo(-i/2,-f*.6),e.closePath(),e.fill(),e.strokeStyle=h,e.stroke(),e.beginPath(),e.moveTo(i/2,0),e.lineTo(i/2+a*.08,0),e.lineTo(i/2+a*.05,-f*.6),e.lineTo(i/2,-f*.6),e.closePath(),e.fill(),e.stroke(),e.save(),e.translate(0,-m-a*.15);const W=e.createLinearGradient(-a*.02,0,a*.02,0);W.addColorStop(0,"#5a4a3a"),W.addColorStop(.5,"#8b7355"),W.addColorStop(1,"#5a4a3a"),e.fillStyle=W,e.fillRect(-a*.02,0,a*.04,-a*.45),e.strokeStyle="#3a2a1a",e.lineWidth=1,e.strokeRect(-a*.02,0,a*.04,-a*.45),e.fillStyle="#FFD700",e.beginPath(),e.arc(0,-a*.45,a*.04,0,Math.PI*2),e.fill(),e.strokeStyle="#DAA520",e.stroke();const I=a*.4,w=a*.25;e.fillStyle="#FFFFFF",e.fillRect(0,-a*.42,I,w),e.strokeStyle="rgba(0, 0, 0, 0.1)",e.strokeRect(0,-a*.42,I,w),e.fillStyle="#C8102E",e.fillRect(I*.4,-a*.42,I*.2,w),e.fillRect(0,-a*.42+w*.4,I,w*.2),e.restore(),e.restore()},drawTudorRose(e,l){const n=l.x,s=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(n,s),e.rotate(l.rotation),e.fillStyle="#C8102E",e.strokeStyle="#8B0000",e.lineWidth=a*.05;for(let o=0;o<5;o++){const r=o/5*Math.PI*2-Math.PI/2;e.save(),e.rotate(r),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-a*.5,-a*.4,-a*.6,-a*.8,0,-a*1.2),e.bezierCurveTo(a*.6,-a*.8,a*.5,-a*.4,0,0),e.closePath(),e.fill(),e.stroke(),e.restore()}e.fillStyle="#FFFFFF",e.strokeStyle="#E0E0E0";for(let o=0;o<5;o++){const r=o/5*Math.PI*2-Math.PI/2+Math.PI/5;e.save(),e.rotate(r),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-a*.3,-a*.25,-a*.35,-a*.5,0,-a*.7),e.bezierCurveTo(a*.35,-a*.5,a*.3,-a*.25,0,0),e.closePath(),e.fill(),e.stroke(),e.restore()}e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=a*.05,e.beginPath(),e.arc(0,0,a*.2,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#FFA500";for(let o=0;o<5;o++){const r=o/5*Math.PI*2,h=a*.12;e.beginPath(),e.arc(Math.cos(r)*h,Math.sin(r)*h,a*.04,0,Math.PI*2),e.fill()}e.restore()},drawOakLeaf(e,l){const n=l.x,s=l.y,a=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(n,s),e.rotate(l.rotation),e.fillStyle=l.color,e.strokeStyle=l.color==="#8b4513"?"#654321":"#1a3a0a",e.lineWidth=a*.08,e.beginPath(),e.moveTo(0,a*1.5),e.bezierCurveTo(a*.3,a*1.2,a*.4,a*1,a*.5,a*.8),e.bezierCurveTo(a*.7,a*.7,a*.8,a*.5,a*.6,a*.3),e.bezierCurveTo(a*.8,a*.2,a*.9,0,a*.7,-a*.3),e.bezierCurveTo(a*.85,-a*.5,a*.8,-a*.8,a*.5,-a*1),e.bezierCurveTo(a*.3,-a*1.2,0,-a*1.3,-a*.3,-a*1.2),e.bezierCurveTo(-a*.8,-a*.8,-a*.85,-a*.5,-a*.7,-a*.3),e.bezierCurveTo(-a*.9,0,-a*.8,a*.2,-a*.6,a*.3),e.bezierCurveTo(-a*.8,a*.5,-a*.7,a*.7,-a*.5,a*.8),e.bezierCurveTo(-a*.4,a*1,-a*.3,a*1.2,0,a*1.5),e.closePath(),e.fill(),e.stroke(),e.strokeStyle=l.color==="#8b4513"?"#654321":"#0a2505",e.lineWidth=a*.06,e.beginPath(),e.moveTo(0,a*1.4),e.lineTo(0,-a*1.15),e.stroke(),e.lineWidth=a*.03;for(let o=0;o<4;o++){const r=a*.8-o*a*.5;e.beginPath(),e.moveTo(0,r),e.lineTo(a*.4,r-a*.15),e.stroke(),e.beginPath(),e.moveTo(0,r),e.lineTo(-a*.4,r-a*.15),e.stroke()}e.restore()},drawSparkle(e,l,n){const s=l.x,a=l.y,o=l.size,r=.6+Math.sin(n*.004+l.twinklePhase)*.4;e.save(),e.globalAlpha=l.opacity*r,e.translate(s,a),e.rotate(l.rotation),e.fillStyle=l.color,e.shadowColor=l.color,e.shadowBlur=o*2,e.beginPath(),e.moveTo(0,-o),e.lineTo(o*.3,-o*.3),e.lineTo(o,0),e.lineTo(o*.3,o*.3),e.lineTo(0,o),e.lineTo(-o*.3,o*.3),e.lineTo(-o,0),e.lineTo(-o*.3,-o*.3),e.closePath(),e.fill(),e.restore()},drawCrown(e,l){const n=l.x,s=l.y,a=l.size,o=(Math.sin(l.glint)+1)*.5;e.save(),e.globalAlpha=l.opacity,e.translate(n,s),e.rotate(l.rotation);const r=e.createLinearGradient(-a,0,a,0);r.addColorStop(0,"#B8860B"),r.addColorStop(.5,"#FFD700"),r.addColorStop(1,"#B8860B"),e.fillStyle=r,e.strokeStyle="#8B6914",e.lineWidth=a*.05,e.beginPath(),e.ellipse(0,a*.3,a*.8,a*.25,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="#8B0000",e.lineWidth=a*.08,e.beginPath(),e.ellipse(0,a*.3,a*.7,a*.2,0,0,Math.PI*2),e.stroke(),e.fillStyle=r,e.strokeStyle="#8B6914",e.lineWidth=a*.05;for(let t=0;t<5;t++){const i=t/5*Math.PI*2-Math.PI/2,f=Math.cos(i)*a*.7,y=a*.3+Math.sin(i)*a*.2;e.save(),e.translate(f,y),e.rotate(i+Math.PI/2),e.beginPath(),e.moveTo(0,-a*.8),e.lineTo(-a*.12,-a*.3),e.lineTo(a*.12,-a*.3),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(-a*.12,-a*.3),e.bezierCurveTo(-a*.25,-a*.5,-a*.28,-a*.65,-a*.2,-a*.75),e.lineTo(-a*.15,-a*.65),e.bezierCurveTo(-a*.18,-a*.55,-a*.15,-a*.4,-a*.08,-a*.32),e.fill(),e.stroke(),e.beginPath(),e.moveTo(a*.12,-a*.3),e.bezierCurveTo(a*.25,-a*.5,a*.28,-a*.65,a*.2,-a*.75),e.lineTo(a*.15,-a*.65),e.bezierCurveTo(a*.18,-a*.55,a*.15,-a*.4,a*.08,-a*.32),e.fill(),e.stroke(),e.restore()}e.fillStyle="#FFD700",e.strokeStyle="#8B6914",e.lineWidth=a*.04,e.beginPath(),e.fillRect(-a*.05,-a*.9,a*.1,a*.25),e.strokeRect(-a*.05,-a*.9,a*.1,a*.25),e.fillRect(-a*.15,-a*.82,a*.3,a*.08),e.strokeRect(-a*.15,-a*.82,a*.3,a*.08);const h=[{x:0,y:a*.3,color:"#DC143C",size:.12},{x:a*.4,y:a*.3,color:"#0000CD",size:.08},{x:-a*.4,y:a*.3,color:"#0000CD",size:.08}];for(const t of h)e.fillStyle=t.color,e.beginPath(),e.arc(t.x,t.y,a*t.size,0,Math.PI*2),e.fill(),e.fillStyle=`rgba(255, 255, 255, ${o*.7})`,e.beginPath(),e.arc(t.x-a*t.size*.3,t.y-a*t.size*.3,a*t.size*.4,0,Math.PI*2),e.fill();e.restore()},drawTwinklingStar(e,l,n){const s=l.x,a=l.y,o=l.size,r=.5+Math.sin(n*l.twinkleSpeed+l.twinklePhase)*.5,h=`rgba(255, 220, 220, ${r})`,t=`rgba(255, 180, 180, ${r*.4})`;e.save(),e.translate(s,a),e.shadowColor=t,e.shadowBlur=o*3*r,e.fillStyle=h,e.beginPath();for(let i=0;i<4;i++){const f=i*Math.PI/2,y=Math.cos(f)*o,g=Math.sin(f)*o,P=f+Math.PI/4,z=Math.cos(P)*(o*.3),T=Math.sin(P)*(o*.3);i===0?e.moveTo(y,g):e.lineTo(y,g),e.lineTo(z,T)}e.closePath(),e.fill(),e.shadowBlur=o*2*r,e.beginPath(),e.arc(0,0,o*.25,0,Math.PI*2),e.fill(),e.restore()}};
1
+ import{drawKnight as E,drawDragon as G}from"./character-drawing.js";export default{name:"st-georges",displayName:"St George's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",intensityConfig:{light:{count:40,speedRange:[.3,1],sizeRange:[2,4],roses:3,knightChance:2e-4,twinklingStars:10},medium:{count:80,speedRange:[.4,1.3],sizeRange:[2,5],roses:5,knightChance:4e-4,twinklingStars:18},heavy:{count:120,speedRange:[.5,1.6],sizeRange:[3,6],roses:8,knightChance:6e-4,twinklingStars:25}},particles:["rose-petal","tudor-rose","oak-leaf","sparkle"],decorations:["english-rose","st-georges-cross","knight","dragon","shield","castle","twinkling-star"],colors:{primary:"#C8102E",secondary:"#FFFFFF",tertiary:"#012169",accent:"#FFD700",greenStem:"#228B22"},createRosePetal(e,l,n){const o=Math.random()<.7?["#C8102E","#DC143C","#B91C1C","#991B1B"]:["#FFFFFF","#FFF5F5","#FECACA","#FEE2E2"];return{type:"rose-petal",x:-30,y:Math.random()*l,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:(n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:o[Math.floor(Math.random()*o.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createTudorRose(e,l,n){return{type:"tudor-rose",x:-30,y:Math.random()*l,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.8+Math.random()*.2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,petalCount:5,active:!0}},createOakLeaf(e,l,n){const s=Math.random();let o;return s<.6?o="#2d5016":s<.85?o="#6b8e23":o="#8b4513",{type:"oak-leaf",x:-30,y:Math.random()*l,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.03,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:o,flutter:Math.random()*Math.PI*2,flutterSpeed:.03+Math.random()*.02,active:!0}},createSparkle(e,l,n){const s=["#FFD700","#FFFFFF","#C8102E"];return{type:"sparkle",x:-20,y:Math.random()*l,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:s[Math.floor(Math.random()*s.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,l,n){const s=Math.random();return s<.6?this.createRosePetal(e,l,n):s<.8?this.createTudorRose(e,l,n):s<.95?this.createSparkle(e,l,n):this.createOakLeaf(e,l,n)},createEnglishRose(e,l,n={}){return{type:"english-rose",x:n.x!==void 0?n.x:Math.random()*e*.8+e*.1,y:n.y!==void 0?n.y:l-60-Math.random()*100,size:15+Math.random()*10,opacity:1,color:Math.random()<.7?"#C8102E":"#FFFFFF",bloomPhase:Math.random()*Math.PI*2,petalCount:8+Math.floor(Math.random()*5),active:!0,static:!0}},createStGeorgesCross(e,l,n={}){return{type:"st-georges-cross",x:n.x!==void 0?n.x:e*.1+Math.random()*e*.8,y:n.y!==void 0?n.y:50+Math.random()*100,size:40+Math.random()*20,opacity:1,waveOffset:Math.random()*Math.PI*2,waveSpeed:.001+Math.random()*.001,active:!0,static:!0}},createKnight(e,l){const n=Math.random()<.5;return{type:"knight",x:n?-80:e+80,y:l-50,baseY:l-50,vx:n?.8+Math.random()*.4:-(.8+Math.random()*.4),size:20+Math.random()*10,opacity:1,marchPhase:Math.random()*Math.PI*2,marchSpeed:.015,active:!0,static:!1}},createDragon(e,l,n={}){const s=Math.random()<.5;return{type:"dragon",x:s?-100:e+100,y:l*.3+Math.random()*l*.2,baseY:l*.3+Math.random()*l*.2,vx:s?1.5+Math.random()*.5:-(1.5+Math.random()*.5),size:30+Math.random()*15,opacity:1,wingPhase:Math.random()*Math.PI*2,wingSpeed:.012,breatheFirePhase:Math.random()*Math.PI*2,active:!0,static:!1}},createShield(e,l,n={}){return{type:"shield",x:n.x!==void 0?n.x:e*.2+Math.random()*e*.6,y:n.y!==void 0?n.y:l-80-Math.random()*150,size:20+Math.random()*10,opacity:1,rotation:-Math.PI/12+Math.random()*(Math.PI/6),glintPhase:Math.random()*Math.PI*2,active:!0,static:!0}},createInitialDecorations(e,l,n){const s=[];s.push({type:"castle",x:150,y:l-100,size:80+Math.random()*20,opacity:1,active:!0,static:!0}),s.push({type:"dragon",x:e-200,y:l-60,baseY:l-60,vx:0,size:25+Math.random()*10,opacity:1,time:0,wingPhase:Math.random()*Math.PI*2,breathePhase:Math.random()*Math.PI*2,active:!0,static:!0}),s.push({type:"knight",x:e*.4,y:l-45,baseY:l-45,vx:0,size:20+Math.random()*5,opacity:1,time:0,legPhase:0,weaponRaised:!0,active:!0,static:!0}),s.push(this.createStGeorgesCross(e,l,{x:150,y:l-180,size:30})),s.push(this.createShield(e,l,{x:e*.15,y:l-60}));const o=n.twinklingStars??18;for(let a=0;a<o;a++)s.push(this.createTwinklingStar(e,l));return s},createTwinklingStar(e,l){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(l*.5),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,l,n,s){const o=Math.random();return o<s.knightChance?e.some(a=>a.type==="knight")?null:this.createKnight(l,n):o<s.knightChance*1.2?e.some(a=>a.type==="dragon")?null:this.createDragon(l,n):o<5e-4&&e.filter(r=>r.type==="english-rose").length<s.roses?this.createEnglishRose(l,n):o<3e-4&&e.filter(r=>r.type==="st-georges-cross").length<2?this.createStGeorgesCross(l,n):o<4e-4&&e.filter(r=>r.type==="shield").length<3?this.createShield(l,n):null},drawRosePetal(e,l,n){const s=l.x,o=l.y,a=l.size,r=Math.sin(n*l.flutterSpeed+l.flutter)*.3;e.save(),e.globalAlpha=l.opacity,e.translate(s,o),e.rotate(l.rotation+r);const t=l.color.includes("FFF")||l.color.includes("fff");e.fillStyle=l.color,e.strokeStyle=t?"#FFE6E6":"#8B0000",e.lineWidth=a*.08,e.beginPath(),e.moveTo(0,-a*.4),e.bezierCurveTo(a*.6,-a*.8,a*.8,-a*.2,a*.4,a*.2),e.lineTo(0,a*1),e.lineTo(-a*.4,a*.2),e.bezierCurveTo(-a*.8,-a*.2,-a*.6,-a*.8,0,-a*.4),e.closePath(),e.fill(),e.stroke(),e.strokeStyle=t?"rgba(255, 182, 193, 0.5)":"rgba(139, 0, 0, 0.4)",e.lineWidth=a*.06,e.beginPath(),e.moveTo(0,-a*.3),e.lineTo(0,a*.9),e.stroke(),e.restore()},drawEnglishRose(e,l,n){const s=l.x,o=l.y,a=l.size,r=.8+(Math.sin(n*.002+l.bloomPhase)+1)*.1;e.save(),e.translate(s,o),e.strokeStyle=this.colors.greenStem,e.lineWidth=a*.12,e.beginPath(),e.moveTo(0,0),e.quadraticCurveTo(-a*.2,a*.8,0,a*1.5),e.stroke(),e.fillStyle="#2D5016",[-1,1].forEach(t=>{e.save(),e.translate(t*a*.15,a*.8),e.rotate(t*Math.PI/6),e.beginPath(),e.ellipse(0,0,a*.3,a*.15,0,0,Math.PI*2),e.fill(),e.restore()}),e.fillStyle=l.color,e.strokeStyle=l.color==="#FFFFFF"?"#FFE6E6":"#8B0000",e.lineWidth=1;for(let t=0;t<l.petalCount;t++){const d=t/l.petalCount*Math.PI*2;e.save(),e.rotate(d),e.translate(0,-a*.4*r),e.beginPath(),e.moveTo(0,a*.25),e.bezierCurveTo(-a*.25,-a*.1,-a*.15,-a*.35,0,-a*.25),e.bezierCurveTo(a*.15,-a*.35,a*.25,-a*.1,0,a*.25),e.closePath(),e.fill(),e.stroke(),e.restore()}e.globalAlpha=.9;for(let t=0;t<l.petalCount-2;t++){const d=t/(l.petalCount-2)*Math.PI*2+Math.PI/l.petalCount;e.save(),e.rotate(d),e.translate(0,-a*.25*r),e.beginPath(),e.moveTo(0,a*.15),e.bezierCurveTo(-a*.15,-a*.05,-a*.1,-a*.2,0,-a*.15),e.bezierCurveTo(a*.1,-a*.2,a*.15,-a*.05,0,a*.15),e.closePath(),e.fill(),e.restore()}e.globalAlpha=1,e.fillStyle="#FFD700",e.beginPath(),e.arc(0,0,a*.15*r,0,Math.PI*2),e.fill(),e.fillStyle="#FFA500";for(let t=0;t<8;t++){const d=t/8*Math.PI*2,i=a*.08*r;e.beginPath(),e.arc(Math.cos(d)*i,Math.sin(d)*i,a*.03,0,Math.PI*2),e.fill()}e.restore()},drawStGeorgesCross(e,l,n){const s=l.x,o=l.y,a=l.size,r=n*l.waveSpeed+l.waveOffset;e.save(),e.translate(s,o);const t=e.createLinearGradient(-a*.64,0,-a*.56,0);t.addColorStop(0,"#5a4a3a"),t.addColorStop(.5,"#8B4513"),t.addColorStop(1,"#6a5343"),e.fillStyle=t,e.fillRect(-a*.64,-a*.35,a*.08,a*1.9),e.strokeStyle="#9a6333",e.lineWidth=1,e.beginPath(),e.moveTo(-a*.64,-a*.35),e.lineTo(-a*.64,a*1.55),e.stroke(),e.strokeStyle="#3a2a1a",e.beginPath(),e.moveTo(-a*.56,-a*.35),e.lineTo(-a*.56,a*1.55),e.stroke(),e.fillStyle="#FFD700",e.beginPath(),e.arc(-a*.6,-a*.4,a*.06,0,Math.PI*2),e.fill(),e.strokeStyle="#DAA520",e.lineWidth=1.5,e.stroke();const d=a*1.5,i=a*1,f=12;for(let M=0;M<f;M++){const P=-a*.5+M/f*d,g=-a*.5+(M+1)/f*d,z=g-P,S=Math.sin(r+M*.4)*a*.12,m=Math.sin(r+(M+1)*.4)*a*.12,u=(P+z/2+a*.5)/d,k=u>.4&&u<.6;e.save(),e.fillStyle="#FFFFFF",e.beginPath(),e.moveTo(P,-i/2+S),e.lineTo(g,-i/2+m),e.lineTo(g,i/2+m),e.lineTo(P,i/2+S),e.closePath(),e.fill(),e.fillStyle="#C8102E",k&&(e.beginPath(),e.moveTo(P,-i/2+S),e.lineTo(g,-i/2+m),e.lineTo(g,i/2+m),e.lineTo(P,i/2+S),e.closePath(),e.fill()),e.beginPath(),e.moveTo(P,-i*.15+S),e.lineTo(g,-i*.15+m),e.lineTo(g,i*.15+m),e.lineTo(P,i*.15+S),e.closePath(),e.fill();const F=Math.sin(r+M*.4)*.15;F>0?e.fillStyle=`rgba(255, 255, 255, ${F*.3})`:e.fillStyle=`rgba(0, 0, 0, ${-F*.2})`,e.beginPath(),e.moveTo(P,-i/2+S),e.lineTo(g,-i/2+m),e.lineTo(g,i/2+m),e.lineTo(P,i/2+S),e.closePath(),e.fill(),e.strokeStyle="rgba(0, 0, 0, 0.1)",e.lineWidth=.5,e.beginPath(),e.moveTo(g,-i/2+m),e.lineTo(g,i/2+m),e.stroke(),e.restore()}e.strokeStyle="rgba(0, 0, 0, 0.25)",e.lineWidth=1.5,e.beginPath(),e.moveTo(-a*.5,-i/2+Math.sin(r)*a*.12);for(let M=1;M<=f;M++){const P=-a*.5+M/f*d,g=Math.sin(r+M*.4)*a*.12;e.lineTo(P,-i/2+g)}e.lineTo(-a*.5+d,i/2+Math.sin(r+f*.4)*a*.12);for(let M=f;M>=0;M--){const P=-a*.5+M/f*d,g=Math.sin(r+M*.4)*a*.12;e.lineTo(P,i/2+g)}e.closePath(),e.stroke(),e.fillStyle="#A9A9A9";for(let M=0;M<3;M++){const P=-i/2+M/2*i,g=Math.sin(r)*a*.12;e.beginPath(),e.arc(-a*.48,P+g,a*.03,0,Math.PI*2),e.fill(),e.strokeStyle="#696969",e.lineWidth=1,e.stroke()}e.restore()},drawKnight:E,drawDragon:G,drawShield(e,l,n){const s=l.x,o=l.y,a=l.size,r=(Math.sin(n*.003+l.glintPhase)+1)*.5;e.save(),e.translate(s,o),e.rotate(l.rotation),e.fillStyle="#FFFFFF",e.strokeStyle="#FFD700",e.lineWidth=2,e.beginPath(),e.moveTo(0,-a*.7),e.lineTo(a*.5,-a*.5),e.lineTo(a*.5,a*.3),e.lineTo(0,a*.7),e.lineTo(-a*.5,a*.3),e.lineTo(-a*.5,-a*.5),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#C8102E",e.fillRect(-a*.1,-a*.6,a*.2,a*1.2),e.fillRect(-a*.45,-a*.1,a*.9,a*.2),e.strokeStyle=`rgba(255, 215, 0, ${r*.8})`,e.lineWidth=3,e.beginPath(),e.moveTo(0,-a*.7),e.lineTo(a*.5,-a*.5),e.lineTo(a*.5,a*.3),e.stroke(),e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=1,e.beginPath(),e.arc(0,0,a*.15,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle=`rgba(255, 255, 255, ${r*.6})`,e.beginPath(),e.arc(-a*.05,-a*.05,a*.06,0,Math.PI*2),e.fill(),e.restore()},drawCastle(e,l){const n=l.x,s=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(n,s);const a="#9a958f",r="#6a655f",t="#4a4540",d="#b5b0aa",i=o*1.4,f=o*1;e.fillStyle=t,e.fillRect(-i/2+o*.05,-f+o*.05,i,f);const M=e.createLinearGradient(-i/2,-f,i/2,-f);M.addColorStop(0,r),M.addColorStop(.5,a),M.addColorStop(1,r),e.fillStyle=M,e.fillRect(-i/2,-f,i,f),e.strokeStyle=t,e.lineWidth=2,e.strokeRect(-i/2,-f,i,f),e.strokeStyle="rgba(74, 69, 64, 0.4)",e.lineWidth=1;const P=o*.12,g=o*.18;for(let h=0;h<8;h++){const y=-f+h*P,p=h%2*(g/2);for(let D=0;D<8;D++){const B=-i/2+D*g+p;e.strokeRect(B,y,g,P)}}e.fillStyle=a;const z=o*.15,S=o*.12;for(let h=0;h<9;h++)if(h%2===0){const y=-i/2+h*(i/8);e.fillRect(y,-f-S,z,S),e.strokeRect(y,-f-S,z,S),e.fillStyle=t,e.fillRect(y+z/2-o*.015,-f-S+o*.02,o*.03,S-o*.04),e.fillStyle=a}const m=o*.22,T=o*1.2,u=-o*.85,k=-T/2;e.fillStyle=t,e.beginPath(),e.ellipse(u+o*.03,k+o*.03,m,T/2,0,0,Math.PI*2),e.fill();const F=e.createRadialGradient(u-m*.3,k,0,u,k,m);F.addColorStop(0,d),F.addColorStop(.5,a),F.addColorStop(1,r),e.fillStyle=F,e.beginPath(),e.ellipse(u,k,m,T/2,0,0,Math.PI*2),e.fill(),e.strokeStyle=t,e.lineWidth=2,e.stroke(),e.fillStyle=a;for(let h=0;h<6;h++)if(h%2===0){const y=h/6*Math.PI,p=Math.cos(y)*m;e.fillRect(u+p-o*.06,-T-o*.1,o*.12,o*.1),e.strokeRect(u+p-o*.06,-T-o*.1,o*.12,o*.1)}e.fillStyle="#1a1510";for(let h=0;h<3;h++){const y=k-T*.2+h*T*.25;e.fillRect(u-o*.02,y,o*.04,o*.15),e.beginPath(),e.moveTo(u-o*.02,y+o*.15),e.lineTo(u-o*.06,y+o*.18),e.lineTo(u+o*.06,y+o*.18),e.lineTo(u+o*.02,y+o*.15),e.fill()}const C=o*.85;e.fillStyle=t,e.beginPath(),e.ellipse(C+o*.03,k+o*.03,m,T/2,0,0,Math.PI*2),e.fill();const I=e.createRadialGradient(C+m*.3,k,0,C,k,m);I.addColorStop(0,d),I.addColorStop(.5,a),I.addColorStop(1,r),e.fillStyle=I,e.beginPath(),e.ellipse(C,k,m,T/2,0,0,Math.PI*2),e.fill(),e.strokeStyle=t,e.lineWidth=2,e.stroke(),e.fillStyle=a;for(let h=0;h<6;h++)if(h%2===0){const y=h/6*Math.PI,p=Math.cos(y)*m;e.fillRect(C+p-o*.06,-T-o*.1,o*.12,o*.1),e.strokeRect(C+p-o*.06,-T-o*.1,o*.12,o*.1)}e.fillStyle="#1a1510";for(let h=0;h<3;h++){const y=k-T*.2+h*T*.25;e.fillRect(C-o*.02,y,o*.04,o*.15),e.beginPath(),e.moveTo(C-o*.02,y+o*.15),e.lineTo(C-o*.06,y+o*.18),e.lineTo(C+o*.06,y+o*.18),e.lineTo(C+o*.02,y+o*.15),e.fill()}const b=o*.35,v=o*.5;e.fillStyle=t,e.beginPath(),e.moveTo(-b,-o*.05),e.lineTo(-b,-v),e.arc(0,-v,b,Math.PI,0,!1),e.lineTo(b,-o*.05),e.closePath(),e.fill(),e.strokeStyle=r,e.lineWidth=o*.06,e.beginPath(),e.arc(0,-v,b-o*.03,Math.PI,0,!1),e.stroke(),e.strokeStyle="rgba(74, 69, 64, 0.6)",e.lineWidth=2;for(let h=0;h<9;h++){const y=Math.PI+h/8*Math.PI;e.beginPath(),e.moveTo(0,-v),e.lineTo(Math.cos(y)*b,-v+Math.sin(y)*b),e.stroke()}e.fillStyle="#0a0a08",e.beginPath(),e.moveTo(-b+o*.1,-o*.05),e.lineTo(-b+o*.1,-v+o*.05),e.arc(0,-v+o*.05,b-o*.1,Math.PI,0,!1),e.lineTo(b-o*.1,-o*.05),e.closePath(),e.fill(),e.strokeStyle="#2a2520",e.lineWidth=4;const A=7;for(let h=0;h<A;h++){const y=-b+o*.15+h/(A-1)*(b*2-o*.3);e.beginPath(),e.moveTo(y,-o*.05),e.lineTo(y,-v+o*.15),e.stroke()}e.lineWidth=3;for(let h=0;h<4;h++){const y=-o*.1-h*o*.12;e.beginPath(),e.moveTo(-b+o*.15,y),e.lineTo(b-o*.15,y),e.stroke()}e.fillStyle=r,e.beginPath(),e.moveTo(-i/2,0),e.lineTo(-i/2-o*.08,0),e.lineTo(-i/2-o*.05,-f*.6),e.lineTo(-i/2,-f*.6),e.closePath(),e.fill(),e.strokeStyle=t,e.stroke(),e.beginPath(),e.moveTo(i/2,0),e.lineTo(i/2+o*.08,0),e.lineTo(i/2+o*.05,-f*.6),e.lineTo(i/2,-f*.6),e.closePath(),e.fill(),e.stroke(),e.save(),e.translate(0,-T-o*.15);const W=e.createLinearGradient(-o*.02,0,o*.02,0);W.addColorStop(0,"#5a4a3a"),W.addColorStop(.5,"#8b7355"),W.addColorStop(1,"#5a4a3a"),e.fillStyle=W,e.fillRect(-o*.02,0,o*.04,-o*.45),e.strokeStyle="#3a2a1a",e.lineWidth=1,e.strokeRect(-o*.02,0,o*.04,-o*.45),e.fillStyle="#FFD700",e.beginPath(),e.arc(0,-o*.45,o*.04,0,Math.PI*2),e.fill(),e.strokeStyle="#DAA520",e.stroke();const R=o*.4,w=o*.25;e.fillStyle="#FFFFFF",e.fillRect(0,-o*.42,R,w),e.strokeStyle="rgba(0, 0, 0, 0.1)",e.strokeRect(0,-o*.42,R,w),e.fillStyle="#C8102E",e.fillRect(R*.4,-o*.42,R*.2,w),e.fillRect(0,-o*.42+w*.4,R,w*.2),e.restore(),e.restore()},drawTudorRose(e,l){const n=l.x,s=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(n,s),e.rotate(l.rotation),e.fillStyle="#C8102E",e.strokeStyle="#8B0000",e.lineWidth=o*.05;for(let a=0;a<5;a++){const r=a/5*Math.PI*2-Math.PI/2;e.save(),e.rotate(r),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-o*.5,-o*.4,-o*.6,-o*.8,0,-o*1.2),e.bezierCurveTo(o*.6,-o*.8,o*.5,-o*.4,0,0),e.closePath(),e.fill(),e.stroke(),e.restore()}e.fillStyle="#FFFFFF",e.strokeStyle="#E0E0E0";for(let a=0;a<5;a++){const r=a/5*Math.PI*2-Math.PI/2+Math.PI/5;e.save(),e.rotate(r),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-o*.3,-o*.25,-o*.35,-o*.5,0,-o*.7),e.bezierCurveTo(o*.35,-o*.5,o*.3,-o*.25,0,0),e.closePath(),e.fill(),e.stroke(),e.restore()}e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=o*.05,e.beginPath(),e.arc(0,0,o*.2,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#FFA500";for(let a=0;a<5;a++){const r=a/5*Math.PI*2,t=o*.12;e.beginPath(),e.arc(Math.cos(r)*t,Math.sin(r)*t,o*.04,0,Math.PI*2),e.fill()}e.restore()},drawOakLeaf(e,l){const n=l.x,s=l.y,o=l.size;e.save(),e.globalAlpha=l.opacity,e.translate(n,s),e.rotate(l.rotation),e.fillStyle=l.color,e.strokeStyle=l.color==="#8b4513"?"#654321":"#1a3a0a",e.lineWidth=o*.08,e.beginPath(),e.moveTo(0,o*1.5),e.bezierCurveTo(o*.3,o*1.2,o*.4,o*1,o*.5,o*.8),e.bezierCurveTo(o*.7,o*.7,o*.8,o*.5,o*.6,o*.3),e.bezierCurveTo(o*.8,o*.2,o*.9,0,o*.7,-o*.3),e.bezierCurveTo(o*.85,-o*.5,o*.8,-o*.8,o*.5,-o*1),e.bezierCurveTo(o*.3,-o*1.2,0,-o*1.3,-o*.3,-o*1.2),e.bezierCurveTo(-o*.8,-o*.8,-o*.85,-o*.5,-o*.7,-o*.3),e.bezierCurveTo(-o*.9,0,-o*.8,o*.2,-o*.6,o*.3),e.bezierCurveTo(-o*.8,o*.5,-o*.7,o*.7,-o*.5,o*.8),e.bezierCurveTo(-o*.4,o*1,-o*.3,o*1.2,0,o*1.5),e.closePath(),e.fill(),e.stroke(),e.strokeStyle=l.color==="#8b4513"?"#654321":"#0a2505",e.lineWidth=o*.06,e.beginPath(),e.moveTo(0,o*1.4),e.lineTo(0,-o*1.15),e.stroke(),e.lineWidth=o*.03;for(let a=0;a<4;a++){const r=o*.8-a*o*.5;e.beginPath(),e.moveTo(0,r),e.lineTo(o*.4,r-o*.15),e.stroke(),e.beginPath(),e.moveTo(0,r),e.lineTo(-o*.4,r-o*.15),e.stroke()}e.restore()},drawSparkle(e,l,n){const s=l.x,o=l.y,a=l.size,r=.6+Math.sin(n*.004+l.twinklePhase)*.4;e.save(),e.globalAlpha=l.opacity*r,e.translate(s,o),e.rotate(l.rotation),e.fillStyle=l.color,e.shadowColor=l.color,e.shadowBlur=a*2,e.beginPath(),e.moveTo(0,-a),e.lineTo(a*.3,-a*.3),e.lineTo(a,0),e.lineTo(a*.3,a*.3),e.lineTo(0,a),e.lineTo(-a*.3,a*.3),e.lineTo(-a,0),e.lineTo(-a*.3,-a*.3),e.closePath(),e.fill(),e.restore()},drawCrown(e,l){const n=l.x,s=l.y,o=l.size,a=(Math.sin(l.glint)+1)*.5;e.save(),e.globalAlpha=l.opacity,e.translate(n,s),e.rotate(l.rotation);const r=e.createLinearGradient(-o,0,o,0);r.addColorStop(0,"#B8860B"),r.addColorStop(.5,"#FFD700"),r.addColorStop(1,"#B8860B"),e.fillStyle=r,e.strokeStyle="#8B6914",e.lineWidth=o*.05,e.beginPath(),e.ellipse(0,o*.3,o*.8,o*.25,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="#8B0000",e.lineWidth=o*.08,e.beginPath(),e.ellipse(0,o*.3,o*.7,o*.2,0,0,Math.PI*2),e.stroke(),e.fillStyle=r,e.strokeStyle="#8B6914",e.lineWidth=o*.05;for(let d=0;d<5;d++){const i=d/5*Math.PI*2-Math.PI/2,f=Math.cos(i)*o*.7,M=o*.3+Math.sin(i)*o*.2;e.save(),e.translate(f,M),e.rotate(i+Math.PI/2),e.beginPath(),e.moveTo(0,-o*.8),e.lineTo(-o*.12,-o*.3),e.lineTo(o*.12,-o*.3),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(-o*.12,-o*.3),e.bezierCurveTo(-o*.25,-o*.5,-o*.28,-o*.65,-o*.2,-o*.75),e.lineTo(-o*.15,-o*.65),e.bezierCurveTo(-o*.18,-o*.55,-o*.15,-o*.4,-o*.08,-o*.32),e.fill(),e.stroke(),e.beginPath(),e.moveTo(o*.12,-o*.3),e.bezierCurveTo(o*.25,-o*.5,o*.28,-o*.65,o*.2,-o*.75),e.lineTo(o*.15,-o*.65),e.bezierCurveTo(o*.18,-o*.55,o*.15,-o*.4,o*.08,-o*.32),e.fill(),e.stroke(),e.restore()}e.fillStyle="#FFD700",e.strokeStyle="#8B6914",e.lineWidth=o*.04,e.beginPath(),e.fillRect(-o*.05,-o*.9,o*.1,o*.25),e.strokeRect(-o*.05,-o*.9,o*.1,o*.25),e.fillRect(-o*.15,-o*.82,o*.3,o*.08),e.strokeRect(-o*.15,-o*.82,o*.3,o*.08);const t=[{x:0,y:o*.3,color:"#DC143C",size:.12},{x:o*.4,y:o*.3,color:"#0000CD",size:.08},{x:-o*.4,y:o*.3,color:"#0000CD",size:.08}];for(const d of t)e.fillStyle=d.color,e.beginPath(),e.arc(d.x,d.y,o*d.size,0,Math.PI*2),e.fill(),e.fillStyle=`rgba(255, 255, 255, ${a*.7})`,e.beginPath(),e.arc(d.x-o*d.size*.3,d.y-o*d.size*.3,o*d.size*.4,0,Math.PI*2),e.fill();e.restore()},drawTwinklingStar(e,l,n){const s=l.x,o=l.y,a=l.size,r=.5+Math.sin(n*l.twinkleSpeed+l.twinklePhase)*.5,t=`rgba(255, 220, 220, ${r})`,d=`rgba(255, 180, 180, ${r*.4})`;e.save(),e.translate(s,o),e.shadowColor=d,e.shadowBlur=a*3*r,e.fillStyle=t,e.beginPath();for(let i=0;i<4;i++){const f=i*Math.PI/2,M=Math.cos(f)*a,P=Math.sin(f)*a,g=f+Math.PI/4,z=Math.cos(g)*(a*.3),S=Math.sin(g)*(a*.3);i===0?e.moveTo(M,P):e.lineTo(M,P),e.lineTo(z,S)}e.closePath(),e.fill(),e.shadowBlur=a*2*r,e.beginPath(),e.arc(0,0,a*.25,0,Math.PI*2),e.fill(),e.restore()}};
@@ -1 +1 @@
1
- export default{name:"st-patricks",displayName:"St Patrick's Day",emoji:"\u2618\uFE0F",intensityConfig:{light:{count:40,speedRange:[.4,1.2],sizeRange:[2,4],pots:1,leprechaunChance:3e-4,twinklingStars:10},medium:{count:80,speedRange:[.5,1.5],sizeRange:[2,5],pots:2,leprechaunChance:5e-4,twinklingStars:18},heavy:{count:120,speedRange:[.6,1.8],sizeRange:[3,6],pots:3,leprechaunChance:8e-4,twinklingStars:25}},particles:["clover-petal","shamrock","gold-coin","sparkle"],decorations:["pot-of-gold","rainbow","leprechaun","harp","static-leprechaun","moon","twinkling-star"],colors:{primary:"#228B22",secondary:"#90EE90",white:"#FFFFFF",accent:"#FFD700",rainbow:["#ff0000","#ffa500","#ffff00","#00ff00","#0000ff","#4b0082","#8b00ff"]},createCloverPetal(e,o,n){const s=["#228B22","#32CD32","#90EE90","#3CB371","#2E8B57"];return{type:"clover-petal",x:-30,y:Math.random()*o,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:(n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.025,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:s[Math.floor(Math.random()*s.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createShamrock(e,o,n){const s=Math.random();let l,a;return s<.5?(l="#228B22",a="#006400"):s<.75?(l="#FFFFFF",a="#d0d0d0"):(l="#FFD700",a="#DAA520"),{type:"shamrock",x:-30,y:Math.random()*o,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.7+Math.random()*.3,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.025,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,color:l,strokeColor:a,active:!0}},createGoldCoin(e,o,n){return{type:"gold-coin",x:-30,y:Math.random()*o,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:2+Math.random()*3,speed:(Math.random()-.5)*.1,opacity:.9+Math.random()*.1,rotation:0,rotationSpeed:.05+Math.random()*.1,spinPhase:Math.random()*Math.PI*2,glintPhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.01+Math.random()*.02,active:!0}},createPotOfGold(e,o,n={}){return{type:"pot-of-gold",x:n.x!==void 0?n.x:Math.random()*e*.6+e*.2,y:n.y!==void 0?n.y:o-40,size:20+Math.random()*10,opacity:1,glintPhase:Math.random()*Math.PI*2,coins:[],active:!0,static:!0}},createRainbow(e,o,n,s){const a=n,r=(20+n)/2,h=o*.2,t=s-h/2;return{type:"rainbow",x:r,y:t,startX:20,endX:a,endY:s,width:e,height:o,opacity:.7,vx:0,vy:0,active:!0,static:!0}},createSparkle(e,o,n){const s=["#FFD700","#FFFFFF","#228B22"];return{type:"sparkle",x:-20,y:Math.random()*o,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:s[Math.floor(Math.random()*s.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,o,n){const s=Math.random();return s<.6?this.createCloverPetal(e,o,n):s<.8?this.createShamrock(e,o,n):s<.95?this.createGoldCoin(e,o,n):this.createSparkle(e,o,n)},createInitialDecorations(e,o,n){const s=[];s.push({type:"moon",x:e-120,y:100,size:60+Math.random()*20,opacity:.85,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0});const l=20,a=220,r=o-40;s.push(this.createPotOfGold(e,o,{x:a,y:r})),s.push(this.createRainbow(e,o,a,r));const h=1+Math.floor(Math.random()*2);for(let f=0;f<h;f++){const P=60+Math.random()*(e-120);s.push({type:"static-leprechaun",x:P,y:o-35,size:12+Math.random()*4,opacity:1,time:Math.random()*1e3,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0})}const t=n.twinklingStars??18;for(let f=0;f<t;f++)s.push(this.createTwinklingStar(e,o));return s},createTwinklingStar(e,o){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(o*.5),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,o,n,s){const l=Math.random();if(l<s.leprechaunChance){if(e.some(t=>t.type==="leprechaun"))return null;const a=Math.random()<.5,r=(o+100)/180;return{type:"leprechaun",x:a?-50:o+50,y:n-35,baseY:n-35,vx:a?r:-r,vy:0,size:12+Math.random()*6,opacity:1,time:0,legPhase:Math.random()*Math.PI*2,active:!0,static:!1}}if(l<s.leprechaunChance+3e-4){if(e.some(r=>r.type==="banshee"))return null;const a=Math.random()<.5;return{type:"banshee",x:a?-100:o+100,y:Math.random()*(n*.4)+50,baseY:Math.random()*(n*.4)+50,vx:a?2+Math.random()*1:-(2+Math.random()*1),size:18+Math.random()*10,opacity:.6+Math.random()*.2,waveAmplitude:25+Math.random()*20,waveFrequency:.0015+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,wailPhase:Math.random()*Math.PI*2,active:!0,static:!1}}if(l<.001&&e.filter(r=>r.type==="pot-of-gold").length<s.pots){const r=this.createPotOfGold(o,n),h=this.createRainbow(o,n,r.x,r.y);return e.push(h),r}return null},updateSpecialParticles(e,o,n,s){return e.forEach(l=>{l.active&&((l.type==="leprechaun"||l.type==="banshee")&&(l.time+=o,l.type==="leprechaun"?(l.vx>0&&l.x>n+l.size*2||l.vx<0&&l.x<-l.size*2)&&(l.active=!1):l.type==="banshee"&&(l.vx>0&&l.x>n+l.size*4||l.vx<0&&l.x<-l.size*4)&&(l.active=!1)),l.type==="static-leprechaun"&&(l.time+=o))}),e.filter(l=>l.active)},drawCloverPetal(e,o,n){const s=o.x,l=o.y,a=o.size,r=Math.sin(n*o.flutterSpeed+o.flutter)*.3;e.save(),e.globalAlpha=o.opacity,e.translate(s,l),e.rotate(o.rotation+r),e.fillStyle=o.color,e.strokeStyle="#006400",e.lineWidth=a*.08,e.beginPath(),e.moveTo(0,-a*.3),e.bezierCurveTo(-a*.6,-a*.7,-a*.8,-a*.3,-a*.5,a*.2),e.lineTo(0,a*.8),e.lineTo(a*.5,a*.2),e.bezierCurveTo(a*.8,-a*.3,a*.6,-a*.7,0,-a*.3),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(0, 100, 0, 0.4)",e.lineWidth=a*.06,e.beginPath(),e.moveTo(0,-a*.2),e.lineTo(0,a*.7),e.stroke(),e.restore()},drawSparkle(e,o,n){const s=o.x,l=o.y,a=o.size,r=.6+Math.sin(n*.004+o.twinklePhase)*.4;e.save(),e.globalAlpha=o.opacity*r,e.translate(s,l),e.rotate(o.rotation),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=a*2,e.beginPath(),e.moveTo(0,-a),e.lineTo(a*.3,-a*.3),e.lineTo(a,0),e.lineTo(a*.3,a*.3),e.lineTo(0,a),e.lineTo(-a*.3,a*.3),e.lineTo(-a,0),e.lineTo(-a*.3,-a*.3),e.closePath(),e.fill(),e.restore()},drawShamrock(e,o){const n=o.x,s=o.y,l=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,s),e.rotate(o.rotation),e.fillStyle=o.color||"#228B22",e.strokeStyle=o.strokeColor||"#006400",e.lineWidth=l*.1;for(let a=0;a<3;a++){const r=a/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(r),e.translate(0,-l*.7),e.beginPath(),e.moveTo(0,l*.3),e.bezierCurveTo(-l*.5,-l*.2,-l*.3,-l*.6,0,-l*.35),e.bezierCurveTo(l*.3,-l*.6,l*.5,-l*.2,0,l*.3),e.closePath(),e.fill(),e.stroke(),e.restore()}e.strokeStyle="#8B4513",e.lineWidth=l*.15,e.beginPath(),e.moveTo(0,0),e.lineTo(0,l*1.2),e.stroke(),e.restore()},drawGoldCoin(e,o,n){const s=o.x,l=o.y,a=o.size,r=Math.abs(Math.cos(o.rotation))*a;if(e.save(),e.globalAlpha=o.opacity,e.translate(s,l),e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=a*.15,e.beginPath(),e.ellipse(0,0,r,a,0,0,Math.PI*2),e.fill(),e.stroke(),r>a*.3){const h=(Math.sin(n*.005+o.glintPhase)+1)*.5;e.fillStyle=`rgba(255, 255, 255, ${h*.6})`,e.beginPath(),e.ellipse(-r*.3,-a*.3,r*.3,a*.3,0,0,Math.PI*2),e.fill()}e.restore()},drawPotOfGold(e,o,n){const s=o.x,l=o.y,a=o.size;e.save(),e.translate(s,l),e.fillStyle="#1a1a1a",e.strokeStyle="#0a0a0a",e.lineWidth=2,e.beginPath(),e.arc(0,0,a*.7,0,Math.PI),e.lineTo(-a*.7,a*.4),e.quadraticCurveTo(0,a*.6,a*.7,a*.4),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#2a2a2a",e.lineWidth=3,e.beginPath(),e.arc(0,-a*.2,a*.5,Math.PI,0),e.stroke();const r=[{x:-a*.4,y:-a*.2,s:.8},{x:a*.3,y:-a*.3,s:.9},{x:-a*.1,y:-a*.5,s:1},{x:a*.5,y:-a*.1,s:.7},{x:-a*.5,y:0,s:.75},{x:a*.1,y:-a*.6,s:.85},{x:0,y:-a*.3,s:.95}];e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=1,r.forEach((t,f)=>{const P=n*.002+f*.5,y=(Math.sin(P)+1)*.5;e.save(),e.translate(t.x,t.y),e.beginPath(),e.arc(0,0,a*.2*t.s,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle=`rgba(255, 255, 255, ${y*.6})`,e.beginPath(),e.arc(-a*.08*t.s,-a*.08*t.s,a*.08*t.s,0,Math.PI*2),e.fill(),e.restore()}),e.globalAlpha=.3;const h=e.createRadialGradient(0,-a*.2,0,0,-a*.2,a*1.5);h.addColorStop(0,"#FFD700"),h.addColorStop(1,"rgba(255, 215, 0, 0)"),e.fillStyle=h,e.fillRect(-a*1.5,-a*1.5,a*3,a*1.5),e.restore()},drawSmallGoldPot(e,o,n,s){e.save(),e.translate(o,n),e.fillStyle="#1a1a1a",e.strokeStyle="#0a0a0a",e.lineWidth=1,e.beginPath(),e.arc(0,-s*.4,s*.7,0,Math.PI,!0),e.lineTo(s*.7,s*.4),e.quadraticCurveTo(0,s*.6,-s*.7,s*.4),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#FFD700",e.beginPath(),e.arc(0,-s*.7,s*.5,0,Math.PI*2),e.fill(),e.restore()},drawRainbow(e,o){const n=o.startX,s=o.endX,l=o.endY,a=o.height;e.save(),e.globalAlpha=.5;const r=Math.abs(s-n),h=(n+s)/2,t=a*.2,f=(r*r+4*t*t)/(8*t),P=l+t-f,y=this.colors.rainbow,g=5;for(let d=y.length-1;d>=0;d--)e.strokeStyle=y[d],e.lineWidth=g,e.beginPath(),e.arc(h,P,f+(y.length-1-d)*g,Math.PI,0),e.stroke();e.restore(),this.drawSmallGoldPot(e,s,l,20)},drawLeprechaun(e,o,n){const s=o.x,l=o.y,a=o.size,r=o.vx>0?1:-1;e.save(),e.translate(s,l),r===-1&&e.scale(-1,1);const h=o.time*.05%(Math.PI*2),t=Math.sin(h+o.legPhase)*(Math.PI/6),f=Math.sin(h+Math.PI+o.legPhase)*(Math.PI/8);e.strokeStyle="#228B22",e.lineWidth=a*.15,e.beginPath(),e.moveTo(a*.2,a*.5),e.lineTo(a*.2+Math.sin(t)*a*.3,a*1.2+Math.cos(t)*a*.1),e.stroke(),e.beginPath(),e.moveTo(-a*.2,a*.5),e.lineTo(-a*.2+Math.sin(t+Math.PI)*a*.3,a*1.2+Math.cos(t+Math.PI)*a*.1),e.stroke(),e.fillStyle="#000000",e.fillRect(a*.2+Math.sin(t)*a*.3-a*.15,a*1.15+Math.cos(t)*a*.1,a*.3,a*.2),e.fillRect(-a*.2+Math.sin(t+Math.PI)*a*.3-a*.15,a*1.15+Math.cos(t+Math.PI)*a*.1,a*.3,a*.2),e.fillStyle="#FFD700",e.fillRect(a*.2+Math.sin(t)*a*.3-a*.1,a*1.2+Math.cos(t)*a*.1,a*.2,a*.1),e.fillRect(-a*.2+Math.sin(t+Math.PI)*a*.3-a*.1,a*1.2+Math.cos(t+Math.PI)*a*.1,a*.2,a*.1),e.fillStyle="#228B22",e.fillRect(-a*.5,0,a,a*.6),e.fillStyle="#000000",e.fillRect(-a*.5,a*.35,a,a*.1),e.fillStyle="#FFD700",e.fillRect(-a*.15,a*.35,a*.3,a*.1),e.fillStyle="#228B22",e.save(),e.translate(a*.4,a*.2),e.rotate(f),e.fillRect(0,0,a*.15,a*.4),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(a*.075,a*.4,a*.12,0,Math.PI*2),e.fill(),e.restore(),e.save(),e.translate(-a*.4-a*.15,a*.2),e.rotate(f+Math.PI),e.fillRect(0,0,a*.15,a*.4),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(a*.075,a*.4,a*.12,0,Math.PI*2),e.fill(),e.restore(),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(0,-a*.3,a*.4,0,Math.PI*2),e.fill(),e.fillStyle="#ff6600",e.beginPath(),e.moveTo(-a*.3,-a*.1),e.quadraticCurveTo(-a*.4,a*.2,0,a*.3),e.quadraticCurveTo(a*.4,a*.2,a*.3,-a*.1),e.closePath(),e.fill(),e.fillStyle="#228B22",e.fillRect(-a*.5,-a*.8,a,a*.1),e.fillRect(-a*.35,-a*1.4,a*.7,a*.6),e.fillStyle="#FFD700",e.fillRect(-a*.15,-a*.85,a*.3,a*.15),e.fillStyle="#000000",e.beginPath(),e.arc(-a*.12,-a*.35,a*.06,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.12,-a*.35,a*.06,0,Math.PI*2),e.fill(),e.restore()},drawBanshee(e,o,n){const s=o.x,l=o.y+Math.sin(n*o.waveFrequency+o.waveOffset)*o.waveAmplitude,a=o.size,r=o.vx>0?1:-1;e.save(),e.globalAlpha=o.opacity,e.translate(s,l),r===-1&&e.scale(-1,1);const h=e.createRadialGradient(0,-a*.5,0,0,-a*.5,a*3);h.addColorStop(0,"rgba(180, 255, 180, 0.4)"),h.addColorStop(.3,"rgba(150, 255, 150, 0.2)"),h.addColorStop(.6,"rgba(120, 255, 120, 0.1)"),h.addColorStop(1,"rgba(100, 255, 100, 0)"),e.fillStyle=h,e.fillRect(-a*3,-a*3,a*6,a*6);const t=Math.sin(n*.008+o.wailPhase)*a*.25;e.fillStyle="rgba(200, 240, 200, 0.3)",e.beginPath(),e.moveTo(-a*.8,-a*1.2),e.bezierCurveTo(-a*1.2+t*2,-a*.4,-a*1+t*1.5,a*.6,-a*.6+t,a*1.8),e.bezierCurveTo(-a*.3,a*1.5,a*.3,a*1.5,a*.6-t,a*1.8),e.bezierCurveTo(a*1-t*1.5,a*.6,a*1.2-t*2,-a*.4,a*.8,-a*1.2),e.closePath(),e.fill(),e.fillStyle="rgba(230, 255, 230, 0.85)",e.strokeStyle="rgba(180, 255, 180, 0.6)",e.lineWidth=a*.04,e.beginPath(),e.moveTo(-a*.5,-a*1);for(let i=0;i<=12;i++){const d=i/12,M=Math.sin(n*.012+d*Math.PI*3+o.wailPhase)*a*.3,b=(d-.5)*a*1.8+M,S=-a*1+d*a*2.2;i===0?e.moveTo(b,S):e.lineTo(b,S)}e.lineTo(-a*.5,-a*1),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(180, 255, 180, 0.4)",e.lineWidth=a*.02;for(let i=0;i<8;i++){const d=-a*.7+i*(a*1.4/7),M=Math.sin(n*.015+i*.8)*a*.2;e.beginPath(),e.moveTo(d,a*.4),e.lineTo(d+M,a*1.2+i%2*a*.4),e.stroke()}const f=Math.sin(n*.006)*.15;e.save(),e.rotate(f),e.fillStyle="rgba(240, 255, 240, 0.9)",e.strokeStyle="rgba(180, 230, 180, 0.5)",e.lineWidth=a*.03,e.beginPath(),e.ellipse(0,-a*.8,a*.35,a*.55,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="rgba(50, 100, 50, 0.6)",e.beginPath(),e.ellipse(-a*.15,-a*.85,a*.12,a*.08,0,0,Math.PI*2),e.ellipse(a*.15,-a*.85,a*.12,a*.08,0,0,Math.PI*2),e.fill();const P=.6+Math.sin(n*.008+o.wailPhase)*.4;e.fillStyle=`rgba(100, 255, 150, ${P})`,e.shadowColor="#64ff96",e.shadowBlur=a*.6,e.beginPath(),e.arc(-a*.15,-a*.85,a*.08,0,Math.PI*2),e.arc(a*.15,-a*.85,a*.08,0,Math.PI*2),e.fill(),e.shadowBlur=0;const y=.2+Math.sin(n*.01+o.wailPhase)*.1;e.fillStyle="rgba(80, 150, 80, 0.7)",e.strokeStyle="rgba(50, 100, 50, 0.8)",e.lineWidth=a*.02,e.beginPath(),e.ellipse(0,-a*.6,a*.15,a*(.2+y),0,0,Math.PI*2),e.fill(),e.stroke(),e.restore(),e.strokeStyle="rgba(220, 255, 220, 0.7)";for(let i=0;i<12;i++){const d=-a*.35+i/11*a*.7,M=Math.sin(n*.01+i*.6+o.wailPhase)*a*.5,b=Math.cos(n*.008+i*.4)*a*.3;e.lineWidth=a*(.04+i%3*.02),e.beginPath(),e.moveTo(d,-a*1.1),e.bezierCurveTo(d+M*.3,-a*.5,d+M*.6+b*.5,a*.2,d+M+b,a*1+i%2*a*.5),e.stroke()}const g=Math.sin(n*.01+o.wailPhase)*a*.3;e.fillStyle="rgba(230, 255, 230, 0.8)",e.strokeStyle="rgba(180, 230, 180, 0.6)",e.lineWidth=a*.02,e.save(),e.translate(-a*.6,-a*.2),e.rotate(-.3+g*.002),e.beginPath(),e.ellipse(0,0,a*.15,a*.25,0,0,Math.PI*2),e.fill(),e.stroke();for(let i=0;i<4;i++){const d=-a*.08+i*a*.055;e.beginPath(),e.moveTo(d,a*.15),e.lineTo(d,a*.35),e.stroke()}e.restore(),e.save(),e.translate(a*.6,-a*.2),e.rotate(.3-g*.002),e.beginPath(),e.ellipse(0,0,a*.15,a*.25,0,0,Math.PI*2),e.fill(),e.stroke();for(let i=0;i<4;i++){const d=-a*.08+i*a*.055;e.beginPath(),e.moveTo(d,a*.15),e.lineTo(d,a*.35),e.stroke()}e.restore(),e.strokeStyle="rgba(180, 255, 180, 0.3)",e.lineWidth=a*.02;for(let i=0;i<6;i++){const d=i/6*Math.PI*2,M=Math.sin(n*.01+i*.8)*a*.6,b=a*(1.5+i%2*.5);e.beginPath(),e.moveTo(0,a*.4),e.bezierCurveTo(Math.cos(d)*a*.8+M*.5,a*1,Math.cos(d)*a*1.5+M,a*1.8,Math.cos(d)*b+M*1.5,a*2.5),e.stroke()}e.restore()},drawMoon(e,o,n){const s=o.x,l=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(s,l);const r=e.createRadialGradient(-a*.2,-a*.2,0,0,0,a);r.addColorStop(0,"#90EE90"),r.addColorStop(.5,"#7FD87F"),r.addColorStop(1,"#5CB85C"),e.fillStyle=r,e.beginPath(),e.arc(0,0,a,0,Math.PI*2),e.fill(),e.fillStyle="rgba(60, 130, 60, 0.3)",e.beginPath(),e.arc(-a*.3,-a*.2,a*.15,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.25,a*.1,a*.2,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.1,-a*.4,a*.12,0,Math.PI*2),e.fill(),e.save(),e.translate(a*.2,a*.35),e.scale(.15,.15),e.fillStyle="rgba(34, 139, 34, 0.4)";for(let f=0;f<3;f++){const P=f/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(P),e.translate(0,-a*.7),e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(-a*.5,-a*.2,-a*.3,-a*.6,0,-a*.35),e.bezierCurveTo(a*.3,-a*.6,a*.5,-a*.2,0,a*.3),e.closePath(),e.fill(),e.restore()}e.restore();const h=.3+Math.sin(n*.002+o.glowPhase)*.15;e.globalAlpha=h;const t=e.createRadialGradient(0,0,a*.8,0,0,a*1.8);t.addColorStop(0,"rgba(144, 238, 144, 0.8)"),t.addColorStop(.5,"rgba(144, 238, 144, 0.4)"),t.addColorStop(1,"rgba(144, 238, 144, 0)"),e.fillStyle=t,e.beginPath(),e.arc(0,0,a*1.8,0,Math.PI*2),e.fill(),e.restore()},drawStaticLeprechaun(e,o,n){const s=o.x,l=o.y,a=o.size;e.save(),e.translate(s,l);const r=Math.sin(o.time*.005+o.wavePhase)*a*.05,h=Math.sin(o.time*.003+o.wavePhase*.5)*.05;e.translate(0,r),e.rotate(h),e.strokeStyle="#228B22",e.lineWidth=a*.15,e.beginPath(),e.moveTo(-a*.2,a*.5),e.lineTo(-a*.25,a*1.2),e.stroke(),e.beginPath(),e.moveTo(a*.2,a*.5),e.lineTo(a*.25,a*1.2),e.stroke(),e.fillStyle="#000000",e.fillRect(-a*.35,a*1.15,a*.25,a*.15),e.fillRect(a*.1,a*1.15,a*.25,a*.15),e.fillStyle="#FFD700",e.fillRect(-a*.32,a*1.18,a*.15,a*.08),e.fillRect(a*.13,a*1.18,a*.15,a*.08),e.fillStyle="#228B22",e.fillRect(-a*.5,0,a,a*.6),e.fillStyle="#000000",e.fillRect(-a*.5,a*.35,a,a*.1),e.fillStyle="#FFD700",e.fillRect(-a*.15,a*.35,a*.3,a*.1),e.save(),e.translate(-a*.5,a*.2),e.rotate(-.3+Math.sin(o.time*.007+o.wavePhase*1.2)*.1),e.fillStyle="#228B22",e.fillRect(0,0,a*.15,a*.4),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(a*.075,a*.4,a*.12,0,Math.PI*2),e.fill(),e.restore(),e.save(),e.translate(a*.5,a*.2),e.rotate(.3-Math.sin(o.time*.006+o.wavePhase*.8)*.05),e.fillStyle="#228B22",e.fillRect(-a*.15,0,a*.15,a*.4),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(-a*.075,a*.4,a*.12,0,Math.PI*2),e.fill(),e.restore(),e.save(),e.translate(0,-a*.3),e.rotate(Math.sin(o.time*.004+o.wavePhase*1.5)*.02),e.beginPath(),e.arc(0,0,a*.4,0,Math.PI*2),e.fill(),e.restore(),e.fillStyle="#ff6600",e.beginPath(),e.moveTo(-a*.3,-a*.1),e.quadraticCurveTo(-a*.4,a*.2,0,a*.3),e.quadraticCurveTo(a*.4,a*.2,a*.3,-a*.1),e.closePath(),e.fill(),e.fillStyle="#228B22",e.fillRect(-a*.5,-a*.8,a,a*.1),e.fillRect(-a*.35,-a*1.4,a*.7,a*.6),e.fillStyle="#FFD700",e.fillRect(-a*.15,-a*.85,a*.3,a*.15),e.fillStyle="#000000",e.beginPath(),e.arc(-a*.12,-a*.35,a*.06,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.12,-a*.35,a*.06,0,Math.PI*2),e.fill(),e.strokeStyle="#000000",e.lineWidth=a*.04,e.beginPath(),e.arc(0,-a*.2,a*.15,0,Math.PI),e.stroke(),e.restore()},drawTwinklingStar(e,o,n){const s=o.x,l=o.y,a=o.size,r=.5+Math.sin(n*o.twinkleSpeed+o.twinklePhase)*.5,h=`rgba(220, 255, 220, ${r})`,t=`rgba(180, 255, 180, ${r*.4})`;e.save(),e.translate(s,l),e.shadowColor=t,e.shadowBlur=a*3*r,e.fillStyle=h,e.beginPath();for(let f=0;f<4;f++){const P=f*Math.PI/2,y=Math.cos(P)*a,g=Math.sin(P)*a,i=P+Math.PI/4,d=Math.cos(i)*(a*.3),M=Math.sin(i)*(a*.3);f===0?e.moveTo(y,g):e.lineTo(y,M),e.lineTo(d,M)}e.closePath(),e.fill(),e.shadowBlur=a*2*r,e.beginPath(),e.arc(0,0,a*.25,0,Math.PI*2),e.fill(),e.restore()}};
1
+ import{drawLeprechaun as m,drawStaticLeprechaun as w}from"./character-drawing.js";export default{name:"st-patricks",displayName:"St Patrick's Day",emoji:"\u2618\uFE0F",intensityConfig:{light:{count:40,speedRange:[.4,1.2],sizeRange:[2,4],pots:1,leprechaunChance:3e-4,twinklingStars:10},medium:{count:80,speedRange:[.5,1.5],sizeRange:[2,5],pots:2,leprechaunChance:5e-4,twinklingStars:18},heavy:{count:120,speedRange:[.6,1.8],sizeRange:[3,6],pots:3,leprechaunChance:8e-4,twinklingStars:25}},particles:["clover-petal","shamrock","gold-coin","sparkle"],decorations:["pot-of-gold","rainbow","leprechaun","harp","static-leprechaun","moon","twinkling-star"],colors:{primary:"#228B22",secondary:"#90EE90",white:"#FFFFFF",accent:"#FFD700",rainbow:["#ff0000","#ffa500","#ffff00","#00ff00","#0000ff","#4b0082","#8b00ff"]},createCloverPetal(e,o,n){const t=["#228B22","#32CD32","#90EE90","#3CB371","#2E8B57"];return{type:"clover-petal",x:-30,y:Math.random()*o,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:(n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.025,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:t[Math.floor(Math.random()*t.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createShamrock(e,o,n){const t=Math.random();let r,a;return t<.5?(r="#228B22",a="#006400"):t<.75?(r="#FFFFFF",a="#d0d0d0"):(r="#FFD700",a="#DAA520"),{type:"shamrock",x:-30,y:Math.random()*o,vx:n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]),size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.7+Math.random()*.3,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.025,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,color:r,strokeColor:a,active:!0}},createGoldCoin(e,o,n){return{type:"gold-coin",x:-30,y:Math.random()*o,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:2+Math.random()*3,speed:(Math.random()-.5)*.1,opacity:.9+Math.random()*.1,rotation:0,rotationSpeed:.05+Math.random()*.1,spinPhase:Math.random()*Math.PI*2,glintPhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.01+Math.random()*.02,active:!0}},createPotOfGold(e,o,n={}){return{type:"pot-of-gold",x:n.x!==void 0?n.x:Math.random()*e*.6+e*.2,y:n.y!==void 0?n.y:o-40,size:20+Math.random()*10,opacity:1,glintPhase:Math.random()*Math.PI*2,coins:[],active:!0,static:!0}},createRainbow(e,o,n,t){const a=n,s=(20+n)/2,d=o*.2,i=t-d/2;return{type:"rainbow",x:s,y:i,startX:20,endX:a,endY:t,width:e,height:o,opacity:.7,vx:0,vy:0,active:!0,static:!0}},createSparkle(e,o,n){const t=["#FFD700","#FFFFFF","#228B22"];return{type:"sparkle",x:-20,y:Math.random()*o,vx:(n.speedRange[0]+Math.random()*(n.speedRange[1]-n.speedRange[0]))*.8,size:n.sizeRange[0]+Math.random()*(n.sizeRange[1]-n.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:t[Math.floor(Math.random()*t.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,o,n){const t=Math.random();return t<.6?this.createCloverPetal(e,o,n):t<.8?this.createShamrock(e,o,n):t<.95?this.createGoldCoin(e,o,n):this.createSparkle(e,o,n)},createInitialDecorations(e,o,n){const t=[];t.push({type:"moon",x:e-120,y:100,size:60+Math.random()*20,opacity:.85,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0});const r=20,a=220,s=o-40;t.push(this.createPotOfGold(e,o,{x:a,y:s})),t.push(this.createRainbow(e,o,a,s));const d=1+Math.floor(Math.random()*2);for(let M=0;M<d;M++){const y=60+Math.random()*(e-120);t.push({type:"static-leprechaun",x:y,y:o-35,size:12+Math.random()*4,opacity:1,time:Math.random()*1e3,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0})}const i=n.twinklingStars??18;for(let M=0;M<i;M++)t.push(this.createTwinklingStar(e,o));return t},createTwinklingStar(e,o){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(o*.5),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,o,n,t){const r=Math.random();if(r<t.leprechaunChance){if(e.some(i=>i.type==="leprechaun"))return null;const a=Math.random()<.5,s=(o+100)/180;return{type:"leprechaun",x:a?-50:o+50,y:n-35,baseY:n-35,vx:a?s:-s,vy:0,size:12+Math.random()*6,opacity:1,time:0,legPhase:Math.random()*Math.PI*2,active:!0,static:!1}}if(r<t.leprechaunChance+3e-4){if(e.some(s=>s.type==="banshee"))return null;const a=Math.random()<.5;return{type:"banshee",x:a?-100:o+100,y:Math.random()*(n*.4)+50,baseY:Math.random()*(n*.4)+50,vx:a?2+Math.random()*1:-(2+Math.random()*1),size:18+Math.random()*10,opacity:.6+Math.random()*.2,waveAmplitude:25+Math.random()*20,waveFrequency:.0015+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,wailPhase:Math.random()*Math.PI*2,active:!0,static:!1}}if(r<.001&&e.filter(s=>s.type==="pot-of-gold").length<t.pots){const s=this.createPotOfGold(o,n),d=this.createRainbow(o,n,s.x,s.y);return e.push(d),s}return null},updateSpecialParticles(e,o,n,t){return e.forEach(r=>{r.active&&((r.type==="leprechaun"||r.type==="banshee")&&(r.time+=o,r.type==="leprechaun"?(r.vx>0&&r.x>n+r.size*2||r.vx<0&&r.x<-r.size*2)&&(r.active=!1):r.type==="banshee"&&(r.vx>0&&r.x>n+r.size*4||r.vx<0&&r.x<-r.size*4)&&(r.active=!1)),r.type==="static-leprechaun"&&(r.time+=o))}),e.filter(r=>r.active)},drawCloverPetal(e,o,n){const t=o.x,r=o.y,a=o.size,s=Math.sin(n*o.flutterSpeed+o.flutter)*.3;e.save(),e.globalAlpha=o.opacity,e.translate(t,r),e.rotate(o.rotation+s),e.fillStyle=o.color,e.strokeStyle="#006400",e.lineWidth=a*.08,e.beginPath(),e.moveTo(0,-a*.3),e.bezierCurveTo(-a*.6,-a*.7,-a*.8,-a*.3,-a*.5,a*.2),e.lineTo(0,a*.8),e.lineTo(a*.5,a*.2),e.bezierCurveTo(a*.8,-a*.3,a*.6,-a*.7,0,-a*.3),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(0, 100, 0, 0.4)",e.lineWidth=a*.06,e.beginPath(),e.moveTo(0,-a*.2),e.lineTo(0,a*.7),e.stroke(),e.restore()},drawSparkle(e,o,n){const t=o.x,r=o.y,a=o.size,s=.6+Math.sin(n*.004+o.twinklePhase)*.4;e.save(),e.globalAlpha=o.opacity*s,e.translate(t,r),e.rotate(o.rotation),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=a*2,e.beginPath(),e.moveTo(0,-a),e.lineTo(a*.3,-a*.3),e.lineTo(a,0),e.lineTo(a*.3,a*.3),e.lineTo(0,a),e.lineTo(-a*.3,a*.3),e.lineTo(-a,0),e.lineTo(-a*.3,-a*.3),e.closePath(),e.fill(),e.restore()},drawShamrock(e,o){const n=o.x,t=o.y,r=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,t),e.rotate(o.rotation),e.fillStyle=o.color||"#228B22",e.strokeStyle=o.strokeColor||"#006400",e.lineWidth=r*.1;for(let a=0;a<3;a++){const s=a/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(s),e.translate(0,-r*.7),e.beginPath(),e.moveTo(0,r*.3),e.bezierCurveTo(-r*.5,-r*.2,-r*.3,-r*.6,0,-r*.35),e.bezierCurveTo(r*.3,-r*.6,r*.5,-r*.2,0,r*.3),e.closePath(),e.fill(),e.stroke(),e.restore()}e.strokeStyle="#8B4513",e.lineWidth=r*.15,e.beginPath(),e.moveTo(0,0),e.lineTo(0,r*1.2),e.stroke(),e.restore()},drawGoldCoin(e,o,n){const t=o.x,r=o.y,a=o.size,s=Math.abs(Math.cos(o.rotation))*a;if(e.save(),e.globalAlpha=o.opacity,e.translate(t,r),e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=a*.15,e.beginPath(),e.ellipse(0,0,s,a,0,0,Math.PI*2),e.fill(),e.stroke(),s>a*.3){const d=(Math.sin(n*.005+o.glintPhase)+1)*.5;e.fillStyle=`rgba(255, 255, 255, ${d*.6})`,e.beginPath(),e.ellipse(-s*.3,-a*.3,s*.3,a*.3,0,0,Math.PI*2),e.fill()}e.restore()},drawPotOfGold(e,o,n){const t=o.x,r=o.y,a=o.size;e.save(),e.translate(t,r),e.fillStyle="#1a1a1a",e.strokeStyle="#0a0a0a",e.lineWidth=2,e.beginPath(),e.arc(0,0,a*.7,0,Math.PI),e.lineTo(-a*.7,a*.4),e.quadraticCurveTo(0,a*.6,a*.7,a*.4),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#2a2a2a",e.lineWidth=3,e.beginPath(),e.arc(0,-a*.2,a*.5,Math.PI,0),e.stroke();const s=[{x:-a*.4,y:-a*.2,s:.8},{x:a*.3,y:-a*.3,s:.9},{x:-a*.1,y:-a*.5,s:1},{x:a*.5,y:-a*.1,s:.7},{x:-a*.5,y:0,s:.75},{x:a*.1,y:-a*.6,s:.85},{x:0,y:-a*.3,s:.95}];e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=1,s.forEach((i,M)=>{const y=n*.002+M*.5,P=(Math.sin(y)+1)*.5;e.save(),e.translate(i.x,i.y),e.beginPath(),e.arc(0,0,a*.2*i.s,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle=`rgba(255, 255, 255, ${P*.6})`,e.beginPath(),e.arc(-a*.08*i.s,-a*.08*i.s,a*.08*i.s,0,Math.PI*2),e.fill(),e.restore()}),e.globalAlpha=.3;const d=e.createRadialGradient(0,-a*.2,0,0,-a*.2,a*1.5);d.addColorStop(0,"#FFD700"),d.addColorStop(1,"rgba(255, 215, 0, 0)"),e.fillStyle=d,e.fillRect(-a*1.5,-a*1.5,a*3,a*1.5),e.restore()},drawSmallGoldPot(e,o,n,t){e.save(),e.translate(o,n),e.fillStyle="#1a1a1a",e.strokeStyle="#0a0a0a",e.lineWidth=1,e.beginPath(),e.arc(0,-t*.4,t*.7,0,Math.PI,!0),e.lineTo(t*.7,t*.4),e.quadraticCurveTo(0,t*.6,-t*.7,t*.4),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#FFD700",e.beginPath(),e.arc(0,-t*.7,t*.5,0,Math.PI*2),e.fill(),e.restore()},drawRainbow(e,o){const n=o.startX,t=o.endX,r=o.endY,a=o.height;e.save(),e.globalAlpha=.5;const s=Math.abs(t-n),d=(n+t)/2,i=a*.2,M=(s*s+4*i*i)/(8*i),y=r+i-M,P=this.colors.rainbow,g=5;for(let h=P.length-1;h>=0;h--)e.strokeStyle=P[h],e.lineWidth=g,e.beginPath(),e.arc(d,y,M+(P.length-1-h)*g,Math.PI,0),e.stroke();e.restore(),this.drawSmallGoldPot(e,t,r,20)},drawLeprechaun:m,drawBanshee(e,o,n){const t=o.x,r=o.y+Math.sin(n*o.waveFrequency+o.waveOffset)*o.waveAmplitude,a=o.size,s=o.vx>0?1:-1;e.save(),e.globalAlpha=o.opacity,e.translate(t,r),s===-1&&e.scale(-1,1);const d=e.createRadialGradient(0,-a*.5,0,0,-a*.5,a*3);d.addColorStop(0,"rgba(180, 255, 180, 0.4)"),d.addColorStop(.3,"rgba(150, 255, 150, 0.2)"),d.addColorStop(.6,"rgba(120, 255, 120, 0.1)"),d.addColorStop(1,"rgba(100, 255, 100, 0)"),e.fillStyle=d,e.fillRect(-a*3,-a*3,a*6,a*6);const i=Math.sin(n*.008+o.wailPhase)*a*.25;e.fillStyle="rgba(200, 240, 200, 0.3)",e.beginPath(),e.moveTo(-a*.8,-a*1.2),e.bezierCurveTo(-a*1.2+i*2,-a*.4,-a*1+i*1.5,a*.6,-a*.6+i,a*1.8),e.bezierCurveTo(-a*.3,a*1.5,a*.3,a*1.5,a*.6-i,a*1.8),e.bezierCurveTo(a*1-i*1.5,a*.6,a*1.2-i*2,-a*.4,a*.8,-a*1.2),e.closePath(),e.fill(),e.fillStyle="rgba(230, 255, 230, 0.85)",e.strokeStyle="rgba(180, 255, 180, 0.6)",e.lineWidth=a*.04,e.beginPath(),e.moveTo(-a*.5,-a*1);for(let l=0;l<=12;l++){const h=l/12,f=Math.sin(n*.012+h*Math.PI*3+o.wailPhase)*a*.3,b=(h-.5)*a*1.8+f,u=-a*1+h*a*2.2;l===0?e.moveTo(b,u):e.lineTo(b,u)}e.lineTo(-a*.5,-a*1),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(180, 255, 180, 0.4)",e.lineWidth=a*.02;for(let l=0;l<8;l++){const h=-a*.7+l*(a*1.4/7),f=Math.sin(n*.015+l*.8)*a*.2;e.beginPath(),e.moveTo(h,a*.4),e.lineTo(h+f,a*1.2+l%2*a*.4),e.stroke()}const M=Math.sin(n*.006)*.15;e.save(),e.rotate(M),e.fillStyle="rgba(240, 255, 240, 0.9)",e.strokeStyle="rgba(180, 230, 180, 0.5)",e.lineWidth=a*.03,e.beginPath(),e.ellipse(0,-a*.8,a*.35,a*.55,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="rgba(50, 100, 50, 0.6)",e.beginPath(),e.ellipse(-a*.15,-a*.85,a*.12,a*.08,0,0,Math.PI*2),e.ellipse(a*.15,-a*.85,a*.12,a*.08,0,0,Math.PI*2),e.fill();const y=.6+Math.sin(n*.008+o.wailPhase)*.4;e.fillStyle=`rgba(100, 255, 150, ${y})`,e.shadowColor="#64ff96",e.shadowBlur=a*.6,e.beginPath(),e.arc(-a*.15,-a*.85,a*.08,0,Math.PI*2),e.arc(a*.15,-a*.85,a*.08,0,Math.PI*2),e.fill(),e.shadowBlur=0;const P=.2+Math.sin(n*.01+o.wailPhase)*.1;e.fillStyle="rgba(80, 150, 80, 0.7)",e.strokeStyle="rgba(50, 100, 50, 0.8)",e.lineWidth=a*.02,e.beginPath(),e.ellipse(0,-a*.6,a*.15,a*(.2+P),0,0,Math.PI*2),e.fill(),e.stroke(),e.restore(),e.strokeStyle="rgba(220, 255, 220, 0.7)";for(let l=0;l<12;l++){const h=-a*.35+l/11*a*.7,f=Math.sin(n*.01+l*.6+o.wailPhase)*a*.5,b=Math.cos(n*.008+l*.4)*a*.3;e.lineWidth=a*(.04+l%3*.02),e.beginPath(),e.moveTo(h,-a*1.1),e.bezierCurveTo(h+f*.3,-a*.5,h+f*.6+b*.5,a*.2,h+f+b,a*1+l%2*a*.5),e.stroke()}const g=Math.sin(n*.01+o.wailPhase)*a*.3;e.fillStyle="rgba(230, 255, 230, 0.8)",e.strokeStyle="rgba(180, 230, 180, 0.6)",e.lineWidth=a*.02,e.save(),e.translate(-a*.6,-a*.2),e.rotate(-.3+g*.002),e.beginPath(),e.ellipse(0,0,a*.15,a*.25,0,0,Math.PI*2),e.fill(),e.stroke();for(let l=0;l<4;l++){const h=-a*.08+l*a*.055;e.beginPath(),e.moveTo(h,a*.15),e.lineTo(h,a*.35),e.stroke()}e.restore(),e.save(),e.translate(a*.6,-a*.2),e.rotate(.3-g*.002),e.beginPath(),e.ellipse(0,0,a*.15,a*.25,0,0,Math.PI*2),e.fill(),e.stroke();for(let l=0;l<4;l++){const h=-a*.08+l*a*.055;e.beginPath(),e.moveTo(h,a*.15),e.lineTo(h,a*.35),e.stroke()}e.restore(),e.strokeStyle="rgba(180, 255, 180, 0.3)",e.lineWidth=a*.02;for(let l=0;l<6;l++){const h=l/6*Math.PI*2,f=Math.sin(n*.01+l*.8)*a*.6,b=a*(1.5+l%2*.5);e.beginPath(),e.moveTo(0,a*.4),e.bezierCurveTo(Math.cos(h)*a*.8+f*.5,a*1,Math.cos(h)*a*1.5+f,a*1.8,Math.cos(h)*b+f*1.5,a*2.5),e.stroke()}e.restore()},drawMoon(e,o,n){const t=o.x,r=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(t,r);const s=e.createRadialGradient(-a*.2,-a*.2,0,0,0,a);s.addColorStop(0,"#90EE90"),s.addColorStop(.5,"#7FD87F"),s.addColorStop(1,"#5CB85C"),e.fillStyle=s,e.beginPath(),e.arc(0,0,a,0,Math.PI*2),e.fill(),e.fillStyle="rgba(60, 130, 60, 0.3)",e.beginPath(),e.arc(-a*.3,-a*.2,a*.15,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.25,a*.1,a*.2,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.1,-a*.4,a*.12,0,Math.PI*2),e.fill(),e.save(),e.translate(a*.2,a*.35),e.scale(.15,.15),e.fillStyle="rgba(34, 139, 34, 0.4)";for(let M=0;M<3;M++){const y=M/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(y),e.translate(0,-a*.7),e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(-a*.5,-a*.2,-a*.3,-a*.6,0,-a*.35),e.bezierCurveTo(a*.3,-a*.6,a*.5,-a*.2,0,a*.3),e.closePath(),e.fill(),e.restore()}e.restore();const d=.3+Math.sin(n*.002+o.glowPhase)*.15;e.globalAlpha=d;const i=e.createRadialGradient(0,0,a*.8,0,0,a*1.8);i.addColorStop(0,"rgba(144, 238, 144, 0.8)"),i.addColorStop(.5,"rgba(144, 238, 144, 0.4)"),i.addColorStop(1,"rgba(144, 238, 144, 0)"),e.fillStyle=i,e.beginPath(),e.arc(0,0,a*1.8,0,Math.PI*2),e.fill(),e.restore()},drawStaticLeprechaun:w,drawTwinklingStar(e,o,n){const t=o.x,r=o.y,a=o.size,s=.5+Math.sin(n*o.twinkleSpeed+o.twinklePhase)*.5,d=`rgba(220, 255, 220, ${s})`,i=`rgba(180, 255, 180, ${s*.4})`;e.save(),e.translate(t,r),e.shadowColor=i,e.shadowBlur=a*3*s,e.fillStyle=d,e.beginPath();for(let M=0;M<4;M++){const y=M*Math.PI/2,P=Math.cos(y)*a,g=Math.sin(y)*a,l=y+Math.PI/4,h=Math.cos(l)*(a*.3),f=Math.sin(l)*(a*.3);M===0?e.moveTo(P,g):e.lineTo(P,f),e.lineTo(h,f)}e.closePath(),e.fill(),e.shadowBlur=a*2*s,e.beginPath(),e.arc(0,0,a*.25,0,Math.PI*2),e.fill(),e.restore()}};
@@ -1 +1 @@
1
- import{drawIllustratedButterfly as T}from"./butterfly-drawing.js";export default{name:"valentines",displayName:"Valentine's Day",emoji:"\u{1F495}",intensityConfig:{light:{count:40,speedRange:[.3,.8],sizeRange:[2,4],garlands:1,cupidChance:3e-4},medium:{count:80,speedRange:[.4,1.2],sizeRange:[2,5],garlands:2,cupidChance:5e-4},heavy:{count:150,speedRange:[.5,1.5],sizeRange:[3,6],garlands:3,cupidChance:8e-4}},particles:["heart","rose-petal","sparkle","lips"],decorations:["cupid","love-letter","heart-garland","envelope","butterfly","heart-moon","neon-sign"],colors:{primary:"#ff1493",secondary:"#ff69b4",accent:"#dc143c",light:"#ffb6c1",gold:"#ffd700"},createHeart(e,o,s){const n=Math.random();let l,a,i;const t=["#ff1493","#ff69b4","#dc143c","#ffb6c1","#ff0080"];return n<.33?(l=s.sizeRange[0]+Math.random()*(s.sizeRange[1]-s.sizeRange[0])*1.5,a=s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0]),i=.8+Math.random()*.2):n<.66?(l=s.sizeRange[0]+Math.random()*(s.sizeRange[1]-s.sizeRange[0]),a=s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0]),i=.6+Math.random()*.2):(l=s.sizeRange[0]+Math.random()*(s.sizeRange[1]-s.sizeRange[0])*.8,a=s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0])*.8,i=.4+Math.random()*.2),{type:"heart",x:Math.random()*e,y:Math.random()*o,size:l,vx:(Math.random()-.5)*.3,vy:(Math.random()-.7)*.2,speed:a*.3,opacity:i,color:t[Math.floor(Math.random()*t.length)],windOffset:Math.random()*Math.PI*2,windSpeed:.005+Math.random()*.01,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.01,pulsePhase:Math.random()*Math.PI*2,pulseSpeed:.002+Math.random()*.003,floatPhase:Math.random()*Math.PI*2,floatSpeed:.001+Math.random()*.002,active:!0,depth:n}},createRosePetal(e,o,s){const n=["#ff1493","#ff69b4","#dc143c","#ff758f","#ffb6c1"];return{type:"rose-petal",x:Math.random()*e,y:-20,size:1.5+Math.random()*2,speed:s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0])*.6,opacity:.7+Math.random()*.3,color:n[Math.floor(Math.random()*n.length)],windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.03,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.05,flutterPhase:Math.random()*Math.PI*2,active:!0}},createSparkle(e,o,s){return{type:"sparkle",x:Math.random()*e,y:Math.random()*o,size:.5+Math.random()*1.5,opacity:1,life:20+Math.random()*30,maxLife:20+Math.random()*30,color:Math.random()<.5?"#ffd700":"#ffffff",twinklePhase:Math.random()*Math.PI*2,active:!0,static:!0}},createLips(e,o,s){const n=["#dc143c","#ff1493","#c71585","#ff0066"];return{type:"lips",x:Math.random()*e,y:Math.random()*o,size:3+Math.random()*3,vx:(Math.random()-.5)*.4,vy:(Math.random()-.7)*.2,speed:.3+Math.random()*.2,opacity:.8+Math.random()*.2,color:n[Math.floor(Math.random()*n.length)],rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.01,pulsePhase:Math.random()*Math.PI*2,pulseSpeed:.003+Math.random()*.002,floatPhase:Math.random()*Math.PI*2,floatSpeed:.001+Math.random()*.002,kissPhase:Math.random()*Math.PI*2,active:!0}},createHeartGarland(e,o,s={}){const n=8+Math.floor(Math.random()*5),l=[];for(let a=0;a<n;a++)l.push({offset:a/n,size:8+Math.random()*4,color:Math.random()<.5?"#ff1493":"#ff69b4",pulsePhase:Math.random()*Math.PI*2});return{type:"heart-garland",x:0,y:s.y!==void 0?s.y:50+Math.random()*100,width:e,hearts:l,sag:40+Math.random()*30,swayPhase:Math.random()*Math.PI*2,swayAmplitude:10+Math.random()*10,opacity:.8+Math.random()*.2,active:!0,static:!0}},createLoveLetter(e,o,s={}){const n=Math.random()<.5;return{type:"love-letter",x:n?-50:e+50,y:Math.random()*o*.6,baseY:Math.random()*o*.6,vx:n?1+Math.random()*1:-(1+Math.random()*1),size:12+Math.random()*6,opacity:.9+Math.random()*.1,rotation:(Math.random()-.5)*.3,rotationSpeed:(Math.random()-.5)*.005,waveAmplitude:15+Math.random()*15,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,active:!0,static:!1}},createFallingParticle(e,o,s){const n=Math.random();return n<.6?this.createHeart(e,o,s):n<.85?this.createRosePetal(e,o,s):this.createLips(e,o,s)},createInitialDecorations(e,o,s){const n=[],l=s.garlands??2;for(let t=0;t<l;t++)n.push(this.createHeartGarland(e,o,{y:50+t*(o/(l+1))}));const a=4;for(let t=0;t<a;t++)n.push({type:"envelope",x:e/(a+1)*(t+1)+(Math.random()-.5)*30,y:o-25-Math.random()*10,size:15+Math.random()*5,opacity:.85,rotation:(Math.random()-.5)*.3,active:!0,static:!0});const i=s.butterflies??3;for(let t=0;t<i;t++)n.push({type:"butterfly",x:Math.random()*e,y:Math.random()*o*.6+50,baseY:Math.random()*o*.6+50,size:12+Math.random()*6,vx:(Math.random()-.5)*2,vy:0,waveOffset:Math.random()*Math.PI*2,waveFrequency:.003+Math.random()*.002,waveAmplitude:20+Math.random()*15,wingPhase:Math.random()*Math.PI*2,opacity:.9,color:Math.random()<.5?"pink":"purple",active:!0,static:!1});return n.push({type:"heart-moon",x:e*.85,y:o*.15,size:60+Math.random()*20,opacity:.9,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0}),n},spawnSpecialParticle(e,o,s,n){const l=Math.random();if(l<n.cupidChance){if(e.some(i=>i.type==="cupid"))return null;const a=Math.random()<.5;return{type:"cupid",x:a?-100:o+100,y:Math.random()*s*.4+50,baseY:Math.random()*s*.4+50,vx:a?2+Math.random()*1.5:-(2+Math.random()*1.5),size:15+Math.random()*8,opacity:1,waveAmplitude:20+Math.random()*20,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,wingPhase:Math.random()*Math.PI*2,active:!0,static:!1}}return l<.001?this.createLoveLetter(o,s):l<.0015?e.some(a=>a.type==="neon-sign"&&a.active)?null:{type:"neon-sign",x:o/2,y:s*.3,size:40+Math.random()*20,opacity:0,targetOpacity:1,phase:"fade-in",phaseTime:0,fadeInDuration:1500,stableDuration:5e3,fadeOutDuration:1e3,crackleIntensity:1,flickerPhase:Math.random()*Math.PI*2,glowPhase:Math.random()*Math.PI*2,tubeFlickers:[],active:!0,static:!1}:l<.02?this.createSparkle(o,s,n):null},drawHeart(e,o,s){const n=o.x,l=o.y,a=o.size,i=1+Math.sin(s*o.pulseSpeed+o.pulsePhase)*.15;e.save(),e.globalAlpha=o.opacity,e.translate(n,l),e.rotate(o.rotation),e.scale(i,i),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=a*.8,e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(-a,-a*.3,-a*.6,-a,0,-a*.4),e.bezierCurveTo(a*.6,-a,a,-a*.3,0,a*.3),e.closePath(),e.fill(),e.shadowBlur=0,e.fillStyle="rgba(255, 255, 255, 0.3)",e.beginPath(),e.arc(-a*.25,-a*.5,a*.15,0,Math.PI*2),e.fill(),e.restore()},drawRosePetal(e,o,s){const n=o.x,l=o.y,a=o.size,i=Math.sin(s*.01+o.flutterPhase)*.3;e.save(),e.globalAlpha=o.opacity,e.translate(n,l),e.rotate(o.rotation+i),e.fillStyle=o.color,e.strokeStyle="rgba(139, 0, 0, 0.3)",e.lineWidth=.5,e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(a*2,-a,a*2,a,0,0),e.closePath(),e.fill(),e.beginPath(),e.moveTo(0,0),e.quadraticCurveTo(a,0,a*1.5,0),e.stroke(),e.restore()},drawSparkle(e,o,s){const n=o.x,l=o.y,a=o.size,i=o.life/o.maxLife,t=(Math.sin(s*.01+o.twinklePhase)+1)*.5;e.save(),e.globalAlpha=o.opacity*i*t,e.translate(n,l),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=a*2,e.beginPath();for(let r=0;r<4;r++){const d=r/4*Math.PI*2-Math.PI/2,f=Math.cos(d)*a*3,h=Math.sin(d)*a*3,M=d+Math.PI/4,u=Math.cos(M)*a*.5,P=Math.sin(M)*a*.5;r===0?e.moveTo(f,h):(e.lineTo(u,P),e.lineTo(f,h))}e.closePath(),e.fill(),e.restore()},drawLips(e,o,s){const n=o.x,l=o.y,a=o.size,i=1+Math.sin(s*o.pulseSpeed+o.pulsePhase)*.1,t=Math.sin(s*.008+o.kissPhase);e.save(),e.globalAlpha=o.opacity,e.translate(n,l),e.rotate(o.rotation),e.scale(i,i);const r=e.createRadialGradient(0,0,0,0,0,a*2);r.addColorStop(0,o.color),r.addColorStop(.6,o.color),r.addColorStop(1,"#8b0000"),e.fillStyle=r,e.strokeStyle="#8b0000",e.lineWidth=a*.1,e.beginPath(),e.moveTo(-a,0),e.bezierCurveTo(-a*.8,-a*.8,-a*.3,-a*1,0,-a*.6),e.bezierCurveTo(a*.3,-a*1,a*.8,-a*.8,a,0),e.fill(),e.stroke();const d=t*a*.15;if(e.beginPath(),e.moveTo(-a,0),e.bezierCurveTo(-a*.7,a*(.7+d),-a*.3,a*(1+d),0,a*(.8+d)),e.bezierCurveTo(a*.3,a*(1+d),a*.7,a*(.7+d),a,0),e.fill(),e.stroke(),e.globalAlpha=o.opacity*.5,e.fillStyle="rgba(255, 255, 255, 0.6)",e.beginPath(),e.ellipse(-a*.4,-a*.4,a*.2,a*.15,-.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.4,-a*.4,a*.2,a*.15,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(0,a*.5,a*.3,a*.2,0,0,Math.PI*2),e.fill(),t>.8){const f=a*1.5,h=Math.sin(o.kissPhase)*f,M=-Math.abs(Math.cos(o.kissPhase))*f;e.globalAlpha=o.opacity*(t-.8)*5,e.fillStyle="#ffd700",e.shadowColor="#ffd700",e.shadowBlur=a*.5,e.beginPath(),e.arc(h,M,a*.15,0,Math.PI*2),e.fill();for(let u=0;u<4;u++){const P=u/4*Math.PI*2+s*.01,m=h+Math.cos(P)*a*.4,y=M+Math.sin(P)*a*.4;e.beginPath(),e.moveTo(h,M),e.lineTo(m,y),e.lineWidth=a*.05,e.strokeStyle="#ffffff",e.stroke()}}e.restore()},drawCupid(e,o,s){const n=o.x,l=o.y,a=o.size,i=o.vx>0?1:-1;e.save(),e.globalAlpha=o.opacity,e.translate(n,l),i===-1&&e.scale(-1,1);const t=Math.sin(s*.015+o.wingPhase)*(Math.PI/6);e.fillStyle="#ffffff",e.strokeStyle="#ffb6c1",e.lineWidth=1.5,e.save(),e.translate(-a*.2,-a*.3),e.rotate(-t),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-a*1.2,-a*.8,-a*1.5,-a*.3,-a*1.2,a*.3),e.bezierCurveTo(-a*.8,a*.2,-a*.3,0,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.fillStyle="#ffdbac",e.beginPath(),e.ellipse(0,0,a*.4,a*.5,0,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.3,-a*.6,a*.35,a*.4,0,0,Math.PI*2),e.fill(),e.fillStyle="#ffd700",e.beginPath(),e.arc(a*.1,-a*.9,a*.22,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.4,-a*.95,a*.18,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.15,-a*.75,a*.15,0,Math.PI*2),e.fill(),e.fillStyle="#000000",e.beginPath(),e.arc(a*.42,-a*.62,a*.05,0,Math.PI*2),e.fill(),e.fillStyle="rgba(255, 105, 180, 0.3)",e.beginPath(),e.arc(a*.25,-a*.5,a*.12,0,Math.PI*2),e.fill(),e.strokeStyle="#ffdbac",e.lineWidth=a*.15,e.lineCap="round",e.beginPath(),e.moveTo(-a*.15,a*.4),e.lineTo(-a*.3,a*.8),e.stroke(),e.beginPath(),e.moveTo(-a*.05,a*.4),e.lineTo(-a*.15,a*.75),e.stroke(),e.strokeStyle="#ffdbac",e.lineWidth=a*.12,e.beginPath(),e.moveTo(a*.1,-a*.2),e.lineTo(a*.6,-a*.3),e.stroke(),e.beginPath(),e.moveTo(a*.05,0),e.lineTo(a*.9,-a*.35),e.stroke(),e.strokeStyle="#8B4513",e.lineWidth=2.5,e.beginPath(),e.moveTo(a*.9,-a*.6),e.quadraticCurveTo(a*1.1,-a*.35,a*.9,-a*.1),e.stroke(),e.strokeStyle="#daa520",e.lineWidth=1.5,e.beginPath(),e.moveTo(a*.9,-a*.6),e.lineTo(a*.6,-a*.35),e.lineTo(a*.9,-a*.1),e.stroke(),e.strokeStyle="#8B4513",e.lineWidth=2,e.beginPath(),e.moveTo(a*.6,-a*.35),e.lineTo(a*1.8,-a*.35),e.stroke(),e.fillStyle="#dc143c",e.beginPath(),e.moveTo(a*1.8,-a*.35),e.lineTo(a*2,-a*.35),e.lineTo(a*1.9,-a*.25),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*1.8,-a*.35),e.lineTo(a*2,-a*.35),e.lineTo(a*1.9,-a*.45),e.closePath(),e.fill(),e.fillStyle="#ff69b4",e.beginPath(),e.moveTo(a*.6,-a*.35),e.lineTo(a*.5,-a*.25),e.lineTo(a*.5,-a*.45),e.closePath(),e.fill(),e.fillStyle="#ffffff",e.strokeStyle="#ffb6c1",e.lineWidth=1.5,e.save(),e.translate(a*.1,-a*.3),e.rotate(t),e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(-a*1,-a*.6,-a*1.3,-a*.2,-a*1,a*.2),e.bezierCurveTo(-a*.6,a*.15,-a*.2,0,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.restore()},drawLoveLetter(e,o,s){const n=o.x,l=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,l),e.rotate(o.rotation),e.fillStyle="#fff5e6",e.strokeStyle="#daa520",e.lineWidth=1,e.fillRect(-a,-a*.7,a*2,a*1.4),e.strokeRect(-a,-a*.7,a*2,a*1.4),e.fillStyle="#ffe4b3",e.beginPath(),e.moveTo(-a,-a*.7),e.lineTo(0,0),e.lineTo(a,-a*.7),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#dc143c",e.shadowColor="#dc143c",e.shadowBlur=5,e.beginPath(),e.moveTo(0,a*.1),e.bezierCurveTo(-a*.3,-a*.1,-a*.2,-a*.3,0,-a*.15),e.bezierCurveTo(a*.2,-a*.3,a*.3,-a*.1,0,a*.1),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()},drawHeartGarland(e,o,s){const n=o.y,l=o.width,a=o.sag,i=o.hearts;e.save(),e.globalAlpha=o.opacity;const t=Math.sin(s*.001+o.swayPhase)*o.swayAmplitude;e.strokeStyle="#daa520",e.lineWidth=2,e.beginPath(),e.moveTo(0,n),e.quadraticCurveTo(l/2,n+a+t,l,n),e.stroke(),i.forEach(r=>{const d=r.offset*l,f=n+Math.sin(Math.PI*r.offset)*(a+t),h=1+Math.sin(s*.003+r.pulsePhase)*.1;e.save(),e.translate(d,f),e.scale(h,h),e.fillStyle=r.color,e.shadowColor=r.color,e.shadowBlur=r.size*.5,e.beginPath(),e.moveTo(0,r.size*.3),e.bezierCurveTo(-r.size,-r.size*.3,-r.size*.6,-r.size,0,-r.size*.4),e.bezierCurveTo(r.size*.6,-r.size,r.size,-r.size*.3,0,r.size*.3),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()}),e.restore()},drawEnvelope(e,o,s){const n=o.x,l=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,l),e.rotate(o.rotation),e.fillStyle="#fff5f5",e.strokeStyle="#ff69b4",e.lineWidth=a*.05,e.fillRect(-a*.7,-a*.5,a*1.4,a),e.strokeRect(-a*.7,-a*.5,a*1.4,a),e.fillStyle="#ffe4e1",e.beginPath(),e.moveTo(-a*.7,-a*.5),e.lineTo(0,a*.1),e.lineTo(a*.7,-a*.5),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#ff1493",e.shadowColor="#ff1493",e.shadowBlur=a*.3,e.beginPath(),e.moveTo(0,a*.25),e.bezierCurveTo(-a*.3,-a*.1,-a*.2,-a*.3,0,-a*.15),e.bezierCurveTo(a*.2,-a*.3,a*.3,-a*.1,0,a*.25),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()},drawButterfly(e,o,s=0){const n=s*(o.waveFrequency||0)+(o.waveOffset||0),l=o.waveAmplitude||0,a=o.color==="purple";T(e,{x:o.x+Math.sin(n)*l,y:(o.baseY??o.y)+Math.cos(s*(o.waveFrequency||0)*.7+(o.waveOffset||0))*l*.6,size:o.size*1.6,heading:-Math.PI/2,flapPhase:s*.01+(o.wingPhase||0),colourUpper:a?"#b48aba":"#d897b3",colourLower:a?"#896eaa":"#bb7798",alpha:o.opacity??1})},drawHeartMoon(e,o,s){const n=o.x,l=o.y,a=o.size,i=.3+Math.sin(s*.002+o.glowPhase)*.2;e.save(),e.globalAlpha=o.opacity,e.translate(n,l);const t=e.createRadialGradient(0,0,a*.5,0,0,a*2.5);t.addColorStop(0,`rgba(255, 182, 193, ${i*.8})`),t.addColorStop(.4,`rgba(255, 105, 180, ${i*.5})`),t.addColorStop(.7,`rgba(255, 20, 147, ${i*.3})`),t.addColorStop(1,"rgba(255, 20, 147, 0)"),e.fillStyle=t,e.beginPath(),e.arc(0,0,a*2.5,0,Math.PI*2),e.fill();const r=e.createRadialGradient(-a*.3,-a*.3,0,0,0,a);r.addColorStop(0,"#ffcce0"),r.addColorStop(.5,"#ffb3d9"),r.addColorStop(1,"#ff69b4"),e.fillStyle=r,e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(-a*.5,a*.5,-a,a*.2,-a,-a*.2),e.bezierCurveTo(-a,-a*.6,-a*.5,-a*.7,0,-a*.3),e.bezierCurveTo(a*.5,-a*.7,a,-a*.6,a,-a*.2),e.bezierCurveTo(a,a*.2,a*.5,a*.5,0,a*.3),e.closePath(),e.fill(),e.strokeStyle="#ff1493",e.lineWidth=a*.02,e.stroke(),e.fillStyle="rgba(255, 240, 245, 0.4)",e.beginPath(),e.arc(-a*.4,-a*.1,a*.15,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.3,0,a*.12,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(-a*.2,a*.15,a*.1,0,Math.PI*2),e.fill(),e.fillStyle=`rgba(255, 255, 255, ${i})`;const d=[{x:-a*.3,y:-a*.4},{x:a*.2,y:-a*.3},{x:0,y:0},{x:-a*.5,y:a*.1},{x:a*.4,y:a*.15}];for(const f of d){e.save(),e.translate(f.x,f.y),e.beginPath();const h=a*.08;e.moveTo(0,-h),e.lineTo(h*.2,-h*.2),e.lineTo(h,0),e.lineTo(h*.2,h*.2),e.lineTo(0,h),e.lineTo(-h*.2,h*.2),e.lineTo(-h,0),e.lineTo(-h*.2,-h*.2),e.closePath(),e.fill(),e.restore()}e.restore()},drawNeonSign(e,o,s){const n=o.x,l=o.y,a=o.size;if(o.phaseTime+=16,o.phase==="fade-in"&&o.phaseTime>=o.fadeInDuration)o.phase="stable",o.phaseTime=0,o.opacity=o.targetOpacity,o.crackleIntensity=0;else if(o.phase==="stable"&&o.phaseTime>=o.stableDuration)o.phase="fade-out",o.phaseTime=0;else if(o.phase==="fade-out"&&o.phaseTime>=o.fadeOutDuration){o.active=!1;return}o.phase==="fade-in"?(o.opacity=o.phaseTime/o.fadeInDuration*o.targetOpacity,o.crackleIntensity=1-o.phaseTime/o.fadeInDuration):o.phase==="fade-out"&&(o.opacity=o.targetOpacity*(1-o.phaseTime/o.fadeOutDuration)),e.save(),e.translate(n,l);const i="#ff1493",t="#ff0066",r="#ffffff",d="Happy Valentine's Day",f=a;e.font=`bold ${f}px 'Arial Black', sans-serif`,e.textAlign="center",e.textBaseline="middle";const h=e.measureText(d).width;let M=0;o.crackleIntensity>0&&(M=(Math.random()-.5)*o.crackleIntensity*5);const u=d.split("");let P=-h/2;for(let m=0;m<u.length;m++){const y=u[m],b=e.measureText(y).width,v=(o.crackleIntensity>0?Math.random()<o.crackleIntensity*.3:!1)?o.opacity*(.3+Math.random()*.7):o.opacity;e.save(),e.translate(P+b/2,M),e.globalAlpha=v;const p=.8+Math.sin(s*.002+o.glowPhase+m*.5)*.2;e.shadowColor=i,e.shadowBlur=a*.8*p,e.fillStyle=i,e.fillText(y,0,0),e.shadowBlur=a*.5*p,e.fillStyle=t,e.fillText(y,0,0),e.shadowBlur=a*.3*p,e.fillStyle=r,e.fillText(y,0,0),e.shadowBlur=0,e.fillStyle=r,e.globalAlpha=v*.9,e.fillText(y,0,0),e.restore(),P+=b}if(o.crackleIntensity>.3){for(let m=0;m<3;m++)if(Math.random()<o.crackleIntensity*.5){const y=(Math.random()-.5)*h,b=(Math.random()-.5)*a*.3,g=2+Math.random()*3;e.save(),e.globalAlpha=o.opacity*Math.random(),e.fillStyle=Math.random()<.5?i:r,e.shadowColor=i,e.shadowBlur=g*4,e.beginPath(),e.arc(y,b,g,0,Math.PI*2),e.fill(),e.restore()}}(o.phase==="stable"||o.phase==="fade-out")&&(e.globalAlpha=o.opacity*.1,e.fillStyle="#ff1493",e.fillRect(-h*.55,-a*.6,h*1.1,a*1.2)),e.restore()}};
1
+ import{drawCupid as v}from"./character-drawing.js";import{drawIllustratedButterfly as z}from"./butterfly-drawing.js";export default{name:"valentines",displayName:"Valentine's Day",emoji:"\u{1F495}",intensityConfig:{light:{count:40,speedRange:[.3,.8],sizeRange:[2,4],garlands:1,cupidChance:3e-4},medium:{count:80,speedRange:[.4,1.2],sizeRange:[2,5],garlands:2,cupidChance:5e-4},heavy:{count:150,speedRange:[.5,1.5],sizeRange:[3,6],garlands:3,cupidChance:8e-4}},particles:["heart","rose-petal","sparkle","lips"],decorations:["cupid","love-letter","heart-garland","envelope","butterfly","heart-moon","neon-sign"],colors:{primary:"#ff1493",secondary:"#ff69b4",accent:"#dc143c",light:"#ffb6c1",gold:"#ffd700"},createHeart(e,o,s){const n=Math.random();let t,a,l;const h=["#ff1493","#ff69b4","#dc143c","#ffb6c1","#ff0080"];return n<.33?(t=s.sizeRange[0]+Math.random()*(s.sizeRange[1]-s.sizeRange[0])*1.5,a=s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0]),l=.8+Math.random()*.2):n<.66?(t=s.sizeRange[0]+Math.random()*(s.sizeRange[1]-s.sizeRange[0]),a=s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0]),l=.6+Math.random()*.2):(t=s.sizeRange[0]+Math.random()*(s.sizeRange[1]-s.sizeRange[0])*.8,a=s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0])*.8,l=.4+Math.random()*.2),{type:"heart",x:Math.random()*e,y:Math.random()*o,size:t,vx:(Math.random()-.5)*.3,vy:(Math.random()-.7)*.2,speed:a*.3,opacity:l,color:h[Math.floor(Math.random()*h.length)],windOffset:Math.random()*Math.PI*2,windSpeed:.005+Math.random()*.01,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.01,pulsePhase:Math.random()*Math.PI*2,pulseSpeed:.002+Math.random()*.003,floatPhase:Math.random()*Math.PI*2,floatSpeed:.001+Math.random()*.002,active:!0,depth:n}},createRosePetal(e,o,s){const n=["#ff1493","#ff69b4","#dc143c","#ff758f","#ffb6c1"];return{type:"rose-petal",x:Math.random()*e,y:-20,size:1.5+Math.random()*2,speed:s.speedRange[0]+Math.random()*(s.speedRange[1]-s.speedRange[0])*.6,opacity:.7+Math.random()*.3,color:n[Math.floor(Math.random()*n.length)],windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.03,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.05,flutterPhase:Math.random()*Math.PI*2,active:!0}},createSparkle(e,o,s){return{type:"sparkle",x:Math.random()*e,y:Math.random()*o,size:.5+Math.random()*1.5,opacity:1,life:20+Math.random()*30,maxLife:20+Math.random()*30,color:Math.random()<.5?"#ffd700":"#ffffff",twinklePhase:Math.random()*Math.PI*2,active:!0,static:!0}},createLips(e,o,s){const n=["#dc143c","#ff1493","#c71585","#ff0066"];return{type:"lips",x:Math.random()*e,y:Math.random()*o,size:3+Math.random()*3,vx:(Math.random()-.5)*.4,vy:(Math.random()-.7)*.2,speed:.3+Math.random()*.2,opacity:.8+Math.random()*.2,color:n[Math.floor(Math.random()*n.length)],rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.01,pulsePhase:Math.random()*Math.PI*2,pulseSpeed:.003+Math.random()*.002,floatPhase:Math.random()*Math.PI*2,floatSpeed:.001+Math.random()*.002,kissPhase:Math.random()*Math.PI*2,active:!0}},createHeartGarland(e,o,s={}){const n=8+Math.floor(Math.random()*5),t=[];for(let a=0;a<n;a++)t.push({offset:a/n,size:8+Math.random()*4,color:Math.random()<.5?"#ff1493":"#ff69b4",pulsePhase:Math.random()*Math.PI*2});return{type:"heart-garland",x:0,y:s.y!==void 0?s.y:50+Math.random()*100,width:e,hearts:t,sag:40+Math.random()*30,swayPhase:Math.random()*Math.PI*2,swayAmplitude:10+Math.random()*10,opacity:.8+Math.random()*.2,active:!0,static:!0}},createLoveLetter(e,o,s={}){const n=Math.random()<.5;return{type:"love-letter",x:n?-50:e+50,y:Math.random()*o*.6,baseY:Math.random()*o*.6,vx:n?1+Math.random()*1:-(1+Math.random()*1),size:12+Math.random()*6,opacity:.9+Math.random()*.1,rotation:(Math.random()-.5)*.3,rotationSpeed:(Math.random()-.5)*.005,waveAmplitude:15+Math.random()*15,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,active:!0,static:!1}},createFallingParticle(e,o,s){const n=Math.random();return n<.6?this.createHeart(e,o,s):n<.85?this.createRosePetal(e,o,s):this.createLips(e,o,s)},createInitialDecorations(e,o,s){const n=[],t=s.garlands??2;for(let h=0;h<t;h++)n.push(this.createHeartGarland(e,o,{y:50+h*(o/(t+1))}));const a=4;for(let h=0;h<a;h++)n.push({type:"envelope",x:e/(a+1)*(h+1)+(Math.random()-.5)*30,y:o-25-Math.random()*10,size:15+Math.random()*5,opacity:.85,rotation:(Math.random()-.5)*.3,active:!0,static:!0});const l=s.butterflies??3;for(let h=0;h<l;h++)n.push({type:"butterfly",x:Math.random()*e,y:Math.random()*o*.6+50,baseY:Math.random()*o*.6+50,size:12+Math.random()*6,vx:(Math.random()-.5)*2,vy:0,waveOffset:Math.random()*Math.PI*2,waveFrequency:.003+Math.random()*.002,waveAmplitude:20+Math.random()*15,wingPhase:Math.random()*Math.PI*2,opacity:.9,color:Math.random()<.5?"pink":"purple",active:!0,static:!1});return n.push({type:"heart-moon",x:e*.85,y:o*.15,size:60+Math.random()*20,opacity:.9,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0}),n},spawnSpecialParticle(e,o,s,n){const t=Math.random();if(t<n.cupidChance){if(e.some(l=>l.type==="cupid"))return null;const a=Math.random()<.5;return{type:"cupid",x:a?-100:o+100,y:Math.random()*s*.4+50,baseY:Math.random()*s*.4+50,vx:a?2+Math.random()*1.5:-(2+Math.random()*1.5),size:15+Math.random()*8,opacity:1,waveAmplitude:20+Math.random()*20,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,wingPhase:Math.random()*Math.PI*2,active:!0,static:!1}}return t<.001?this.createLoveLetter(o,s):t<.0015?e.some(a=>a.type==="neon-sign"&&a.active)?null:{type:"neon-sign",x:o/2,y:s*.3,size:40+Math.random()*20,opacity:0,targetOpacity:1,phase:"fade-in",phaseTime:0,fadeInDuration:1500,stableDuration:5e3,fadeOutDuration:1e3,crackleIntensity:1,flickerPhase:Math.random()*Math.PI*2,glowPhase:Math.random()*Math.PI*2,tubeFlickers:[],active:!0,static:!1}:t<.02?this.createSparkle(o,s,n):null},drawHeart(e,o,s){const n=o.x,t=o.y,a=o.size,l=1+Math.sin(s*o.pulseSpeed+o.pulsePhase)*.15;e.save(),e.globalAlpha=o.opacity,e.translate(n,t),e.rotate(o.rotation),e.scale(l,l),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=a*.8,e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(-a,-a*.3,-a*.6,-a,0,-a*.4),e.bezierCurveTo(a*.6,-a,a,-a*.3,0,a*.3),e.closePath(),e.fill(),e.shadowBlur=0,e.fillStyle="rgba(255, 255, 255, 0.3)",e.beginPath(),e.arc(-a*.25,-a*.5,a*.15,0,Math.PI*2),e.fill(),e.restore()},drawRosePetal(e,o,s){const n=o.x,t=o.y,a=o.size,l=Math.sin(s*.01+o.flutterPhase)*.3;e.save(),e.globalAlpha=o.opacity,e.translate(n,t),e.rotate(o.rotation+l),e.fillStyle=o.color,e.strokeStyle="rgba(139, 0, 0, 0.3)",e.lineWidth=.5,e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(a*2,-a,a*2,a,0,0),e.closePath(),e.fill(),e.beginPath(),e.moveTo(0,0),e.quadraticCurveTo(a,0,a*1.5,0),e.stroke(),e.restore()},drawSparkle(e,o,s){const n=o.x,t=o.y,a=o.size,l=o.life/o.maxLife,h=(Math.sin(s*.01+o.twinklePhase)+1)*.5;e.save(),e.globalAlpha=o.opacity*l*h,e.translate(n,t),e.fillStyle=o.color,e.shadowColor=o.color,e.shadowBlur=a*2,e.beginPath();for(let r=0;r<4;r++){const d=r/4*Math.PI*2-Math.PI/2,f=Math.cos(d)*a*3,i=Math.sin(d)*a*3,M=d+Math.PI/4,y=Math.cos(M)*a*.5,p=Math.sin(M)*a*.5;r===0?e.moveTo(f,i):(e.lineTo(y,p),e.lineTo(f,i))}e.closePath(),e.fill(),e.restore()},drawLips(e,o,s){const n=o.x,t=o.y,a=o.size,l=1+Math.sin(s*o.pulseSpeed+o.pulsePhase)*.1,h=Math.sin(s*.008+o.kissPhase);e.save(),e.globalAlpha=o.opacity,e.translate(n,t),e.rotate(o.rotation),e.scale(l,l);const r=e.createRadialGradient(0,0,0,0,0,a*2);r.addColorStop(0,o.color),r.addColorStop(.6,o.color),r.addColorStop(1,"#8b0000"),e.fillStyle=r,e.strokeStyle="#8b0000",e.lineWidth=a*.1,e.beginPath(),e.moveTo(-a,0),e.bezierCurveTo(-a*.8,-a*.8,-a*.3,-a*1,0,-a*.6),e.bezierCurveTo(a*.3,-a*1,a*.8,-a*.8,a,0),e.fill(),e.stroke();const d=h*a*.15;if(e.beginPath(),e.moveTo(-a,0),e.bezierCurveTo(-a*.7,a*(.7+d),-a*.3,a*(1+d),0,a*(.8+d)),e.bezierCurveTo(a*.3,a*(1+d),a*.7,a*(.7+d),a,0),e.fill(),e.stroke(),e.globalAlpha=o.opacity*.5,e.fillStyle="rgba(255, 255, 255, 0.6)",e.beginPath(),e.ellipse(-a*.4,-a*.4,a*.2,a*.15,-.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(a*.4,-a*.4,a*.2,a*.15,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(0,a*.5,a*.3,a*.2,0,0,Math.PI*2),e.fill(),h>.8){const f=a*1.5,i=Math.sin(o.kissPhase)*f,M=-Math.abs(Math.cos(o.kissPhase))*f;e.globalAlpha=o.opacity*(h-.8)*5,e.fillStyle="#ffd700",e.shadowColor="#ffd700",e.shadowBlur=a*.5,e.beginPath(),e.arc(i,M,a*.15,0,Math.PI*2),e.fill();for(let y=0;y<4;y++){const p=y/4*Math.PI*2+s*.01,m=i+Math.cos(p)*a*.4,u=M+Math.sin(p)*a*.4;e.beginPath(),e.moveTo(i,M),e.lineTo(m,u),e.lineWidth=a*.05,e.strokeStyle="#ffffff",e.stroke()}}e.restore()},drawCupid:v,drawLoveLetter(e,o,s){const n=o.x,t=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,t),e.rotate(o.rotation),e.fillStyle="#fff5e6",e.strokeStyle="#daa520",e.lineWidth=1,e.fillRect(-a,-a*.7,a*2,a*1.4),e.strokeRect(-a,-a*.7,a*2,a*1.4),e.fillStyle="#ffe4b3",e.beginPath(),e.moveTo(-a,-a*.7),e.lineTo(0,0),e.lineTo(a,-a*.7),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#dc143c",e.shadowColor="#dc143c",e.shadowBlur=5,e.beginPath(),e.moveTo(0,a*.1),e.bezierCurveTo(-a*.3,-a*.1,-a*.2,-a*.3,0,-a*.15),e.bezierCurveTo(a*.2,-a*.3,a*.3,-a*.1,0,a*.1),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()},drawHeartGarland(e,o,s){const n=o.y,t=o.width,a=o.sag,l=o.hearts;e.save(),e.globalAlpha=o.opacity;const h=Math.sin(s*.001+o.swayPhase)*o.swayAmplitude;e.strokeStyle="#daa520",e.lineWidth=2,e.beginPath(),e.moveTo(0,n),e.quadraticCurveTo(t/2,n+a+h,t,n),e.stroke(),l.forEach(r=>{const d=r.offset*t,f=n+Math.sin(Math.PI*r.offset)*(a+h),i=1+Math.sin(s*.003+r.pulsePhase)*.1;e.save(),e.translate(d,f),e.scale(i,i),e.fillStyle=r.color,e.shadowColor=r.color,e.shadowBlur=r.size*.5,e.beginPath(),e.moveTo(0,r.size*.3),e.bezierCurveTo(-r.size,-r.size*.3,-r.size*.6,-r.size,0,-r.size*.4),e.bezierCurveTo(r.size*.6,-r.size,r.size,-r.size*.3,0,r.size*.3),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()}),e.restore()},drawEnvelope(e,o,s){const n=o.x,t=o.y,a=o.size;e.save(),e.globalAlpha=o.opacity,e.translate(n,t),e.rotate(o.rotation),e.fillStyle="#fff5f5",e.strokeStyle="#ff69b4",e.lineWidth=a*.05,e.fillRect(-a*.7,-a*.5,a*1.4,a),e.strokeRect(-a*.7,-a*.5,a*1.4,a),e.fillStyle="#ffe4e1",e.beginPath(),e.moveTo(-a*.7,-a*.5),e.lineTo(0,a*.1),e.lineTo(a*.7,-a*.5),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#ff1493",e.shadowColor="#ff1493",e.shadowBlur=a*.3,e.beginPath(),e.moveTo(0,a*.25),e.bezierCurveTo(-a*.3,-a*.1,-a*.2,-a*.3,0,-a*.15),e.bezierCurveTo(a*.2,-a*.3,a*.3,-a*.1,0,a*.25),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()},drawButterfly(e,o,s=0){const n=s*(o.waveFrequency||0)+(o.waveOffset||0),t=o.waveAmplitude||0,a=o.color==="purple";z(e,{x:o.x+Math.sin(n)*t,y:(o.baseY??o.y)+Math.cos(s*(o.waveFrequency||0)*.7+(o.waveOffset||0))*t*.6,size:o.size*1.6,heading:-Math.PI/2,flapPhase:s*.01+(o.wingPhase||0),colourUpper:a?"#b48aba":"#d897b3",colourLower:a?"#896eaa":"#bb7798",alpha:o.opacity??1})},drawHeartMoon(e,o,s){const n=o.x,t=o.y,a=o.size,l=.3+Math.sin(s*.002+o.glowPhase)*.2;e.save(),e.globalAlpha=o.opacity,e.translate(n,t);const h=e.createRadialGradient(0,0,a*.5,0,0,a*2.5);h.addColorStop(0,`rgba(255, 182, 193, ${l*.8})`),h.addColorStop(.4,`rgba(255, 105, 180, ${l*.5})`),h.addColorStop(.7,`rgba(255, 20, 147, ${l*.3})`),h.addColorStop(1,"rgba(255, 20, 147, 0)"),e.fillStyle=h,e.beginPath(),e.arc(0,0,a*2.5,0,Math.PI*2),e.fill();const r=e.createRadialGradient(-a*.3,-a*.3,0,0,0,a);r.addColorStop(0,"#ffcce0"),r.addColorStop(.5,"#ffb3d9"),r.addColorStop(1,"#ff69b4"),e.fillStyle=r,e.beginPath(),e.moveTo(0,a*.3),e.bezierCurveTo(-a*.5,a*.5,-a,a*.2,-a,-a*.2),e.bezierCurveTo(-a,-a*.6,-a*.5,-a*.7,0,-a*.3),e.bezierCurveTo(a*.5,-a*.7,a,-a*.6,a,-a*.2),e.bezierCurveTo(a,a*.2,a*.5,a*.5,0,a*.3),e.closePath(),e.fill(),e.strokeStyle="#ff1493",e.lineWidth=a*.02,e.stroke(),e.fillStyle="rgba(255, 240, 245, 0.4)",e.beginPath(),e.arc(-a*.4,-a*.1,a*.15,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.3,0,a*.12,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(-a*.2,a*.15,a*.1,0,Math.PI*2),e.fill(),e.fillStyle=`rgba(255, 255, 255, ${l})`;const d=[{x:-a*.3,y:-a*.4},{x:a*.2,y:-a*.3},{x:0,y:0},{x:-a*.5,y:a*.1},{x:a*.4,y:a*.15}];for(const f of d){e.save(),e.translate(f.x,f.y),e.beginPath();const i=a*.08;e.moveTo(0,-i),e.lineTo(i*.2,-i*.2),e.lineTo(i,0),e.lineTo(i*.2,i*.2),e.lineTo(0,i),e.lineTo(-i*.2,i*.2),e.lineTo(-i,0),e.lineTo(-i*.2,-i*.2),e.closePath(),e.fill(),e.restore()}e.restore()},drawNeonSign(e,o,s){const n=o.x,t=o.y,a=o.size;if(o.phaseTime+=16,o.phase==="fade-in"&&o.phaseTime>=o.fadeInDuration)o.phase="stable",o.phaseTime=0,o.opacity=o.targetOpacity,o.crackleIntensity=0;else if(o.phase==="stable"&&o.phaseTime>=o.stableDuration)o.phase="fade-out",o.phaseTime=0;else if(o.phase==="fade-out"&&o.phaseTime>=o.fadeOutDuration){o.active=!1;return}o.phase==="fade-in"?(o.opacity=o.phaseTime/o.fadeInDuration*o.targetOpacity,o.crackleIntensity=1-o.phaseTime/o.fadeInDuration):o.phase==="fade-out"&&(o.opacity=o.targetOpacity*(1-o.phaseTime/o.fadeOutDuration)),e.save(),e.translate(n,t);const l="#ff1493",h="#ff0066",r="#ffffff",d="Happy Valentine's Day",f=a;e.font=`bold ${f}px 'Arial Black', sans-serif`,e.textAlign="center",e.textBaseline="middle";const i=e.measureText(d).width;let M=0;o.crackleIntensity>0&&(M=(Math.random()-.5)*o.crackleIntensity*5);const y=d.split("");let p=-i/2;for(let m=0;m<y.length;m++){const u=y[m],P=e.measureText(u).width,w=(o.crackleIntensity>0?Math.random()<o.crackleIntensity*.3:!1)?o.opacity*(.3+Math.random()*.7):o.opacity;e.save(),e.translate(p+P/2,M),e.globalAlpha=w;const g=.8+Math.sin(s*.002+o.glowPhase+m*.5)*.2;e.shadowColor=l,e.shadowBlur=a*.8*g,e.fillStyle=l,e.fillText(u,0,0),e.shadowBlur=a*.5*g,e.fillStyle=h,e.fillText(u,0,0),e.shadowBlur=a*.3*g,e.fillStyle=r,e.fillText(u,0,0),e.shadowBlur=0,e.fillStyle=r,e.globalAlpha=w*.9,e.fillText(u,0,0),e.restore(),p+=P}if(o.crackleIntensity>.3){for(let m=0;m<3;m++)if(Math.random()<o.crackleIntensity*.5){const u=(Math.random()-.5)*i,P=(Math.random()-.5)*a*.3,b=2+Math.random()*3;e.save(),e.globalAlpha=o.opacity*Math.random(),e.fillStyle=Math.random()<.5?l:r,e.shadowColor=l,e.shadowBlur=b*4,e.beginPath(),e.arc(u,P,b,0,Math.PI*2),e.fill(),e.restore()}}(o.phase==="stable"||o.phase==="fade-out")&&(e.globalAlpha=o.opacity*.1,e.fillStyle="#ff1493",e.fillRect(-i*.55,-a*.6,i*1.1,a*1.2)),e.restore()}};
@@ -1 +1 @@
1
- (function(){"use strict";fetch("/api/effects/settings").then(function(y){return y.json()}).then(function(y){var z=y.respectMotion!==!1,A=y.defaultDuration||600,S=y.defaultAnimation||"fade",E=y.defaultThreshold!=null?y.defaultThreshold:.1,p=z&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,d=document.querySelector(".page-body");if(!d)return;function r(t,e){return t.getAttribute("data-fx-"+e)}function i(t,e,n){var a=r(t,e);return a!==null?parseFloat(a):n}function v(t,e,n){var a=r(t,e);return a===null?n:a==="true"||a==="1"}function b(t,e,n){var a=new IntersectionObserver(function(o){o[0].isIntersecting&&(a.unobserve(t),n())},{threshold:e});a.observe(t)}d.querySelectorAll(".dm-fx-reveal").forEach(function(t){var e=r(t,"animation")||S,n=i(t,"duration",A),a=i(t,"delay",0),o=i(t,"threshold",E),f=v(t,"once",!0);p||(t.style.opacity="0",t.style.transition="none",e==="slide-up"?t.style.transform="translateY(30px)":e==="slide-down"?t.style.transform="translateY(-30px)":e==="zoom"?t.style.transform="scale(0.85)":e==="flip"&&(t.style.transform="rotateY(90deg)"),requestAnimationFrame(function(){requestAnimationFrame(function(){t.style.transition="opacity "+n+"ms ease "+a+"ms, transform "+n+"ms ease "+a+"ms";var s=new IntersectionObserver(function(u){u.forEach(function(h){h.isIntersecting?(t.style.opacity="1",t.style.transform="",f&&s.unobserve(t)):f||(t.style.opacity="0",e==="slide-up"?t.style.transform="translateY(30px)":e==="slide-down"?t.style.transform="translateY(-30px)":e==="zoom"?t.style.transform="scale(0.85)":e==="flip"?t.style.transform="rotateY(90deg)":t.style.transform="")})},{threshold:o});s.observe(t)})}))}),d.querySelectorAll(".dm-fx-counter").forEach(function(t){var e=i(t,"to",0),n=i(t,"from",0),a=i(t,"duration",2e3),o=r(t,"prefix")||"",f=r(t,"suffix")||"",s=i(t,"decimals",0),u=r(t,"separator")||"";function h(m){var l=m.toFixed(s);if(u){var x=l.split(".");x[0]=x[0].replace(/\B(?=(\d{3})+(?!\d))/g,u),l=x.join(".")}return o+l+f}if(p){t.textContent=h(e);return}b(t,.5,function(){var m=null;requestAnimationFrame(function l(x){m||(m=x);var w=Math.min((x-m)/a,1),q=1-Math.pow(1-w,3);t.textContent=h(n+(e-n)*q),w<1&&requestAnimationFrame(l)})})}),p||d.querySelectorAll(".dm-fx-scramble").forEach(function(t){var e=i(t,"speed",50),n=t.textContent,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&",o=0;b(t,.3,function(){var f=setInterval(function(){for(var s="",u=0;u<n.length;u++)u<o||n[u]===" "?s+=n[u]:s+=a[Math.floor(Math.random()*a.length)];t.textContent=s,o<n.length?o++:clearInterval(f)},e)})}),p||d.querySelectorAll(".dm-fx-shake").forEach(function(t){var e=i(t,"intensity",5),n=i(t,"duration",500),a=r(t,"direction")||"horizontal",o=a==="vertical"?"translateY":"translateX";t.animate([{transform:o+"(0)"},{transform:o+"(-"+e+"px)"},{transform:o+"("+e+"px)"},{transform:o+"(-"+e+"px)"},{transform:o+"("+e+"px)"},{transform:o+"(0)"}],{duration:n,easing:"ease-in-out"})}),d.querySelectorAll(".dm-fx-ripple").forEach(function(t){t.style.position="relative",t.style.overflow="hidden",t.addEventListener("click",function(e){var n=r(t,"colour")||"rgba(255,255,255,0.3)",a=i(t,"duration",600),o=t.getBoundingClientRect(),f=Math.max(o.width,o.height)*2,s=document.createElement("span");s.style.cssText="position:absolute;border-radius:50%;pointer-events:none;width:"+f+"px;height:"+f+"px;left:"+(e.clientX-o.left-f/2)+"px;top:"+(e.clientY-o.top-f/2)+"px;background:"+n+";transform:scale(0);opacity:1;transition:transform "+a+"ms ease,opacity "+a+"ms ease;",t.appendChild(s),requestAnimationFrame(function(){s.style.transform="scale(1)",s.style.opacity="0"}),setTimeout(function(){s.remove()},a)})});var c=window.Domma&&window.Domma.effects;c&&(d.querySelectorAll(".dm-fx-breathe").forEach(function(t){if(!p){var e={};r(t,"amplitude")&&(e.amplitude=i(t,"amplitude",6)),r(t,"duration")&&(e.duration=i(t,"duration",3e3)),r(t,"easing")&&(e.easing=r(t,"easing")),r(t,"stagger")&&(e.stagger=i(t,"stagger",0)),c.breathe(t,e)}}),d.querySelectorAll(".dm-fx-pulse").forEach(function(t){if(!p){var e={};r(t,"scale")&&(e.scale=i(t,"scale",1.05)),r(t,"duration")&&(e.duration=i(t,"duration",2e3)),r(t,"easing")&&(e.easing=r(t,"easing")),c.pulse(t,e)}}),d.querySelectorAll(".dm-fx-scribe").forEach(function(t){var e={};r(t,"speed")&&(e.speed=i(t,"speed",50)),r(t,"delete-speed")&&(e.deleteSpeed=i(t,"delete-speed",30)),r(t,"cursor")&&(e.cursor=v(t,"cursor",!0)),r(t,"cursor-char")&&(e.cursorChar=r(t,"cursor-char")),r(t,"cursor-type")&&(e.cursorType=r(t,"cursor-type")),r(t,"mode")&&(e.mode=r(t,"mode")),r(t,"loop")&&(e.loop=v(t,"loop",!1)),r(t,"loop-delay")&&(e.loopDelay=i(t,"loop-delay",1e3)),r(t,"pause-on-hover")&&(e.pauseOnHover=v(t,"pause-on-hover",!1));var n=r(t,"actions");if(n)try{e.actions=JSON.parse(n)}catch{return}else{var a=t.textContent.trim();if(!a)return;t.textContent="",e.actions=[{render:a}]}c.scribe(t,e)}),d.querySelectorAll(".dm-fx-twinkle").forEach(function(t){var e={};r(t,"count")&&(e.count=i(t,"count",100)),r(t,"shape")&&(e.shape=r(t,"shape")),r(t,"colour")&&(e.colour=r(t,"colour")),r(t,"min-size")&&(e.minSize=i(t,"min-size",1)),r(t,"max-size")&&(e.maxSize=i(t,"max-size",3)),c.twinkle(t,e)}),typeof c.tickerTape=="function"&&d.querySelectorAll(".dm-fx-ticker-tape").forEach(function(t){if(!p){var e={};r(t,"palette")&&(e.palette=r(t,"palette")),r(t,"density")&&(e.density=i(t,"density",50)),r(t,"speed")&&(e.speed=i(t,"speed",1)),r(t,"sway")&&(e.sway=i(t,"sway",60)),r(t,"rotation-speed")&&(e.rotationSpeed=i(t,"rotation-speed",6)),r(t,"min-width")&&(e.minWidth=i(t,"min-width",5)),r(t,"max-width")&&(e.maxWidth=i(t,"max-width",9)),r(t,"min-height")&&(e.minHeight=i(t,"min-height",12)),r(t,"max-height")&&(e.maxHeight=i(t,"max-height",22)),r(t,"fade-start")&&(e.fadeStart=i(t,"fade-start",.55)),r(t,"burst")&&(e.burst=v(t,"burst",!1)),r(t,"burst-count")&&(e.burstCount=i(t,"burst-count",150)),r(t,"z-index")&&(e.zIndex=i(t,"z-index",1));var n=r(t,"mode");n==="page"?c.tickerTape(null,e):c.tickerTape(t,e)}}),typeof c.butterflies=="function"&&d.querySelectorAll(".dm-fx-butterflies").forEach(function(t){if(!p){var e={};r(t,"palette")&&(e.palette=r(t,"palette")),r(t,"density")&&(e.density=i(t,"density",18)),r(t,"speed")&&(e.speed=i(t,"speed",1)),r(t,"wander")&&(e.wander=i(t,"wander",1)),r(t,"rise-speed")&&(e.riseSpeed=i(t,"rise-speed",.4)),r(t,"flap-speed")&&(e.flapSpeed=i(t,"flap-speed",1)),r(t,"min-size")&&(e.minSize=i(t,"min-size",14)),r(t,"max-size")&&(e.maxSize=i(t,"max-size",26)),r(t,"two-tone")&&(e.twoTone=v(t,"two-tone",!0)),r(t,"burst")&&(e.burst=v(t,"burst",!1)),r(t,"burst-count")&&(e.burstCount=i(t,"burst-count",40)),r(t,"z-index")&&(e.zIndex=i(t,"z-index",1));var n=r(t,"mode");n==="page"?c.butterflies(null,e):c.butterflies(t,e)}}),typeof c.strobe=="function"&&d.querySelectorAll(".dm-fx-strobe").forEach(function(t){if(p)return;function e(s){var u=r(t,s);if(!u)return null;var h=u.split(",").map(function(m){return m.trim()}).filter(Boolean);return h.length?h:null}var n={};r(t,"preset")&&(n.preset=r(t,"preset")),r(t,"motion")&&(n.motion=r(t,"motion")),r(t,"speed")&&(n.speed=i(t,"speed",1)),r(t,"sweep-arc")&&(n.sweepArc=i(t,"sweep-arc",100)),r(t,"beam-width")&&(n.beamWidth=i(t,"beam-width",16)),r(t,"intensity")&&(n.intensity=i(t,"intensity",.7)),r(t,"flicker")&&(n.flicker=v(t,"flicker",!0)),r(t,"hz")&&(n.hz=i(t,"hz",10));var a=e("origins");a&&(n.origins=a);var o=e("colours");o&&(n.colours=o),r(t,"duration")&&(n.duration=i(t,"duration",null)),r(t,"z-index")&&(n.zIndex=i(t,"z-index",9999));var f=r(t,"mode");f==="page"?c.strobe(null,n):c.strobe(t,n)}));var g=d.querySelectorAll(".dm-fx-celebrate");g.length&&!p&&import("/public/js/celebrations/index.js?v=20261001-options").then(function(t){var e=t.CelebrationsEffect;g.forEach(function(n){var a=n.getAttribute("data-fx-theme")||"auto",o=n.getAttribute("data-fx-intensity")||"medium",f=n.getAttribute("data-fx-z-index")?parseInt(n.getAttribute("data-fx-z-index"),10):999;if(!(a==="auto"&&(a=e.getCurrentTheme(),!a))){var s={},u=["data-fx-theme","data-fx-intensity","data-fx-z-index"];Array.from(n.attributes).forEach(function(m){m.name.startsWith("data-fx-")&&!u.includes(m.name)&&(s[m.name.slice(8)]=m.value)});var h=new e({theme:a,intensity:o,enabled:!0,zIndex:f,overrides:s});h.init().then(function(){h.start()})}})}).catch(function(){})}).catch(function(){})})();
1
+ (function(){"use strict";fetch("/api/effects/settings").then(function(y){return y.json()}).then(function(y){var z=y.respectMotion!==!1,A=y.defaultDuration||600,S=y.defaultAnimation||"fade",E=y.defaultThreshold!=null?y.defaultThreshold:.1,p=z&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,d=document.querySelector(".page-body");if(!d)return;function r(t,e){return t.getAttribute("data-fx-"+e)}function i(t,e,n){var a=r(t,e);return a!==null?parseFloat(a):n}function v(t,e,n){var a=r(t,e);return a===null?n:a==="true"||a==="1"}function b(t,e,n){var a=new IntersectionObserver(function(o){o[0].isIntersecting&&(a.unobserve(t),n())},{threshold:e});a.observe(t)}d.querySelectorAll(".dm-fx-reveal").forEach(function(t){var e=r(t,"animation")||S,n=i(t,"duration",A),a=i(t,"delay",0),o=i(t,"threshold",E),f=v(t,"once",!0);p||(t.style.opacity="0",t.style.transition="none",e==="slide-up"?t.style.transform="translateY(30px)":e==="slide-down"?t.style.transform="translateY(-30px)":e==="zoom"?t.style.transform="scale(0.85)":e==="flip"&&(t.style.transform="rotateY(90deg)"),requestAnimationFrame(function(){requestAnimationFrame(function(){t.style.transition="opacity "+n+"ms ease "+a+"ms, transform "+n+"ms ease "+a+"ms";var s=new IntersectionObserver(function(u){u.forEach(function(h){h.isIntersecting?(t.style.opacity="1",t.style.transform="",f&&s.unobserve(t)):f||(t.style.opacity="0",e==="slide-up"?t.style.transform="translateY(30px)":e==="slide-down"?t.style.transform="translateY(-30px)":e==="zoom"?t.style.transform="scale(0.85)":e==="flip"?t.style.transform="rotateY(90deg)":t.style.transform="")})},{threshold:o});s.observe(t)})}))}),d.querySelectorAll(".dm-fx-counter").forEach(function(t){var e=i(t,"to",0),n=i(t,"from",0),a=i(t,"duration",2e3),o=r(t,"prefix")||"",f=r(t,"suffix")||"",s=i(t,"decimals",0),u=r(t,"separator")||"";function h(m){var l=m.toFixed(s);if(u){var x=l.split(".");x[0]=x[0].replace(/\B(?=(\d{3})+(?!\d))/g,u),l=x.join(".")}return o+l+f}if(p){t.textContent=h(e);return}b(t,.5,function(){var m=null;requestAnimationFrame(function l(x){m||(m=x);var w=Math.min((x-m)/a,1),q=1-Math.pow(1-w,3);t.textContent=h(n+(e-n)*q),w<1&&requestAnimationFrame(l)})})}),p||d.querySelectorAll(".dm-fx-scramble").forEach(function(t){var e=i(t,"speed",50),n=t.textContent,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&",o=0;b(t,.3,function(){var f=setInterval(function(){for(var s="",u=0;u<n.length;u++)u<o||n[u]===" "?s+=n[u]:s+=a[Math.floor(Math.random()*a.length)];t.textContent=s,o<n.length?o++:clearInterval(f)},e)})}),p||d.querySelectorAll(".dm-fx-shake").forEach(function(t){var e=i(t,"intensity",5),n=i(t,"duration",500),a=r(t,"direction")||"horizontal",o=a==="vertical"?"translateY":"translateX";t.animate([{transform:o+"(0)"},{transform:o+"(-"+e+"px)"},{transform:o+"("+e+"px)"},{transform:o+"(-"+e+"px)"},{transform:o+"("+e+"px)"},{transform:o+"(0)"}],{duration:n,easing:"ease-in-out"})}),d.querySelectorAll(".dm-fx-ripple").forEach(function(t){t.style.position="relative",t.style.overflow="hidden",t.addEventListener("click",function(e){var n=r(t,"colour")||"rgba(255,255,255,0.3)",a=i(t,"duration",600),o=t.getBoundingClientRect(),f=Math.max(o.width,o.height)*2,s=document.createElement("span");s.style.cssText="position:absolute;border-radius:50%;pointer-events:none;width:"+f+"px;height:"+f+"px;left:"+(e.clientX-o.left-f/2)+"px;top:"+(e.clientY-o.top-f/2)+"px;background:"+n+";transform:scale(0);opacity:1;transition:transform "+a+"ms ease,opacity "+a+"ms ease;",t.appendChild(s),requestAnimationFrame(function(){s.style.transform="scale(1)",s.style.opacity="0"}),setTimeout(function(){s.remove()},a)})});var c=window.Domma&&window.Domma.effects;c&&(d.querySelectorAll(".dm-fx-breathe").forEach(function(t){if(!p){var e={};r(t,"amplitude")&&(e.amplitude=i(t,"amplitude",6)),r(t,"duration")&&(e.duration=i(t,"duration",3e3)),r(t,"easing")&&(e.easing=r(t,"easing")),r(t,"stagger")&&(e.stagger=i(t,"stagger",0)),c.breathe(t,e)}}),d.querySelectorAll(".dm-fx-pulse").forEach(function(t){if(!p){var e={};r(t,"scale")&&(e.scale=i(t,"scale",1.05)),r(t,"duration")&&(e.duration=i(t,"duration",2e3)),r(t,"easing")&&(e.easing=r(t,"easing")),c.pulse(t,e)}}),d.querySelectorAll(".dm-fx-scribe").forEach(function(t){var e={};r(t,"speed")&&(e.speed=i(t,"speed",50)),r(t,"delete-speed")&&(e.deleteSpeed=i(t,"delete-speed",30)),r(t,"cursor")&&(e.cursor=v(t,"cursor",!0)),r(t,"cursor-char")&&(e.cursorChar=r(t,"cursor-char")),r(t,"cursor-type")&&(e.cursorType=r(t,"cursor-type")),r(t,"mode")&&(e.mode=r(t,"mode")),r(t,"loop")&&(e.loop=v(t,"loop",!1)),r(t,"loop-delay")&&(e.loopDelay=i(t,"loop-delay",1e3)),r(t,"pause-on-hover")&&(e.pauseOnHover=v(t,"pause-on-hover",!1));var n=r(t,"actions");if(n)try{e.actions=JSON.parse(n)}catch{return}else{var a=t.textContent.trim();if(!a)return;t.textContent="",e.actions=[{render:a}]}c.scribe(t,e)}),d.querySelectorAll(".dm-fx-twinkle").forEach(function(t){var e={};r(t,"count")&&(e.count=i(t,"count",100)),r(t,"shape")&&(e.shape=r(t,"shape")),r(t,"colour")&&(e.colour=r(t,"colour")),r(t,"min-size")&&(e.minSize=i(t,"min-size",1)),r(t,"max-size")&&(e.maxSize=i(t,"max-size",3)),c.twinkle(t,e)}),typeof c.tickerTape=="function"&&d.querySelectorAll(".dm-fx-ticker-tape").forEach(function(t){if(!p){var e={};r(t,"palette")&&(e.palette=r(t,"palette")),r(t,"density")&&(e.density=i(t,"density",50)),r(t,"speed")&&(e.speed=i(t,"speed",1)),r(t,"sway")&&(e.sway=i(t,"sway",60)),r(t,"rotation-speed")&&(e.rotationSpeed=i(t,"rotation-speed",6)),r(t,"min-width")&&(e.minWidth=i(t,"min-width",5)),r(t,"max-width")&&(e.maxWidth=i(t,"max-width",9)),r(t,"min-height")&&(e.minHeight=i(t,"min-height",12)),r(t,"max-height")&&(e.maxHeight=i(t,"max-height",22)),r(t,"fade-start")&&(e.fadeStart=i(t,"fade-start",.55)),r(t,"burst")&&(e.burst=v(t,"burst",!1)),r(t,"burst-count")&&(e.burstCount=i(t,"burst-count",150)),r(t,"z-index")&&(e.zIndex=i(t,"z-index",1));var n=r(t,"mode");n==="page"?c.tickerTape(null,e):c.tickerTape(t,e)}}),typeof c.butterflies=="function"&&d.querySelectorAll(".dm-fx-butterflies").forEach(function(t){if(!p){var e={};r(t,"palette")&&(e.palette=r(t,"palette")),r(t,"density")&&(e.density=i(t,"density",18)),r(t,"speed")&&(e.speed=i(t,"speed",1)),r(t,"wander")&&(e.wander=i(t,"wander",1)),r(t,"rise-speed")&&(e.riseSpeed=i(t,"rise-speed",.4)),r(t,"flap-speed")&&(e.flapSpeed=i(t,"flap-speed",1)),r(t,"min-size")&&(e.minSize=i(t,"min-size",14)),r(t,"max-size")&&(e.maxSize=i(t,"max-size",26)),r(t,"two-tone")&&(e.twoTone=v(t,"two-tone",!0)),r(t,"burst")&&(e.burst=v(t,"burst",!1)),r(t,"burst-count")&&(e.burstCount=i(t,"burst-count",40)),r(t,"z-index")&&(e.zIndex=i(t,"z-index",1));var n=r(t,"mode");n==="page"?c.butterflies(null,e):c.butterflies(t,e)}}),typeof c.strobe=="function"&&d.querySelectorAll(".dm-fx-strobe").forEach(function(t){if(p)return;function e(s){var u=r(t,s);if(!u)return null;var h=u.split(",").map(function(m){return m.trim()}).filter(Boolean);return h.length?h:null}var n={};r(t,"preset")&&(n.preset=r(t,"preset")),r(t,"motion")&&(n.motion=r(t,"motion")),r(t,"speed")&&(n.speed=i(t,"speed",1)),r(t,"sweep-arc")&&(n.sweepArc=i(t,"sweep-arc",100)),r(t,"beam-width")&&(n.beamWidth=i(t,"beam-width",16)),r(t,"intensity")&&(n.intensity=i(t,"intensity",.7)),r(t,"flicker")&&(n.flicker=v(t,"flicker",!0)),r(t,"hz")&&(n.hz=i(t,"hz",10));var a=e("origins");a&&(n.origins=a);var o=e("colours");o&&(n.colours=o),r(t,"duration")&&(n.duration=i(t,"duration",null)),r(t,"z-index")&&(n.zIndex=i(t,"z-index",9999));var f=r(t,"mode");f==="page"?c.strobe(null,n):c.strobe(t,n)}));var g=d.querySelectorAll(".dm-fx-celebrate");g.length&&!p&&import("/public/js/celebrations/index.js?v=20261001-paper").then(function(t){var e=t.CelebrationsEffect;g.forEach(function(n){var a=n.getAttribute("data-fx-theme")||"auto",o=n.getAttribute("data-fx-intensity")||"medium",f=n.getAttribute("data-fx-z-index")?parseInt(n.getAttribute("data-fx-z-index"),10):999;if(!(a==="auto"&&(a=e.getCurrentTheme(),!a))){var s={},u=["data-fx-theme","data-fx-intensity","data-fx-z-index"];Array.from(n.attributes).forEach(function(m){m.name.startsWith("data-fx-")&&!u.includes(m.name)&&(s[m.name.slice(8)]=m.value)});var h=new e({theme:a,intensity:o,enabled:!0,zIndex:f,overrides:s});h.init().then(function(){h.start()})}})}).catch(function(){})}).catch(function(){})})();
@@ -154,7 +154,7 @@
154
154
  <script src="/public/js/forms.js?v=20260927-submit-btn" type="module"></script>
155
155
 
156
156
  <!-- Core effects runtime -->
157
- <script src="/public/js/effects.js?v=20261001-options"></script>
157
+ <script src="/public/js/effects.js?v=20261001-paper"></script>
158
158
 
159
159
  <!-- Plugin body-end injection -->
160
160
  {{bodyEndInject}}