domma-cms 0.8.0 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "brand": {
3
- "text": "Domma CMS Base",
3
+ "text": "Domma CMS",
4
4
  "url": "/",
5
- "icon": "home"
5
+ "icon": "home",
6
+ "size": "lg"
6
7
  },
7
8
  "items": [
8
9
  {
@@ -76,9 +77,17 @@
76
77
  {
77
78
  "text": "Scratch",
78
79
  "url": "/scratch",
79
- "icon": "home"
80
+ "icon": "home",
81
+ "hidden": true
80
82
  }
81
83
  ],
82
- "variant": "dark",
83
- "position": "sticky"
84
+ "variant": "transparent",
85
+ "position": "sticky",
86
+ "style": {
87
+ "fontFamily": "Roboto",
88
+ "fontSize": "16px",
89
+ "fontWeight": "400",
90
+ "letterSpacing": "0em",
91
+ "iconSize": "16px"
92
+ }
84
93
  }
@@ -1,10 +1,6 @@
1
1
  {
2
2
  "theme-switcher": {
3
- "enabled": true,
4
- "settings": {
5
- "position": "top-right",
6
- "offsetX": 16,
7
- "offsetY": 8
8
- }
3
+ "enabled": false,
4
+ "settings": {}
9
5
  }
10
6
  }
package/config/site.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "tagline": "A nice little bloggy type thingy.",
4
4
  "fontFamily": "Roboto",
5
5
  "fontSize": 16,
6
- "theme": "charcoal-light",
6
+ "theme": "charcoal-dark",
7
7
  "autoTheme": {
8
8
  "enabled": false,
9
9
  "dayTheme": "charcoal-light",
@@ -11,7 +11,7 @@
11
11
  "dayStart": "07:00",
12
12
  "nightStart": "19:00"
13
13
  },
14
- "adminTheme": "silver-dark",
14
+ "adminTheme": "charcoal-dark",
15
15
  "layoutOptions": {
16
16
  "spacerSize": 40
17
17
  },
@@ -81,5 +81,8 @@
81
81
  "showAnalytics": true,
82
82
  "showMarketing": true,
83
83
  "consentVersion": "1.0"
84
+ },
85
+ "adminBrand": {
86
+ "title": "Domma Admin"
84
87
  }
