domma-cms 0.7.5 → 0.7.7
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.
- package/admin/js/app.js +4 -4
- package/config/plugins.json +0 -9
- package/package.json +1 -1
- package/plugins/analytics/stats.json +1 -1
- package/server/server.js +10 -2
- package/server/services/plugins.js +9 -3
- package/plugins/domma-effects/admin/templates/domma-effects.html +0 -577
- package/plugins/domma-effects/admin/views/domma-effects.js +0 -56
- package/plugins/domma-effects/config.js +0 -9
- package/plugins/domma-effects/plugin.js +0 -147
- package/plugins/domma-effects/plugin.json +0 -36
- package/plugins/domma-effects/public/celebrations/core/canvas.js +0 -9
- package/plugins/domma-effects/public/celebrations/core/particles.js +0 -1
- package/plugins/domma-effects/public/celebrations/core/physics.js +0 -1
- package/plugins/domma-effects/public/celebrations/index.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/christmas.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/guy-fawkes.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/halloween.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/st-andrews.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/st-davids.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/st-georges.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/st-patricks.js +0 -1
- package/plugins/domma-effects/public/celebrations/themes/valentines.js +0 -1
- package/plugins/domma-effects/public/inject-body.html +0 -287
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domma Effects Plugin — Server
|
|
3
|
-
*
|
|
4
|
-
* Registers all [effect] shortcodes via the hooks API at startup.
|
|
5
|
-
* Shortcodes are only active when this plugin is enabled — disabling the plugin
|
|
6
|
-
* means [reveal], [counter], etc. pass through as plain text.
|
|
7
|
-
*
|
|
8
|
-
* Endpoints (prefix: /api/plugins/domma-effects):
|
|
9
|
-
* GET /settings — public (called from public site IIFE)
|
|
10
|
-
* PUT /settings — admin-auth — saves user overrides
|
|
11
|
-
*/
|
|
12
|
-
import {getPluginSettings, savePluginState} from '../../server/services/plugins.js';
|
|
13
|
-
|
|
14
|
-
export default async function dommaEffectsPlugin(fastify, options) {
|
|
15
|
-
const {authenticate, requireAdmin} = options.auth;
|
|
16
|
-
const {registerShortcode} = options.hooks;
|
|
17
|
-
|
|
18
|
-
// -------------------------------------------------------------------------
|
|
19
|
-
// Shortcode registrations
|
|
20
|
-
// -------------------------------------------------------------------------
|
|
21
|
-
|
|
22
|
-
// Self-closing: [counter to="100" from="0" prefix="$" suffix="+" duration="2000" /]
|
|
23
|
-
registerShortcode('counter', (attrStr, _body, ctx) => {
|
|
24
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
25
|
-
const to = attrs.to || '0';
|
|
26
|
-
const prefix = attrs.prefix || '';
|
|
27
|
-
const suffix = attrs.suffix || '';
|
|
28
|
-
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${v}"`).join('');
|
|
29
|
-
return `<span class="dm-fx-counter"${dataAttrs}>${prefix}${to}${suffix}</span>`;
|
|
30
|
-
}, {priority: 5});
|
|
31
|
-
|
|
32
|
-
// Self-closing: [celebrate theme="christmas" intensity="medium" /]
|
|
33
|
-
registerShortcode('celebrate', (attrStr, _body, ctx) => {
|
|
34
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
35
|
-
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${v}"`).join('');
|
|
36
|
-
return `<div class="dm-fx-celebrate"${dataAttrs}></div>`;
|
|
37
|
-
}, {priority: 5});
|
|
38
|
-
|
|
39
|
-
// [firework] — self-closing and wrapping forms.
|
|
40
|
-
// Self-closing: [firework type="burst" colour="rainbow" size="lg" continuous="true" /]
|
|
41
|
-
// Wrapping: [firework type="sparkle" colour="info"]Click me[/firework]
|
|
42
|
-
// Note: [fireworks] (plural) is registered separately below.
|
|
43
|
-
registerShortcode('firework', (attrStr, body, ctx) => {
|
|
44
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
45
|
-
const classes = ['firework'];
|
|
46
|
-
if (attrs.type) classes.push(`firework-${attrs.type}`);
|
|
47
|
-
if (attrs.colour) classes.push(`firework-${attrs.colour}`);
|
|
48
|
-
if (attrs.size) classes.push(`firework-${attrs.size}`);
|
|
49
|
-
if (attrs.continuous === 'true') classes.push('firework-continuous');
|
|
50
|
-
if (attrs.hover === 'true') classes.push('firework-on-hover');
|
|
51
|
-
if (body === null) {
|
|
52
|
-
return `<div class="${classes.join(' ')}"></div>`;
|
|
53
|
-
}
|
|
54
|
-
const innerHtml = ctx.marked.parse(ctx.processCardBlocks(ctx.processGridBlocks(body.trim())));
|
|
55
|
-
return `<div class="${classes.join(' ')}">${innerHtml}</div>\n`;
|
|
56
|
-
}, {priority: 5});
|
|
57
|
-
|
|
58
|
-
// Wrapping container: [fireworks]...[/fireworks]
|
|
59
|
-
// Body contains already-processed firework HTML from the firework handler above.
|
|
60
|
-
registerShortcode('fireworks', (attrStr, body, _ctx) => {
|
|
61
|
-
if (body === null) return '';
|
|
62
|
-
return `<div class="fireworks-container">${body.trim()}</div>\n`;
|
|
63
|
-
}, {priority: 10});
|
|
64
|
-
|
|
65
|
-
// Dedicated scribe handler — supports both simple wrapping and action-script syntax.
|
|
66
|
-
// Simple: [scribe speed="fast"]Hello world[/scribe]
|
|
67
|
-
// Script: [scribe][render effect="fade"]Hello[/render][wait]1s[/wait][undo /][/scribe]
|
|
68
|
-
registerShortcode('scribe', (attrStr, body, ctx) => {
|
|
69
|
-
if (body === null) return '';
|
|
70
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
71
|
-
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${ctx.escapeAttr(v)}"`).join('');
|
|
72
|
-
const hasActions = /\[\s*(render|wait|undo)\b/.test(body);
|
|
73
|
-
if (!hasActions) {
|
|
74
|
-
const innerHtml = ctx.marked.parse(ctx.processCardBlocks(ctx.processGridBlocks(body.trim())));
|
|
75
|
-
return `<div class="dm-fx-scribe"${dataAttrs}>${innerHtml}</div>\n`;
|
|
76
|
-
}
|
|
77
|
-
const actions = [];
|
|
78
|
-
const actionRe = /\[render([^\]]*)\]([\s\S]*?)\[\/render\]|\[wait\]([\s\S]*?)\[\/wait\]|\[undo([^\]]*?)\/\]/gi;
|
|
79
|
-
for (const match of body.matchAll(actionRe)) {
|
|
80
|
-
if (match[0].startsWith('[render')) {
|
|
81
|
-
const rAttrs = ctx.parseShortcodeAttrs(match[1] || '');
|
|
82
|
-
const action = {render: match[2].trim()};
|
|
83
|
-
if (rAttrs.effect) action.effect = rAttrs.effect;
|
|
84
|
-
actions.push(action);
|
|
85
|
-
} else if (match[0].startsWith('[wait')) {
|
|
86
|
-
const val = match[3].trim();
|
|
87
|
-
actions.push({wait: isNaN(val) ? val : parseInt(val, 10)});
|
|
88
|
-
} else {
|
|
89
|
-
const uAttrs = ctx.parseShortcodeAttrs(match[4] || '');
|
|
90
|
-
if (uAttrs.all === 'true') actions.push({undoRender: 'all'});
|
|
91
|
-
else if (uAttrs.count) actions.push({undoRender: parseInt(uAttrs.count, 10)});
|
|
92
|
-
else actions.push({undoRender: true});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (!actions.length) return '';
|
|
96
|
-
const actionsJson = ctx.escapeAttr(JSON.stringify(actions));
|
|
97
|
-
return `<span class="dm-fx-scribe"${dataAttrs} data-fx-actions="${actionsJson}"></span>\n`;
|
|
98
|
-
}, {priority: 5});
|
|
99
|
-
|
|
100
|
-
// Wrapping animation effects — all follow the same dm-fx-{name} pattern.
|
|
101
|
-
for (const name of ['reveal', 'breathe', 'pulse', 'shake', 'scramble', 'ripple', 'twinkle']) {
|
|
102
|
-
registerShortcode(name, (attrStr, body, ctx) => {
|
|
103
|
-
if (body === null) return '';
|
|
104
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
105
|
-
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${v}"`).join('');
|
|
106
|
-
const innerHtml = ctx.marked.parse(ctx.processCardBlocks(ctx.processGridBlocks(body.trim())));
|
|
107
|
-
return `<div class="dm-fx-${name}"${dataAttrs}>${innerHtml}</div>\n`;
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// CSS-only: [animate type="fade-in-up" duration="slow" delay="200ms" repeat="infinite"]...[/animate]
|
|
112
|
-
registerShortcode('animate', (attrStr, body, ctx) => {
|
|
113
|
-
if (body === null) return '';
|
|
114
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
115
|
-
const classes = [];
|
|
116
|
-
if (attrs.type) classes.push(`animate-${attrs.type}`);
|
|
117
|
-
if (attrs.duration) classes.push(`animate-duration-${attrs.duration}`);
|
|
118
|
-
if (attrs.delay) classes.push(`animate-delay-${attrs.delay}`);
|
|
119
|
-
if (attrs.repeat) classes.push(`animate-${attrs.repeat}`);
|
|
120
|
-
return `<div class="${classes.join(' ')}">${ctx.marked.parse(ctx.processCardBlocks(ctx.processGridBlocks(body.trim())))}</div>\n`;
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// CSS-only: [ambient type="float-blobs" speed="slow" intensity="subtle"]...[/ambient]
|
|
124
|
-
registerShortcode('ambient', (attrStr, body, ctx) => {
|
|
125
|
-
if (body === null) return '';
|
|
126
|
-
const attrs = ctx.parseShortcodeAttrs(attrStr);
|
|
127
|
-
const classes = [];
|
|
128
|
-
if (attrs.type) classes.push(`bg-ambient-${attrs.type}`);
|
|
129
|
-
if (attrs.speed) classes.push(`bg-ambient-${attrs.speed}`);
|
|
130
|
-
if (attrs.intensity) classes.push(`bg-ambient-${attrs.intensity}`);
|
|
131
|
-
return `<div class="${classes.join(' ')}">${ctx.marked.parse(ctx.processCardBlocks(ctx.processGridBlocks(body.trim())))}</div>\n`;
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// -------------------------------------------------------------------------
|
|
135
|
-
// Settings routes
|
|
136
|
-
// -------------------------------------------------------------------------
|
|
137
|
-
|
|
138
|
-
fastify.get('/settings', async () => {
|
|
139
|
-
return getPluginSettings('domma-effects');
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
fastify.put('/settings', {preHandler: [authenticate, requireAdmin]}, async (request) => {
|
|
143
|
-
const body = request.body || {};
|
|
144
|
-
savePluginState('domma-effects', {settings: body});
|
|
145
|
-
return {ok: true};
|
|
146
|
-
});
|
|
147
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "domma-effects",
|
|
3
|
-
"displayName": "Domma Effects",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"description": "Initialises Domma Effects shortcodes on public pages with scroll-triggered reveals, animations, typewriter text, counters, and more.",
|
|
6
|
-
"author": "Darryl Waterhouse",
|
|
7
|
-
"date": "2026-03-03",
|
|
8
|
-
"icon": "sparkles",
|
|
9
|
-
"admin": {
|
|
10
|
-
"sidebar": [
|
|
11
|
-
{
|
|
12
|
-
"id": "domma-effects",
|
|
13
|
-
"text": "Domma Effects",
|
|
14
|
-
"icon": "sparkles",
|
|
15
|
-
"url": "#/plugins/domma-effects",
|
|
16
|
-
"section": "#/plugins/domma-effects"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"routes": [
|
|
20
|
-
{
|
|
21
|
-
"path": "/plugins/domma-effects",
|
|
22
|
-
"view": "plugin-domma-effects",
|
|
23
|
-
"title": "Domma Effects - Domma CMS"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"views": {
|
|
27
|
-
"plugin-domma-effects": {
|
|
28
|
-
"entry": "domma-effects/admin/views/domma-effects.js",
|
|
29
|
-
"exportName": "dommaEffectsView"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"inject": {
|
|
34
|
-
"bodyEnd": "public/inject-body.html"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export class CanvasManager{constructor(e={}){this.canvasId=e.canvasId||"celebrations-canvas",this.zIndex=e.zIndex||999,this.canvas=null,this.ctx=null,this.resizeTimeout=null,this.resizeCallback=e.onResize||null,this._handleResize=this._handleResize.bind(this)}create(){this.canvas||(this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.style.cssText=`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
width: 100vw;
|
|
6
|
-
height: 100vh;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
z-index: ${this.zIndex};
|
|
9
|
-
`,this.ctx=this.canvas.getContext("2d",{alpha:!0}),this.resize(),document.body.appendChild(this.canvas),window.addEventListener("resize",this._handleResize))}resize(){this.canvas&&(this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight)}clear(){this.ctx&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}getDimensions(){return{width:this.canvas?.width||0,height:this.canvas?.height||0}}isMobile(){return window.innerWidth<768}destroy(){window.removeEventListener("resize",this._handleResize),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.ctx=null}_handleResize(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.resize(),this.resizeCallback&&this.resizeCallback()},250)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function createParticle(e,t,d){const a=Math.random();let r,n,M,h;return a<.33?(r=e.sizeRange[0]+Math.random()*(e.sizeRange[1]-e.sizeRange[0])*1.5,n=e.speedRange[0]+Math.random()*(e.speedRange[1]-e.speedRange[0])*1.3,M=.8+Math.random()*.2,h=.01+Math.random()*.02):a<.66?(r=e.sizeRange[0]+Math.random()*(e.sizeRange[1]-e.sizeRange[0]),n=e.speedRange[0]+Math.random()*(e.speedRange[1]-e.speedRange[0]),M=.5+Math.random()*.2,h=.02+Math.random()*.03):(r=e.sizeRange[0]+Math.random()*(e.sizeRange[1]-e.sizeRange[0])*.7,n=e.speedRange[0]+Math.random()*(e.speedRange[1]-e.speedRange[0])*.7,M=.3+Math.random()*.2,h=.03+Math.random()*.04),{x:Math.random()*t,y:Math.random()*d-d,size:r,speed:n,opacity:M,windOffset:Math.random()*Math.PI*2,windSpeed:h,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,depth:a}}export function createStaticDecoration(e,t,d,a={}){return{type:e,x:a.x!==void 0?a.x:Math.random()*t,y:a.y!==void 0?a.y:Math.random()*d,vx:0,vy:0,size:a.size||20+Math.random()*15,opacity:a.opacity||.6+Math.random()*.3,rotation:a.rotation||0,rotationSpeed:0,active:!0,static:!0,...a}}export function createMovingParticle(e,t,d,a={}){const r=a.startX!==void 0?a.startX:-100,n=a.startY!==void 0?a.startY:d*.3;return{type:e,x:r,y:n,vx:a.vx||1.5,vy:a.vy||0,size:a.size||40,opacity:a.opacity||1,rotation:a.rotation||0,rotationSpeed:a.rotationSpeed||0,active:!0,static:!1,waveAmplitude:a.waveAmplitude||0,waveFrequency:a.waveFrequency||0,waveOffset:a.waveOffset||0,...a}}export function recycleParticle(e,t,d){e.y>d+10&&(e.y=-10,e.x=Math.random()*t),e.x<-10?e.x=t+10:e.x>t+10&&(e.x=-10)}export function isOffScreen(e,t,d,a=100){return e.x<-a||e.x>t+a||e.y<-a||e.y>d+a}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class PhysicsEngine{constructor(n={}){this.windGust=0,this.windGustTarget=0,this.lastGustTime=0,this.gustInterval=n.gustInterval||[5e3,15e3],this.gustStrength=n.gustStrength||[-2,2]}updateWind(n){const[s,e]=this.gustInterval;if(n-this.lastGustTime>s+Math.random()*(e-s)){const[o,i]=this.gustStrength;this.windGustTarget=o+Math.random()*(i-o),this.lastGustTime=n}this.windGust+=(this.windGustTarget-this.windGust)*.02}getWindForce(){return this.windGust}resetWind(){this.windGust=0,this.windGustTarget=0}}export function updateParticlePhysics(t,n,s=0){const e=n/16.666666666666668,o=t.vy||t.speed||0;if(t.y+=o*e,t.vx&&(t.x+=t.vx*e),t.windOffset!==void 0&&t.windSpeed!==void 0){t.windOffset+=t.windSpeed*e;const i=Math.sin(t.windOffset)*.5;t.x+=(i+s)*e}t.rotationSpeed&&(t.rotation+=t.rotationSpeed*e)}export function updateMovingParticle(t,n,s){const e=n/16.666666666666668;if(t.x+=t.vx*e,t.waveAmplitude&&t.waveFrequency){const o=s*t.waveFrequency/1e3;t.y=t.baseY+Math.sin(o+t.waveOffset)*t.waveAmplitude}else t.y+=t.vy*e;t.rotationSpeed&&(t.rotation+=t.rotationSpeed*e)}export function applyGravity(t,n,s=.5){const e=n/16.666666666666668;t.vy+=s*e,t.y+=t.vy*e}export function applyBounce(t,n,s=.6){t.y>=n&&t.vy>0&&(t.y=n,t.vy*=-s,Math.abs(t.vy)<.5&&(t.vy=0))}export function normalizeDelta(t,n=60){return t/(1e3/n)}export function lerp(t,n,s){return t+(n-t)*s}export function clamp(t,n,s){return Math.min(Math.max(t,n),s)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.defineProperty;var f=(h,e,s)=>e in h?g(h,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):h[e]=s;var d=(h,e,s)=>f(h,typeof e!="symbol"?e+"":e,s);import{CanvasManager as y}from"./core/canvas.js";import{PhysicsEngine as p,updateParticlePhysics as M,updateMovingParticle as w}from"./core/physics.js";import{createParticle as v}from"./core/particles.js";const r=class r{static isDateInRange(e,s,i,n){const o=new Date,a=o.getMonth()+1,l=o.getDate();return i<e?a===e&&l>=s||a>e||a<e&&a<=i||a===i&&l<=n:(a>e||a===e&&l>=s)&&(a<i||a===i&&l<=n)}static getCurrentTheme(){for(const[e,s]of Object.entries(r.themes)){const[[i,n],[o,a]]=s.dates;if(r.isDateInRange(i,n,o,a))return e}return null}static isCelebrationSeason(){return r.getCurrentTheme()!==null}static getThemes(){return r.themes}constructor(e={}){this.options={theme:e.theme||"auto",intensity:e.intensity||"medium",enabled:e.enabled!==void 0?e.enabled:!0,zIndex:e.zIndex||999},this.canvasManager=null,this.physicsEngine=null,this.themeModule=null,this.currentTheme=null,this.particles=[],this.specialParticles=[],this.animationFrame=null,this.lastTime=0,this.running=!1,this.initialized=!1}async init(){if(this.initialized){console.warn("[Celebrations] Already initialized");return}console.log("[Celebrations] Initializing...");let e=this.options.theme;if(e==="auto"&&(e=r.getCurrentTheme(),!e)){console.log("[Celebrations] No active celebration detected");return}if(!r.themes[e]){console.error(`[Celebrations] Unknown theme: ${e}`);return}this.currentTheme=e,console.log(`[Celebrations] Loading theme: ${e}`);try{const i=await import(r.themes[e].module);this.themeModule=i.default,console.log(`[Celebrations] Theme loaded: ${this.themeModule.displayName}`)}catch(s){console.error(`[Celebrations] Failed to load theme module: ${s.message}`);return}this.canvasManager=new y({canvasId:"celebrations-canvas",zIndex:this.options.zIndex}),this.canvasManager.create(),this.physicsEngine=new p({gustInterval:[5e3,15e3],gustStrength:[-2,2]}),window.addEventListener("resize",()=>{this.canvasManager.resize(),this.resetParticles()}),this.resetParticles(),this.initialized=!0,console.log("[Celebrations] Initialized successfully"),this.options.enabled&&this.start()}resetParticles(){const e=this.themeModule.intensityConfig[this.options.intensity],s=this.canvasManager.canvas.width,i=this.canvasManager.canvas.height;this.particles=[],this.specialParticles=[];const n=e.initialParticleRatio!==void 0?e.initialParticleRatio:1,o=Math.floor(e.count*n);if(this.themeModule.createFallingParticle)for(let a=0;a<o;a++){const l=this.themeModule.createFallingParticle(s,i,e);l.y=Math.random()*i,this.particles.push(l)}else for(let a=0;a<o;a++){const l=v(e,s,i);l.y=Math.random()*i,this.particles.push(l)}if(this.themeModule.createInitialDecorations){const a=this.themeModule.createInitialDecorations(s,i,e);this.specialParticles.push(...a),console.log(`[Celebrations] Created ${a.length} decorations`)}console.log(`[Celebrations] Created ${o}/${e.count} particles (${this.options.intensity}, ${Math.round(n*100)}% initial)`)}start(){if(!this.initialized){console.warn("[Celebrations] Cannot start - not initialized");return}if(this.running){console.warn("[Celebrations] Already running");return}console.log("[Celebrations] Starting animation"),this.running=!0,this.lastTime=performance.now(),this.animate()}pause(){this.running&&(console.log("[Celebrations] Pausing animation"),this.running=!1,this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=null))}resume(){this.running||this.start()}destroy(){console.log("[Celebrations] Destroying effect"),this.pause(),this.canvasManager&&this.canvasManager.canvas&&this.canvasManager.canvas.remove(),this.particles=[],this.specialParticles=[],this.canvasManager=null,this.physicsEngine=null,this.themeModule=null,this.initialized=!1}setIntensity(e){if(!["light","medium","heavy"].includes(e)){console.error(`[Celebrations] Invalid intensity: ${e}`);return}console.log(`[Celebrations] Changing intensity to: ${e}`),this.options.intensity=e,this.resetParticles()}async setTheme(e){console.log(`[Celebrations] Changing theme to: ${e}`);const s=this.running;this.pause(),await new Promise(i=>setTimeout(i,20)),this.initialized=!1,this.canvasManager&&this.canvasManager.clear(),this.particles=[],this.specialParticles=[],this.canvasManager&&this.canvasManager.clear(),this.options.theme=e,await this.init(),s&&this.start()}animate(){if(!this.running)return;const e=performance.now(),s=e-this.lastTime;this.lastTime=e,this.canvasManager.clear();const i=this.canvasManager.ctx,n=this.canvasManager.canvas.width,o=this.canvasManager.canvas.height,a=this.themeModule.intensityConfig[this.options.intensity];this.physicsEngine.updateWind(e);const l=this.physicsEngine.getWindForce();if(this.particles.length<a.count&&Math.random()<.05&&this.themeModule.createFallingParticle){const t=this.themeModule.createFallingParticle(n,o,a);(t.y===void 0||t.y<0)&&(t.y=-20),this.particles.push(t)}if(this.particles.forEach((t,u)=>{if(M(t,s,l),t.y>o+50&&(t.y=-20,t.x=Math.random()*n),t.x<-50&&(t.x=n+50),t.x>n+50&&(t.x=-50),this.themeModule.drawSnowflake&&t.type==="snowflake")this.themeModule.drawSnowflake(i,t);else if(this.themeModule["draw"+this.capitalizeFirst(t.type)]){const c="draw"+this.capitalizeFirst(t.type);this.themeModule[c](i,t,e)}else i.save(),i.globalAlpha=t.opacity,i.fillStyle=this.themeModule.colors?.primary||"#ffffff",i.beginPath(),i.arc(t.x,t.y,t.size,0,Math.PI*2),i.fill(),i.restore()}),this.themeModule.updateSpecialParticles&&this.themeModule.updateSpecialParticles(this.specialParticles,s,n,o),this.specialParticles=this.specialParticles.filter(t=>{if(!t.active)return!1;if(!t.static){w(t,s,e);const m=t.type==="train"?600:200;if(t.x<-m||t.x>n+m)return t.active=!1,!1}if(!isFinite(t.x)||!isFinite(t.y)||t.size&&!isFinite(t.size))return console.warn("[Celebrations] Invalid particle values, removing:",t.type),t.active=!1,!1;const c="draw"+this.capitalizeFirst(t.type);return this.themeModule[c]&&this.themeModule[c](i,t,e),!0}),this.themeModule.spawnSpecialParticle){const t=this.themeModule.spawnSpecialParticle(this.specialParticles,n,o,a);t&&this.specialParticles.push(t)}this.themeModule.drawGlobalEffects&&this.themeModule.drawGlobalEffects(i,e,n,o),this.animationFrame=requestAnimationFrame(()=>this.animate())}capitalizeFirst(e){if(!e)return"";const s=e.replace(/-([a-z])/g,(i,n)=>n.toUpperCase());return s.charAt(0).toUpperCase()+s.slice(1)}};d(r,"themes",{christmas:{module:"./themes/christmas.js",dates:[[12,1],[1,1]],displayName:"Christmas",emoji:"\u{1F384}"},halloween:{module:"./themes/halloween.js",dates:[[10,26],[10,31]],displayName:"Halloween",emoji:"\u{1F383}"},valentines:{module:"./themes/valentines.js",dates:[[2,9],[2,14]],displayName:"Valentine's Day",emoji:"\u{1F495}"},"guy-fawkes":{module:"./themes/guy-fawkes.js",dates:[[11,1],[11,5]],displayName:"Guy Fawkes Night",emoji:"\u{1F386}"},"st-patricks":{module:"./themes/st-patricks.js",dates:[[3,12],[3,17]],displayName:"St Patrick's Day",emoji:"\u2618\uFE0F"},"st-andrews":{module:"./themes/st-andrews.js",dates:[[11,25],[11,30]],displayName:"St Andrew's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}"},"st-davids":{module:"./themes/st-davids.js",dates:[[2,24],[3,1]],displayName:"St David's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}"},"st-georges":{module:"./themes/st-georges.js",dates:[[4,18],[4,23]],displayName:"St George's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}"}});export let CelebrationsEffect=r;export default CelebrationsEffect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createParticle as ee}from"./../core/particles.js";export default{name:"christmas",displayName:"Christmas",emoji:"\u{1F384}",intensityConfig:{light:{count:50,speedRange:[.5,1.5],sizeRange:[1,3],trees:3,wreaths:2,northStars:1,snowmen:2},medium:{count:150,speedRange:[.8,2.5],sizeRange:[1,4],trees:6,wreaths:3,northStars:1,snowmen:3},heavy:{count:300,speedRange:[1,3.5],sizeRange:[1,5],trees:10,wreaths:4,northStars:1,snowmen:4}},particles:["snowflake"],decorations:["tree","wreath","sleigh","robin","train","elf","firework","north-star","snowman"],colors:{primary:"#ffffff",secondary:"#228B22",accent:"#c00",gold:"#FFD700"},createSnowflakeParticle(e,i,s){const y=ee(s,e,i);return y.type="snowflake",y},createFallingParticle(e,i,s){return this.createSnowflakeParticle(e,i,s)},createTree(e,i,s={}){return{type:"tree",x:s.x!==void 0?s.x:Math.random()*e,y:s.y!==void 0?s.y:Math.random()*i,vx:0,vy:0,size:20+Math.random()*15,opacity:.6+Math.random()*.3,rotation:0,rotationSpeed:0,active:!0,static:!0}},createWreath(e,i,s={}){const y=[];for(let o=0;o<20;o++){const h=o/20*Math.PI*2;y.push({angle:h,radius:.9+Math.random()*.2,thickness:.2+Math.random()*.15,color:o%2===0?"#1a6b1a":"#228B22"})}return{type:"wreath",x:s.x!==void 0?s.x:Math.random()*e,y:s.y!==void 0?s.y:Math.random()*i,vx:0,vy:0,size:15+Math.random()*10,opacity:.7+Math.random()*.2,rotation:0,rotationSpeed:0,active:!0,static:!0,shape:y}},createNorthStar(e,i,s={}){return{type:"north-star",x:s.x!==void 0?s.x:e/2,y:s.y!==void 0?s.y:80,vx:0,vy:0,size:25,opacity:1,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003,active:!0,static:!0}},createSnowman(e,i,s={}){return{type:"snowman",x:s.x!==void 0?s.x:Math.random()*e,y:s.y!==void 0?s.y:i-50,vx:0,vy:0,size:15+Math.random()*10,opacity:1,time:Math.random()*1e3,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0}},createInitialDecorations(e,i,s){const y=[],n=s.trees||6;for(let l=0;l<n;l++)y.push(this.createTree(e,i,{x:e/(n+1)*(l+1),y:i-60-Math.random()*20}));const o=s.wreaths||3;for(let l=0;l<o;l++)y.push(this.createWreath(e,i,{x:e/(o+1)*(l+1),y:50+Math.random()*100}));s.northStars&&y.push(this.createNorthStar(e,i,{x:e/2,y:60}));const h=s.snowmen||3;for(let l=0;l<h;l++)y.push(this.createSnowman(e,i,{x:e/(h+1)*(l+1),y:i-50-Math.random()*10}));return y},spawnSpecialParticle(e,i,s){const y=Math.random();if(y<5e-4){if(e.some(l=>l.type==="sleigh"))return null;const n=Math.random()<.5,o=n?-100:i+100,h=100+Math.random()*(s*.3);return{type:"sleigh",x:o,startX:o,y:h,baseY:h,targetX:n?i+100:-100,canvasWidth:i,vx:n?3+Math.random()*2:-(3+Math.random()*2),vy:0,arcHeight:150+Math.random()*100,time:0,size:15+Math.random()*10,opacity:.9,rotation:0,active:!0,static:!1}}else if(y<.0013){const n=Math.random()<.5;return{type:"elf",x:n?-50:i+50,y:s-30,baseY:s-30,vx:n?1.5+Math.random()*1:-(1.5+Math.random()*1),waveAmplitude:3,waveFrequency:.05,waveOffset:Math.random()*Math.PI*2,time:0,size:10+Math.random()*5,opacity:.95,rotation:0,active:!0,static:!1}}else if(y<.005){if(e.some(r=>r.type==="train"))return null;const n=Math.random()<.5,o=n?-500:i+500,h=21+Math.random()*9,l=h*.72,a=s-l-10;return{type:"train",x:o,y:a,baseY:a,vx:n?4+Math.random()*2:-(4+Math.random()*2),vy:0,size:h,opacity:1,time:0,smoke:[],active:!0,static:!1,carriages:2+Math.floor(Math.random()*2)}}else{if(y<.008)return{type:"firework",x:Math.random()*i,y:s,vx:(Math.random()-.5)*4,vy:-10-Math.random()*5,size:2+Math.random()*2,opacity:1,active:!0,static:!1,time:0,exploded:!1,explosionTime:30+Math.random()*30};if(y<.012){if(e.some(g=>g.type==="robin"))return null;const n=Math.random()<.5,o=Math.random()*(s*.2),h=n?-50:i+50,l=10+Math.random()*5,a=Math.max(l*3,Math.min(s*.6-l*2,s*.2+Math.random()*(s*.4))),r=Math.random()*(i*.6)+i*.2;return{type:"robin",state:"flying_in",x:h,y:o,startX:h,startY:o,targetX:r,targetY:a,vx:n?.5+Math.random()*.5:-(.5+Math.random()*.5),vy:0,size:l,opacity:.95,active:!0,static:!1,sitTime:3e3+Math.random()*2e3,sitStartTime:0,flightProgress:0,time:0,waveOffset:Math.random()*Math.PI*2}}}return null},updateSpecialParticles(e,i,s=1024,y=768){e.forEach(n=>{switch(n.time!==void 0&&(n.time+=i),n.type){case"sleigh":(n.vx>0&&n.x>n.targetX||n.vx<0&&n.x<n.targetX)&&(n.active=!1);break;case"robin":switch(n.state){case"flying_in":const o=n.targetX-n.x,h=n.targetY-n.y,l=Math.sqrt(o*o+h*h);if(l<20)n.state="sitting",n.vx=0,n.vy=0,n.sitStartTime=n.time;else{const P=o/l,M=h/l,m=3;n.vx=P*m;const k=30,S=.008,u=Math.sin(n.time*S+n.waveOffset)*k,v=Math.cos(n.time*S+n.waveOffset)*k*S;n.vy=M*m*.3+v}break;case"sitting":if(n.vx=0,n.vy=0,n.time-n.sitStartTime>n.sitTime){n.state="flying_away";const P=n.x<s/2?-4:4;n.vx=P,n.flyAwayStartTime=n.time}break;case"flying_away":const a=n.vx>0?1:-1;n.vx=a*4;const r=25,g=.01,t=n.time-n.flyAwayStartTime,f=Math.sin(t*g+n.waveOffset)*r,d=Math.cos(t*g+n.waveOffset)*r*g;n.vy=-1.5+d,(n.x<-50||n.x>s+50||n.y<-50)&&(n.active=!1);break}break;case"train":if(n.smoke||(n.smoke=[]),(n.vx>0&&n.x>s+500||n.vx<0&&n.x<-500)&&(n.active=!1),n.lastSmokeTime||(n.lastSmokeTime=0),n.time-n.lastSmokeTime>150){n.lastSmokeTime=n.time;const h=n.size*1.8/20,l=n.vx>0?1:-1,a=h*8,r=h*7,g=h*10,d=-a-h-r-g*2-h*8,P=h*70,M=h*25,k=(P-M)*.7,S=n.x+k*l,u=n.y+d,v={x:S,y:u,vx:(Math.random()-.5)*.8,vy:-.8-Math.random()*.4,size:8+Math.random()*6,opacity:.7+Math.random()*.2,fadeRate:.012+Math.random()*.008};n.smoke.push(v)}n.smoke=n.smoke.filter(o=>(o.x+=o.vx,o.y+=o.vy,o.vy*=.99,o.size*=1.02,o.opacity-=o.fadeRate,o.opacity>0));break;case"firework":if(!n.exploded){const o=n.y<=n.targetY,h=n.time>=n.explosionTime;(o||h)&&(n.exploded=!0,this.explodeFirework(n,e),n.active=!1)}break}})},drawSnowflake(e,i){e.save(),e.translate(i.x,i.y),e.rotate(i.rotation),e.globalAlpha=i.opacity,e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineWidth=Math.max(i.size*.15,.5);const s=6,y=i.size;for(let n=0;n<s;n++){const o=Math.PI*2*n/s;e.beginPath(),e.moveTo(0,0),e.lineTo(Math.cos(o)*y,Math.sin(o)*y),e.stroke();const h=y*.4,l=Math.PI/6,a=Math.cos(o)*(y*.6),r=Math.sin(o)*(y*.6);e.beginPath(),e.moveTo(a,r),e.lineTo(a+Math.cos(o-l)*h,r+Math.sin(o-l)*h),e.stroke(),e.beginPath(),e.moveTo(a,r),e.lineTo(a+Math.cos(o+l)*h,r+Math.sin(o+l)*h),e.stroke()}e.restore()},drawTree(e,i,s){const y=i.x,n=i.y,o=i.size;e.save(),e.translate(y,n),e.rotate(i.rotation),e.fillStyle="#654321",e.beginPath(),e.moveTo(-o*.2,o*.8),e.lineTo(o*.2,o*.8),e.lineTo(o*.15,o*1.3),e.lineTo(-o*.15,o*1.3),e.closePath(),e.fill(),e.strokeStyle="#4a2f1a",e.lineWidth=1;for(let t=0;t<3;t++)e.beginPath(),e.moveTo(-o*.15,o*.9+t*o*.12),e.lineTo(o*.15,o*.9+t*o*.12),e.stroke();e.fillStyle="#228B22";for(let t=0;t<3;t++){const f=t*o*.4,d=o*(1.2-t*.2);e.beginPath(),e.moveTo(0,-f),e.lineTo(-d,o*.3-f),e.lineTo(d,o*.3-f),e.closePath(),e.fill()}e.strokeStyle="#C0C0C0",e.lineWidth=1.5;for(let t=0;t<3;t++){const f=t*o*.4,d=o*(1.2-t*.2);e.beginPath();for(let P=0;P<=6;P++){const M=-d+P/6*d*2,m=o*.15-f+(P%2===0?-o*.1:0);P===0?e.moveTo(M,m):e.lineTo(M,m)}e.stroke()}const h=["#ff0000","#0000ff","#ffd700","#ff69b4","#00ff00"];for(let t=0;t<8;t++){const f=Math.floor(t/3),d=f*o*.4,P=o*(1.2-f*.2)*.7,M=t%3*(Math.PI*2/3)+f*.5,m=Math.cos(M)*P,k=o*.1-d;e.fillStyle=h[t%h.length],e.beginPath(),e.arc(m,k,o*.12,0,Math.PI*2),e.fill(),e.fillStyle="rgba(255,255,255,0.5)",e.beginPath(),e.arc(m-o*.04,k-o*.04,o*.04,0,Math.PI*2),e.fill()}const l=["#ffff00","#ff0000","#00ff00","#0000ff","#ffffff"];for(let t=0;t<12;t++){const f=Math.floor(t/4),d=f*o*.4,P=o*(1.2-f*.2)*.85,M=t%4*(Math.PI*2/4)+f*.3,m=Math.cos(M)*P,k=o*.2-d,S=(Math.sin(s*.003+t*.5)+1)*.5,u=.3+S*.7,v=e.createRadialGradient(m,k,0,m,k,o*.15),T=l[t%l.length];v.addColorStop(0,T),v.addColorStop(1,"rgba(255,255,255,0)"),e.globalAlpha=u,e.fillStyle=v,e.beginPath(),e.arc(m,k,o*.15,0,Math.PI*2),e.fill(),e.globalAlpha=.5+S*.5,e.fillStyle=T,e.beginPath(),e.arc(m,k,o*.08,0,Math.PI*2),e.fill(),e.globalAlpha=1}const a=o*.35,r=-o*1.4,g=e.createRadialGradient(0,r,0,0,r,a*2);g.addColorStop(0,"rgba(255,223,0,1)"),g.addColorStop(.3,"rgba(255,215,0,0.7)"),g.addColorStop(.6,"rgba(255,215,0,0.3)"),g.addColorStop(1,"rgba(255,215,0,0)"),e.fillStyle=g,e.beginPath(),e.arc(0,r,a*2,0,Math.PI*2),e.fill(),e.fillStyle="#FFD700",e.strokeStyle="#FFA500",e.lineWidth=2,e.save(),e.translate(0,r),e.beginPath();for(let t=0;t<10;t++){const f=Math.PI*2*t/10-Math.PI/2,d=t%2===0?a:a*.4,P=Math.cos(f)*d,M=Math.sin(f)*d;t===0?e.moveTo(P,M):e.lineTo(P,M)}e.closePath(),e.fill(),e.stroke(),e.restore(),e.restore()},drawWreath(e,i,s){const y=i.x,n=i.y,o=i.size;e.save(),e.translate(y,n),e.rotate(i.rotation),i.shape.forEach(a=>{e.lineWidth=o*a.thickness,e.strokeStyle=a.color,e.beginPath();const r=a.angle-Math.PI/i.shape.length,g=a.angle+Math.PI/i.shape.length;e.arc(0,0,o*a.radius,r,g),e.stroke()});const h=["#ff0000","#ffff00","#0000ff"];for(let a=0;a<4;a++){const r=a/4*Math.PI*2+i.rotation,g=Math.cos(r)*o,t=Math.sin(r)*o,f=(Math.sin(s*.002+a*.7)+1)/2;if(f>.5){const d=(f-.5)*2,P=h[a%h.length],M=e.createRadialGradient(g,t,0,g,t,o*.15);M.addColorStop(0,P),M.addColorStop(1,"rgba(255,255,255,0)"),e.globalAlpha=d,e.fillStyle=M,e.beginPath(),e.arc(g,t,o*.15,0,Math.PI*2),e.fill(),e.globalAlpha=1}}e.fillStyle="#c00";const l=-o;e.beginPath(),e.ellipse(-o*.3,l,o*.3,o*.4,-.3,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(o*.3,l,o*.3,o*.4,.3,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(0,l,o*.2,0,Math.PI*2),e.fill(),e.restore()},drawNorthStar(e,i,s){const y=i.x,n=i.y,o=i.size,h=.8+Math.sin(s*i.twinkleSpeed+i.twinklePhase)*.2;e.save(),e.translate(y,n);const l=o*4*h,a=e.createRadialGradient(0,0,0,0,0,l);a.addColorStop(0,"rgba(220, 230, 240, 0.4)"),a.addColorStop(.4,"rgba(200, 210, 220, 0.2)"),a.addColorStop(1,"rgba(180, 190, 200, 0)"),e.fillStyle=a,e.beginPath(),e.arc(0,0,l,0,Math.PI*2),e.fill();const r=o*1,g=o*1.5,t=o*.12,f=e.createRadialGradient(0,0,0,0,0,o);f.addColorStop(0,"#ffffff"),f.addColorStop(.3,"#f0f0f0"),f.addColorStop(.6,"#c0c0c0"),f.addColorStop(1,"#a0a0a0"),e.shadowColor="rgba(220, 230, 240, 0.9)",e.shadowBlur=o*.8*h,e.fillStyle=f,e.beginPath(),e.moveTo(0,-g),e.lineTo(t,-t),e.lineTo(r,0),e.lineTo(t,t),e.lineTo(0,g),e.lineTo(-t,t),e.lineTo(-r,0),e.lineTo(-t,-t),e.closePath(),e.fill(),e.shadowBlur=o*1.2*h,e.shadowColor="rgba(255, 255, 255, 1)";const d=e.createRadialGradient(0,0,0,0,0,o*.3);d.addColorStop(0,"#ffffff"),d.addColorStop(.6,"#f5f5f5"),d.addColorStop(1,"rgba(200, 200, 200, 0.8)"),e.fillStyle=d,e.beginPath(),e.arc(0,0,o*.3,0,Math.PI*2),e.fill(),e.shadowBlur=0,e.restore()},drawSleigh(e,i){const s=i.x,y=Math.abs(i.targetX-i.startX),n=Math.abs(i.x-i.startX),o=Math.min(1,n/y),h=Math.sin(o*Math.PI)*i.arcHeight,l=i.baseY-h,a=i.size*1.5,r=i.vx>0?1:-1,g=Math.abs(Math.sin(i.time*.007));if(!isFinite(s)||!isFinite(l)||!isFinite(a)){console.warn("[Christmas] Invalid sleigh values:",{x:s,y:l,size:a});return}const t=[{x:4.8,y:0},{x:4,y:-.3},{x:4,y:.3},{x:3.2,y:-.15},{x:3.2,y:.15}];t.forEach((T,F)=>{const b=s+r*(a*T.x),C=T.y*a;e.fillStyle="#9c6e49",e.strokeStyle="#7b563a",e.lineWidth=1,e.beginPath(),e.moveTo(b-r*a*.4,l+C),e.quadraticCurveTo(b,l+C-a*.4,b+r*a*.4,l+C),e.quadraticCurveTo(b,l+C+a*.4,b-r*a*.4,l+C),e.fill(),e.stroke();const R=b+r*a*.5,G=l+C-a*.3;e.beginPath(),e.ellipse(R,G,a*.25,a*.2,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="#6e4a2e",e.lineWidth=1.5;const Y=R-r*a*.1,A=G-a*.15;e.beginPath(),e.moveTo(Y,A),e.lineTo(Y-r*a*.2,A-a*.3),e.lineTo(Y-r*a*.1,A-a*.4),e.moveTo(Y-r*a*.2,A-a*.3),e.lineTo(Y-r*a*.3,A-a*.35),e.stroke();const X=l+C+a*.1;e.lineWidth=2.5,e.strokeStyle="#7b563a";const L=g*a*.45;e.beginPath(),e.moveTo(b+r*a*.3,X),e.lineTo(b+r*(a*.3+L),X+a*.3),e.stroke();const W=(1-g)*a*.45;if(e.beginPath(),e.moveTo(b-r*a*.3,X),e.lineTo(b-r*(a*.3+W),X+a*.3),e.stroke(),F===0){const z=R+r*a*.25,B=G;e.fillStyle="#ff0000",e.beginPath(),e.arc(z,B,a*.03,0,Math.PI*2),e.fill();const q=e.createRadialGradient(z,B,0,z,B,a*.1);q.addColorStop(0,"rgba(255,0,0,0.7)"),q.addColorStop(1,"rgba(255,0,0,0)"),e.fillStyle=q,e.beginPath(),e.arc(z,B,a*.1,0,Math.PI*2),e.fill()}}),e.fillStyle="#c00",e.strokeStyle="#FFD700",e.lineWidth=2;const f=l-a*.7,d=s+r*a*1.5,P=s-r*a*.3,M=l+a*.3;e.beginPath(),e.moveTo(d,f),e.quadraticCurveTo(s+r*a,l-a*.2,d-r*a*.8,l),e.lineTo(P,l),e.lineTo(P,M),e.lineTo(d,M),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(P,l),e.quadraticCurveTo(P-r*a*.4,l-a*.5,P,f),e.quadraticCurveTo(P+r*a*.2,l-a*.4,P+r*a*.2,l),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#a52a2a",e.lineWidth=4;const m=M+a*.2;function k(T){e.beginPath(),e.moveTo(d+r*a*.1,m+T),e.quadraticCurveTo(s,m+T+a*.2,P-r*a*.2,m+T),e.stroke(),e.beginPath(),e.moveTo(d-r*a*.5,M),e.lineTo(d-r*a*.5,m+T),e.stroke(),e.beginPath(),e.moveTo(P+r*a*.5,M),e.lineTo(P+r*a*.5,m+T),e.stroke()}k(0),k(a*.1);const S=s-r*a*.05;e.fillStyle="#5c4033",e.beginPath(),e.moveTo(S-a*.3,l-a*.4),e.quadraticCurveTo(S-a*.6,l-a*.2,S-a*.4,l+a*.1),e.quadraticCurveTo(S,l+a*.3,S+a*.4,l+a*.1),e.quadraticCurveTo(S+a*.6,l-a*.2,S+a*.3,l-a*.4),e.closePath(),e.fill(),e.fillStyle="rgba(255, 255, 255, 0.2)",e.beginPath(),e.ellipse(S+a*.1,l-a*.3,a*.2,a*.1,-Math.PI/4,0,Math.PI*2),e.fill(),e.strokeStyle="#654321",e.lineWidth=1,e.beginPath(),e.arc(S,l-a*.4,a*.2,0,Math.PI,!0),e.stroke();const u=s+r*a*.6,v=l-a*.55;e.fillStyle="#c00",e.beginPath(),e.moveTo(u-a*.2,v),e.lineTo(u+a*.2,v),e.lineTo(u,v-a*.4),e.closePath(),e.fill(),e.fillStyle="#fff",e.fillRect(u-a*.22,v,a*.44,a*.08),e.beginPath(),e.arc(u,v-a*.4,a*.07,0,Math.PI*2),e.fill(),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(u,v+a*.08,a*.18,0,Math.PI*2),e.fill(),e.fillStyle="#fff",e.beginPath(),e.ellipse(u,v+a*.2,a*.25,a*.2,0,0,Math.PI),e.fill(),e.strokeStyle="#654321",e.lineWidth=1,t.forEach(T=>{const F=s+r*(a*T.x),b=T.y*a,C=F+r*a*.5;e.beginPath(),e.moveTo(u,v+a*.1),e.quadraticCurveTo((u+C)/2,l+b-a*.5,C-r*a*.1,l+b-a*.3),e.stroke()})},drawElf(e,i){const s=i.x,y=i.y,n=i.size,o=i.vx>0?1:-1;e.save(),e.translate(s,y);const h=Math.sin(i.time*.05)*(Math.PI/3);e.fillStyle="#004d00",e.fillRect(o*-n*.1,n*.2,n*.2,n*.5+Math.sin(h+Math.PI)*n*.1),e.fillStyle="#4a2c2a",e.beginPath(),e.ellipse(o*0,n*.7+Math.sin(h+Math.PI)*n*.1,n*.3,n*.15,0,0,Math.PI*2),e.fill(),e.fillStyle="#006400",e.fillRect(o*n*.1,n*.2,n*.2,n*.5+Math.sin(h)*n*.1),e.fillStyle="#5d3836",e.beginPath(),e.ellipse(o*n*.2,n*.7+Math.sin(h)*n*.1,n*.3,n*.15,0,0,Math.PI*2),e.fill(),e.fillStyle="#008000",e.beginPath(),e.moveTo(0,-n*.5),e.lineTo(o*n*.4,n*.3),e.lineTo(o*-n*.4,n*.3),e.closePath(),e.fill(),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(0,-n*.6,n*.3,0,Math.PI*2),e.fill(),e.fillStyle="#c00",e.beginPath(),e.moveTo(0,-n*.7),e.lineTo(o*n*.35,-n*.6),e.lineTo(o*-n*.35,-n*.6),e.closePath(),e.fill(),e.beginPath(),e.moveTo(0,-n*.7),e.quadraticCurveTo(o*n*.2,-n*1.1,o*n*.4,-n*1.3),e.stroke(),e.fillStyle="#ffff00",e.beginPath(),e.arc(o*n*.4,-n*1.3,n*.15,0,Math.PI*2),e.fill(),e.restore()},drawTrain(e,i){const s=i.x,y=i.y,n=i.size*1.8,o=i.vx>0?1:-1,h=i.time;i.smoke&&i.smoke.length>0&&i.smoke.forEach(w=>{e.save(),e.globalAlpha=w.opacity;const I=e.createRadialGradient(w.x,w.y,0,w.x,w.y,w.size);I.addColorStop(0,"#CCCCCC"),I.addColorStop(.5,"#AAAAAA"),I.addColorStop(1,"#888888"),e.fillStyle=I,e.beginPath(),e.arc(w.x,w.y,w.size,0,Math.PI*2),e.fill(),e.restore()}),e.save(),e.translate(s,y),o===-1&&e.scale(-1,1);const l=h*.005,a=n/20,r=0,g=a*8,t=a*5,f=a*7,d=a*35,P=-t-a,M=-g-a,m=P-d,k=a*30,S=a*10,u=M-f-S*2,v=a*70,T=a*25,F=v-T,b=a*60,C=a*15;for(let w=1;w<=i.carriages;w++){const I=-(T+w*(b+C)-C);e.fillStyle="#222",e.strokeStyle="#444",e.lineWidth=1,e.beginPath(),e.arc(I+b*.25,-t,t,0,Math.PI*2),e.fill(),e.stroke(),e.beginPath(),e.arc(I+b*.75,-t,t,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#004d00",e.strokeStyle="#DAA520",e.lineWidth=a*.5,e.fillRect(I,m,b,d),e.strokeRect(I,m,b,d);const U=d*.6,_=m+d*.2;e.shadowColor="#F1C40F",e.shadowBlur=15;const c=.8+Math.sin(h*.001+w)*.2;e.fillStyle=`rgba(255, 235, 150, ${c})`;const E=b*.25,$=I+b*.15,j=I+b*.6;e.fillRect($,_,E,U),e.fillRect(j,_,E,U),e.shadowBlur=0,e.fillStyle="rgba(0, 0, 0, 0.4)";const D=E*.2,V=$+E/2,J=_+D*1.8;e.beginPath(),e.arc(V,J,D,0,Math.PI*2),e.fill(),e.fillRect(V-D,J+D,D*2,D*2);const O=E*.18,K=j+E/2,Q=_+O*1.6;e.beginPath(),e.arc(K,Q,O,0,Math.PI*2),e.fill(),e.fillRect(K-O*1.2,Q,O*2.4,O*2.5);const N=a*4;e.fillStyle="#228B22",e.beginPath(),e.arc(I+b/2,m+d/2,N,0,Math.PI*2),e.arc(I+b/2,m+d/2,N*.6,0,Math.PI*2,!0),e.fill(),e.fillStyle="#c00",e.beginPath(),e.arc(I+b/2,m+d/2+N,N*.3,0,Math.PI*2),e.fill(),e.strokeStyle="#111",e.lineWidth=a,e.beginPath();const Z=P+f/2,x=w===1?-T:I+b+C;e.moveTo(I+b,Z),e.lineTo(x,Z),e.stroke()}e.fillStyle="#2C3E50",e.strokeStyle="#555",e.lineWidth=a;const R=[a*15,a*35,a*55];R.forEach(w=>{e.beginPath(),e.arc(w,-g,g,0,Math.PI*2),e.fill(),e.stroke()});const G=-a*10;e.beginPath(),e.arc(G,-t,t,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#1C2833",e.fillRect(-T-a*5,M-f,v+a*5,f),e.fillStyle="#B03A2E",e.strokeStyle="#DAA520",e.lineWidth=a*.7;const Y=M-f-k;e.beginPath(),e.moveTo(-T,Y),e.lineTo(0,Y),e.lineTo(0,M-f),e.lineTo(-T-a*5,M-f),e.closePath(),e.fill(),e.stroke(),e.fillStyle=`rgba(255, 235, 150, ${.8+Math.sin(h*.001)*.2})`,e.fillRect(-T+a*4,Y+a*4,T-a*12,a*10),e.fillStyle="#2C3E50",e.beginPath(),e.moveTo(0,M-f),e.lineTo(F,M-f),e.arc(F,u+S,S,Math.PI/2,-Math.PI/2),e.lineTo(0,u),e.closePath(),e.fill(),e.stroke();const A=u-a*8;e.fillStyle="#17202A",e.beginPath(),e.moveTo(F*.7,u),e.lineTo(F*.7-a*2,A),e.lineTo(F*.7+a*10,A-a*4),e.lineTo(F*.7+a*8,u),e.closePath(),e.fill();const X=F+S,L=u+S,W=a*4,z=e.createRadialGradient(X,L,W*.2,X,L,W*1.5);z.addColorStop(0,"rgba(255, 255, 200, 1)"),z.addColorStop(.4,"rgba(255, 220, 100, 0.8)"),z.addColorStop(1,"rgba(255, 200, 0, 0)"),e.fillStyle=z,e.fillRect(X-W,L-W,W*2,W*2),e.strokeStyle="#99A3A4",e.lineWidth=a*2;const B=Math.sin(l)*g*.6,q=R[1]+Math.cos(l)*g*.6,H=v-a*10,p=M-f+a*2+Math.sin(h*.01)*a;e.beginPath(),e.moveTo(H,p),e.lineTo(q,-g+B),e.stroke(),e.lineWidth=a*1.5,[R[0],R[2]].forEach(w=>{const I=w+Math.cos(l)*g*.6;e.beginPath(),e.moveTo(q,-g+B),e.lineTo(I,-g+B),e.stroke()}),e.restore()},drawFirework(e,i){e.fillStyle=i.color||"#ffffff",e.beginPath(),e.arc(i.x,i.y,i.size,0,Math.PI*2),e.fill()},explodeFirework(e,i){const s=50+Math.random()*50,y=["#ff0000","#ffff00","#00ff00","#0000ff","#ffffff"];for(let n=0;n<s;n++){const o=Math.random()*Math.PI*2,h=Math.random()*5+2;i.push({type:"spark",x:e.x,y:e.y,vx:Math.cos(o)*h,vy:Math.sin(o)*h,size:2+Math.random()*2,opacity:1,active:!0,static:!1,color:y[Math.floor(Math.random()*y.length)]})}},drawRobin(e,i,s){const y=i.x,n=i.y,o=i.size,h=i.vx>=0?1:-1,l=i.state==="flying_in"||i.state==="flying_away",a=i.state==="sitting";i.wingIntensity===void 0&&(i.wingIntensity=l?1:0);const r=l?1:0,g=.02;i.wingIntensity+=(r-i.wingIntensity)*g;let t=0;if(i.wingIntensity>.01){const M=Math.sin(s*.012+i.waveOffset),m=Math.sin(M*Math.PI/2),k=Math.PI/6;t=m*k*i.wingIntensity}e.save(),e.translate(y,n),h===-1&&e.scale(-1,1),e.fillStyle="#A52A2A",e.beginPath(),e.ellipse(0,0,o*.6,o*.8,0,0,Math.PI*2),e.fill(),e.fillStyle="#DC143C",e.beginPath(),e.ellipse(o*.15,o*.1,o*.45,o*.6,0,0,Math.PI*2),e.fill(),e.fillStyle="#654321",e.strokeStyle="#4a2c2a",e.lineWidth=.5,e.beginPath(),e.moveTo(-o*.5,0),e.quadraticCurveTo(-o*.7,-o*.08,-o*.85,0),e.quadraticCurveTo(-o*.7,o*.08,-o*.5,0),e.fill(),e.stroke(),e.fillStyle="#8B4513",e.strokeStyle="#654321",e.lineWidth=1,e.save(),e.translate(-o*.3,-o*.1),e.rotate(t),e.beginPath(),e.ellipse(0,0,o*.45,o*.25,-Math.PI/6,0,Math.PI*2),e.fill(),e.stroke(),e.restore(),e.fillStyle="#A0692F",e.strokeStyle="#654321",e.lineWidth=1,e.save(),e.translate(-o*.3,o*.1),e.rotate(-t),e.beginPath(),e.ellipse(0,0,o*.45,o*.25,Math.PI/6,0,Math.PI*2),e.fill(),e.stroke(),e.restore(),e.fillStyle="#A52A2A",e.beginPath(),e.arc(o*.5,-o*.2,o*.35,0,Math.PI*2),e.fill(),e.fillStyle="#FFD700",e.strokeStyle="#DAA520",e.lineWidth=.5,e.beginPath(),e.moveTo(o*.75,-o*.2),e.lineTo(o*.95,-o*.15),e.lineTo(o*.75,-o*.1),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#000000",e.beginPath(),e.arc(o*.6,-o*.25,o*.08,0,Math.PI*2),e.fill(),e.fillStyle="#FFFFFF",e.beginPath(),e.arc(o*.62,-o*.27,o*.03,0,Math.PI*2),e.fill(),a&&(e.strokeStyle="#8B4513",e.lineWidth=o*.08,e.lineCap="round",e.beginPath(),e.moveTo(o*.1,o*.7),e.lineTo(o*.1,o*1),e.stroke(),e.beginPath(),e.moveTo(-o*.1,o*.7),e.lineTo(-o*.1,o*1),e.stroke(),e.lineWidth=o*.06,e.beginPath(),e.moveTo(o*.1,o*1),e.lineTo(o*.25,o*1),e.stroke(),e.beginPath(),e.moveTo(-o*.1,o*1),e.lineTo(-o*.25,o*1),e.stroke());const f=o*.5,d=-o*.55;e.fillStyle="#c00",e.beginPath(),e.moveTo(f-o*.3,d),e.lineTo(f+o*.25,d),e.lineTo(f+o*.1,d-o*.5),e.closePath(),e.fill(),e.fillStyle="#FFFFFF",e.fillRect(f-o*.32,d,o*.58,o*.1),e.beginPath(),e.arc(f+o*.1,d-o*.5,o*.1,0,Math.PI*2),e.fill(),e.restore()},drawSnowman(e,i,s){const y=i.x,n=i.y,o=i.size,h=Math.sin(s*.002+i.wavePhase)*.03;e.save(),e.translate(y,n),e.rotate(h),e.fillStyle="rgba(0, 0, 0, 0.2)",e.beginPath(),e.ellipse(0,o*2,o*1.2,o*.3,0,0,Math.PI*2),e.fill(),e.fillStyle="#FFFFFF",e.strokeStyle="#E0E0E0",e.lineWidth=1,e.beginPath(),e.arc(0,o*1.3,o*1,0,Math.PI*2),e.fill(),e.stroke(),e.beginPath(),e.arc(0,o*.3,o*.7,0,Math.PI*2),e.fill(),e.stroke(),e.beginPath(),e.arc(0,-o*.6,o*.5,0,Math.PI*2),e.fill(),e.stroke(),e.fillStyle="#000000",e.beginPath(),e.arc(0,o*.5,o*.08,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(0,o*.1,o*.08,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(0,-o*.2,o*.08,0,Math.PI*2),e.fill(),e.strokeStyle="#654321",e.lineWidth=o*.1,e.beginPath(),e.moveTo(-o*.6,o*.3),e.lineTo(-o*1.2,o*0),e.lineTo(-o*1.5,-o*.1),e.stroke(),e.lineWidth=o*.05,e.beginPath(),e.moveTo(-o*1.5,-o*.1),e.lineTo(-o*1.7,-o*.3),e.stroke(),e.beginPath(),e.moveTo(-o*1.5,-o*.1),e.lineTo(-o*1.8,-o*.05),e.stroke(),e.lineWidth=o*.1,e.beginPath(),e.moveTo(o*.6,o*.3),e.lineTo(o*1.2,o*0),e.lineTo(o*1.5,-o*.1),e.stroke(),e.lineWidth=o*.05,e.beginPath(),e.moveTo(o*1.5,-o*.1),e.lineTo(o*1.7,-o*.3),e.stroke(),e.beginPath(),e.moveTo(o*1.5,-o*.1),e.lineTo(o*1.8,-o*.05),e.stroke(),e.fillStyle="#FF6347",e.beginPath(),e.moveTo(o*.15,-o*.6),e.lineTo(o*.6,-o*.65),e.lineTo(o*.15,-o*.55),e.closePath(),e.fill(),e.fillStyle="#000000",e.beginPath(),e.arc(-o*.15,-o*.7,o*.08,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(o*.15,-o*.7,o*.08,0,Math.PI*2),e.fill(),[{x:-o*.2,y:-o*.4},{x:-o*.1,y:-o*.35},{x:0,y:-o*.33},{x:o*.1,y:-o*.35},{x:o*.2,y:-o*.4}].forEach(a=>{e.beginPath(),e.arc(a.x,a.y,o*.05,0,Math.PI*2),e.fill()}),e.fillStyle="#c00",e.strokeStyle="#8B0000",e.lineWidth=1,e.beginPath(),e.ellipse(0,-o*.15,o*.55,o*.15,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillRect(o*.3,-o*.1,o*.2,o*.8),e.strokeRect(o*.3,-o*.1,o*.2,o*.8),e.strokeStyle="#8B0000",e.lineWidth=o*.03;for(let a=0;a<4;a++)e.beginPath(),e.moveTo(o*.33+a*o*.13,o*.7),e.lineTo(o*.33+a*o*.13,o*.85),e.stroke();e.fillStyle="#000000",e.strokeStyle="#333333",e.lineWidth=2,e.beginPath(),e.ellipse(0,-o*1.1,o*.7,o*.15,0,0,Math.PI*2),e.fill(),e.stroke(),e.fillRect(-o*.45,-o*1.8,o*.9,o*.7),e.strokeRect(-o*.45,-o*1.8,o*.9,o*.7),e.fillStyle="#c00",e.fillRect(-o*.45,-o*1.3,o*.9,o*.15),e.fillStyle="#228B22",e.beginPath(),e.arc(-o*.15,-o*1.22,o*.08,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(o*.15,-o*1.22,o*.08,0,Math.PI*2),e.fill(),e.fillStyle="#FF0000",e.beginPath(),e.arc(0,-o*1.25,o*.06,0,Math.PI*2),e.fill(),e.restore()}};
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export default{name:"halloween",displayName:"Halloween",emoji:"\u{1F383}",intensityConfig:{light:{count:30,speedRange:[.3,1],sizeRange:[2,5],gravestones:3,jackOLanterns:2,spiders:2,scarecrows:1,twinklingStars:8},medium:{count:60,speedRange:[.5,1.5],sizeRange:[2,6],gravestones:5,jackOLanterns:4,spiders:4,scarecrows:2,twinklingStars:15},heavy:{count:100,speedRange:[.7,2],sizeRange:[3,8],gravestones:8,jackOLanterns:6,spiders:6,scarecrows:3,twinklingStars:25}},particles:["bat","ghost","pumpkin"],decorations:["gravestone","jack-o-lantern","haunted-house","cauldron","spider","scarecrow","twinkling-star"],colors:{primary:"#ff6600",secondary:"#1a1a2e",accent:"#8b0000",ghost:"#f0f0f0",purple:"#6a0dad"},lightningChance:5e-4,lightningDuration:200,lightningTimer:0,lightningActive:!1,lightningColor:"#fefefe",createBat(e,n,i){const s=Math.random();let o,a,l;s<.33?(o=i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*1.5,a=i.speedRange[0]+Math.random()*(i.speedRange[1]-i.speedRange[0])*1.3,l=.9+Math.random()*.1):s<.66?(o=i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]),a=i.speedRange[0]+Math.random()*(i.speedRange[1]-i.sizeRange[0]),l=.6+Math.random()*.2):(o=i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*.7,a=i.speedRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*.7,l=.4+Math.random()*.2);const t=Math.random()<.5;return{type:"bat",x:t?-20:e+20,y:Math.random()*n*.7,baseY:Math.random()*n*.7,vx:t?a*2:-a*2,vy:0,size:o,speed:a,opacity:l,waveAmplitude:10+Math.random()*20,waveFrequency:.002+Math.random()*.003,waveOffset:Math.random()*Math.PI*2,time:0,rotation:0,active:!0,depth:s}},createGhost(e,n,i){const s=Math.random();let o,a,l;return s<.33?(o=i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*1.8,a=i.speedRange[0]+Math.random()*(i.speedRange[1]-i.sizeRange[0])*.5,l=.7+Math.random()*.2):s<.66?(o=i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*1.2,a=i.speedRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*.5,l=.5+Math.random()*.15):(o=i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]),a=i.speedRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0])*.5,l=.3+Math.random()*.15),{type:"ghost",x:Math.random()*e,y:-50,size:o,speed:a,opacity:l,windOffset:Math.random()*Math.PI*2,windSpeed:.01+Math.random()*.02,rotation:0,rotationSpeed:(Math.random()-.5)*.005,time:Math.random()*1e3,active:!0,depth:s}},createPumpkin(e,n,i){return{type:"pumpkin",x:Math.random()*e,y:Math.random()*n,size:i.sizeRange[0]+Math.random()*(i.sizeRange[1]-i.sizeRange[0]),vx:(Math.random()-.5)*.2,speed:(i.speedRange[0]+Math.random()*(i.speedRange[1]-i.sizeRange[0]))*.2,opacity:.8+Math.random()*.2,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.008,windOffset:Math.random()*Math.PI*2,windSpeed:.008+Math.random()*.015,glowPhase:Math.random()*Math.PI*2,floatPhase:Math.random()*Math.PI*2,floatSpeed:.001+Math.random()*.002,active:!0}},createGravestone(e,n,i={}){const s=["rounded","cross","obelisk"];return{type:"gravestone",x:i.x!==void 0?i.x:Math.random()*e,y:i.y!==void 0?i.y:n-30-Math.random()*20,size:15+Math.random()*10,opacity:.7+Math.random()*.2,shape:s[Math.floor(Math.random()*s.length)],rotation:(Math.random()-.5)*.1,active:!0,static:!0}},createJackOLantern(e,n,i={}){const s=["happy","scary","wicked"];return{type:"jack-o-lantern",x:i.x!==void 0?i.x:Math.random()*e,y:i.y!==void 0?i.y:n-25-Math.random()*15,size:12+Math.random()*8,opacity:.9+Math.random()*.1,face:s[Math.floor(Math.random()*s.length)],glowPhase:Math.random()*Math.PI*2,active:!0,static:!0}},createSpider(e,n,i={}){return{type:"spider",x:i.x!==void 0?i.x:Math.random()*e,y:i.y!==void 0?i.y:Math.random()*n*.3,baseY:i.y!==void 0?i.y:Math.random()*n*.3,size:5+Math.random()*5,opacity:.8+Math.random()*.2,threadLength:30+Math.random()*50,swingPhase:Math.random()*Math.PI*2,swingAmplitude:20+Math.random()*30,swingSpeed:.001+Math.random()*.002,time:0,active:!0,static:!1}},createFallingParticle(e,n,i){return Math.random()<.7?this.createPumpkin(e,n,i):{type:"spider-small",x:Math.random()*e,y:-20,size:1+Math.random()*2,speed:i.speedRange[0]+Math.random()*(i.speedRange[1]-i.sizeRange[0])*.5,opacity:.6+Math.random()*.3,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,windOffset:Math.random()*Math.PI*2,windSpeed:.01+Math.random()*.02,active:!0}},createInitialDecorations(e,n,i){const s=[];s.push({type:"haunted-house",x:80,y:n-120,size:80,opacity:.85,active:!0,static:!0}),s.push({type:"moon",x:e-120,y:100,size:60,opacity:.9,glowPhase:0,active:!0,static:!0});const o=i.gravestones||5;for(let r=0;r<o;r++)s.push({type:"gravestone",x:e/(o+1)*(r+1)+(Math.random()-.5)*40,y:n-30-Math.random()*10,size:12+Math.random()*8,opacity:.7+Math.random()*.2,variant:Math.floor(Math.random()*3),active:!0,static:!0});const a=i.jackOLanterns||4;for(let r=0;r<a;r++)s.push({type:"jack-o-lantern",x:e/(a+1)*(r+1)+(Math.random()-.5)*30,y:n-15,size:10+Math.random()*6,opacity:.9,glowPhase:Math.random()*Math.PI*2,active:!0,static:!0});const l=i.spiders||4;for(let r=0;r<l;r++)s.push({type:"spider",x:e/(l+1)*(r+1),y:0,targetY:50+Math.random()*100,currentY:0,size:3+Math.random()*3,opacity:.8,swingPhase:Math.random()*Math.PI*2,swingAmplitude:20+Math.random()*30,swingSpeed:.02+Math.random()*.02,active:!0,static:!0});const t=i.scarecrows||2;for(let r=0;r<t;r++)s.push({type:"scarecrow",x:120+r/(t-1||1)*(e-240),y:n-60,size:30+Math.random()*10,opacity:.9,swayPhase:Math.random()*Math.PI*2,swaySpeed:.015+Math.random()*.015,glowPhase:Math.random()*Math.PI*2,glowSpeed:.02,active:!0,static:!0});const h=i.twinklingStars||15;for(let r=0;r<h;r++)s.push(this.createTwinklingStar(e,n));return s},createTwinklingStar(e,n){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(n*.5),size:1+Math.random()*2.5,opacity:.5+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.004+Math.random()*.003,colorVariant:Math.floor(Math.random()*3),active:!0,static:!0}},drawLightning(e,n,i,s,o,a,l,t,h,r,M){if(a<1)return;const d=(n+s)/2,f=(i+o)/2,g=Math.atan2(o-i,s-n),m=g+Math.PI/2,T=(Math.random()-.5)*l,y=d+Math.cos(m)*T,P=f+Math.sin(m)*T,u=a-1,w=l*t,b=r*.8;if(e.strokeStyle=M,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(n,i),e.lineTo(y,P),e.lineTo(s,o),e.stroke(),u>0&&(this.drawLightning(e,n,i,y,P,u,w,t,h,b,M),this.drawLightning(e,y,P,s,o,u,w,t,h,b,M),Math.random()<h&&u>1)){const S=Math.random()*l*.5,v=(Math.random()-.5)*Math.PI/3,k=y+Math.cos(g+v)*S,p=P+Math.sin(g+v)*S;this.drawLightning(e,y,P,k,p,u-1,w*.5,t,h*.5,b*.6,M)}},spawnSpecialParticle(e,n,i){const s=Math.random(),o=this.intensityConfig.medium;if(s<.15)return this.createBat(n,i,o);if(s<.16){if(e.some(l=>l.type==="witch"))return null;const a=Math.random()<.5;return{type:"witch",x:a?-100:n+100,y:Math.random()*(i*.4)+50,baseY:Math.random()*(i*.4)+50,vx:a?3+Math.random()*2:-(3+Math.random()*2),size:15+Math.random()*8,opacity:.85,waveAmplitude:15+Math.random()*20,waveFrequency:.002+Math.random()*.002,waveOffset:Math.random()*Math.PI*2,time:0,active:!0,static:!1}}return s<.18?{type:"floating-pumpkin",x:Math.random()*n,y:-50,size:8+Math.random()*6,vx:(Math.random()-.5)*.5,vy:.3+Math.random()*.5,opacity:.9,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.01,glowPhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015,active:!0}:s<.2102?e.some(a=>a.type==="haunted-house")?null:{type:"haunted-house",x:Math.random()*n*.6+n*.2,y:i-100,size:40+Math.random()*20,opacity:.8,windowFlicker:0,active:!0,static:!0}:s<.2105?e.some(a=>a.type==="cauldron")?null:{type:"cauldron",x:Math.random()*n*.6+n*.2,y:i-40,size:25+Math.random()*10,opacity:1,bubbles:[],smoke:[],time:0,active:!0,static:!0}:null},updateSpecialParticles(e,n,i,s){this.lightningActive?(this.lightningTimer+=n,this.lightningTimer>=this.lightningDuration&&(this.lightningActive=!1,this.lightningTimer=0)):Math.random()<this.lightningChance&&(this.lightningActive=!0,this.lightningTimer=0),e.forEach(o=>{switch(o.time!==void 0&&(o.time+=n),o.type){case"moon":break;case"witch":(o.vx>0&&o.x>i+100||o.vx<0&&o.x<-100)&&(o.active=!1);break;case"floating-pumpkin":o.y>s+50&&(o.active=!1);break;case"cauldron":o.time%100<20&&o.bubbles.push({x:(Math.random()-.5)*o.size*.5,y:o.size*.3+Math.random()*o.size*.2,size:o.size*(.05+Math.random()*.1),vy:-.5-Math.random()*.5,opacity:1,life:1,fadeRate:.01+Math.random()*.005}),o.bubbles=o.bubbles.filter(a=>(a.y+=a.vy,a.vy*=.98,a.opacity-=a.fadeRate,a.opacity>0&&a.y>-o.size)),o.time%200<30&&o.smoke.push({x:(Math.random()-.5)*o.size*.3,y:-o.size*.5+Math.random()*o.size*.1,size:o.size*(.2+Math.random()*.3),vx:(Math.random()-.5)*.1,vy:-.2-Math.random()*.2,opacity:.5,life:1,fadeRate:.005+Math.random()*.003}),o.smoke=o.smoke.filter(a=>(a.x+=a.vx,a.y+=a.vy,a.size*=1.02,a.opacity-=a.fadeRate,a.opacity>0));break}})},drawBat(e,n){const i=n.x,s=n.y,o=n.size,a=n.vx>0?1:-1,l=n.time;e.save(),e.globalAlpha=n.opacity,e.translate(i,s),a===-1&&e.scale(-1,1);const t=l*.01,h=Math.sin(t)*(Math.PI/4);e.fillStyle="#1a1a1a",e.beginPath(),e.ellipse(0,0,o*.4,o*.6,0,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(o*.3,-o*.4,o*.35,0,Math.PI*2),e.fill(),e.beginPath(),e.moveTo(o*.1,-o*.7),e.lineTo(o*.25,-o*1.1),e.lineTo(o*.4,-o*.7),e.fill(),e.beginPath(),e.moveTo(o*.2,-o*.7),e.lineTo(o*.35,-o*1),e.lineTo(o*.5,-o*.7),e.fill(),e.fillStyle="#ff0000",e.beginPath(),e.arc(o*.2,-o*.45,o*.08,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(o*.4,-o*.45,o*.08,0,Math.PI*2),e.fill(),e.fillStyle="rgba(255, 0, 0, 0.3)",e.beginPath(),e.arc(o*.2,-o*.45,o*.15,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(o*.4,-o*.45,o*.15,0,Math.PI*2),e.fill(),e.fillStyle="#2a2a2a",e.strokeStyle="#1a1a1a",e.lineWidth=1,e.save(),e.translate(-o*.3,0),e.rotate(-h),e.beginPath(),e.moveTo(0,0),e.quadraticCurveTo(-o*.8,-o*.5,-o*1.2,0),e.quadraticCurveTo(-o*.9,o*.3,-o*.6,o*.4),e.quadraticCurveTo(-o*.3,o*.2,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.save(),e.translate(o*.3,0),e.rotate(h),e.beginPath(),e.moveTo(0,0),e.quadraticCurveTo(o*.8,-o*.5,o*1.2,0),e.quadraticCurveTo(o*.9,o*.3,o*.6,o*.4),e.quadraticCurveTo(o*.3,o*.2,0,0),e.closePath(),e.fill(),e.stroke(),e.restore(),e.restore()},drawGhost(e,n){const i=n.x,s=n.y,o=n.size,a=n.time;e.save(),e.globalAlpha=n.opacity,e.translate(i,s),e.fillStyle="#f0f0f0",e.shadowColor="rgba(240, 240, 240, 0.5)",e.shadowBlur=15,e.beginPath(),e.arc(0,-o*.5,o*.6,Math.PI,0);const l=5;for(let t=0;t<=l;t++){const h=-o*.6+t/l*o*1.2,r=Math.sin(a*.005+t)*o*.15;t===0?e.lineTo(h,r):e.quadraticCurveTo(h-o*.12,r-o*.1,h,r)}e.closePath(),e.fill(),e.shadowBlur=0,e.fillStyle="#000000",e.beginPath(),e.ellipse(-o*.2,-o*.6,o*.12,o*.18,-.2,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(o*.2,-o*.6,o*.12,o*.18,.2,0,Math.PI*2),e.fill(),e.beginPath(),e.ellipse(0,-o*.3,o*.15,o*.2,0,0,Math.PI*2),e.fill(),e.restore()},drawPumpkin(e,n,i){const s=n.x,o=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(s,o),e.rotate(n.rotation),e.fillStyle="#ff6600",e.strokeStyle="#cc5200",e.lineWidth=a*.08;const l=5;e.beginPath();for(let r=0;r<l;r++){const M=r/l*Math.PI*2-Math.PI/2,d=(r+1)/l*Math.PI*2-Math.PI/2,f=a*.9,g=a;r===0&&e.moveTo(Math.cos(M)*f,Math.sin(M)*g),e.quadraticCurveTo(Math.cos((M+d)/2)*f*.8,Math.sin((M+d)/2)*g*.8,Math.cos(d)*f,Math.sin(d)*g)}e.closePath(),e.fill(),e.stroke(),e.fillStyle="#8B4513",e.fillRect(-a*.2,-a*1.1,a*.4,a*.2);const t=(Math.sin(i*.002+n.glowPhase)+1)*.5;e.globalAlpha=n.opacity*t*.7;const h=e.createRadialGradient(0,0,0,0,0,a);h.addColorStop(0,"#ffaa00"),h.addColorStop(1,"rgba(255, 170, 0, 0)"),e.fillStyle=h,e.fillRect(-a,-a,a*2,a*2),e.restore()},drawGravestone(e,n){const i=n.x,s=n.y,o=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(i,s),e.rotate(n.rotation),e.fillStyle="#555555",e.strokeStyle="#333333",e.lineWidth=1,n.shape==="rounded"?(e.beginPath(),e.moveTo(-o*.5,o*.8),e.lineTo(-o*.5,-o*.3),e.arc(0,-o*.3,o*.5,Math.PI,0),e.lineTo(o*.5,o*.8),e.closePath(),e.fill(),e.stroke()):n.shape==="cross"?(e.fillRect(-o*.15,-o,o*.3,o*1.8),e.fillRect(-o*.5,-o*.3,o,o*.3)):(e.beginPath(),e.moveTo(-o*.4,o*.8),e.lineTo(-o*.5,-o*.5),e.lineTo(0,-o),e.lineTo(o*.5,-o*.5),e.lineTo(o*.4,o*.8),e.closePath(),e.fill(),e.stroke()),e.fillStyle="rgba(0, 100, 0, 0.3)",e.fillRect(-o*.4,o*.5,o*.8,o*.3),e.fillStyle="#222222",e.font=`${o*.4}px serif`,e.textAlign="center",e.textBaseline="middle",e.fillText("RIP",0,0),e.restore()},drawJackOLantern(e,n,i){const s=n.x,o=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(s,o),e.fillStyle="#ff8800",e.beginPath(),e.ellipse(0,0,a*1.2,a,0,0,Math.PI*2),e.fill(),e.strokeStyle="#cc6600",e.lineWidth=a*.08;for(let r=-2;r<=2;r++)e.beginPath(),e.moveTo(r*a*.35,-a*.8),e.quadraticCurveTo(r*a*.3,0,r*a*.35,a*.8),e.stroke();e.fillStyle="#8B4513",e.fillRect(-a*.2,-a*1.1,a*.4,a*.2);const l=.8+Math.sin(i*.02+n.glowPhase)*.2,t=.5+l*.5,h=e.createRadialGradient(0,0,0,0,0,a*1.5);h.addColorStop(0,`rgba(255, 255, 100, ${t})`),h.addColorStop(.5,`rgba(255, 200, 0, ${t*.7})`),h.addColorStop(1,"rgba(255, 150, 0, 0)"),e.fillStyle=h,e.fillRect(-a*1.5,-a*1.5,a*3,a*3),e.fillStyle="#000000",e.shadowColor=`rgba(255, 180, 0, ${l})`,e.shadowBlur=a*.5,e.beginPath(),e.moveTo(-a*.6,-a*.4),e.lineTo(-a*.2,-a*.3),e.lineTo(-a*.5,-a*.1),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.6,-a*.4),e.lineTo(a*.2,-a*.3),e.lineTo(a*.5,-a*.1),e.closePath(),e.fill(),e.beginPath(),e.moveTo(-a*.7,a*.2),e.lineTo(-a*.5,a*.4),e.lineTo(-a*.3,a*.25),e.lineTo(0,a*.45),e.lineTo(a*.3,a*.25),e.lineTo(a*.5,a*.4),e.lineTo(a*.7,a*.2),e.lineTo(a*.5,a*.1),e.lineTo(0,a*.25),e.lineTo(-a*.5,a*.1),e.closePath(),e.fill(),e.shadowBlur=0,e.restore()},drawHauntedHouse(e,n,i){const s=n.x,o=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(s,o);const l="#1a1a2e",t="#0a0a0a",h=.5+Math.random()*.5;e.fillStyle=l,e.strokeStyle=t,e.lineWidth=2,e.fillRect(-a*1.2,-a*1.4,a*.5,a*2);for(let r=0;r<3;r++)e.fillRect(-a*1.2+r*a*.2,-a*1.5,a*.12,a*.1);e.beginPath(),e.moveTo(-a*1.3,-a*1.5),e.lineTo(-a*.95,-a*2),e.lineTo(-a*.6,-a*1.5),e.closePath(),e.fill(),e.stroke(),e.fillRect(a*.7,-a*1.3,a*.5,a*1.9);for(let r=0;r<3;r++)e.fillRect(a*.7+r*a*.2,-a*1.4,a*.12,a*.1);e.beginPath(),e.moveTo(a*.6,-a*1.4),e.lineTo(a*.95,-a*1.9),e.lineTo(a*1.3,-a*1.4),e.closePath(),e.fill(),e.stroke(),e.fillRect(-a*.7,-a*.9,a*1.4,a*1.5),e.strokeRect(-a*.7,-a*.9,a*1.4,a*1.5);for(let r=0;r<7;r++)r%2===0&&e.fillRect(-a*.7+r*a*.2,-a*1,a*.2,a*.1);e.fillRect(-a*.8,-a*1.1,a*.3,a*.5),e.beginPath(),e.moveTo(-a*.85,-a*1.1),e.lineTo(-a*.65,-a*1.35),e.lineTo(-a*.45,-a*1.1),e.closePath(),e.fill(),e.fillRect(a*.5,-a*1.1,a*.3,a*.5),e.beginPath(),e.moveTo(a*.45,-a*1.1),e.lineTo(a*.65,-a*1.35),e.lineTo(a*.85,-a*1.1),e.closePath(),e.fill(),e.fillStyle=`rgba(255, 200, 100, ${h})`,e.shadowColor="#ffcc66",e.shadowBlur=10,e.fillRect(-a*1.05,-a*1.2,a*.2,a*.25),e.fillRect(-a*1.05,-a*.8,a*.2,a*.25),e.fillRect(-a*1.05,-a*.4,a*.2,a*.25),e.fillRect(a*.85,-a*1.1,a*.2,a*.25),e.fillRect(a*.85,-a*.7,a*.2,a*.25),e.fillRect(a*.85,-a*.3,a*.2,a*.25),e.fillRect(-a*.5,-a*.6,a*.25,a*.3),e.fillRect(-a*.1,-a*.6,a*.25,a*.3),e.fillRect(a*.3,-a*.6,a*.25,a*.3),e.fillRect(-a*.3,-a*.15,a*.25,a*.3),e.fillRect(a*.1,-a*.15,a*.25,a*.3),e.shadowBlur=0,e.fillStyle=t,e.beginPath(),e.arc(0,a*.3,a*.25,Math.PI,0,!0),e.lineTo(a*.25,a*.6),e.lineTo(-a*.25,a*.6),e.closePath(),e.fill(),e.strokeStyle="#333333",e.lineWidth=1.5;for(let r=-2;r<=2;r++)e.beginPath(),e.moveTo(r*a*.1,a*.3),e.lineTo(r*a*.1,a*.6),e.stroke();e.restore()},drawCauldron(e,n,i){const s=n.x,o=n.y,a=n.size;e.save(),e.translate(s,o),e.fillStyle="#222222",e.strokeStyle="#111111",e.lineWidth=2,e.beginPath(),e.arc(0,0,a*.8,0,Math.PI),e.lineTo(-a*.8,a*.5),e.quadraticCurveTo(0,a*.8,a*.8,a*.5),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#1a1a1a",e.lineWidth=3,[-a*.5,0,a*.5].forEach(l=>{e.beginPath(),e.moveTo(l,a*.5),e.lineTo(l,a*.9),e.stroke()}),e.fillStyle="#00ff00",e.shadowColor="#00ff00",e.shadowBlur=15,e.beginPath(),e.ellipse(0,0,a*.7,a*.3,0,0,Math.PI*2),e.fill(),e.shadowBlur=0,n.bubbles.forEach(l=>{e.globalAlpha=l.opacity,e.fillStyle="#88ff88",e.beginPath(),e.arc(l.x,l.y,l.size,0,Math.PI*2),e.fill()}),e.globalAlpha=1,n.smoke.forEach(l=>{e.globalAlpha=l.opacity,e.fillStyle="#aaaaaa",e.beginPath(),e.arc(l.x,l.y,l.size,0,Math.PI*2),e.fill()}),e.restore()},drawSpider(e,n,i){const s=n.x,o=n.y,a=n.size,l=Math.sin(i*n.swingSpeed+n.swingPhase)*n.swingAmplitude;e.save(),e.globalAlpha=n.opacity,e.strokeStyle="#cccccc",e.lineWidth=1,e.setLineDash([2,2]),e.beginPath(),e.moveTo(s,o),e.lineTo(s+l,o+n.threadLength),e.stroke(),e.setLineDash([]),e.translate(s+l,o+n.threadLength),e.fillStyle="#000000",e.beginPath(),e.ellipse(0,0,a*.5,a*.7,0,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(0,-a*.5,a*.3,0,Math.PI*2),e.fill(),e.strokeStyle="#1a1a1a",e.lineWidth=a*.1;const t=Math.sin(i*.005)*.2;for(let h=0;h<4;h++){const r=h/4*Math.PI-Math.PI/2,M=a*1.5;e.beginPath(),e.moveTo(-a*.3,-a*.2+h*a*.2),e.quadraticCurveTo(-a-Math.sin(r+t)*a*.3,-a*.2+h*a*.2-a*.5,-a*1.2,-a*.2+h*a*.2),e.stroke(),e.beginPath(),e.moveTo(a*.3,-a*.2+h*a*.2),e.quadraticCurveTo(a+Math.sin(r+t)*a*.3,-a*.2+h*a*.2-a*.5,a*1.2,-a*.2+h*a*.2),e.stroke()}e.fillStyle="#ff0000";for(let h=0;h<4;h++)e.beginPath(),e.arc(-a*.15+h%2*a*.3,-a*.55+Math.floor(h/2)*a*.1,a*.05,0,Math.PI*2),e.fill();e.restore()},drawSpiderSmall(e,n){e.save(),e.globalAlpha=n.opacity,e.translate(n.x,n.y),e.rotate(n.rotation),e.fillStyle="#1a1a1a",e.beginPath(),e.arc(0,0,n.size,0,Math.PI*2),e.fill(),e.strokeStyle="#1a1a1a",e.lineWidth=n.size*.3;for(let i=0;i<4;i++){const s=i/4*Math.PI-Math.PI/2;e.beginPath(),e.moveTo(0,0),e.lineTo(Math.cos(s)*n.size*2,Math.sin(s)*n.size*2),e.stroke(),e.beginPath(),e.moveTo(0,0),e.lineTo(-Math.cos(s)*n.size*2,Math.sin(s)*n.size*2),e.stroke()}e.restore()},drawWitch(e,n,i){const s=n.x,o=n.y+Math.sin(i*n.waveFrequency+n.waveOffset)*n.waveAmplitude,a=n.size,l=n.vx>0?1:-1;e.save(),e.globalAlpha=n.opacity,e.translate(s,o),l===-1&&e.scale(-1,1),e.strokeStyle="#8B4513",e.lineWidth=a*.12,e.lineCap="round",e.beginPath(),e.moveTo(a*.2,a*.6),e.lineTo(-a*1.5,a*.6),e.stroke(),e.strokeStyle="#D2691E",e.lineWidth=a*.06;for(let t=0;t<8;t++){const h=Math.PI/3*(t/7-.5);e.beginPath(),e.moveTo(-a*1.5,a*.6),e.lineTo(-a*1.5+Math.cos(h)*a*.4,a*.6+Math.sin(h)*a*.4),e.stroke()}e.fillStyle="#1a1a1a",e.strokeStyle="#0a0a0a",e.lineWidth=1,e.beginPath(),e.moveTo(a*.2,a*.6),e.quadraticCurveTo(-a*.5,a*.4,-a*.8,a*.1),e.lineTo(-a*.7,-a*.3),e.quadraticCurveTo(-a*.3,-a*.5,0,-a*.6),e.lineTo(a*.3,-a*.4),e.lineTo(a*.3,a*.5),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#8B9355",e.beginPath(),e.ellipse(a*.25,-a*.6,a*.3,a*.35,0,0,Math.PI*2),e.fill(),e.fillStyle="#7a8245",e.beginPath(),e.moveTo(a*.45,-a*.6),e.quadraticCurveTo(a*.7,-a*.65,a*.72,-a*.5),e.lineTo(a*.6,-a*.52),e.quadraticCurveTo(a*.58,-a*.58,a*.4,-a*.55),e.closePath(),e.fill(),e.fillStyle="#2C1810",e.beginPath(),e.moveTo(a*.05,-a*.85),e.lineTo(a*.4,-a*1.6),e.lineTo(a*.5,-a*.8),e.closePath(),e.fill(),e.beginPath(),e.ellipse(a*.25,-a*.85,a*.5,a*.12,0,0,Math.PI*2),e.fill(),e.fillStyle="#ff6600",e.shadowColor="#ff6600",e.shadowBlur=a*.3,e.beginPath(),e.arc(a*.35,-a*.65,a*.08,0,Math.PI*2),e.fill(),e.shadowBlur=0,e.fillStyle="#8B9355",e.beginPath(),e.arc(a*.1,a*.5,a*.12,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(-a*.3,a*.55,a*.1,0,Math.PI*2),e.fill(),e.strokeStyle="#1a1a1a",e.lineWidth=a*.1,e.beginPath(),e.moveTo(a*.15,a*.6),e.lineTo(a*.1,a*1),e.stroke(),e.beginPath(),e.moveTo(a*.05,a*.6),e.lineTo(a*.2,a*.95),e.stroke(),e.restore()},drawFloatingPumpkin(e,n){const i=n.x,s=n.y,o=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(i,s),e.rotate(n.rotation),e.fillStyle="#ff6600",e.strokeStyle="#cc5200",e.lineWidth=o*.1,e.beginPath(),e.ellipse(0,0,o,o*.9,0,0,Math.PI*2),e.fill(),e.stroke();for(let l=-2;l<=2;l++)e.beginPath(),e.moveTo(l*o*.25,-o*.8),e.quadraticCurveTo(l*o*.3,0,l*o*.25,o*.8),e.stroke();e.fillStyle="#228B22",e.beginPath(),e.moveTo(-o*.15,-o*.8),e.lineTo(-o*.1,-o*1.1),e.lineTo(o*.1,-o*1.1),e.lineTo(o*.15,-o*.8),e.closePath(),e.fill();const a=.5+Math.sin(n.glowPhase+Date.now()*.005)*.5;e.fillStyle=`rgba(255, 200, 0, ${a})`,e.beginPath(),e.moveTo(-o*.4,-o*.3),e.lineTo(-o*.2,-o*.1),e.lineTo(-o*.6,-o*.1),e.closePath(),e.fill(),e.beginPath(),e.moveTo(o*.4,-o*.3),e.lineTo(o*.6,-o*.1),e.lineTo(o*.2,-o*.1),e.closePath(),e.fill(),e.beginPath(),e.moveTo(-o*.5,o*.2);for(let l=-4;l<=4;l++)e.lineTo(l*o*.12,o*.2+(l%2===0?o*.15:0));e.lineTo(o*.5,o*.2),e.closePath(),e.fill(),e.restore()},drawMoon(e,n,i){const s=n.x,o=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(s,o);const l=.8+Math.sin(i*.001+n.glowPhase)*.2,t=e.createRadialGradient(0,0,0,0,0,a*1.5);t.addColorStop(0,`rgba(255, 255, 220, ${l})`),t.addColorStop(.4,`rgba(255, 255, 200, ${l*.5})`),t.addColorStop(.7,`rgba(255, 220, 150, ${l*.2})`),t.addColorStop(1,"rgba(255, 200, 100, 0)"),e.fillStyle=t,e.fillRect(-a*1.5,-a*1.5,a*3,a*3),e.fillStyle="#ffffdc",e.shadowColor="#ffffaa",e.shadowBlur=a*.3,e.beginPath(),e.arc(0,0,a,0,Math.PI*2),e.fill(),e.shadowBlur=0,e.fillStyle="rgba(200, 200, 170, 0.4)",e.beginPath(),e.arc(-a*.3,-a*.2,a*.2,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.4,a*.1,a*.15,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(a*.1,a*.4,a*.18,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(-a*.2,a*.5,a*.12,0,Math.PI*2),e.fill(),e.restore()},drawScarecrow(e,n,i){const s=n.x,o=n.y,a=n.size,l=Math.sin(i*n.swaySpeed+n.swayPhase)*a*.12,t=Math.abs(Math.sin(i*n.swaySpeed*2+n.swayPhase))*a*.03;e.save(),e.globalAlpha=n.opacity,e.translate(s+l,o-t);const h=e.createLinearGradient(-a*.05,0,a*.05,0);if(h.addColorStop(0,"#5a4632"),h.addColorStop(.5,"#6b5644"),h.addColorStop(1,"#4a3622"),e.fillStyle=h,e.fillRect(-a*.05,0,a*.1,a*1.8),e.strokeStyle="#3a2612",e.lineWidth=1,e.strokeRect(-a*.05,0,a*.1,a*1.8),e.fillRect(-a*.8,a*.5,a*1.6,a*.08),e.strokeRect(-a*.8,a*.5,a*1.6,a*.08),e.fillStyle="#8B7355",e.strokeStyle="#654321",e.lineWidth=1.5,e.beginPath(),e.moveTo(-a*.4,a*.5),e.lineTo(-a*.45,a*1.2),e.lineTo(-a*.25,a*1.4),e.lineTo(a*.25,a*1.4),e.lineTo(a*.45,a*1.2),e.lineTo(a*.4,a*.5),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#6b5c4d",e.fillRect(-a*.3,a*.7,a*.2,a*.15),e.fillRect(a*.1,a*1,a*.18,a*.2),e.fillStyle="#8B7355",e.strokeStyle="#654321",e.beginPath(),e.moveTo(-a*.8,a*.5),e.lineTo(-a*.75,a*.7),e.lineTo(-a*.85,a*.75),e.lineTo(-a*.9,a*.6),e.closePath(),e.fill(),e.stroke(),e.beginPath(),e.moveTo(a*.8,a*.5),e.lineTo(a*.75,a*.7),e.lineTo(a*.85,a*.75),e.lineTo(a*.9,a*.6),e.closePath(),e.fill(),e.stroke(),Math.random()<.6){const d=e.createRadialGradient(-a*.1,-a*.05,0,0,0,a*.35);d.addColorStop(0,"#ff8c00"),d.addColorStop(.7,"#ff6600"),d.addColorStop(1,"#cc5500"),e.fillStyle=d,e.beginPath(),e.ellipse(0,a*.2,a*.35,a*.3,0,0,Math.PI*2),e.fill(),e.strokeStyle="#8B4513",e.lineWidth=2,e.stroke(),e.strokeStyle="#cc5500",e.lineWidth=1;for(let f=-2;f<=2;f++)e.beginPath(),e.moveTo(f*a*.12,a*.05),e.quadraticCurveTo(f*a*.1,a*.2,f*a*.12,a*.45),e.stroke();e.fillStyle="#228B22",e.strokeStyle="#1a6b1a",e.fillRect(-a*.04,a*.02,a*.08,a*.1),e.strokeRect(-a*.04,a*.02,a*.08,a*.1)}else{e.fillStyle="#d2b48c",e.strokeStyle="#8b7355",e.lineWidth=2,e.beginPath(),e.ellipse(0,a*.2,a*.32,a*.28,0,0,Math.PI*2),e.fill(),e.stroke(),e.strokeStyle="#a0826d",e.lineWidth=.5;for(let d=-3;d<=3;d++)e.beginPath(),e.moveTo(d*a*.1,a*.05),e.lineTo(d*a*.1,a*.42),e.stroke()}const M=.6+Math.sin(i*n.glowSpeed+n.glowPhase)*.4;e.shadowColor="#ff0000",e.shadowBlur=a*.2,e.fillStyle=`rgba(255, 0, 0, ${M})`,e.beginPath(),e.moveTo(-a*.18,a*.15),e.lineTo(-a*.12,a*.2),e.lineTo(-a*.18,a*.25),e.closePath(),e.fill(),e.beginPath(),e.moveTo(a*.18,a*.15),e.lineTo(a*.12,a*.2),e.lineTo(a*.18,a*.25),e.closePath(),e.fill(),e.strokeStyle="#000000",e.lineWidth=a*.03,e.beginPath(),e.moveTo(-a*.2,a*.35);for(let d=-3;d<=3;d++){const f=d%2===0?0:a*.04;e.lineTo(d*a*.07,a*.35+f)}e.stroke(),e.shadowBlur=0,e.fillStyle="#2a2a2a",e.strokeStyle="#1a1a1a",e.lineWidth=2,e.beginPath(),e.ellipse(0,a*.05,a*.45,a*.08,0,0,Math.PI*2),e.fill(),e.stroke(),e.beginPath(),e.moveTo(-a*.2,a*.05),e.lineTo(-a*.15,-a*.2),e.lineTo(a*.15,-a*.2),e.lineTo(a*.2,a*.05),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#8B4513",e.fillRect(-a*.2,a*.03,a*.4,a*.05),e.strokeStyle="#1a1a1a",e.lineWidth=1;for(let d=0;d<5;d++){const f=d/5*Math.PI*2,g=Math.cos(f)*a*.45,m=a*.05+Math.sin(f)*a*.08;e.beginPath(),e.moveTo(g,m),e.lineTo(g+Math.cos(f)*a*.08,m+Math.sin(f)*a*.08),e.stroke()}if(Math.random()<.3){const d=Math.random()<.5?-a*.6:a*.6;e.fillStyle="#000000",e.beginPath(),e.arc(d,a*.5,a*.08,0,Math.PI*2),e.fill(),e.fillStyle="#ffa500",e.beginPath(),e.moveTo(d+a*.08,a*.5),e.lineTo(d+a*.15,a*.5),e.lineTo(d+a*.1,a*.52),e.closePath(),e.fill()}e.restore()},drawTwinklingStar(e,n,i){const s=n.x,o=n.y,a=n.size,l=.4+Math.sin(i*n.twinkleSpeed+n.twinklePhase)*.6;let t,h;switch(n.colorVariant){case 0:t=`rgba(255, 255, 255, ${l})`,h=`rgba(255, 255, 255, ${l*.3})`;break;case 1:t=`rgba(200, 150, 255, ${l})`,h=`rgba(150, 100, 255, ${l*.3})`;break;case 2:t=`rgba(255, 180, 100, ${l})`,h=`rgba(255, 150, 50, ${l*.3})`;break}e.save(),e.translate(s,o),e.shadowColor=h,e.shadowBlur=a*4*l,e.fillStyle=t,e.beginPath();for(let r=0;r<4;r++){const M=r/4*Math.PI-Math.PI/2,d=Math.cos(M)*a,f=Math.sin(M)*a,g=M+Math.PI/4,m=Math.cos(g)*(a*.3),T=Math.sin(g)*(a*.3);r===0?e.moveTo(d,f):e.lineTo(d,f),e.lineTo(m,T)}e.closePath(),e.fill(),e.shadowBlur=a*2*l,e.beginPath(),e.arc(0,0,a*.3,0,Math.PI*2),e.fill(),e.restore()},drawGlobalEffects(e,n,i,s){if(this.lightningActive){e.save(),e.globalAlpha=.8+Math.sin(this.lightningTimer*.01)*.2,e.shadowColor=this.lightningColor,e.shadowBlur=20;const o=i*(.4+Math.random()*.2),a=0,l=i*Math.random(),t=s;this.drawLightning(e,o,a,l,t,5+Math.floor(Math.random()*3),50+Math.random()*50,.7,.3,3+Math.random()*2,this.lightningColor),e.restore()}}};
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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()}};
|