@sarthak03dot/romantic-animations
Version:
Romantic & celebratory canvas animations — hearts, sparkles, fireworks, confetti, star fields and more. Zero dependencies.
11 lines (10 loc) • 36.1 kB
JavaScript
(function(u,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(u=typeof globalThis<"u"?globalThis:u||self,A(u.RomanticAnimations={}))})(this,(function(u){"use strict";const A={zIndex:0};function et(o,a={}){const n=Object.assign({},A,a),t=typeof o=="string"?document.getElementById(o):o;if(!t)throw new Error(`[romantic-animations] Container "${o}" not found in the DOM.`);const r=t.querySelector("canvas[data-ra]");r&&r.remove();const h=document.createElement("canvas");h.setAttribute("data-ra","1"),h.style.cssText=`
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: ${n.zIndex};
`;const f=()=>{h.width=window.innerWidth,h.height=window.innerHeight};f(),t.style.position=t.style.position||"relative",t.appendChild(h);const c=new ResizeObserver(f);c.observe(t);const l=h.getContext("2d");function i(){c.disconnect(),h.remove()}return{canvas:h,ctx:l,options:n,destroy:i}}function p(o,a={}){return Object.assign({},o,a)}const ot={count:.12,minSize:14,maxSize:32,minSpeed:.8,maxSpeed:2.4,colors:["#ff6b8a","#ff4d6d","#ff85a1","#ffc2d1","#ff0a54","#ff477e"],wobble:!0,glow:!0};function it(o,a,n,t,r,h=1,f=!1){o.save(),o.globalAlpha=h,f&&(o.shadowColor=r,o.shadowBlur=t*1.2),o.fillStyle=r,o.beginPath(),o.moveTo(a,n+t*.3),o.bezierCurveTo(a-t*1.1,n-t*.5,a-t*1.6,n+t*.5,a,n+t*1.4),o.bezierCurveTo(a+t*1.6,n+t*.5,a+t*1.1,n-t*.5,a,n+t*.3),o.fill(),o.restore()}function nt(o,a={}){const n=p(ot,a),t=o.getContext("2d"),r=[];let h=!0;function f(){const l=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*o.width,y:o.height+l*2,size:l,speed:n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed),color:n.colors[Math.floor(Math.random()*n.colors.length)],alpha:.7+Math.random()*.3,wobbleOffset:Math.random()*Math.PI*2,wobbleSpeed:.02+Math.random()*.03,wobbleAmount:.5+Math.random()*1.5}}function c(){if(h){t.clearRect(0,0,o.width,o.height),Math.random()<n.count&&r.push(f());for(let l=r.length-1;l>=0;l--){const i=r[l];i.y-=i.speed,i.wobbleOffset+=i.wobbleSpeed;const e=n.wobble?Math.sin(i.wobbleOffset)*i.wobbleAmount*i.size*.5:0,s=Math.min(i.alpha,i.y/(o.height*.2));if(s<=0||i.y<-i.size*3){r.splice(l,1);continue}it(t,i.x+e,i.y,i.size,i.color,Math.max(0,s),n.glow)}requestAnimationFrame(c)}}return c(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const rt={minSize:6,maxSize:16,decay:.025,colors:["#ff6b8a","#ff4d6d","#ff85a1","#ffc2d1","#c9184a"],glow:!0};function at(o,a,n,t,r,h,f){o.save(),o.globalAlpha=Math.max(0,h),f&&(o.shadowColor=r,o.shadowBlur=t*2),o.fillStyle=r,o.beginPath(),o.moveTo(a,n+t*.3),o.bezierCurveTo(a-t*1.1,n-t*.5,a-t*1.6,n+t*.5,a,n+t*1.4),o.bezierCurveTo(a+t*1.6,n+t*.5,a+t*1.1,n-t*.5,a,n+t*.3),o.fill(),o.restore()}function lt(o,a={}){const n=p(rt,a),t=o.getContext("2d"),r=[];let h=!0;function f(e,s){r.push({x:e,y:s,size:n.minSize+Math.random()*(n.maxSize-n.minSize),alpha:.9+Math.random()*.1,decay:n.decay*(.8+Math.random()*.4),color:n.colors[Math.floor(Math.random()*n.colors.length)],vy:-(.3+Math.random()*.6)})}const c=e=>{const s=o.getBoundingClientRect();f(e.clientX-s.left,e.clientY-s.top)},l=e=>{const s=o.getBoundingClientRect();Array.from(e.touches).forEach(d=>{f(d.clientX-s.left,d.clientY-s.top)})};window.addEventListener("mousemove",c),window.addEventListener("touchmove",l,{passive:!0});function i(){if(h){t.clearRect(0,0,o.width,o.height);for(let e=r.length-1;e>=0;e--){const s=r[e];s.y+=s.vy,at(t,s.x,s.y,s.size,s.color,s.alpha,n.glow),s.alpha-=s.decay,s.alpha<=0&&r.splice(e,1)}requestAnimationFrame(i)}}return i(),function(){h=!1,window.removeEventListener("mousemove",c),window.removeEventListener("touchmove",l),t.clearRect(0,0,o.width,o.height)}}const st={count:20,minSize:8,maxSize:20,minSpeed:2,maxSpeed:7,gravity:.08,decay:.018,colors:["#ff0a54","#ff477e","#ff7096","#ff85a1","#fbb1bd","#ff4d6d"],glow:!0,symbols:["heart"]};function ht(o,a,n,t,r,h,f,c){if(o.save(),o.globalAlpha=Math.max(0,f),c&&(o.shadowColor=h,o.shadowBlur=r*2),o.fillStyle=h,a==="star"){o.beginPath();for(let l=0;l<5;l++){const i=Math.PI/2+l*2*Math.PI/5,e=i+Math.PI/5;l===0?o.moveTo(n+r*Math.cos(i),t-r*Math.sin(i)):o.lineTo(n+r*Math.cos(i),t-r*Math.sin(i)),o.lineTo(n+r*.4*Math.cos(e),t-r*.4*Math.sin(e))}o.closePath(),o.fill()}else if(a==="sparkle")for(let l=0;l<4;l++){const i=l*Math.PI/2;o.beginPath(),o.ellipse(n+Math.cos(i)*r*.5,t+Math.sin(i)*r*.5,r*.18,r*.7,i,0,Math.PI*2),o.fill()}else o.beginPath(),o.moveTo(n,t+r*.3),o.bezierCurveTo(n-r*1.1,t-r*.5,n-r*1.6,t+r*.5,n,t+r*1.4),o.bezierCurveTo(n+r*1.6,t+r*.5,n+r*1.1,t-r*.5,n,t+r*.3),o.fill();o.restore()}function ft(o,a={}){const n=p(st,a),t=o.getContext("2d"),r=[];let h=!0;function f(e,s){for(let d=0;d<n.count;d++){const m=Math.random()*Math.PI*2,g=n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed);r.push({x:e,y:s,size:n.minSize+Math.random()*(n.maxSize-n.minSize),vx:Math.cos(m)*g,vy:Math.sin(m)*g,alpha:1,decay:n.decay*(.8+Math.random()*.4),color:n.colors[Math.floor(Math.random()*n.colors.length)],symbol:n.symbols[Math.floor(Math.random()*n.symbols.length)]})}}const c=e=>{const s=o.getBoundingClientRect();f(e.clientX-s.left,e.clientY-s.top)},l=e=>{const s=o.getBoundingClientRect();Array.from(e.changedTouches).forEach(d=>f(d.clientX-s.left,d.clientY-s.top))};window.addEventListener("click",c),window.addEventListener("touchend",l,{passive:!0});function i(){if(h){t.clearRect(0,0,o.width,o.height);for(let e=r.length-1;e>=0;e--){const s=r[e];s.x+=s.vx,s.y+=s.vy,s.vy+=n.gravity,s.alpha-=s.decay,ht(t,s.symbol,s.x,s.y,s.size,s.color,s.alpha,n.glow),s.alpha<=0&&r.splice(e,1)}requestAnimationFrame(i)}}return i(),function(){h=!1,window.removeEventListener("click",c),window.removeEventListener("touchend",l),t.clearRect(0,0,o.width,o.height)}}const dt={count:80,minSize:2,maxSize:6,speed:.5,twinkleSpeed:.04,colors:["#fff","#ffe4e8","#ffb3c1","#ff85a1","#ffd6ff","#e7c6ff"],glow:!0};function ct(o,a={}){const n=p(dt,a),t=o.getContext("2d"),r=[];let h=!0;function f(){return{x:Math.random()*o.width,y:Math.random()*o.height,size:n.minSize+Math.random()*(n.maxSize-n.minSize),alpha:Math.random(),alphaDir:Math.random()>.5?1:-1,twinkleSpeed:n.twinkleSpeed*(.5+Math.random()),color:n.colors[Math.floor(Math.random()*n.colors.length)],vx:(Math.random()-.5)*n.speed,vy:(Math.random()-.5)*n.speed}}for(let i=0;i<n.count;i++)r.push(f());function c(i){t.save(),t.globalAlpha=Math.max(0,Math.min(1,i.alpha)),n.glow&&(t.shadowColor=i.color,t.shadowBlur=i.size*3),t.fillStyle=i.color;const e=i.size;t.beginPath();for(let s=0;s<4;s++){const d=s*Math.PI/2;t.ellipse(i.x+Math.cos(d)*e*.35,i.y+Math.sin(d)*e*.35,e*.15,e*.7,d,0,Math.PI*2)}t.fill(),t.beginPath(),t.arc(i.x,i.y,e*.2,0,Math.PI*2),t.fill(),t.restore()}function l(){if(h){t.clearRect(0,0,o.width,o.height);for(let i=0;i<r.length;i++){const e=r[i];e.x+=e.vx,e.y+=e.vy,e.alpha+=e.alphaDir*e.twinkleSpeed,e.alpha>=1?(e.alpha=1,e.alphaDir=-1):e.alpha<=0&&(e.alpha=0,e.alphaDir=1),e.x<-10&&(e.x=o.width+10),e.x>o.width+10&&(e.x=-10),e.y<-10&&(e.y=o.height+10),e.y>o.height+10&&(e.y=-10),c(e)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const mt={density:.15,symbols:["❤","💕","✨","💖","💗","⭐","×"],minSize:12,maxSize:28,minSpeed:1,maxSpeed:3.5,colors:["#ff6b8a","#ff4d6d","#ffc2d1","#ff85a1","#ff0a54","#a2d2ff"],opacity:.85,glow:!0};function ut(o,a={}){const n=p(mt,a),t=o.getContext("2d"),r=[];let h=!0;function f(){const l=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*o.width,y:-l*2,size:l,speed:n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed),symbol:n.symbols[Math.floor(Math.random()*n.symbols.length)],color:n.colors[Math.floor(Math.random()*n.colors.length)],alpha:.4+Math.random()*.6,angle:(Math.random()-.5)*.4,wobble:Math.random()*Math.PI*2,wobbleSpeed:.02+Math.random()*.02}}function c(){if(h){t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(f());for(let l=r.length-1;l>=0;l--){const i=r[l];i.y+=i.speed,i.wobble+=i.wobbleSpeed;const e=Math.sin(i.wobble)*i.size*.3;t.save(),t.globalAlpha=i.alpha*n.opacity,t.font=`${i.size}px serif`,t.fillStyle=i.color,n.glow&&(t.shadowColor=i.color,t.shadowBlur=i.size*.8),t.translate(i.x+e,i.y),t.rotate(i.angle),t.fillText(i.symbol,0,0),t.restore(),i.y>o.height+i.size*2&&r.splice(l,1)}requestAnimationFrame(c)}}return c(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const gt={density:.18,colors:["#ff6b8a","#ff4d6d","#ffd6ff","#e7c6ff","#c77dff","#48cae4","#ffe66d","#06d6a0"],minSize:6,maxSize:14,minSpeed:1.5,maxSpeed:4,gravity:.06,drag:.99,shapes:["rect","circle","ribbon"]};function pt(o,a={}){const n=p(gt,a),t=o.getContext("2d"),r=[];let h=!0;function f(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize),e=n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed);return{x:Math.random()*o.width,y:-i*2,w:i,h:i*(.4+Math.random()*.8),vx:(Math.random()-.5)*3,vy:e,angle:Math.random()*Math.PI*2,spin:(Math.random()-.5)*.15,color:n.colors[Math.floor(Math.random()*n.colors.length)],alpha:.8+Math.random()*.2,shape:n.shapes[Math.floor(Math.random()*n.shapes.length)]}}function c(i){t.save(),t.globalAlpha=i.alpha,t.fillStyle=i.color,t.strokeStyle=i.color,t.translate(i.x,i.y),t.rotate(i.angle),i.shape==="circle"?(t.beginPath(),t.ellipse(0,0,i.w/2,i.h/2,0,0,Math.PI*2),t.fill()):i.shape==="ribbon"?(t.beginPath(),t.moveTo(-i.w/2,0),t.quadraticCurveTo(0,-i.h,i.w/2,0),t.quadraticCurveTo(0,i.h,-i.w/2,0),t.fill()):t.fillRect(-i.w/2,-i.h/2,i.w,i.h),t.restore()}function l(){if(h){t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(f());for(let i=r.length-1;i>=0;i--){const e=r[i];e.vy+=n.gravity,e.vx*=n.drag,e.vy*=n.drag,e.x+=e.vx,e.y+=e.vy,e.angle+=e.spin,c(e),e.y>o.height+20&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Mt={interval:1200,trailLength:28,particleCount:80,colors:["#ff6b8a","#ff4d6d","#ffd6ff","#e7c6ff","#ffe66d","#06d6a0","#48cae4","#ffffff"],gravity:.09,decay:.014,glow:!0};function wt(o,a={}){const n=p(Mt,a),t=o.getContext("2d");let r=!0;const h=[],f=[];function c(){const s=o.width*(.2+Math.random()*.6),d=o.height*(.1+Math.random()*.4),m=8+Math.random()*5,g=n.colors[Math.floor(Math.random()*n.colors.length)];h.push({x:s,y:o.height,vy:-Math.abs(m),targetY:d,trail:[],color:g})}function l(s,d,m){for(let g=0;g<n.particleCount;g++){const z=Math.random()*Math.PI*2,S=1+Math.random()*5;f.push({x:s,y:d,vx:Math.cos(z)*S,vy:Math.sin(z)*S,alpha:1,decay:n.decay*(.7+Math.random()*.6),size:2+Math.random()*3,color:m})}}const i=setInterval(()=>{r&&c()},n.interval);c();function e(){if(r){t.clearRect(0,0,o.width,o.height);for(let s=h.length-1;s>=0;s--){const d=h[s];d.y+=d.vy,d.trail.push({x:d.x,y:d.y}),d.trail.length>n.trailLength&&d.trail.shift();for(let m=0;m<d.trail.length;m++){const g=m/d.trail.length*.8;t.save(),t.globalAlpha=g,n.glow&&(t.shadowColor=d.color,t.shadowBlur=6),t.fillStyle=d.color,t.beginPath(),t.arc(d.trail[m].x,d.trail[m].y,2.5*(m/d.trail.length),0,Math.PI*2),t.fill(),t.restore()}d.y<=d.targetY&&(l(d.x,d.y,d.color),h.splice(s,1))}for(let s=f.length-1;s>=0;s--){const d=f[s];d.x+=d.vx,d.y+=d.vy,d.vy+=n.gravity,d.alpha-=d.decay,t.save(),t.globalAlpha=Math.max(0,d.alpha),n.glow&&(t.shadowColor=d.color,t.shadowBlur=d.size*2),t.fillStyle=d.color,t.beginPath(),t.arc(d.x,d.y,d.size,0,Math.PI*2),t.fill(),t.restore(),d.alpha<=0&&f.splice(s,1)}requestAnimationFrame(e)}}return e(),function(){r=!1,clearInterval(i),t.clearRect(0,0,o.width,o.height)}}const zt={starCount:120,speed:.4,colors:["#ffffff","#ffe4e8","#ffc2d1","#e7c6ff","#a2d2ff"],minSize:1,maxSize:3.5,twinkle:!0,connectDist:100,connectOpacity:.08};function St(o,a={}){const n=p(zt,a),t=o.getContext("2d"),r=[];let h=!0;function f(l=!1){return{x:Math.random()*o.width,y:Math.random()*o.height,size:n.minSize+Math.random()*(n.maxSize-n.minSize),alpha:.3+Math.random()*.7,alphaDir:Math.random()>.5?1:-1,twinkleSpeed:.008+Math.random()*.015,vx:(Math.random()-.5)*n.speed,vy:(Math.random()-.5)*n.speed,color:n.colors[Math.floor(Math.random()*n.colors.length)]}}for(let l=0;l<n.starCount;l++)r.push(f(!0));function c(){if(h){if(t.clearRect(0,0,o.width,o.height),n.connectDist>0)for(let l=0;l<r.length;l++)for(let i=l+1;i<r.length;i++){const e=r[l].x-r[i].x,s=r[l].y-r[i].y,d=Math.sqrt(e*e+s*s);d<n.connectDist&&(t.save(),t.globalAlpha=n.connectOpacity*(1-d/n.connectDist),t.strokeStyle="#ffffff",t.lineWidth=.5,t.beginPath(),t.moveTo(r[l].x,r[l].y),t.lineTo(r[i].x,r[i].y),t.stroke(),t.restore())}for(let l=0;l<r.length;l++){const i=r[l];i.x+=i.vx,i.y+=i.vy,n.twinkle&&(i.alpha+=i.alphaDir*i.twinkleSpeed,i.alpha>=1&&(i.alpha=1,i.alphaDir=-1),i.alpha<=.1&&(i.alpha=.1,i.alphaDir=1)),i.x<-5&&(i.x=o.width+5),i.x>o.width+5&&(i.x=-5),i.y<-5&&(i.y=o.height+5),i.y>o.height+5&&(i.y=-5),t.save(),t.globalAlpha=i.alpha,t.shadowColor=i.color,t.shadowBlur=i.size*3,t.fillStyle=i.color,t.beginPath(),t.arc(i.x,i.y,i.size,0,Math.PI*2),t.fill(),t.restore()}requestAnimationFrame(c)}}return c(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const yt={density:.05,colors:["#c77dff","#ff85a1","#ffc2d1","#48cae4","#e7c6ff","#fbb1bd"],minSize:10,maxSize:22,minSpeed:.8,maxSpeed:2.2,glow:!0};function bt(o,a={}){const n=p(yt,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:-i*2,y:o.height*.1+Math.random()*(o.height*.8),size:i,speed:n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed),color:n.colors[Math.floor(Math.random()*n.colors.length)],alpha:0,flapSpeed:.1+Math.random()*.15,flapOffset:Math.random()*Math.PI*2,wobbleSpeed:.01+Math.random()*.02,wobbleOffset:Math.random()*Math.PI*2}}function l(){if(h){f++,t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(c());for(let i=r.length-1;i>=0;i--){const e=r[i];e.x+=e.speed,e.y+=Math.sin(f*e.wobbleSpeed+e.wobbleOffset)*1.5,e.alpha<1&&e.x<o.width/2&&(e.alpha+=.02);const s=Math.abs(Math.sin(f*e.flapSpeed+e.flapOffset));t.save(),t.globalAlpha=Math.min(1,e.alpha),t.translate(e.x,e.y),t.rotate(-.1-s*.1),n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size*1.5),t.fillStyle=e.color,t.beginPath(),t.ellipse(-e.size*.2,0,e.size*.4*s,e.size*.5,.3,0,Math.PI*2),t.fill(),t.beginPath(),t.ellipse(e.size*.3*s,-e.size*.1,e.size*.5*s,e.size*.6,-.2,0,Math.PI*2),t.fill(),t.restore(),e.x>o.width+e.size*2&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const xt={particleCount:150,minSize:1,maxSize:4,colors:["#ffd6ff","#e7c6ff","#c77dff","#ffb3c1","#ffffff"],speed:.8,glow:!0};function Pt(o,a={}){const n=p(xt,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){return{x:Math.random()*o.width,y:Math.random()*o.height,size:n.minSize+Math.random()*(n.maxSize-n.minSize),color:n.colors[Math.floor(Math.random()*n.colors.length)],angle:Math.random()*Math.PI*2,orbitRadius:20+Math.random()*80,orbitSpeed:(.01+Math.random()*.03)*(Math.random()>.5?1:-1),centerX:Math.random()*o.width,centerY:o.height+50,upwardSpeed:n.speed+Math.random()*1.5,alpha:0}}for(let i=0;i<n.particleCount;i++)r.push(c()),r[i].centerY=Math.random()*o.height,r[i].alpha=Math.random();function l(){if(h){f++,t.clearRect(0,0,o.width,o.height);for(let i=0;i<r.length;i++){const e=r[i];e.angle+=e.orbitSpeed,e.centerY-=e.upwardSpeed,e.x=e.centerX+Math.cos(e.angle)*e.orbitRadius+Math.sin(f*.01+e.angle)*30,e.y=e.centerY+Math.sin(e.angle)*(e.orbitRadius*.5),e.alpha<1&&e.centerY>0&&(e.alpha+=.01),e.y<-50&&(Object.assign(e,c()),e.centerY=o.height+50,e.centerX=Math.random()*o.width),t.save(),t.globalAlpha=e.alpha,n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size*3),t.fillStyle=e.color,t.beginPath(),t.arc(e.x,e.y,e.size,0,Math.PI*2),t.fill(),t.restore()}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Ct={orbCount:15,minSize:50,maxSize:150,colors:["#ff4d6d","#c77dff","#48cae4","#ffe66d"],speed:.5,glow:!0};function At(o,a={}){const n=p(Ct,a),t=o.getContext("2d"),r=[];let h=!0;function f(){const l=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*o.width,y:Math.random()*o.height,size:l,vx:(Math.random()-.5)*n.speed,vy:(Math.random()-.5)*n.speed,color:n.colors[Math.floor(Math.random()*n.colors.length)],alpha:0}}for(let l=0;l<n.orbCount;l++){const i=f();i.alpha=Math.random()*.5+.1,r.push(i)}function c(){if(h){t.clearRect(0,0,o.width,o.height);for(let l=0;l<r.length;l++){const i=r[l];i.x+=i.vx,i.y+=i.vy,i.x<-i.size&&(i.x=o.width+i.size),i.x>o.width+i.size&&(i.x=-i.size),i.y<-i.size&&(i.y=o.height+i.size),i.y>o.height+i.size&&(i.y=-i.size),t.save(),t.globalAlpha=i.alpha,t.globalCompositeOperation="screen";const e=t.createRadialGradient(i.x,i.y,0,i.x,i.y,i.size);e.addColorStop(0,i.color),e.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=e,t.beginPath(),t.arc(i.x,i.y,i.size,0,Math.PI*2),t.fill(),t.restore()}requestAnimationFrame(c)}}return c(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Tt={density:.02,minSpeed:10,maxSpeed:25,colors:["#ffffff","#e7c6ff","#48cae4","#ffe66d"],glow:!0};function Rt(o,a={}){const n=p(Tt,a),t=o.getContext("2d"),r=[];let h=!0;function f(){return{x:Math.random()*o.width*1.5,y:-50,length:50+Math.random()*100,thickness:1+Math.random()*2,speed:n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed),color:n.colors[Math.floor(Math.random()*n.colors.length)],angle:Math.PI/4+(Math.random()*.2-.1),opacity:1}}function c(){if(h){t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(f());for(let l=r.length-1;l>=0;l--){const i=r[l],e=-Math.cos(i.angle)*i.speed,s=Math.sin(i.angle)*i.speed;i.x+=e,i.y+=s,i.opacity-=.01,t.save(),t.globalAlpha=Math.max(0,i.opacity),n.glow&&(t.shadowColor=i.color,t.shadowBlur=i.thickness*4);const d=t.createLinearGradient(i.x,i.y,i.x-e*(i.length/i.speed),i.y-s*(i.length/i.speed));d.addColorStop(0,i.color),d.addColorStop(1,"rgba(255,255,255,0)"),t.strokeStyle=d,t.lineWidth=i.thickness,t.lineCap="round",t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(i.x-e*(i.length/i.speed),i.y-s*(i.length/i.speed)),t.stroke(),t.restore(),(i.opacity<=0||i.x<-100||i.y>o.height+100)&&r.splice(l,1)}requestAnimationFrame(c)}}return c(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Ft={density:.08,colors:["#ff0a54","#ff477e","#ff7096","#ff85a1","#fbb1bd"],minSize:15,maxSize:30,minSpeed:.8,maxSpeed:2,glow:!0};function It(o,a={}){const n=p(Ft,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*o.width,y:-i*2,size:i,speedY:n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed),speedX:(Math.random()-.5)*1.5,color:n.colors[Math.floor(Math.random()*n.colors.length)],rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.05,flipSpeed:.02+Math.random()*.04,flipPhase:Math.random()*Math.PI*2}}function l(){if(h){f++,t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(c());for(let i=r.length-1;i>=0;i--){const e=r[i];e.y+=e.speedY,e.x+=e.speedX+Math.sin(f*.02+e.flipPhase)*.5,e.rotation+=e.rotationSpeed;const s=Math.sin(f*e.flipSpeed+e.flipPhase);t.save(),t.translate(e.x,e.y),t.rotate(e.rotation),t.scale(1,Math.abs(s)),n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size),t.fillStyle=e.color,t.beginPath(),t.moveTo(0,e.size*-.5),t.bezierCurveTo(e.size*.5,e.size*-.5,e.size*.8,e.size*.2,0,e.size*.5),t.bezierCurveTo(e.size*-.8,e.size*.2,e.size*-.5,e.size*-.5,0,e.size*-.5),t.fill(),t.restore(),e.y>o.height+e.size*2&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Bt={density:.02,colors:["#ef476f","#ffd166","#06d6a0","#118ab2","#073b4c","#ff9f1c"],minSize:30,maxSize:60,minSpeed:.5,maxSpeed:1.5,glow:!1};function kt(o,a={}){const n=p(Bt,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*o.width,y:o.height+i*3,size:i,speedY:n.minSpeed+Math.random()*(n.maxSpeed-n.minSpeed),color:n.colors[Math.floor(Math.random()*n.colors.length)],swaySpeed:.01+Math.random()*.02,swayOffset:Math.random()*Math.PI*2}}function l(){if(h){f++,t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(c());for(let i=r.length-1;i>=0;i--){const e=r[i];e.y-=e.speedY;const s=Math.sin(f*e.swaySpeed+e.swayOffset)*(e.size*.5);t.save(),t.translate(e.x+s,e.y),n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size*.5),t.beginPath(),t.moveTo(0,e.size),t.bezierCurveTo(e.size*.2,e.size*1.5,e.size*-.2,e.size*2,0,e.size*3),t.strokeStyle="rgba(255, 255, 255, 0.4)",t.lineWidth=1.5,t.stroke(),t.fillStyle=e.color,t.beginPath(),t.moveTo(-e.size*.1,e.size*1.1),t.lineTo(e.size*.1,e.size*1.1),t.lineTo(0,e.size*.95),t.fill(),t.beginPath(),t.moveTo(0,e.size),t.bezierCurveTo(e.size*1.1,e.size*.8,e.size*1.1,-e.size,0,-e.size),t.bezierCurveTo(-e.size*1.1,-e.size,-e.size*1.1,e.size*.8,0,e.size),t.fill(),t.beginPath(),t.ellipse(-e.size*.3,-e.size*.4,e.size*.1,e.size*.2,-.3,0,Math.PI*2),t.fillStyle="rgba(255, 255, 255, 0.3)",t.fill(),t.restore(),e.y<-e.size*4&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Lt={density:.1,colors:["#00f0ff","#00b4d8","#90e0ef"],speed:1,minSize:1,maxSize:3,glow:!0};function Dt(o,a={}){const n=p(Lt,a),t=o.getContext("2d");let r=!0,h=0;const f=[],c=Math.round(n.density*300)+50,l=Math.min(o.width,o.height)*.4,i=Math.PI*(3-Math.sqrt(5));for(let s=0;s<c;s++){const d=1-s/(c-1)*2,m=Math.sqrt(1-d*d),g=i*s,z=Math.cos(g)*m,S=Math.sin(g)*m;f.push({x:z,y:d,z:S,baseX:z,baseY:d,baseZ:S,size:n.minSize+Math.random()*(n.maxSize-n.minSize),color:n.colors[Math.floor(Math.random()*n.colors.length)]})}function e(){if(!r)return;h+=.01*n.speed,t.clearRect(0,0,o.width,o.height);const s=o.width/2,d=o.height/2,m=Math.cos(h),g=Math.sin(h),z=.4,S=Math.cos(z),T=Math.sin(z),P=[];for(let y=0;y<f.length;y++){const w=f[y];let b=w.baseX*m-w.baseZ*g,x=w.baseZ*m+w.baseX*g,R=w.baseY,ee=b,oe=R*S-x*T,ie=x*S+R*T;P.push({x:s+ee*l,y:d+oe*l,z:ie,orig:w})}P.sort((y,w)=>y.z-w.z);for(let y=0;y<P.length;y++){const w=P[y],b=Math.max(.1,(w.z+1)/2);t.beginPath(),t.arc(w.x,w.y,w.orig.size*b,0,Math.PI*2),t.fillStyle=w.orig.color,t.globalAlpha=b,n.glow&&(t.shadowBlur=10*b,t.shadowColor=w.orig.color),t.fill()}t.globalAlpha=.15,t.lineWidth=1,t.shadowBlur=0;for(let y=0;y<P.length;y++){const w=P[y];if(!(w.z<0))for(let b=y+1;b<P.length;b++){const x=P[b];if(x.z<0)continue;(w.x-x.x)**2+(w.y-x.y)**2+(w.z*l-x.z*l)**2<(l*.4)**2&&(t.beginPath(),t.moveTo(w.x,w.y),t.lineTo(x.x,x.y),t.strokeStyle=w.orig.color,t.stroke())}}t.globalAlpha=1,requestAnimationFrame(e)}return e(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const Et={density:.15,colors:["#ffb7b2","#ffdac1","#e2f0cb","#ff9aa2"],minSize:8,maxSize:18,speed:1.5,wind:2,glow:!1};function qt(o,a={}){const n=p(Et,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*(o.width+200)-100,y:-i*2,size:i,speedY:(1+Math.random())*n.speed,speedX:Math.random()-.5+n.wind,color:n.colors[Math.floor(Math.random()*n.colors.length)],rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,flip:Math.random()*Math.PI,flipSpeed:.05+Math.random()*.05}}function l(){if(h){f++,t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(c());for(let i=r.length-1;i>=0;i--){const e=r[i];e.y+=e.speedY,e.x+=e.speedX+Math.sin(f*.05+e.flip)*1.5,e.rotation+=e.rotationSpeed,e.flip+=e.flipSpeed;const s=Math.abs(Math.sin(e.flip));t.save(),t.translate(e.x,e.y),t.rotate(e.rotation),t.scale(1,s),n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size),t.fillStyle=e.color,t.beginPath(),t.moveTo(0,e.size*-.5),t.bezierCurveTo(e.size*.6,e.size*-.8,e.size*.8,e.size*.4,0,e.size*.6),t.bezierCurveTo(e.size*-.8,e.size*.4,e.size*-.6,e.size*-.8,0,e.size*-.5),t.lineTo(0,e.size*-.3),t.fill(),t.restore(),(e.y>o.height+e.size*2||e.x>o.width+e.size*2)&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Yt={density:.05,colors:["#e9ff70","#d4ff00","#f9f871"],minSize:2,maxSize:6,speed:1,glow:!0};function Ot(o,a={}){const n=p(Yt,a),t=o.getContext("2d");let r=!0;const h=Math.round(n.density*200)+20,f=[];for(let i=0;i<h;i++)f.push({x:Math.random()*o.width,y:Math.random()*o.height,vx:(Math.random()-.5)*n.speed,vy:(Math.random()-.5)*n.speed,size:n.minSize+Math.random()*(n.maxSize-n.minSize),color:n.colors[Math.floor(Math.random()*n.colors.length)],blinkPhase:Math.random()*Math.PI*2,blinkSpeed:.02+Math.random()*.03,roamPhase:Math.random()*Math.PI*2});let c=0;function l(){if(r){c++,t.clearRect(0,0,o.width,o.height);for(let i=0;i<f.length;i++){const e=f[i];e.vx+=Math.sin(c*.01+e.roamPhase)*.05,e.vy+=Math.cos(c*.015+e.roamPhase)*.05;const s=n.speed*2;e.vx=Math.max(-s,Math.min(s,e.vx)),e.vy=Math.max(-s,Math.min(s,e.vy)),e.x+=e.vx,e.y+=e.vy,e.x<-20&&(e.x=o.width+20),e.x>o.width+20&&(e.x=-20),e.y<-20&&(e.y=o.height+20),e.y>o.height+20&&(e.y=-20);const d=(Math.sin(c*e.blinkSpeed+e.blinkPhase)+1)/2;t.save(),t.globalAlpha=d,t.fillStyle=e.color,n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size*3),t.beginPath(),t.arc(e.x,e.y,e.size,0,Math.PI*2),t.fill(),t.restore()}requestAnimationFrame(l)}}return l(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const $t={density:.2,colors:["#ffffff","#e0f7fa"],minSize:1,maxSize:4,speed:1,wind:.5,glow:!1};function Ut(o,a={}){const n=p($t,a),t=o.getContext("2d");let r=!0;const h=Math.round(n.density*500)+50,f=[];for(let i=0;i<h;i++)f.push({x:Math.random()*o.width,y:Math.random()*o.height,size:n.minSize+Math.random()*(n.maxSize-n.minSize),speedY:(.5+Math.random()*1.5)*n.speed,speedX:n.wind+(Math.random()-.5)*.5,color:n.colors[Math.floor(Math.random()*n.colors.length)],swayPhase:Math.random()*Math.PI*2,swaySpeed:.01+Math.random()*.02});let c=0;function l(){if(r){c++,t.clearRect(0,0,o.width,o.height);for(let i=0;i<f.length;i++){const e=f[i];e.y+=e.speedY,e.x+=e.speedX+Math.sin(c*e.swaySpeed+e.swayPhase)*.5,e.y>o.height+e.size&&(e.y=-e.size,e.x=Math.random()*o.width),e.x>o.width+e.size?e.x=-e.size:e.x<-e.size&&(e.x=o.width+e.size),t.beginPath(),t.arc(e.x,e.y,e.size,0,Math.PI*2),t.fillStyle=e.color,n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size*2),t.globalAlpha=.8,t.fill()}t.globalAlpha=1,requestAnimationFrame(l)}}return l(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const Xt={density:.1,colors:["#0f0","#00ff41"],minSize:14,maxSize:22,speed:1,glow:!0};function Ht(o,a={}){const n=p(Xt,a),t=o.getContext("2d");let r=!0;const h=(n.minSize+n.maxSize)/2,f=Math.floor(o.width/h),c=[],l=`ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$+-*/=%""'#&_(),.;:?!\\|{}<>[]^~`;for(let e=0;e<f;e++)c[e]=Math.random()*-100;function i(){if(r){t.fillStyle="rgba(0, 0, 0, 0.1)",t.fillRect(0,0,o.width,o.height),t.font=`${h}px monospace`;for(let e=0;e<c.length;e++){if(Math.random()>n.density&&c[e]<0)continue;const s=l.charAt(Math.floor(Math.random()*l.length)),d=n.colors[Math.floor(Math.random()*n.colors.length)];t.fillStyle=d,n.glow?(t.shadowBlur=5,t.shadowColor=d):t.shadowBlur=0,t.fillText(s,e*h,c[e]*h),c[e]*h>o.height&&Math.random()>.95&&(c[e]=0),c[e]+=n.speed*.5}setTimeout(()=>{r&&requestAnimationFrame(i)},50)}}return i(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const jt={density:.1,colors:["#e76f51","#f4a261","#e9c46a","#d62828"],minSize:10,maxSize:25,speed:1.5,glow:!1};function Wt(o,a={}){const n=p(jt,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*(o.width+200)-100,y:-i*2,size:i,speedY:(.8+Math.random()*1.5)*n.speed,speedX:(Math.random()-.5)*2,color:n.colors[Math.floor(Math.random()*n.colors.length)],rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,flipPhase:Math.random()*Math.PI*2,flipSpeed:.05+Math.random()*.05}}function l(){if(h){f++,t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(c());for(let i=r.length-1;i>=0;i--){const e=r[i];e.y+=e.speedY,e.x+=e.speedX+Math.sin(f*.03+e.flipPhase)*2,e.rotation+=e.rotationSpeed;const s=Math.sin(f*e.flipSpeed+e.flipPhase);t.save(),t.translate(e.x,e.y),t.rotate(e.rotation),t.scale(1,Math.max(.1,Math.abs(s))),n.glow&&(t.shadowColor=e.color,t.shadowBlur=e.size*.5),t.fillStyle=e.color,t.beginPath(),t.moveTo(0,e.size*-.6),t.bezierCurveTo(e.size*.5,e.size*-.5,e.size*.6,e.size*.2,0,e.size*.6),t.bezierCurveTo(e.size*-.6,e.size*.2,e.size*-.5,e.size*-.5,0,e.size*-.6),t.fill(),t.beginPath(),t.moveTo(0,e.size*.5),t.lineTo(0,e.size*.8),t.strokeStyle="#3e2723",t.lineWidth=Math.max(1,e.size*.05),t.stroke(),t.restore(),(e.y>o.height+e.size*2||e.x>o.width+e.size*2)&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Gt={density:.05,colors:["rgba(255,255,255,0.4)","rgba(230,240,255,0.5)","rgba(255,230,250,0.5)"],minSize:10,maxSize:35,speed:1,glow:!1};function _t(o,a={}){const n=p(Gt,a),t=o.getContext("2d"),r=[];let h=!0,f=0;function c(){const i=n.minSize+Math.random()*(n.maxSize-n.minSize);return{x:Math.random()*o.width,y:o.height+i*2,size:i,speedY:(.5+Math.random())*n.speed,wobbleSpeed:.02+Math.random()*.03,wobblePhase:Math.random()*Math.PI*2,color:n.colors[Math.floor(Math.random()*n.colors.length)],highlightPhase:Math.random()*Math.PI*2}}function l(){if(h){f++,t.clearRect(0,0,o.width,o.height),Math.random()<n.density&&r.push(c());for(let i=r.length-1;i>=0;i--){const e=r[i];e.y-=e.speedY;const s=Math.sin(f*e.wobbleSpeed+e.wobblePhase)*(e.size*.3),d=Math.cos(f*e.wobbleSpeed*1.5+e.wobblePhase)*(e.size*.1);t.save(),t.translate(e.x+s,e.y+d),n.glow&&(t.shadowColor="#fff",t.shadowBlur=e.size*.5),t.beginPath(),t.arc(0,0,e.size,0,Math.PI*2),t.fillStyle=e.color,t.fill(),t.strokeStyle="rgba(255, 255, 255, 0.6)",t.lineWidth=1,t.stroke();const m=-e.size*.3,g=-e.size*.3;t.beginPath(),t.ellipse(m,g,e.size*.4,e.size*.2,-Math.PI/4,0,Math.PI*2),t.fillStyle=`rgba(255, 255, 255, ${.4+Math.sin(f*.05+e.highlightPhase)*.2})`,t.fill(),t.beginPath(),t.arc(e.size*.4,e.size*.4,e.size*.2,0,Math.PI*2),t.fillStyle="rgba(255, 255, 255, 0.15)",t.fill(),t.restore(),e.y<-e.size*3&&r.splice(i,1)}requestAnimationFrame(l)}}return l(),function(){h=!1,t.clearRect(0,0,o.width,o.height)}}const Nt={density:.15,colors:["#c77dff","#7b2cbf","#e0aaff","#9d4edd","#ffffff"],minSize:1,maxSize:3,speed:1,glow:!0};function Zt(o,a={}){const n=p(Nt,a),t=o.getContext("2d");let r=!0;const h=[],f=Math.round(n.density*500)+100,c=o.width/2,l=o.height/2,i=Math.max(o.width,o.height)*.7;function e(){return{angle:Math.random()*Math.PI*2,r:i,size:n.minSize+Math.random()*(n.maxSize-n.minSize),speed:(1+Math.random()*2)*n.speed,color:n.colors[Math.floor(Math.random()*n.colors.length)]}}for(let d=0;d<f;d++){const m=e();m.r=Math.random()*i,h.push(m)}function s(){if(r){t.fillStyle="rgba(0, 0, 0, 0.2)",t.fillRect(0,0,o.width,o.height);for(let d=0;d<h.length;d++){const m=h[d];m.r-=m.speed*(1+(i-m.r)/i),m.angle+=.02+(i-m.r)/i*.1*n.speed,m.r<10&&(m.r=i,m.angle=Math.random()*Math.PI*2);const g=c+Math.cos(m.angle)*m.r,z=l+Math.sin(m.angle)*m.r;t.beginPath(),t.arc(g,z,m.size,0,Math.PI*2),t.fillStyle=m.color,n.glow&&(t.shadowColor=m.color,t.shadowBlur=m.size*2),t.fill()}t.beginPath(),t.arc(c,l,15,0,Math.PI*2),t.fillStyle="#000",t.shadowBlur=30,t.shadowColor="#5a189a",t.fill(),t.shadowBlur=0,requestAnimationFrame(s)}}return s(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const Jt={density:.5,colors:["#00ff9f","#00b8ff","#001eff","#bd00ff","#d600ff"],speed:1,glow:!0};function Kt(o,a={}){const n=p(Jt,a),t=o.getContext("2d");let r=!0,h=0;function f(){if(r){h+=.01*n.speed,t.clearRect(0,0,o.width,o.height),t.globalCompositeOperation="screen";for(let c=0;c<3;c++){t.beginPath();const l=o.height*.3+c*100;for(let d=0;d<=o.width;d+=20){const m=Math.sin(d*.005+h*2+c)*50,g=Math.cos(d*.01-h*1.5)*40,z=Math.sin(d*.002+h)*100,S=l+m+g+z;d===0?t.moveTo(d,S):t.lineTo(d,S)}t.lineTo(o.width,o.height),t.lineTo(0,o.height),t.closePath();const i=t.createLinearGradient(0,l-100,0,o.height);i.addColorStop(0,"rgba(0,0,0,0)");const e=n.colors[c*2%n.colors.length],s=n.colors[(c*2+1)%n.colors.length];i.addColorStop(.2,e),i.addColorStop(.8,s),i.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=i,t.globalAlpha=.3*n.density*2,t.fill()}t.globalCompositeOperation="source-over",t.globalAlpha=1,requestAnimationFrame(f)}}return f(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const Qt={density:.1,colors:["rgba(255, 230, 200, 0.8)","rgba(200, 220, 255, 0.6)"],speed:1,glow:!0};function Vt(o,a={}){const n=p(Qt,a),t=o.getContext("2d");let r=!0,h=0;const f={x:o.width*.2,y:o.height*.2},c=[{scale:.5,dist:.2,color:"rgba(0, 255, 100, 0.1)"},{scale:1.2,dist:-.4,color:"rgba(200, 100, 255, 0.15)"},{scale:.3,dist:.8,color:"rgba(255, 255, 255, 0.2)"},{scale:.8,dist:-1.2,color:"rgba(100, 200, 255, 0.1)"},{scale:2,dist:1.5,color:"rgba(255, 100, 50, 0.05)"},{scale:.1,dist:1.1,color:"rgba(255, 255, 255, 0.4)"}];function l(){if(!r)return;h+=.01*n.speed,t.clearRect(0,0,o.width,o.height),t.globalCompositeOperation="screen",f.x=o.width/2+Math.cos(h*.5)*(o.width*.4),f.y=o.height/2+Math.sin(h*.3)*(o.height*.4);const i=o.width/2,e=o.height/2,s=t.createRadialGradient(f.x,f.y,0,f.x,f.y,200*n.density*10);s.addColorStop(0,"#ffffff"),s.addColorStop(.1,n.colors[0]),s.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.arc(f.x,f.y,1e3,0,Math.PI*2),t.fillStyle=s,t.fill(),t.beginPath(),t.ellipse(f.x,f.y,o.width,4,0,0,Math.PI*2),t.fillStyle=n.colors[1],t.fill();const d=i-f.x,m=e-f.y;for(const g of c){const z=i+d*g.dist,S=e+m*g.dist,T=100*g.scale*n.density*10;t.beginPath(),t.arc(z,S,T,0,Math.PI*2),t.fillStyle=g.color,t.fill(),g.scale>.5&&(t.beginPath(),t.arc(z,S,T*1.2,0,Math.PI*2),t.strokeStyle=g.color,t.lineWidth=2,t.stroke())}t.globalCompositeOperation="source-over",requestAnimationFrame(l)}return l(),function(){r=!1,t.clearRect(0,0,o.width,o.height)}}const C=new Map;let vt=0;function M(o,a,n={}){const{canvas:t,destroy:r}=et(o,n),h=a(t,n),f=++vt;return C.set(f,{destroy:r,stop:h}),f}function F(o){if(C.has(o)){const a=C.get(o);typeof a.stop=="function"&&a.stop(),a.destroy(),C.delete(o)}}function I(){C.forEach(o=>{typeof o.stop=="function"&&o.stop(),o.destroy()}),C.clear()}function B(o,a={}){return M(o,nt,a)}function k(o,a={}){return M(o,lt,a)}function L(o,a={}){return M(o,ft,a)}function D(o,a={}){return M(o,ct,a)}function E(o,a={}){return M(o,ut,a)}function q(o,a={}){return M(o,pt,a)}function Y(o,a={}){return M(o,wt,a)}function O(o,a={}){return M(o,St,a)}function $(o,a={}){return M(o,bt,a)}function U(o,a={}){return M(o,Pt,a)}function X(o,a={}){return M(o,At,a)}function H(o,a={}){return M(o,Rt,a)}function j(o,a={}){return M(o,It,a)}function W(o,a={}){return M(o,kt,a)}function G(o,a={}){return M(o,Dt,a)}function _(o,a={}){return M(o,qt,a)}function N(o,a={}){return M(o,Ot,a)}function Z(o,a={}){return M(o,Ut,a)}function J(o,a={}){return M(o,Ht,a)}function K(o,a={}){return M(o,Wt,a)}function Q(o,a={}){return M(o,_t,a)}function V(o,a={}){return M(o,Zt,a)}function v(o,a={}){return M(o,Kt,a)}function tt(o,a={}){return M(o,Vt,a)}const te={startFloatingHearts:B,startHeartTrail:k,startHeartBurst:L,startSparkles:D,startLoveRain:E,startConfetti:q,startFireworks:Y,startStarField:O,startButterflies:$,startMagicDust:U,startFloatingOrbs:X,startShootingStars:H,startRosePetals:j,startFloatingBalloons:W,startGlobeMovement:G,startCherryBlossoms:_,startFireflies:N,startSnowStorm:Z,startMatrixRain:J,startAutumnLeaves:K,startBubbles:Q,startBlackHole:V,startAuroraBorealis:v,startLensFlares:tt,stopAnimation:F,stopAll:I};u.default=te,u.startAuroraBorealis=v,u.startAutumnLeaves=K,u.startBlackHole=V,u.startBubbles=Q,u.startButterflies=$,u.startCherryBlossoms=_,u.startConfetti=q,u.startFireflies=N,u.startFireworks=Y,u.startFloatingBalloons=W,u.startFloatingHearts=B,u.startFloatingOrbs=X,u.startGlobeMovement=G,u.startHeartBurst=L,u.startHeartTrail=k,u.startLensFlares=tt,u.startLoveRain=E,u.startMagicDust=U,u.startMatrixRain=J,u.startRosePetals=j,u.startShootingStars=H,u.startSnowStorm=Z,u.startSparkles=D,u.startStarField=O,u.stopAll=I,u.stopAnimation=F,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
//# sourceMappingURL=romantic-animations.umd.js.map