85
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "0.8.0",
3
+ "version": "0.8.6",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -1 +1 @@
1
- body,button,input,select,textarea{font-family:Roboto,sans-serif}.navbar-actions{order:4;margin-left:auto;display:flex;align-items:center;gap:.5rem}.navbar-dark .navbar-actions{color:var(--dm-text-inverse, rgba(255, 255, 255, .85))}.navbar-dark .site-search-shortcut-hint{color:#fff9;border-color:#ffffff40}.navbar-light .navbar-actions{color:var(--dm-text, #111)}.site-main{min-height:calc(100vh - 60px);padding-top:2rem;padding-bottom:4rem}.site-main.with-sidebar{display:grid;grid-template-columns:260px 1fr;gap:0}.site-sidebar{min-height:100%;border-right:1px solid var(--border-color, rgba(255,255,255,.08))}.site-content{overflow:hidden}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}.container{max-width:860px;margin:0 auto;padding:0 1.5rem}.page-title{font-size:clamp(1.5rem,4vw,2rem);font-weight:700;margin-bottom:1.5rem;line-height:1.2}.page-body{line-height:1.7;font-size:1rem}.page-body h1,.page-body h2,.page-body h3,.page-body h4{margin-top:2rem;margin-bottom:.75rem;font-weight:600}.page-body h2{font-size:clamp(1.2rem,3vw,1.5rem)}.page-body h3{font-size:clamp(1.1rem,2.5vw,1.25rem)}.page-body p{margin-bottom:1rem}.page-body ul,.page-body ol{margin-bottom:1rem;padding-left:1.5rem}.page-body a{color:var(--primary, #5b8cff)}.page-body a:hover{text-decoration:underline}.page-body code{font-family:Fira Code,Courier New,monospace;font-size:.9em;background:#ffffff0f;padding:.15em .35em;border-radius:3px}.page-body pre{background:#0000004d;border:1px solid rgba(255,255,255,.08);border-radius:6px;padding:1rem;overflow-x:auto;margin-bottom:1rem}.page-body pre code{background:none;padding:0}.page-body img{max-width:100%;border-radius:6px}.page-body blockquote{border-left:3px solid var(--primary, #5b8cff);margin:1.5rem 0;padding:.75rem 1rem;background:#5b8cff0f;border-radius:0 6px 6px 0}h3.accordion-header{margin:0}.accordion-button{all:unset;display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer;font:inherit}.page-body .card-header h2{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.card[data-collapsible] .card-header{cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between}.card[data-collapsible] .card-header:after{content:"\25be";font-size:1.1em;line-height:1;display:inline-block;transition:transform .25s ease;flex-shrink:0}.card[data-collapsible].is-collapsed .card-header:after{transform:rotate(-90deg)}.card[data-collapsible] .card-body{overflow:hidden;max-height:4000px;opacity:1;transition:max-height .3s ease,opacity .25s ease}.card[data-collapsible].is-collapsed .card-body{max-height:0;opacity:0}.navbar-link span[data-icon],.navbar-link svg,.navbar-dropdown-toggle span[data-icon],.navbar-dropdown-toggle svg,.navbar-dropdown-item span[data-icon],.navbar-dropdown-item svg{width:13px!important;height:13px!important;margin-right:10px!important}.navbar-dropdown-toggle{font-size:var(--dm-font-size-base)}@media(min-width:993px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-sm)}}@media(min-width:1201px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-xs)}}.dm-reduced-motion *,.dm-reduced-motion *:before,.dm-reduced-motion *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.page-footer{border-top:1px solid var(--border-color, rgba(255,255,255,.08));padding:1.5rem 0}.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}.footer-inner p{margin:0;color:var(--text-muted, #888);font-size:.875rem}.footer-links{display:flex;gap:1.25rem}.footer-links a{color:var(--text-muted, #888);font-size:.875rem;text-decoration:none}.footer-links a:hover{color:var(--text, #eee)}.footer-social{display:flex;gap:.5rem;align-items:center}.footer-social-link{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;color:var(--text-muted, #888);transition:color .15s}.footer-social-link:hover{color:var(--text, #eee)}.footer-social-link svg{width:1rem;height:1rem}.footer-motion-switch{font-size:.8rem;color:var(--text-muted, #888);white-space:nowrap}.footer-motion-switch .form-switch-label{color:var(--text-muted, #888)}.footer-motion-switch .form-switch-input{width:2rem;height:1.125rem}.footer-motion-switch .form-switch-input:after{width:.875rem;height:.875rem}.footer-motion-switch .form-switch-input:checked:after{transform:translate(.875rem)}.dm-slideover-header{display:flex;align-items:center;justify-content:space-between;padding:.875rem 1.25rem;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08));flex-shrink:0}.dm-slideover-title{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.dm-slideover-body{padding:1.25rem;overflow-y:auto;flex:1}@media(max-width:768px){.site-main.with-sidebar{grid-template-columns:1fr}.site-sidebar{display:none}}.dm-spacer{display:block;width:100%}.hero-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.site-main:has(.page-body>.hero-breakout:first-child){padding-top:0}body[data-layout=landing]>.site-main{padding-top:0}body[data-layout=landing]>.site-main .container{max-width:none;padding:0}body[data-layout=landing] .page-body{padding-left:1.5rem;padding-right:1.5rem}body[data-layout=landing] .page-body>p,body[data-layout=landing] .page-body>h1,body[data-layout=landing] .page-body>h2,body[data-layout=landing] .page-body>h3,body[data-layout=landing] .page-body>ul,body[data-layout=landing] .page-body>ol,body[data-layout=landing] .page-body>blockquote{max-width:860px;margin-left:auto;margin-right:auto}body[data-layout=landing] .page-body .hero-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem}body[data-layout=landing] .page-body .grid-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem;padding-left:1.5rem;padding-right:1.5rem}.page-body .card{transition:transform .2s ease,box-shadow .2s ease}.page-body .card:hover{transform:translateY(-3px);box-shadow:0 8px 24px #00000059}.page-body .card-header-icon-inline{display:flex;align-items:center;gap:.6rem}.page-body .card-header-icon-inline [data-icon]{flex-shrink:0;line-height:0}.page-body .card-header-icon-inline [data-icon] svg,.page-body .card-header-icon-inline>svg{display:block;width:1.25rem;height:1.25rem}.page-body .card-header-icon-stacked{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.35rem;padding-top:.25rem}.page-body .card-header-icon-stacked [data-icon],.page-body .card-header-icon-stacked svg{width:2rem;height:2rem}.hero.hero-dark{background:linear-gradient(135deg,#1f2937,#111827);color:#e2e8f0}.hero .hero-content{position:relative;z-index:2}.hero.hero-left .hero-content{text-align:left;align-items:flex-start;max-width:62%}@media(max-width:768px){.hero.hero-left .hero-content{max-width:100%}}.hero .hero-cta{display:flex;gap:.85rem;flex-wrap:wrap;margin-top:1.75rem}.hero .hero-cta a{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem 1.35rem;border-radius:6px;font-size:.95rem;font-weight:500;text-decoration:none;transition:background .2s ease,border-color .2s ease,transform .15s ease,box-shadow .2s ease}.hero .hero-cta a:first-child{background:#ffffffeb;color:#111;border:1px solid transparent}.hero .hero-cta a:first-child:hover{background:#fff;box-shadow:0 4px 16px #00000040;transform:translateY(-2px)}.hero .hero-cta a:last-child{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4)}.hero .hero-cta a:last-child:hover{border-color:#ffffffbf;background:#ffffff14;transform:translateY(-2px)}.hero .hero-label{display:inline-block;margin-bottom:.9rem;padding:.2rem .8rem;border-radius:999px;font-size:.72rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:#ffffffb3;border:1px solid rgba(255,255,255,.22)}.grid-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.dm-breadcrumbs{position:fixed;z-index:200;display:inline-flex;align-items:center;gap:.2rem;padding:.3rem .8rem;border-radius:999px;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);background:#00000047;border:1px solid rgba(255,255,255,.11);box-shadow:0 2px 10px #00000038;font-size:.72rem;font-weight:500;letter-spacing:.01em;line-height:1.4;max-width:calc(100vw - 2rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dm-breadcrumbs .dm-breadcrumbs-item{color:#ffffffa6}.dm-breadcrumbs .dm-breadcrumbs-link{display:inline-flex;align-items:center;gap:.25rem;color:#ffffff8c;text-decoration:none;transition:color .15s}.dm-breadcrumbs .dm-breadcrumbs-home-icon{flex-shrink:0;vertical-align:middle}.dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#fffffff2}.dm-breadcrumbs .dm-breadcrumbs-current{color:#ffffffeb;font-weight:600}.dm-breadcrumbs .dm-breadcrumbs-separator{color:#ffffff47;font-size:.8em;line-height:1;margin:0 .05rem}[data-mode=light] .dm-breadcrumbs{background:#ffffff8c;border-color:#00000012;box-shadow:0 2px 10px #00000014}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-item,[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link{color:#0000008c}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#000000e6}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-current{color:#000000d9}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-separator{color:#00000040}.dm-collection-display{margin:1.5rem 0}.dm-collection-list{display:flex;flex-direction:column;gap:0}.dm-collection-list-item{padding:1rem 0;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08))}.dm-collection-list-item:last-child{border-bottom:none}.dm-collection-list-item strong{display:block;font-size:1rem;margin-bottom:.25rem}.dm-collection-list-item p{margin:0;color:var(--text-muted, #888);font-size:.9rem}.dm-collection-empty p{color:var(--text-muted, #888);font-style:italic}.hero-gradient-purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#1e1b4b}.hero-gradient-blue{background:linear-gradient(135deg,#dbeafe,#bfdbfe);color:#1e3a5f}.hero-gradient-green{background:linear-gradient(135deg,#d1fae5,#a7f3d0);color:#064e3b}.hero-gradient-sunset{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#78350f}.hero-gradient-ocean{background:linear-gradient(135deg,#e0f2fe,#bae6fd);color:#0c4a6e}.hero-gradient-rose{background:linear-gradient(135deg,#fce7f3,#fbcfe8);color:#831843}.hero-gradient-forest{background:linear-gradient(135deg,#dcfce7,#bbf7d0);color:#14532d}.hero-gradient-night{background:linear-gradient(135deg,#334155,#1e293b);color:#e2e8f0}.hero-gradient-ocean-light{background:linear-gradient(135deg,#e0f2fe,#caf0f8);color:#1e293b}.hero-gradient-ocean-dark{background:linear-gradient(135deg,#0c4a6e,#164e63);color:#e2e8f0}.hero-gradient-forest-light{background:linear-gradient(135deg,#d1fae5,#c6f6dc);color:#1e293b}.hero-gradient-forest-dark{background:linear-gradient(135deg,#1a4731,#166534);color:#e2e8f0}.hero-gradient-sunset-light{background:linear-gradient(135deg,#fde8d8,#fddcc9);color:#1e293b}.hero-gradient-sunset-dark{background:linear-gradient(135deg,#6b3727,#7c4036);color:#f5ede8}.hero-gradient-royal-light{background:linear-gradient(135deg,#e8f0fd,#dce8fc);color:#1e293b}.hero-gradient-royal-dark{background:linear-gradient(135deg,#1e3465,#263d7a);color:#e2e8f0}.hero-gradient-lemon-light{background:linear-gradient(135deg,#fefce8,#fef9c3);color:#1e293b}.hero-gradient-lemon-dark{background:linear-gradient(135deg,#5c4d1a,#6b5920);color:#fefce8}.hero-gradient-silver-light{background:linear-gradient(135deg,#f1f5f9,#e2e8f0);color:#1e293b}.hero-gradient-silver-dark{background:linear-gradient(135deg,#2d3748,#374151);color:#e2e8f0}.hero-gradient-charcoal-light{background:linear-gradient(135deg,#eceff1,#e1e7eb);color:#1e293b}.hero-gradient-charcoal-dark{background:linear-gradient(135deg,#2c3843,#374451);color:#e2e8f0}.hero-gradient-christmas-light{background:linear-gradient(135deg,#fde8ea,#fdd5d8);color:#1e293b}.hero-gradient-christmas-dark{background:linear-gradient(135deg,#5c0f1d,#7a1525);color:#fde8ea}.hero-gradient-unicorn-light{background:linear-gradient(135deg,#f5e8fd,#edd6fb);color:#1e293b}.hero-gradient-unicorn-dark{background:linear-gradient(135deg,#3d1a5a,#4a2068);color:#f5e8fd}.hero-gradient-dreamy-light{background:linear-gradient(135deg,#f5ede8,#eeddd4);color:#1e293b}.hero-gradient-dreamy-dark{background:linear-gradient(135deg,#3d2820,#503328);color:#f5ede8}.hero-gradient-grayve-light{background:linear-gradient(135deg,#e0f7f9,#cbf2f5);color:#1e293b}.hero-gradient-grayve-dark{background:linear-gradient(135deg,#00363d,#00444d);color:#e0f7f9}.hero-gradient-mint-light{background:linear-gradient(135deg,#d8f5ea,#c5efdd);color:#1e293b}.hero-gradient-mint-dark{background:linear-gradient(135deg,#134d33,#195f3f);color:#d8f5ea}.hero-gradient-wedding-light{background:linear-gradient(135deg,#faf3e0,#f5e9c7);color:#1e293b}.hero-gradient-wedding-dark{background:linear-gradient(135deg,#5c4418,#6f5320);color:#faf3e0}.tabs-centered{text-align:center}.tabs-centered .tab-list{display:inline-flex}.tabs-centered .tab-content{text-align:left}.site-main{overflow-x:hidden}@media(max-width:768px){.hero .hero-cta a,.dm-so-trigger,.dm-cta-trigger{min-height:44px;padding:.6rem 1.25rem}}
1
+ body,button,input,select,textarea{font-family:Roboto,sans-serif}#site-navbar.navbar-dark .navbar-brand,#site-navbar.navbar-dark .navbar-brand-text,#site-navbar.navbar-dark .navbar-brand-tagline{color:var(--dm-text-inverse, #fff)}#site-navbar.navbar-light .navbar-brand,#site-navbar.navbar-light .navbar-brand-text,#site-navbar.navbar-light .navbar-brand-tagline{color:var(--dm-text, #212529)}.navbar-brand-logo{height:32px;width:auto;display:inline-block;vertical-align:middle;margin-right:.4em}.navbar-brand-tagline{display:block;font-size:.65em;opacity:.75;line-height:1.2;letter-spacing:.02em}.navbar-brand-text.navbar-brand-sm{font-size:.85em}.navbar-brand-text.navbar-brand-lg{font-size:1.25em}.navbar-actions{order:4;margin-left:auto;display:flex;align-items:center;gap:.5rem}.navbar-dark .navbar-actions{color:var(--dm-text-inverse, rgba(255, 255, 255, .85))}.navbar-dark .site-search-shortcut-hint{color:#fff9;border-color:#ffffff40}.navbar-light .navbar-actions{color:var(--dm-text, #111)}.site-main{min-height:calc(100vh - 60px);padding-top:2rem;padding-bottom:4rem}.site-main.with-sidebar{display:grid;grid-template-columns:260px 1fr;gap:0}.site-sidebar{min-height:100%;border-right:1px solid var(--border-color, rgba(255,255,255,.08))}.site-content{overflow:hidden}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}.container{max-width:860px;margin:0 auto;padding:0 1.5rem}.page-title{font-size:clamp(1.5rem,4vw,2rem);font-weight:700;margin-bottom:1.5rem;line-height:1.2}.page-body{line-height:1.7;font-size:1rem}.page-body h1,.page-body h2,.page-body h3,.page-body h4{margin-top:2rem;margin-bottom:.75rem;font-weight:600}.page-body h2{font-size:clamp(1.2rem,3vw,1.5rem)}.page-body h3{font-size:clamp(1.1rem,2.5vw,1.25rem)}.page-body p{margin-bottom:1rem}.page-body ul,.page-body ol{margin-bottom:1rem;padding-left:1.5rem}.page-body a{color:var(--primary, #5b8cff)}.page-body a:hover{text-decoration:underline}.page-body code{font-family:Fira Code,Courier New,monospace;font-size:.9em;background:#ffffff0f;padding:.15em .35em;border-radius:3px}.page-body pre{background:#0000004d;border:1px solid rgba(255,255,255,.08);border-radius:6px;padding:1rem;overflow-x:auto;margin-bottom:1rem}.page-body pre code{background:none;padding:0}.page-body img{max-width:100%;border-radius:6px}.page-body blockquote{border-left:3px solid var(--primary, #5b8cff);margin:1.5rem 0;padding:.75rem 1rem;background:#5b8cff0f;border-radius:0 6px 6px 0}h3.accordion-header{margin:0}.accordion-button{all:unset;display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer;font:inherit}.page-body .card-header h2{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.card[data-collapsible] .card-header{cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between}.card[data-collapsible] .card-header:after{content:"\25be";font-size:1.1em;line-height:1;display:inline-block;transition:transform .25s ease;flex-shrink:0}.card[data-collapsible].is-collapsed .card-header:after{transform:rotate(-90deg)}.card[data-collapsible] .card-body{overflow:hidden;max-height:4000px;opacity:1;transition:max-height .3s ease,opacity .25s ease}.card[data-collapsible].is-collapsed .card-body{max-height:0;opacity:0}.navbar-link span[data-icon],.navbar-link svg,.navbar-dropdown-toggle span[data-icon],.navbar-dropdown-toggle svg,.navbar-dropdown-item span[data-icon],.navbar-dropdown-item svg{width:13px!important;height:13px!important;margin-right:10px!important}.navbar-dropdown-toggle{font-size:var(--dm-font-size-base)}@media(min-width:993px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-sm)}}@media(min-width:1201px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-xs)}}.dm-reduced-motion *,.dm-reduced-motion *:before,.dm-reduced-motion *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.page-footer{border-top:1px solid var(--border-color, rgba(255,255,255,.08));padding:1.5rem 0}.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}.footer-inner p{margin:0;color:var(--text-muted, #888);font-size:.875rem}.footer-links{display:flex;gap:1.25rem}.footer-links a{color:var(--text-muted, #888);font-size:.875rem;text-decoration:none}.footer-links a:hover{color:var(--text, #eee)}.footer-social{display:flex;gap:.5rem;align-items:center}.footer-social-link{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;color:var(--text-muted, #888);transition:color .15s}.footer-social-link:hover{color:var(--text, #eee)}.footer-social-link svg{width:1rem;height:1rem}.footer-motion-switch{font-size:.8rem;color:var(--text-muted, #888);white-space:nowrap}.footer-motion-switch .form-switch-label{color:var(--text-muted, #888)}.footer-motion-switch .form-switch-input{width:2rem;height:1.125rem}.footer-motion-switch .form-switch-input:after{width:.875rem;height:.875rem}.footer-motion-switch .form-switch-input:checked:after{transform:translate(.875rem)}.dm-slideover-header{display:flex;align-items:center;justify-content:space-between;padding:.875rem 1.25rem;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08));flex-shrink:0}.dm-slideover-title{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.dm-slideover-body{padding:1.25rem;overflow-y:auto;flex:1}@media(max-width:768px){.site-main.with-sidebar{grid-template-columns:1fr}.site-sidebar{display:none}}.dm-spacer{display:block;width:100%}.hero-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.site-main:has(.page-body>.hero-breakout:first-child){padding-top:0}body[data-layout=landing]>.site-main{padding-top:0}body[data-layout=landing]>.site-main .container{max-width:none;padding:0}body[data-layout=landing] .page-body{padding-left:1.5rem;padding-right:1.5rem}body[data-layout=landing] .page-body>p,body[data-layout=landing] .page-body>h1,body[data-layout=landing] .page-body>h2,body[data-layout=landing] .page-body>h3,body[data-layout=landing] .page-body>ul,body[data-layout=landing] .page-body>ol,body[data-layout=landing] .page-body>blockquote{max-width:860px;margin-left:auto;margin-right:auto}body[data-layout=landing] .page-body .hero-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem}body[data-layout=landing] .page-body .grid-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem;padding-left:1.5rem;padding-right:1.5rem}.page-body .card{transition:transform .2s ease,box-shadow .2s ease}.page-body .card:hover{transform:translateY(-3px);box-shadow:0 8px 24px #00000059}.page-body .card-header-icon-inline{display:flex;align-items:center;gap:.6rem}.page-body .card-header-icon-inline [data-icon]{flex-shrink:0;line-height:0}.page-body .card-header-icon-inline [data-icon] svg,.page-body .card-header-icon-inline>svg{display:block;width:1.25rem;height:1.25rem}.page-body .card-header-icon-stacked{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.35rem;padding-top:.25rem}.page-body .card-header-icon-stacked [data-icon],.page-body .card-header-icon-stacked svg{width:2rem;height:2rem}.hero.hero-dark{background:linear-gradient(135deg,#1f2937,#111827);color:#e2e8f0}.hero .hero-content{position:relative;z-index:2}.hero.hero-left .hero-content{text-align:left;align-items:flex-start;max-width:62%}@media(max-width:768px){.hero.hero-left .hero-content{max-width:100%}}.hero .hero-cta{display:flex;gap:.85rem;flex-wrap:wrap;margin-top:1.75rem}.hero .hero-cta a{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem 1.35rem;border-radius:6px;font-size:.95rem;font-weight:500;text-decoration:none;transition:background .2s ease,border-color .2s ease,transform .15s ease,box-shadow .2s ease}.hero .hero-cta a:first-child{background:#ffffffeb;color:#111;border:1px solid transparent}.hero .hero-cta a:first-child:hover{background:#fff;box-shadow:0 4px 16px #00000040;transform:translateY(-2px)}.hero .hero-cta a:last-child{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4)}.hero .hero-cta a:last-child:hover{border-color:#ffffffbf;background:#ffffff14;transform:translateY(-2px)}.hero .hero-label{display:inline-block;margin-bottom:.9rem;padding:.2rem .8rem;border-radius:999px;font-size:.72rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:#ffffffb3;border:1px solid rgba(255,255,255,.22)}.grid-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.dm-breadcrumbs{position:fixed;z-index:200;display:inline-flex;align-items:center;gap:.2rem;padding:.3rem .8rem;border-radius:999px;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);background:#00000047;border:1px solid rgba(255,255,255,.11);box-shadow:0 2px 10px #00000038;font-size:.72rem;font-weight:500;letter-spacing:.01em;line-height:1.4;max-width:calc(100vw - 2rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dm-breadcrumbs .dm-breadcrumbs-item{color:#ffffffa6}.dm-breadcrumbs .dm-breadcrumbs-link{display:inline-flex;align-items:center;gap:.25rem;color:#ffffff8c;text-decoration:none;transition:color .15s}.dm-breadcrumbs .dm-breadcrumbs-home-icon{flex-shrink:0;vertical-align:middle}.dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#fffffff2}.dm-breadcrumbs .dm-breadcrumbs-current{color:#ffffffeb;font-weight:600}.dm-breadcrumbs .dm-breadcrumbs-separator{color:#ffffff47;font-size:.8em;line-height:1;margin:0 .05rem}[data-mode=light] .dm-breadcrumbs{background:#ffffff8c;border-color:#00000012;box-shadow:0 2px 10px #00000014}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-item,[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link{color:#0000008c}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#000000e6}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-current{color:#000000d9}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-separator{color:#00000040}.dm-collection-display{margin:1.5rem 0}.dm-collection-list{display:flex;flex-direction:column;gap:0}.dm-collection-list-item{padding:1rem 0;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08))}.dm-collection-list-item:last-child{border-bottom:none}.dm-collection-list-item strong{display:block;font-size:1rem;margin-bottom:.25rem}.dm-collection-list-item p{margin:0;color:var(--text-muted, #888);font-size:.9rem}.dm-collection-empty p{color:var(--text-muted, #888);font-style:italic}.hero-gradient-purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#1e1b4b}.hero-gradient-blue{background:linear-gradient(135deg,#dbeafe,#bfdbfe);color:#1e3a5f}.hero-gradient-green{background:linear-gradient(135deg,#d1fae5,#a7f3d0);color:#064e3b}.hero-gradient-sunset{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#78350f}.hero-gradient-ocean{background:linear-gradient(135deg,#e0f2fe,#bae6fd);color:#0c4a6e}.hero-gradient-rose{background:linear-gradient(135deg,#fce7f3,#fbcfe8);color:#831843}.hero-gradient-forest{background:linear-gradient(135deg,#dcfce7,#bbf7d0);color:#14532d}.hero-gradient-night{background:linear-gradient(135deg,#334155,#1e293b);color:#e2e8f0}.hero-gradient-ocean-light{background:linear-gradient(135deg,#e0f2fe,#caf0f8);color:#1e293b}.hero-gradient-ocean-dark{background:linear-gradient(135deg,#0c4a6e,#164e63);color:#e2e8f0}.hero-gradient-forest-light{background:linear-gradient(135deg,#d1fae5,#c6f6dc);color:#1e293b}.hero-gradient-forest-dark{background:linear-gradient(135deg,#1a4731,#166534);color:#e2e8f0}.hero-gradient-sunset-light{background:linear-gradient(135deg,#fde8d8,#fddcc9);color:#1e293b}.hero-gradient-sunset-dark{background:linear-gradient(135deg,#6b3727,#7c4036);color:#f5ede8}.hero-gradient-royal-light{background:linear-gradient(135deg,#e8f0fd,#dce8fc);color:#1e293b}.hero-gradient-royal-dark{background:linear-gradient(135deg,#1e3465,#263d7a);color:#e2e8f0}.hero-gradient-lemon-light{background:linear-gradient(135deg,#fefce8,#fef9c3);color:#1e293b}.hero-gradient-lemon-dark{background:linear-gradient(135deg,#5c4d1a,#6b5920);color:#fefce8}.hero-gradient-silver-light{background:linear-gradient(135deg,#f1f5f9,#e2e8f0);color:#1e293b}.hero-gradient-silver-dark{background:linear-gradient(135deg,#2d3748,#374151);color:#e2e8f0}.hero-gradient-charcoal-light{background:linear-gradient(135deg,#eceff1,#e1e7eb);color:#1e293b}.hero-gradient-charcoal-dark{background:linear-gradient(135deg,#2c3843,#374451);color:#e2e8f0}.hero-gradient-christmas-light{background:linear-gradient(135deg,#fde8ea,#fdd5d8);color:#1e293b}.hero-gradient-christmas-dark{background:linear-gradient(135deg,#5c0f1d,#7a1525);color:#fde8ea}.hero-gradient-unicorn-light{background:linear-gradient(135deg,#f5e8fd,#edd6fb);color:#1e293b}.hero-gradient-unicorn-dark{background:linear-gradient(135deg,#3d1a5a,#4a2068);color:#f5e8fd}.hero-gradient-dreamy-light{background:linear-gradient(135deg,#f5ede8,#eeddd4);color:#1e293b}.hero-gradient-dreamy-dark{background:linear-gradient(135deg,#3d2820,#503328);color:#f5ede8}.hero-gradient-grayve-light{background:linear-gradient(135deg,#e0f7f9,#cbf2f5);color:#1e293b}.hero-gradient-grayve-dark{background:linear-gradient(135deg,#00363d,#00444d);color:#e0f7f9}.hero-gradient-mint-light{background:linear-gradient(135deg,#d8f5ea,#c5efdd);color:#1e293b}.hero-gradient-mint-dark{background:linear-gradient(135deg,#134d33,#195f3f);color:#d8f5ea}.hero-gradient-wedding-light{background:linear-gradient(135deg,#faf3e0,#f5e9c7);color:#1e293b}.hero-gradient-wedding-dark{background:linear-gradient(135deg,#5c4418,#6f5320);color:#faf3e0}.tabs-centered{text-align:center}.tabs-centered .tab-list{display:inline-flex}.tabs-centered .tab-content{text-align:left}.site-main{overflow-x:hidden}@media(max-width:768px){.hero .hero-cta a,.dm-so-trigger,.dm-cta-trigger{min-height:44px;padding:.6rem 1.25rem}}
@@ -1 +1 @@
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
+ var g=Object.defineProperty;var f=(h,e,a)=>e in h?g(h,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):h[e]=a;var d=(h,e,a)=>f(h,typeof e!="symbol"?e+"":e,a);import{CanvasManager as y}from"./core/canvas.js";import{PhysicsEngine as p,updateMovingParticle as v,updateParticlePhysics as w}from"./core/physics.js";import{createParticle as M}from"./core/particles.js";const l=class l{static isDateInRange(e,a,i,n){const o=new Date,s=o.getMonth()+1,r=o.getDate();return i<e?s===e&&r>=a||s>e||s<e&&s<=i||s===i&&r<=n:(s>e||s===e&&r>=a)&&(s<i||s===i&&r<=n)}static getCurrentTheme(){for(const[e,a]of Object.entries(l.themes)){const[[i,n],[o,s]]=a.dates;if(l.isDateInRange(i,n,o,s))return e}return null}static isCelebrationSeason(){return l.getCurrentTheme()!==null}static getThemes(){return l.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,overrides:e.overrides||{}},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=l.getCurrentTheme(),!e)){console.log("[Celebrations] No active celebration detected");return}if(!l.themes[e]){console.error(`[Celebrations] Unknown theme: ${e}`);return}this.currentTheme=e,console.log(`[Celebrations] Loading theme: ${e}`);try{const i=await import(l.themes[e].module);this.themeModule=i.default,console.log(`[Celebrations] Theme loaded: ${this.themeModule.displayName}`)}catch(a){console.error(`[Celebrations] Failed to load theme module: ${a.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=Object.assign({},this.themeModule.intensityConfig[this.options.intensity]);for(const[s,r]of Object.entries(this.options.overrides))r==="off"&&(e[s]=0);this.config=e;const a=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 s=0;s<o;s++){const r=this.themeModule.createFallingParticle(a,i,e);r.y=Math.random()*i,this.particles.push(r)}else for(let s=0;s<o;s++){const r=M(e,a,i);r.y=Math.random()*i,this.particles.push(r)}if(this.themeModule.createInitialDecorations){const s=this.themeModule.createInitialDecorations(a,i,e);this.specialParticles.push(...s),console.log(`[Celebrations] Created ${s.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 a=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(),a&&this.start()}animate(){if(!this.running)return;const e=performance.now(),a=e-this.lastTime;this.lastTime=e,this.canvasManager.clear();const i=this.canvasManager.ctx,n=this.canvasManager.canvas.width,o=this.canvasManager.canvas.height,s=this.config;this.physicsEngine.updateWind(e);const r=this.physicsEngine.getWindForce();if(this.particles.length<s.count&&Math.random()<.05&&this.themeModule.createFallingParticle){const t=this.themeModule.createFallingParticle(n,o,s);(t.y===void 0||t.y<0)&&(t.y=-20),this.particles.push(t)}if(this.particles.forEach((t,u)=>{if(w(t,a,r),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,a,n,o),this.specialParticles=this.specialParticles.filter(t=>{if(!t.active)return!1;if(!t.static){v(t,a,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,s);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 a=e.replace(/-([a-z])/g,(i,n)=>n.toUpperCase());return a.charAt(0).toUpperCase()+a.slice(1)}};d(l,"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=l;export default CelebrationsEffect;
@@ -1 +1 @@
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
+ 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!==0&&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,y={}){const n=Math.random();if(n<5e-4){if(y.sleigh===0||e.some(a=>a.type==="sleigh"))return null;const o=Math.random()<.5,h=o?-100:i+100,l=100+Math.random()*(s*.3);return{type:"sleigh",x:h,startX:h,y:l,baseY:l,targetX:o?i+100:-100,canvasWidth:i,vx:o?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(n<.0013&&y.elf!==0){const o=Math.random()<.5;return{type:"elf",x:o?-50:i+50,y:s-30,baseY:s-30,vx:o?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(n<.005&&y.train!==0){if(e.some(g=>g.type==="train"))return null;const o=Math.random()<.5,h=o?-500:i+500,l=21+Math.random()*9,a=l*.72,r=s-a-10;return{type:"train",x:h,y:r,baseY:r,vx:o?4+Math.random()*2:-(4+Math.random()*2),vy:0,size:l,opacity:1,time:0,smoke:[],active:!0,static:!1,carriages:2+Math.floor(Math.random()*2)}}else{if(n<.008&&y.firework!==0)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(n<.012&&y.robin!==0){if(e.some(t=>t.type==="robin"))return null;const o=Math.random()<.5,h=Math.random()*(s*.2),l=o?-50:i+50,a=10+Math.random()*5,r=Math.max(a*3,Math.min(s*.6-a*2,s*.2+Math.random()*(s*.4))),g=Math.random()*(i*.6)+i*.2;return{type:"robin",state:"flying_in",x:l,y:h,startX:l,startY:h,targetX:g,targetY:r,vx:o?.5+Math.random()*.5:-(.5+Math.random()*.5),vy:0,size:a,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 +1 @@
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
+ 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 +1 @@
1
- export default{name:"st-andrews",displayName:"St Andrew's Day",emoji:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",intensityConfig:{light:{count:50,speedRange:[.5,1.5],sizeRange:[2,4],thistles:4,bagpiperChance:2e-4,twinklingStars:12},medium:{count:100,speedRange:[.6,2],sizeRange:[2,5],thistles:6,bagpiperChance:4e-4,twinklingStars:20},heavy:{count:200,speedRange:[.8,2.5],sizeRange:[3,6],thistles:8,bagpiperChance:6e-4,twinklingStars:30}},particles:["heather-petal","heather","saltire-sparkle"],decorations:["thistle-plant","bagpiper","saltire-flag","tartan-pattern","highland-scene","twinkling-star"],colors:{primary:"#0065BD",secondary:"#FFFFFF",accent:"#8B008B",tartan:["#0065BD","#006400","#8B0000","#FFDD00"]},createHeatherPetal(e,n,l){const s=["#9370DB","#BA55D3","#DA70D6","#DDA0DD","#8B008B"];return{type:"heather-petal",x:-30,y:Math.random()*n,vx:l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0]),size:(l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0]))*1.5,speed:(Math.random()-.5)*.2,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:s[Math.floor(Math.random()*s.length)],flutter:Math.random()*Math.PI*2,flutterSpeed:.02+Math.random()*.02,active:!0}},createThistle(e,n,l){const s=Math.random()<.5,a=s?"#FFFFFF":"#0065BD",o=s?["#FFFFFF","#f0f0f0","#e0e0e0"]:["#0065BD","#1a7dd4","#3399ee"];return{type:"thistle",x:-30,y:Math.random()*n,vx:l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0])*.7,size:l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.7+Math.random()*.3,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.02,flowerColor:a,petalColors:o,active:!0}},createHeather(e,n,l){const s=Math.random();let a;return s<.5?a="#9370DB":s<.8?a="#BA55D3":a="#DA70D6",{type:"heather",x:-30,y:Math.random()*n,vx:(l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0]))*.6,size:l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0]),speed:(Math.random()-.5)*.15,opacity:.75+Math.random()*.25,windOffset:Math.random()*Math.PI*2,windSpeed:.02+Math.random()*.02,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.03,color:a,sway:Math.random()*Math.PI*2,swaySpeed:.02+Math.random()*.02,bellCount:3+Math.floor(Math.random()*3),active:!0}},createSaltireSparkle(e,n,l){const s=["#0065BD","#FFFFFF"];return{type:"saltire-sparkle",x:-20,y:Math.random()*n,vx:(l.speedRange[0]+Math.random()*(l.speedRange[1]-l.speedRange[0]))*.8,size:l.sizeRange[0]+Math.random()*(l.sizeRange[1]-l.sizeRange[0])*.6,vy:(Math.random()-.5)*.2,opacity:.6+Math.random()*.4,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.04,color:s[Math.floor(Math.random()*s.length)],twinklePhase:Math.random()*Math.PI*2,windOffset:Math.random()*Math.PI*2,windSpeed:.015+Math.random()*.02,active:!0,static:!1}},createFallingParticle(e,n,l){const s=Math.random();return s<.6?this.createHeatherPetal(e,n,l):s<.8?this.createHeather(e,n,l):s<.95?this.createSaltireSparkle(e,n,l):this.createThistle(e,n,l)},createThistlePlant(e,n,l={}){return{type:"thistle-plant",x:l.x!==void 0?l.x:Math.random()*e,y:l.y!==void 0?l.y:n-40,size:15+Math.random()*10,opacity:.8+Math.random()*.2,swayPhase:Math.random()*Math.PI*2,active:!0,static:!0}},createInitialDecorations(e,n,l){const s=[],a=l.thistles||5;for(let r=0;r<a;r++)s.push(this.createThistlePlant(e,n,{x:80+r/(a-1)*(e-160),y:n-60-Math.random()*30}));s.push({type:"bagpiper",x:150,y:n-60,baseY:n-60,vx:0,size:30+Math.random()*8,opacity:1,time:0,legPhase:0,bagInflate:.5,active:!0,static:!0}),s.push({type:"saltire-flag",x:e-100,y:80,size:60,opacity:1,wavePhase:Math.random()*Math.PI*2,active:!0,static:!0}),s.push({type:"tartan-pattern",x:e*.5,y:n-80,size:80+Math.random()*20,opacity:.9,active:!0,static:!0}),s.push({type:"highland-scene",x:e-200,y:n-150,size:100,opacity:.7,active:!0,static:!0});const o=l.twinklingStars||20;for(let r=0;r<o;r++)s.push(this.createTwinklingStar(e,n));return s},createTwinklingStar(e,n){return{type:"twinkling-star",x:Math.random()*e,y:Math.random()*(n*.6),size:1+Math.random()*2,opacity:.6+Math.random()*.3,twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:.003+Math.random()*.003,active:!0,static:!0}},spawnSpecialParticle(e,n,l,s){const a=Math.random();if(a<s.bagpiperChance){if(e.some(r=>r.type==="bagpiper"))return null;const o=Math.random()<.5;return{type:"bagpiper",x:o?-60:n+60,y:l-50,vx:o?.8+Math.random()*.5:-(.8+Math.random()*.5),size:18+Math.random()*8,opacity:.9,time:0,marchPhase:Math.random()*Math.PI*2,active:!0,static:!1}}return a<4e-4&&e.filter(r=>r.type==="saltire-flag").length<2?{type:"saltire-flag",x:Math.random()*n*.6+n*.2,y:50+Math.random()*100,size:40+Math.random()*20,opacity:.8,waveOffset:Math.random()*Math.PI*2,time:0,active:!0,static:!1}:a<.01?this.createSaltireSparkle(n,l,s):null},drawHeatherPetal(e,n,l){const s=n.x,a=n.y,o=n.size,r=Math.sin(l*n.flutterSpeed+n.flutter)*.3;e.save(),e.globalAlpha=n.opacity,e.translate(s,a),e.rotate(n.rotation+r),e.fillStyle=n.color,e.strokeStyle="#6A0DAD",e.lineWidth=o*.08,e.beginPath(),e.moveTo(0,-o*.6),e.bezierCurveTo(o*.4,-o*.5,o*.5,o*.2,o*.3,o*.8),e.lineTo(-o*.3,o*.8),e.bezierCurveTo(-o*.5,o*.2,-o*.4,-o*.5,0,-o*.6),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="rgba(106, 13, 173, 0.3)",e.lineWidth=o*.04;for(let t=0;t<4;t++){const i=-o*.5+t*o*.35;e.beginPath(),e.moveTo(-o*.25,i),e.lineTo(o*.25,i),e.stroke()}e.restore()},drawHeather(e,n){const l=n.x,s=n.y,a=n.size,o=Math.sin(n.sway)*a*.4;e.save(),e.globalAlpha=n.opacity,e.translate(l+o,s),e.rotate(n.rotation),e.strokeStyle="#6b5c4d",e.lineWidth=a*.12,e.lineCap="round",e.beginPath(),e.moveTo(0,a*.6),e.lineTo(0,-a*.8),e.stroke();const r=n.bellCount||4;for(let t=0;t<r;t++){const i=-a*.7+t/r*a*1.2,h=a*(.18+Math.random()*.08),d=t%2===0?1:-1;e.save(),e.translate(d*a*.15,i),e.rotate(d*.3);const y=e.createLinearGradient(0,-h,0,h*.3);y.addColorStop(0,n.color),y.addColorStop(.6,n.color),y.addColorStop(1,`${n.color}CC`),e.fillStyle=y,e.beginPath(),e.ellipse(0,0,h*.4,h,0,0,Math.PI*2),e.fill(),e.strokeStyle=`${n.color}AA`,e.lineWidth=h*.1,e.beginPath(),e.ellipse(0,h*.7,h*.35,h*.15,0,0,Math.PI*2),e.stroke(),e.strokeStyle="#8B7355",e.lineWidth=h*.08,e.beginPath(),e.moveTo(0,h*.8),e.lineTo(0,h*1.1),e.stroke(),e.restore()}e.fillStyle="#6b8b6b";for(let t=0;t<3;t++){const i=t/3*Math.PI*2-Math.PI/2;e.save(),e.rotate(i),e.beginPath(),e.ellipse(0,a*.5,a*.1,a*.25,0,0,Math.PI*2),e.fill(),e.restore()}e.restore()},drawThistle(e,n){const l=n.x,s=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(l,s),e.rotate(n.rotation),e.strokeStyle="#5a704a",e.lineWidth=a*.1,e.lineCap="round",e.beginPath(),e.moveTo(0,a*2),e.quadraticCurveTo(a*.1,a*1.2,0,a*.5),e.stroke();const o=16;e.strokeStyle="#4a7a3a",e.fillStyle="#5a8a4a",e.lineWidth=a*.06,e.lineCap="round";for(let i=0;i<o;i++){const h=i/o*Math.PI*2,d=a*(.35+Math.random()*.15),y=h+(Math.random()-.5)*.3;e.save(),e.rotate(h),e.beginPath(),e.moveTo(0,-a*.2);const M=a*.15,f=-a*.3,m=Math.sin(.4)*d,p=-Math.cos(.4)*d-a*.2;e.quadraticCurveTo(M,f,m,p),e.stroke();for(let S=0;S<3;S++){const b=(S+1)/4,g=b*m,P=-a*.2+b*(p+a*.2);e.beginPath(),e.moveTo(g,P),e.lineTo(g+a*.08,P-a*.06),e.stroke()}e.restore()}e.fillStyle="#6a8a5a",e.beginPath(),e.ellipse(0,-a*.15,a*.28,a*.35,0,0,Math.PI*2),e.fill();const r=3,t=n.petalColors||["#9b59b6","#b980d1","#d4a5e3"];for(let i=0;i<r;i++){const h=a*(.25+i*.08),d=8+i*4,y=t[i];e.fillStyle=y;for(let M=0;M<d;M++){const f=M/d*Math.PI*2+i*.15,m=Math.cos(f)*h,p=Math.sin(f)*h-a*.15;e.save(),e.translate(m,p),e.rotate(f),e.beginPath(),e.moveTo(0,0),e.lineTo(0,-a*(.2+i*.05)),e.lineWidth=a*.02,e.strokeStyle=y,e.stroke(),e.restore()}}e.fillStyle="#4a6a3a",e.strokeStyle="#3a5a2a",e.lineWidth=1;for(let i=0;i<2;i++){const h=a*(.8+i*.6),d=i%2===0?1:-1;e.save(),e.translate(0,h),e.beginPath(),e.moveTo(0,0);const y=5,M=a*.15;for(let f=0;f<=y;f++){const m=f/y,p=a*.25*Math.sin(m*Math.PI);f<y?(e.lineTo(d*p*.3,-M*m),e.lineTo(d*(p+a*.08),-M*(m+.05)),e.lineTo(d*p*.7,-M*(m+.1))):e.lineTo(0,-M)}e.quadraticCurveTo(d*a*.05,-M*.5,0,0),e.closePath(),e.fill(),e.stroke(),e.strokeStyle="#2a4a1a",e.lineWidth=.5,e.beginPath(),e.moveTo(0,0),e.lineTo(0,-M),e.stroke(),e.restore()}e.restore()},drawThistlePlant(e,n,l){const s=n.x,a=n.y,o=n.size,r=Math.sin(l*.001+n.swayPhase)*.1;e.save(),e.globalAlpha=n.opacity,e.translate(s,a),e.rotate(r);for(let t=0;t<3;t++){const i=(t-1)*o*.4,h=o*(1.5+t*.3);e.strokeStyle="#8B4513",e.lineWidth=o*.1,e.beginPath(),e.moveTo(i,0),e.quadraticCurveTo(i+r*o,-h*.5,i,-h),e.stroke(),e.fillStyle="#8B008B",e.beginPath(),e.arc(i,-h,o*.4,0,Math.PI*2),e.fill();const d=8;e.strokeStyle="#8B008B",e.lineWidth=o*.05;for(let y=0;y<d;y++){const M=y/d*Math.PI*2;e.beginPath(),e.moveTo(i,-h),e.lineTo(i+Math.cos(M)*o*.6,-h+Math.sin(M)*o*.6),e.stroke()}}e.restore()},drawBagpiper(e,n,l){const s=n.x,a=n.y,o=n.size,r=n.vx>0?1:-1;e.save(),e.translate(s,a),r===-1&&e.scale(-1,1);const t=Math.sin(l*.015+n.marchPhase)*(Math.PI/6);e.strokeStyle="#000080",e.lineWidth=o*.15,e.beginPath(),e.moveTo(-o*.2,o*.6),e.lineTo(-o*.3,o*1.4+Math.sin(t)*o*.15),e.stroke(),e.beginPath(),e.moveTo(o*.2,o*.6),e.lineTo(o*.3,o*1.4+Math.sin(t+Math.PI)*o*.15),e.stroke(),e.fillStyle="#000080",e.fillRect(-o*.45,o*.2,o*.9,o*.5),e.fillStyle="#8B4513",e.fillRect(-o*.25,o*.5,o*.5,o*.25),e.fillStyle="#8B0000",e.fillRect(-o*.4,-o*.2,o*.8,o*.5),e.strokeStyle="#FFD7BA",e.lineWidth=o*.12,e.beginPath(),e.moveTo(-o*.3,0),e.lineTo(-o*.6,o*.3),e.stroke(),e.beginPath(),e.moveTo(o*.3,0),e.lineTo(o*.7,o*.2),e.stroke(),e.fillStyle="#654321",e.beginPath(),e.ellipse(o*.1,o*.25,o*.35,o*.25,0,0,Math.PI*2),e.fill(),e.strokeStyle="#654321",e.lineWidth=o*.08,e.beginPath(),e.moveTo(o*.15,o*.05),e.lineTo(o*.15,-o*.7),e.stroke(),e.beginPath(),e.moveTo(o*.3,o*.1),e.lineTo(o*.3,-o*.6),e.stroke(),e.beginPath(),e.moveTo(o*.55,o*.2),e.lineTo(o*.65,o*.7),e.stroke(),e.fillStyle="#FFD7BA",e.beginPath(),e.arc(0,-o*.45,o*.35,0,Math.PI*2),e.fill(),e.fillStyle="#000080",e.fillRect(-o*.4,-o*.8,o*.8,o*.15),e.beginPath(),e.moveTo(-o*.35,-o*.8),e.lineTo(0,-o*1.1),e.lineTo(o*.35,-o*.8),e.closePath(),e.fill(),e.strokeStyle="#ff0000",e.lineWidth=2,e.beginPath(),e.moveTo(0,-o*1.1),e.quadraticCurveTo(o*.2,-o*1.3,o*.3,-o*1.4),e.stroke(),e.restore()},drawSaltireFlag(e,n,l){const s=n.x,a=n.y,o=n.size,r=l*.002+n.waveOffset;e.save(),e.globalAlpha=n.opacity,e.translate(s,a),e.fillStyle="#654321",e.fillRect(-o*.05,0,o*.1,o*1.5);const t=10,i=o*1.2,h=o*.8;e.fillStyle="#0065BD";for(let d=0;d<t;d++){const y=i/t,M=d*y,f=(d+1)*y,m=Math.sin(r+d*.3)*o*.1,p=Math.sin(r+(d+1)*.3)*o*.1;e.beginPath(),e.moveTo(M,m),e.lineTo(f,p),e.lineTo(f,h+p),e.lineTo(M,h+m),e.closePath(),e.fill()}e.strokeStyle="#FFFFFF",e.lineWidth=o*.12,e.shadowColor="rgba(255, 255, 255, 0.5)",e.shadowBlur=5;for(let d=0;d<t;d++){const y=i/t,M=d*y,f=(d+1)*y,m=Math.sin(r+d*.3)*o*.1,p=Math.sin(r+(d+1)*.3)*o*.1;e.beginPath(),e.moveTo(M,m),e.lineTo(f,h+p),e.stroke(),e.beginPath(),e.moveTo(M,h+m),e.lineTo(f,p),e.stroke()}e.shadowBlur=0,e.restore()},drawSaltireSparkle(e,n,l){const s=n.x,a=n.y,o=n.size,r=.6+Math.sin(l*.004+n.twinklePhase)*.4;e.save(),e.globalAlpha=n.opacity*r,e.translate(s,a),e.rotate(n.rotation),e.fillStyle=n.color,e.shadowColor=n.color,e.shadowBlur=o*2,e.beginPath(),e.moveTo(0,-o),e.lineTo(o*.3,-o*.3),e.lineTo(o,0),e.lineTo(o*.3,o*.3),e.lineTo(0,o),e.lineTo(-o*.3,o*.3),e.lineTo(-o,0),e.lineTo(-o*.3,-o*.3),e.closePath(),e.fill(),e.restore()},drawTartanPattern(e,n){const l=n.x,s=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(l,s);const o=120,r=document.createElement("canvas");r.width=o,r.height=o;const t=r.getContext("2d"),i="#1a237e",h="#c62828",d="#1b5e20",y="#f9a825",M="#ffffff",f="#000000",m=[[4,h],[2,f],[2,h],[2,f],[4,h],[8,i],[2,f],[2,i],[2,f],[8,i],[2,d],[2,y],[2,d],[8,i],[2,f],[2,i],[2,f],[8,i],[4,h],[2,f],[2,h],[2,f],[4,h]];let p=0;for(let g=0;g<2;g++)for(const[P,T]of m)t.fillStyle=T,t.fillRect(0,p,o,P),p+=P;t.globalCompositeOperation="multiply",t.globalAlpha=.8;let S=0;for(let g=0;g<2;g++)for(const[P,T]of m)t.fillStyle=T,t.fillRect(S,0,P,o),S+=P;t.globalCompositeOperation="lighten",t.globalAlpha=.15,S=0;for(let g=0;g<2;g++)for(const[P,T]of m)(T===y||T===M)&&(t.fillStyle=M,t.fillRect(S,0,P,o)),S+=P;t.globalCompositeOperation="source-over",t.globalAlpha=1;const b=e.createPattern(r,"repeat");e.fillStyle=b,e.fillRect(-a/2,-a/2,a,a),e.strokeStyle="#2a2a2a",e.lineWidth=a*.03,e.strokeRect(-a/2,-a/2,a,a),e.strokeStyle="#e0e0e0",e.lineWidth=a*.015,e.strokeRect(-a/2+a*.04,-a/2+a*.04,a-a*.08,a-a*.08),e.strokeStyle="rgba(255, 255, 255, 0.1)",e.lineWidth=.5;for(let g=-a;g<a;g+=4)e.beginPath(),e.moveTo(-a/2+g,-a/2),e.lineTo(-a/2+g+a,a/2),e.stroke();e.save(),e.translate(-a*.35,-a*.35),e.fillStyle="#c0c0c0",e.strokeStyle="#808080",e.lineWidth=2,e.beginPath(),e.arc(0,0,a*.08,0,Math.PI*2),e.fill(),e.stroke(),e.scale(.06,.06),e.fillStyle="#8B008B",e.strokeStyle="#6A006A",e.lineWidth=2;for(let g=0;g<6;g++){const P=g/6*Math.PI*2;e.beginPath(),e.moveTo(0,0),e.lineTo(Math.cos(P)*a*.4,Math.sin(P)*a*.4),e.stroke()}e.beginPath(),e.arc(0,0,a*.15,0,Math.PI*2),e.fill(),e.restore(),e.restore()},drawHighlandScene(e,n){const l=n.x,s=n.y,a=n.size;e.save(),e.globalAlpha=n.opacity,e.translate(l,s);const o=e.createLinearGradient(0,-a,0,a*.5);o.addColorStop(0,"#4a7ba7"),o.addColorStop(1,"#b0c4de"),e.fillStyle=o,e.fillRect(-a,-a,a*2,a*1.5),e.fillStyle="rgba(80, 100, 130, 0.6)",e.beginPath(),e.moveTo(-a,a*.3),e.lineTo(-a*.6,-a*.3),e.lineTo(-a*.2,a*.1),e.lineTo(a*.2,-a*.5),e.lineTo(a*.6,a*.2),e.lineTo(a,a*.3),e.closePath(),e.fill(),e.fillStyle="rgba(60, 80, 100, 0.8)",e.beginPath(),e.moveTo(-a,a*.4),e.lineTo(-a*.7,a*.1),e.lineTo(-a*.3,-a*.1),e.lineTo(a*.1,-a*.2),e.lineTo(a*.5,a*.15),e.lineTo(a,a*.4),e.closePath(),e.fill(),e.fillStyle="#2a3a4a",e.fillRect(-a*.15,a*.25,a*.3,a*.2),e.fillRect(-a*.2,a*.15,a*.1,a*.15),e.fillRect(a*.1,a*.15,a*.1,a*.15),e.fillRect(-a*.06,a*.05,a*.12,a*.25);for(let t=0;t<5;t++)t%2===0&&e.fillRect(-a*.06+t*a*.06,a*.02,a*.03,a*.03);const r=e.createLinearGradient(0,a*.45,0,a*.6);r.addColorStop(0,"#1e3a5f"),r.addColorStop(1,"#0a1f3d"),e.fillStyle=r,e.fillRect(-a,a*.45,a*2,a*.15),e.globalAlpha=n.opacity*.3,e.fillStyle="#4a6a8a",e.fillRect(-a*.15,a*.48,a*.3,a*.08),e.globalAlpha=n.opacity*.2,e.fillStyle="#d0e0f0",e.fillRect(-a,a*.5,a*2,a*.05),e.restore()},drawTwinklingStar(e,n,l){const s=n.x,a=n.y,o=n.size,r=.5+Math.sin(l*n.twinkleSpeed+n.twinklePhase)*.5,t=`rgba(200, 220, 255, ${r})`,i=`rgba(150, 180, 255, ${r*.4})`;e.save(),e.translate(s,a),e.shadowColor=i,e.shadowBlur=o*3*r,e.fillStyle=t,e.beginPath();for(let h=0;h<4;h++){const d=h*Math.PI/2,y=Math.cos(d)*o,M=Math.sin(d)*o,f=d+Math.PI/4,m=Math.cos(f)*(o*.3),p=Math.sin(f)*(o*.3);h===0?e.moveTo(y,M):e.lineTo(y,M),e.lineTo(m,p)}e.closePath(),e.fill(),e.shadowBlur=o*2*r,e.beginPath(),e.arc(0,0,o*.25,0,Math.PI*2),e.fill(),e.restore()}};
1
+ 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()}};