animated-backgrounds
Version:
A feature-rich React package for stunning animated backgrounds with interactive controls, themes, performance monitoring, and layered compositions.
3 lines (2 loc) • 48.6 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}function n(e,t,a){return t=c(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,a||[],c(e).constructor):t.apply(e,a))}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function l(e,t,a){return t&&o(e.prototype,t),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,a){return(t=y(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function f(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){h(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,i,o,l=[],h=!0,c=!1;try{if(i=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;h=!1}else for(;!(h=(r=i.call(a)).done)&&(l.push(r.value),l.length!==t);h=!0);}catch(e){c=!0,n=e}finally{try{if(!h&&null!=a.return&&(o=a.return(),Object(o)!==o))return}finally{if(c)throw n}}return l}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return r(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(e,t):void 0}}var v=function(e,t){for(var a=[],r=0;r<150;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:2*Math.random(),vx:Math.floor(50*Math.random())-25,vy:Math.floor(50*Math.random())-25,twinkle:Math.random(),color:"hsla(".concat(360*Math.random(),", 70%, 70%, 0.8)")});return function(){t.fillStyle="rgba(15, 23, 42, 0.1)",t.fillRect(0,0,e.width,e.height),a.forEach((function(a){a.twinkle+=.02;var r=Math.abs(Math.sin(a.twinkle)),n=t.createRadialGradient(a.x,a.y,0,a.x,a.y,4*a.radius);n.addColorStop(0,a.color),n.addColorStop(1,"transparent"),t.beginPath(),t.arc(a.x,a.y,4*a.radius,0,2*Math.PI),t.fillStyle=n,t.fill(),t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, ".concat(r,")"),t.fill(),a.x+=a.vx/60,a.y+=a.vy/60,(a.x<0||a.x>e.width)&&(a.vx=-a.vx),(a.y<0||a.y>e.height)&&(a.vy=-a.vy)}))}},b=function(e,t){for(var a=[],r=0;r<75;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:30*Math.random()+5,speed:.7*Math.random()+.1,color:"hsla(".concat(360*Math.random(),", 70%, 60%, 0.6)"),glowColor:"hsla(".concat(360*Math.random(),", 70%, 60%, 0.3)")});return function(){t.fillStyle="rgba(30, 41, 59, 0.1)",t.fillRect(0,0,e.width,e.height),a.forEach((function(a){var r=t.createRadialGradient(a.x,a.y,0,a.x,a.y,2*a.radius);r.addColorStop(0,a.glowColor),r.addColorStop(1,"transparent"),t.beginPath(),t.arc(a.x,a.y,2*a.radius,0,2*Math.PI),t.fillStyle=r,t.fill(),t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fillStyle=a.color,t.fill(),t.beginPath(),t.arc(a.x-.3*a.radius,a.y-.3*a.radius,.2*a.radius,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, 0.6)",t.fill(),a.y-=a.speed,a.x+=.5*Math.sin(.03*a.y),a.y+a.radius<0&&(a.y=e.height+a.radius,a.x=Math.random()*e.width)}))}},M=function(e,t){var a=0;return function(){a+=.01;var r=t.createLinearGradient(0,0,e.width,e.height);r.addColorStop(0,"hsl(".concat(10*a%360,", 70%, 50%)")),r.addColorStop(1,"hsl(".concat((10*a+180)%360,", 70%, 50%)")),t.fillStyle=r,t.fillRect(0,0,e.width,e.height);for(var n=0;n<7;n++){t.beginPath(),t.moveTo(0,.15*e.height*n+30*Math.sin(a+n));for(var i=0;i<e.width;i+=10)t.lineTo(i,.15*e.height*n+30*Math.sin(a+n+.01*i));t.strokeStyle="rgba(255, 255, 255, ".concat(.1-.01*n,")"),t.lineWidth=2,t.stroke()}}},w=function(e,t){for(var a=[],r=0;r<150;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:3*Math.random()+1,vx:1.5*Math.random()-.75,vy:1.5*Math.random()-.75,color:"hsl(".concat(360*Math.random(),", 70%, 70%)")});return function(){t.fillStyle="rgba(15, 23, 42, 0.1)",t.fillRect(0,0,e.width,e.height),a.forEach((function(a){a.x+=a.vx,a.y+=a.vy,(a.x<0||a.x>e.width)&&(a.vx*=-1),(a.y<0||a.y>e.height)&&(a.vy*=-1),t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fillStyle=a.color,t.fill()}));for(var r=0;r<a.length;r++)for(var n=r+1;n<a.length;n++){var i=a[r].x-a[n].x,o=a[r].y-a[n].y,l=Math.sqrt(i*i+o*o);l<120&&(t.beginPath(),t.moveTo(a[r].x,a[r].y),t.lineTo(a[n].x,a[n].y),t.strokeStyle="rgba(255, 255, 255, ".concat(1-l/120,")"),t.lineWidth=.5,t.stroke())}}},x=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4,r=function(e,t){for(var a=[],r=0;r<t;r++){var n=Math.random()*e.width*.4,i=Math.random()*Math.PI*2;a.push({x:Math.cos(i)*n,y:Math.sin(i)*n,radius:1.5*Math.random()+.5,color:"hsl(".concat(60*Math.random()+200,", 80%, 70%)"),angle:i,distance:n})}return a}(e,2e3),n=0;return function(){t.fillStyle="rgba(10, 10, 30, 0.1)",t.fillRect(0,0,e.width,e.height),t.save(),t.translate(e.width/2,e.height/2),t.rotate(n),function(e,t,a,r){t.forEach((function(t){var a=Math.cos(t.angle)*t.distance,n=Math.sin(t.angle)*t.distance;e.beginPath(),e.arc(a,n,t.radius,0,2*Math.PI),e.fillStyle=t.color,e.fill(),t.angle+=r/(8e-5*t.distance)}))}(t,r,0,a),t.restore(),n+=a}},S=function(e,t){var a=0,r=["#FF0000","#FF7F00","#FFFF00","#00FF00","#0000FF","#4B0082","#8B00FF"];return function(){t.fillStyle="rgba(0, 0, 0, 0.05)",t.fillRect(0,0,e.width,e.height),a+=.02;for(var n=0;n<7;n++){t.beginPath(),t.moveTo(0,e.height/2);for(var i=0;i<e.width;i++){var o=50*Math.sin(.01*i+a+.5*n)+25*Math.cos(.02*i+.7*a+.3*n)+e.height/2;t.lineTo(i,o)}t.strokeStyle=r[n%r.length],t.lineWidth=4,t.stroke()}}},P=function(e,t){var a=0,r=[{pos:0,color:"rgba(0, 255, 128, 0.5)"},{pos:.5,color:"rgba(0, 128, 255, 0.5)"},{pos:1,color:"rgba(128, 0, 255, 0.5)"}];return function(){t.fillStyle="rgba(0, 0, 20, 0.1)",t.fillRect(0,0,e.width,e.height),a+=.005;for(var n=function(){var n=t.createLinearGradient(0,0,e.width,0);r.forEach((function(e){n.addColorStop(e.pos,e.color)})),t.beginPath();for(var o=0;o<e.width;o++){var l=50*Math.sin(.01*o+a+i)+30*Math.sin(.02*o-1.5*a+i)+e.height*(.4+.2*i);t.lineTo(o,l)}t.lineTo(e.width,e.height),t.lineTo(0,e.height),t.closePath(),t.fillStyle=n,t.fill()},i=0;i<3;i++)n()}},E=function(e,t){for(var a=[],r=["#FF00FF","#00FFFF","#FFFF00","#FF00AA"],n=0;n<20;n++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:50*Math.random()+20,color:r[Math.floor(Math.random()*r.length)],phase:Math.random()*Math.PI*2});return function(){t.fillStyle="rgba(0, 0, 0, 0.1)",t.fillRect(0,0,e.width,e.height),a.forEach((function(e){var a=20*Math.sin(e.phase)+30,r=t.createRadialGradient(e.x,e.y,0,e.x,e.y,e.radius);r.addColorStop(0,e.color),r.addColorStop(1,"rgba(0, 0, 0, 0)"),t.beginPath(),t.arc(e.x,e.y,e.radius+a,0,2*Math.PI),t.fillStyle=r,t.fill(),e.phase+=.05}))}},C=function(e,t){for(var a=[],r=0;r<300;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:2*Math.random()+.5,speedX:.5*(Math.random()-.5),speedY:.5*(Math.random()-.5),color:"hsl(".concat(60*Math.random()+180,", 100%, 70%)")});return function(){t.fillStyle="rgba(0, 0, 20, 0.05)",t.fillRect(0,0,e.width,e.height),a.forEach((function(a){t.beginPath(),t.arc(a.x,a.y,a.size,0,2*Math.PI),t.fillStyle=a.color,t.fill(),a.x+=a.speedX,a.y+=a.speedY,(a.x<0||a.x>e.width)&&(a.speedX*=-1),(a.y<0||a.y>e.height)&&(a.speedY*=-1)}))}},k=function(e,t){var a=[];return function(){t.fillStyle="rgba(0, 0, 20, 0.2)",t.fillRect(0,0,e.width,e.height),Math.random()<.1&&a.push(function(){for(var t=Math.random()*e.width,a=0,r=[{x:t,y:a}];a<e.height;)t+=50*(Math.random()-.5),a+=20*Math.random()+10,r.push({x:t,y:a});return{points:r,life:5+5*Math.random(),width:3*Math.random()+1}}()),a.forEach((function(e,r){t.beginPath(),t.moveTo(e.points[0].x,e.points[0].y);for(var n=1;n<e.points.length;n++)t.lineTo(e.points[n].x,e.points[n].y);t.strokeStyle="rgba(180, 220, 255, ".concat(e.life/10,")"),t.lineWidth=e.width,t.stroke(),e.life-=.2,e.life<=0&&a.splice(r,1)}))}},R=function(e,t){for(var a=[],r=0;r<100;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:4*Math.random()+1,speedX:2*(Math.random()-.5),speedY:2*(Math.random()-.5),hue:360*Math.random()});return function(){t.fillStyle="rgba(0, 0, 0, 0.05)",t.fillRect(0,0,e.width,e.height),a.forEach((function(r){r.x+=r.speedX,r.y+=r.speedY,(r.x<0||r.x>e.width)&&(r.speedX*=-1),(r.y<0||r.y>e.height)&&(r.speedY*=-1),t.beginPath(),t.arc(r.x,r.y,r.size,0,2*Math.PI),t.fillStyle="hsla(".concat(r.hue,", 100%, 50%, 0.8)"),t.fill(),a.forEach((function(e){var a=r.x-e.x,n=r.y-e.y,i=Math.sqrt(a*a+n*n);i<100&&(t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(e.x,e.y),t.strokeStyle="hsla(".concat((r.hue+e.hue)/2,", 100%, 50%, ").concat(1-i/100,")"),t.stroke())})),r.hue=(r.hue+.5)%360}))}},T=function(e,t){for(var a=[],r=0;r<50;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:30*Math.random()+10,type:Math.floor(3*Math.random()),rotation:Math.random()*Math.PI*2,speed:.5*Math.random()+.1,color:"hsl(".concat(360*Math.random(),", 70%, 50%)")});return function(){t.clearRect(0,0,e.width,e.height),a.forEach((function(a){switch(t.save(),t.translate(a.x,a.y),t.rotate(a.rotation),t.fillStyle=a.color,a.type){case 0:t.fillRect(-a.size/2,-a.size/2,a.size,a.size);break;case 1:t.beginPath(),t.arc(0,0,a.size/2,0,2*Math.PI),t.fill();break;case 2:t.beginPath(),t.moveTo(0,-a.size/2),t.lineTo(a.size/2,a.size/2),t.lineTo(-a.size/2,a.size/2),t.closePath(),t.fill()}t.restore(),a.rotation+=.05*a.speed,a.y+=a.speed,a.y>e.height+a.size&&(a.y=-a.size,a.x=Math.random()*e.width)}))}},z=function(e,t){for(var a=[],r=0;r<100;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:3*Math.random()+1,speed:.5*Math.random()+.1,brightness:Math.random(),angle:Math.random()*Math.PI*2});return function(){t.fillStyle="rgba(0, 0, 0, 0.1)",t.fillRect(0,0,e.width,e.height),a.forEach((function(a){a.brightness+=.1*Math.random()-.05,a.brightness=Math.max(0,Math.min(1,a.brightness)),t.beginPath(),t.arc(a.x,a.y,a.size,0,2*Math.PI),t.fillStyle="rgba(255, 255, 100, ".concat(a.brightness,")"),t.fill(),a.x+=Math.cos(a.angle)*a.speed,a.y+=Math.sin(a.angle)*a.speed,(a.x<0||a.x>e.width||a.y<0||a.y>e.height)&&(a.angle+=Math.PI),Math.random()<.01&&(a.angle=Math.random()*Math.PI*2)}))}},I=function(e,t){for(var a=Math.floor(e.width/20),r=[],n=0;n<a;n++)r[n]=Math.random()*e.height;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()_+[]{}|;:,.<>?";return function(){t.fillStyle="rgba(0, 0, 0, 0.05)",t.fillRect(0,0,e.width,e.height),t.fillStyle="#0F0",t.font="15px monospace";for(var a=0;a<r.length;a++){var n=i[Math.floor(85*Math.random())];t.fillText(n,20*a,20*r[a]),20*r[a]>e.height&&Math.random()>.975&&(r[a]=0),r[a]+=.6}}},F=function(e,t){var a=0;return function(){t.fillStyle="rgba(0, 0, 0, 0.1)",t.fillRect(0,0,e.width,e.height),t.save(),t.translate(e.width/2,e.height/2);for(var r=0;r<2;r++){t.beginPath();for(var n=-e.width/2;n<e.width/2;n+=10){var i=100+50*Math.sin(.01*n+a+r*Math.PI);t.lineTo(n,i)}t.strokeStyle=0===r?"rgba(255, 0, 0, 0.5)":"rgba(0, 0, 255, 0.5)",t.lineWidth=2,t.stroke();for(var o=-e.width/2;o<e.width/2;o+=40){var l=100+50*Math.sin(.01*o+a+r*Math.PI);t.fillStyle=0===r?"rgba(255, 255, 0, 0.8)":"rgba(0, 255, 0, 0.8)",t.beginPath(),t.arc(o,l,5,0,2*Math.PI),t.fill()}}t.restore(),a+=.02}},A=function(e,t){var a=[],r=[],n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,"#000000"),n.addColorStop(1,"#1a1a2e");for(var i=0;i<30;i++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,vx:.3*(Math.random()-.5),vy:.3*(Math.random()-.5),size:2*Math.random()+2});for(var o=0;o<a.length;o++)for(var l=o+1;l<a.length;l++)Math.random()<.2&&r.push([o,l]);return function(){t.fillStyle=n,t.fillRect(0,0,e.width,e.height),a.forEach((function(a,r){a.x+=a.vx,a.y+=a.vy,(a.x<0||a.x>e.width)&&(a.vx*=-1),(a.y<0||a.y>e.height)&&(a.vy*=-1),t.beginPath(),t.arc(a.x,a.y,a.size,0,2*Math.PI),t.fillStyle="hsl(".concat(12*r,", 100%, 50%)"),t.fill(),t.beginPath(),t.arc(a.x,a.y,a.size+3,0,2*Math.PI);var n=t.createRadialGradient(a.x,a.y,a.size,a.x,a.y,a.size+3);n.addColorStop(0,"hsla(".concat(12*r,", 100%, 50%, 0.8)")),n.addColorStop(1,"hsla(".concat(12*r,", 100%, 50%, 0)")),t.fillStyle=n,t.fill()})),r.forEach((function(r){var n=g(r,2),i=n[0],o=n[1],l=a[i].x-a[o].x,h=a[i].y-a[o].y,c=1-Math.sqrt(l*l+h*h)/Math.max(e.width,e.height);t.beginPath(),t.moveTo(a[i].x,a[i].y),t.lineTo(a[o].x,a[o].y),t.strokeStyle="rgba(255, 255, 255, ".concat(.2*c,")"),t.stroke()}));for(var i=0;i<5;i++)t.beginPath(),t.arc(Math.random()*e.width,Math.random()*e.height,1.5*Math.random(),0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, 0.5)",t.fill()}},O=function(e,t){var a=0,r=t.createLinearGradient(0,0,0,.6*e.height);r.addColorStop(0,"#87CEEB"),r.addColorStop(1,"#E0F6FF");var n={x:.8*e.width,y:.2*e.height,radius:40,glow:20},i=[{x:.1*e.width,y:.15*e.height,radius:30},{x:.3*e.width,y:.1*e.height,radius:40},{x:.6*e.width,y:.2*e.height,radius:35}];return function(){t.fillStyle=r,t.fillRect(0,0,e.width,.6*e.height),t.save(),t.beginPath(),t.arc(n.x,n.y,n.radius,0,2*Math.PI);var o=t.createRadialGradient(n.x,n.y,n.radius-n.glow,n.x,n.y,n.radius+n.glow);o.addColorStop(0,"rgba(255, 255, 0, 1)"),o.addColorStop(.8,"rgba(255, 255, 0, 0.3)"),o.addColorStop(1,"rgba(255, 255, 0, 0)"),t.fillStyle=o,t.fill(),t.restore(),i.forEach((function(e){t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, 0.8)",t.fill()}));for(var l=0;l<7;l++){t.beginPath(),t.moveTo(0,e.height);for(var h=0;h<=e.width;h+=5){var c=30*Math.sin(.02*h+a+.5*l)*(1+.1*l)+(e.height-(l+1)*(.4*e.height/7));t.lineTo(h,c)}t.lineTo(e.width,e.height);var d=t.createLinearGradient(0,0,0,e.height);d.addColorStop(0,"rgba(0, 100, 255, ".concat(.1+l/7*.15,")")),d.addColorStop(1,"rgba(0, 50, 200, ".concat(.1+l/7*.15,")")),t.fillStyle=d,t.fill()}a+=.03}},L=function(e,t){var a=[],r=t.createLinearGradient(0,0,0,e.height);r.addColorStop(0,"#0c1445"),r.addColorStop(1,"#1c2754");for(var n={x:.8*e.width,y:.2*e.height,radius:50,glow:20},i=[{points:[[0,e.height],[.3*e.width,.7*e.height],[.5*e.width,e.height]],color:"#0a1128"},{points:[[.4*e.width,e.height],[.7*e.width,.75*e.height],[e.width,e.height]],color:"#0d1636"}],o=0;o<200;o++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,vx:1.5*(Math.random()-.5),vy:1*Math.random()+.5,size:3*Math.random()+1,opacity:.5*Math.random()+.5});return function(){t.fillStyle=r,t.fillRect(0,0,e.width,e.height),t.save(),t.beginPath(),t.arc(n.x,n.y,n.radius,0,2*Math.PI);var o=t.createRadialGradient(n.x,n.y,n.radius-n.glow,n.x,n.y,n.radius+n.glow);o.addColorStop(0,"rgba(255, 255, 230, 1)"),o.addColorStop(.5,"rgba(255, 255, 230, 0.3)"),o.addColorStop(1,"rgba(255, 255, 230, 0)"),t.fillStyle=o,t.fill(),t.restore(),i.forEach((function(e){t.beginPath(),t.moveTo(e.points[0][0],e.points[0][1]),e.points.forEach((function(e){return t.lineTo(e[0],e[1])})),t.fillStyle=e.color,t.fill()})),a.forEach((function(a){a.x+=a.vx+.3*Math.sin(.01*a.y),a.y+=a.vy,a.y>e.height&&(a.x=Math.random()*e.width,a.y=-a.size,a.vx=1.5*(Math.random()-.5),a.vy=1*Math.random()+.5),t.beginPath(),t.arc(a.x,a.y,a.size,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, ".concat(a.opacity,")"),t.fill()})),t.fillStyle="rgba(255, 255, 255, 0.03)",t.fillRect(0,0,e.width,e.height)}},j=function(e,t){for(var a=[],r=[],n=0;n<5;n++)r.push({x:Math.random()*e.width,y:e.height,height:200*Math.random()+300,width:100*Math.random()+50});for(var i=0;i<100;i++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:2*Math.random()+1,speed:.5*Math.random()+.1,angle:Math.random()*Math.PI*2,angleSpeed:.01*(Math.random()-.5),glowIntensity:Math.random()});return function(){t.fillStyle="rgba(0, 0, 20, 0.1)",t.fillRect(0,0,e.width,e.height),r.forEach((function(e){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(e.x-e.width/2,e.y-e.height),t.lineTo(e.x+e.width/2,e.y-e.height),t.closePath(),t.fillStyle="rgba(0, 50, 0, 0.8)",t.fill()})),a.forEach((function(a){a.x+=Math.cos(a.angle)*a.speed,a.y+=Math.sin(a.angle)*a.speed,a.angle+=a.angleSpeed,(a.x<0||a.x>e.width)&&(a.angle=Math.PI-a.angle),(a.y<0||a.y>e.height)&&(a.angle=-a.angle),a.glowIntensity=.5*Math.sin(.002*Date.now()+.1*a.x)+.5,t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fillStyle="rgba(255, 255, 100, ".concat(a.glowIntensity,")"),t.fill(),t.beginPath(),t.arc(a.x,a.y,3*a.radius,0,2*Math.PI);var r=t.createRadialGradient(a.x,a.y,0,a.x,a.y,3*a.radius);r.addColorStop(0,"rgba(255, 255, 100, ".concat(.5*a.glowIntensity,")")),r.addColorStop(1,"rgba(255, 255, 100, 0)"),t.fillStyle=r,t.fill()}))}},B=function(e,t){var a,r=[];function n(e,t){for(var a=Math.floor(50*Math.random())+50,r=[],n=0;n<a;n++)r.push({x:e+200*Math.random()-100,y:t+100*Math.random()-50,radius:30*Math.random()+10});return{particles:r,x:e,y:t,speed:.5*Math.random()+.1}}for(var i=0;i<10;i++)r.push(n(Math.random()*e.width,Math.random()*(e.height/2)));var o=function(){a=e.height;var r=t.createLinearGradient(0,0,0,a);return r.addColorStop(0,"#1e90ff"),r.addColorStop(.5,"#87ceeb"),r.addColorStop(1,"#e6f3ff"),r},l=o();return function(){a!==e.height&&(l=o()),t.fillStyle=l,t.fillRect(0,0,e.width,e.height),r.forEach((function(a){a.x+=a.speed,a.x>e.width+200&&(a.x=-200),t.save(),t.translate(a.x,a.y),a.particles.forEach((function(e){t.beginPath(),t.arc(e.x+5,e.y+5,e.radius,0,2*Math.PI),t.fillStyle="rgba(0, 0, 0, 0.1)",t.fill()})),a.particles.forEach((function(e){t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI);var a=t.createRadialGradient(e.x,e.y,0,e.x,e.y,e.radius);a.addColorStop(0,"rgba(255, 255, 255, 0.8)"),a.addColorStop(1,"rgba(255, 255, 255, 0.2)"),t.fillStyle=a,t.fill()})),t.restore()}));t.beginPath(),t.arc(e.width-100,100,40,0,2*Math.PI);var n=t.createRadialGradient(e.width-100,100,0,e.width-100,100,60);n.addColorStop(0,"rgba(255, 255, 200, 1)"),n.addColorStop(.8,"rgba(255, 255, 0, 0.3)"),n.addColorStop(1,"rgba(255, 255, 0, 0)"),t.fillStyle=n,t.fill()}},W=function(e,t){var a,r=[],n=["#ff6b6b","#feca57","#ff9ff3","#ff9f43","#e17055"],i=["1.jpg","2.jpg"],o=[],l=!1;a=0,i.forEach((function(e,t){var r=new Image;r.onload=function(){o[t]=r,++a===i.length&&(l=!0)},r.onerror=function(){++a===i.length&&(l=!0)},r.src=e}));for(var h=0;h<100;h++)r.push({x:Math.random()*e.width,y:Math.random()*e.height,size:20*Math.random()+10,speed:2*Math.random()+1,amplitude:20*Math.random()+10,angle:Math.random()*Math.PI*2,angleSpeed:.05*(Math.random()-.5),imageIndex:Math.floor(Math.random()*i.length),color:n[Math.floor(Math.random()*n.length)]});return function(){t.fillStyle="rgba(135, 206, 235, 0.1)",t.fillRect(0,0,e.width,e.height),r.forEach((function(a){a.y+=a.speed,a.x+=Math.sin(.01*a.y)*a.amplitude*.05,a.angle+=a.angleSpeed,a.y>e.height&&(a.y=-a.size,a.x=Math.random()*e.width),function(e){t.save(),t.translate(e.x,e.y),t.rotate(e.angle),l&&o[e.imageIndex]?t.drawImage(o[e.imageIndex],-e.size/2,-e.size/2,e.size,e.size):(t.beginPath(),t.ellipse(0,0,e.size/2,e.size/4,0,0,2*Math.PI),t.fillStyle=e.color,t.fill()),t.restore()}(a)}))}},G=function(e,t){for(var a=[],r=[],n=0;n<1e3;n++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,length:20*Math.random()+10,speed:10*Math.random()+15});return function(){t.fillStyle="rgba(0, 0, 0, 0.1)",t.fillRect(0,0,e.width,e.height),t.strokeStyle="rgba(174, 194, 224, 0.5)",t.lineWidth=1,a.forEach((function(a){t.beginPath(),t.moveTo(a.x,a.y),t.lineTo(a.x,a.y+a.length),t.stroke(),a.y+=a.speed,a.y>e.height&&(a.y=-a.length,r.push({x:a.x,y:e.height,radius:3*Math.random()+1,opacity:1}))})),r.forEach((function(e,a){t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI),t.fillStyle="rgba(174, 194, 224, ".concat(e.opacity,")"),t.fill(),e.radius+=.1,e.opacity-=.03,e.opacity<=0&&r.splice(a,1)}))}},Y=function(e,t){for(var a=[],r=["🍔","🍕","🌭","🍟","🌮","🍣","🍩","🍦","🍎","🍇","🍓","🍑","🍍","🥑","🥕","🥪","🥨","🧀","🥐","🥯","🍱","🍜","🍙","🍗","🥟","🥘","🍤","🥞","🧇","🥓"],n=[{r:255,g:102,b:102},{r:255,g:178,b:102},{r:255,g:255,b:153},{r:153,g:255,b:153},{r:153,g:204,b:255},{r:178,g:102,b:255},{r:255,g:153,b:255}],i=0,o=1,l=0,h=0;h<50;h++)a.push({x:Math.random()*e.width,y:Math.random()*e.height-e.height,emoji:r[Math.floor(Math.random()*r.length)],size:20*Math.random()+30,speed:1.5*Math.random()+.5,rotation:Math.random()*Math.PI*2,rotationSpeed:.02*(2*Math.random()-1)});return function(){(l+=.005)>=1&&(l=0,i=o,o=(o+1)%n.length);var r,h,c,d=(r=n[i],h=n[o],c=l,{r:Math.round(r.r+(h.r-r.r)*c),g:Math.round(r.g+(h.g-r.g)*c),b:Math.round(r.b+(h.b-r.b)*c)}),s=t.createLinearGradient(0,0,e.width,e.height);s.addColorStop(0,"rgb(".concat(d.r,", ").concat(d.g,", ").concat(d.b,")")),s.addColorStop(1,"rgb(".concat(255-d.r,", ").concat(255-d.g,", ").concat(255-d.b,")")),t.filter="blur(5px)",t.fillStyle=s,t.fillRect(0,0,e.width,e.height),t.filter="none",a.forEach((function(a){t.save(),t.translate(a.x,a.y),t.rotate(a.rotation),t.font="".concat(a.size,"px Arial"),t.textAlign="center",t.textBaseline="middle",t.strokeStyle="white",t.lineWidth=3,t.strokeText(a.emoji,0,0),t.fillStyle="black",t.fillText(a.emoji,0,0),t.restore(),a.y+=a.speed,a.rotation+=a.rotationSpeed,a.y>e.height+a.size&&(a.y=-a.size,a.x=Math.random()*e.width)}))}},X=function(e,t){for(var a=[],r=[],n=[],i=0;i<20;i++)a.push({x:Math.random()*e.width,height:200*Math.random()+100,width:20*Math.random()+10});for(var o=0;o<50;o++)r.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:2*Math.random()+1,speed:.5*Math.random()+.1,opacity:Math.random()});for(var l=0;l<100;l++)n.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:50*Math.random()+20,speed:.2*Math.random()+.1});return function(){t.fillStyle="#0a0a0a",t.fillRect(0,0,e.width,e.height),t.fillStyle="#1a1a1a",a.forEach((function(a){t.beginPath(),t.moveTo(a.x,e.height),t.lineTo(a.x-a.width/2,e.height-a.height),t.lineTo(a.x+a.width/2,e.height-a.height),t.closePath(),t.fill()})),t.fillStyle="rgba(200, 200, 200, 0.05)",n.forEach((function(a){t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fill(),a.x+=a.speed,a.x>e.width+a.radius&&(a.x=-a.radius)})),r.forEach((function(a){t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fillStyle="rgba(255, 255, 100, ".concat(a.opacity,")"),t.fill(),a.x+=Math.sin(.001*Date.now())*a.speed,a.y+=Math.cos(.001*Date.now())*a.speed,a.opacity=.5*Math.sin(.01*Date.now())+.5,a.x<0&&(a.x=e.width),a.x>e.width&&(a.x=0),a.y<0&&(a.y=e.height),a.y>e.height&&(a.y=0)}))}},D=function(e,t){for(var a=[],r=0;r<5;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:50*Math.random()+30,speed:.5*Math.random()+.1,opacity:.5*Math.random()});return function(){t.fillStyle="#000033",t.fillRect(0,0,e.width,e.height),a.forEach((function(a){t.beginPath(),t.moveTo(a.x,a.y),t.bezierCurveTo(a.x-a.size/2,a.y-a.size/2,a.x-a.size/2,a.y+a.size/2,a.x,a.y+a.size),t.bezierCurveTo(a.x+a.size/2,a.y+a.size/2,a.x+a.size/2,a.y-a.size/2,a.x,a.y);var r=t.createRadialGradient(a.x,a.y,0,a.x,a.y,a.size);r.addColorStop(0,"rgba(255, 255, 255, ".concat(a.opacity,")")),r.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=r,t.fill(),a.y-=a.speed,a.opacity=.2*Math.sin(.001*Date.now())+.3,a.y+a.size<0&&(a.y=e.height+a.size,a.x=Math.random()*e.width)}))}},N=function(e,t){for(var a=[],r=0;r<20;r++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:100*Math.random()+50,rotation:Math.random()*Math.PI*2});return function(){t.clearRect(0,0,e.width,e.height),a.forEach((function(e){!function(e,a,r,n){t.save(),t.translate(e,a),t.rotate(n),t.beginPath();for(var i=0;i<8;i++){var o=2*Math.PI/8*i;t.moveTo(0,0),t.lineTo(Math.cos(o)*r,Math.sin(o)*r)}for(var l=r/4;l<r;l+=r/4){t.moveTo(l,0);for(var h=1;h<8;h++){var c=2*Math.PI/8*h;t.lineTo(Math.cos(c)*l,Math.sin(c)*l)}t.closePath()}t.strokeStyle="rgba(255, 255, 255, 0.1)",t.stroke(),t.restore()}(e.x,e.y,e.size,e.rotation)}))}},q=function(e,t){for(var a=[],r=[],n=[],i=0;i<15;i++)a.push({x:Math.random()*e.width,y:e.height-100*Math.random()-50,width:30*Math.random()+20,height:40*Math.random()+30});for(var o=0;o<10;o++)r.push({x:Math.random()*e.width,y:e.height,speed:.5*Math.random()+.1,size:30*Math.random()+20});for(var l=0;l<50;l++)n.push({x:Math.random()*e.width,y:Math.random()*e.height,radius:100*Math.random()+50,speed:.2*Math.random()+.1});return function(){var i=t.createLinearGradient(0,0,0,e.height);i.addColorStop(0,"#0a0a1a"),i.addColorStop(1,"#1a0a1a"),t.fillStyle=i,t.fillRect(0,0,e.width,e.height),t.beginPath(),t.arc(.8*e.width,.2*e.height,40,0,2*Math.PI),t.fillStyle="rgba(255, 255, 200, 0.8)",t.fill(),t.fillStyle="#333",a.forEach((function(e){t.fillRect(e.x,e.y,e.width,e.height),t.fillStyle="#222",t.fillRect(e.x+.1*e.width,e.y,.8*e.width,.1*e.height)})),r.forEach((function(a){t.beginPath(),t.arc(a.x,a.y-a.size,.5*a.size,0,2*Math.PI),t.fillStyle="#3a5",t.fill(),t.beginPath(),t.moveTo(a.x,a.y-a.size),t.lineTo(a.x-.5*a.size,a.y),t.lineTo(a.x+.5*a.size,a.y),t.closePath(),t.fillStyle="#3a5",t.fill(),a.y-=a.speed,a.y<.7*e.height&&(a.y=e.height,a.x=Math.random()*e.width)})),t.fillStyle="rgba(255, 255, 255, 0.05)",n.forEach((function(a){t.beginPath(),t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.fill(),a.x+=a.speed,a.x>e.width+a.radius&&(a.x=-a.radius)}))}},H=function(e,t){for(var a=[],r=[],n=0;n<200;n++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,length:20*Math.random()+10,speed:5*Math.random()+5});return function(){t.fillStyle="rgba(20, 0, 0, 0.1)",t.fillRect(0,0,e.width,e.height),t.strokeStyle="#800",t.lineWidth=1,a.forEach((function(a){t.beginPath(),t.moveTo(a.x,a.y),t.lineTo(a.x,a.y+a.length),t.stroke(),a.y+=a.speed,a.y>e.height&&(a.y=0,a.x=Math.random()*e.width,r.push({x:a.x,y:e.height,size:5*Math.random()+2,opacity:1}))})),r.forEach((function(e,a){t.beginPath(),t.arc(e.x,e.y,e.size,0,2*Math.PI),t.fillStyle="rgba(128, 0, 0, ".concat(e.opacity,")"),t.fill(),e.opacity-=.005,e.opacity<=0&&r.splice(a,1)}))}},_=function(e,t){for(var a=[],r=[],n=0;n<50;n++)a.push({x:Math.random()*e.width,y:Math.random()*e.height,size:5*Math.random()+2,speedX:2*Math.random()-1,speedY:2*Math.random()-1});for(var i=0;i<20;i++)r.push({x:Math.random()*e.width,y:Math.random()*e.height});return function(){t.fillStyle="rgba(0, 0, 0, 0.1)",t.fillRect(0,0,e.width,e.height),t.strokeStyle="rgba(255, 255, 255, 0.1)",t.beginPath(),r.forEach((function(e,a){r.slice(a+1).forEach((function(a){t.moveTo(e.x,e.y),t.lineTo(a.x,a.y)}))})),t.stroke(),t.fillStyle="#400",a.forEach((function(a){t.beginPath(),t.arc(a.x,a.y,a.size,0,2*Math.PI),t.fill(),a.x+=a.speedX,a.y+=a.speedY,(a.x<0||a.x>e.width)&&(a.speedX*=-1),(a.y<0||a.y>e.height)&&(a.speedY*=-1),Math.random()<.01&&(a.speedX=2*Math.random()-1,a.speedY=2*Math.random()-1)}))}},U=function(e){function t(){var e;i(this,t);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return h(e=n(this,t,[].concat(r)),"state",{hasError:!1}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,a["default"].Component),l(t,[{key:"render",value:function(){return this.state.hasError?a.default.createElement("span",null,"Animation failed to load."):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0}}}])}(),J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=t.sampleSize,r=void 0===a?60:a,n=t.warningThreshold,i=void 0===n?30:n;t.autoOptimize;var o=g(e.useState(60),2),l=o[0],h=o[1],c=g(e.useState(60),2),d=c[0],s=c[1],f=g(e.useState(0),2),u=f[0],m=f[1],y=g(e.useState([]),2),p=y[0],v=y[1],b=e.useRef(0),M=e.useRef(performance.now()),w=e.useRef([]),x=e.useRef(new Set),S=e.useCallback((function(e){return e>=55?"excellent":e>=40?"good":e>=25?"fair":"poor"}),[]),P=e.useCallback((function(){var e=performance.now(),t=e-M.current;if(t>=1e3){var a=Math.round(1e3*b.current/t);h(a),w.current.push(a),w.current.length>r&&w.current.shift();var n=w.current.reduce((function(e,t){return e+t}),0)/w.current.length;s(Math.round(n));var o=new Set(x.current);if(a<i?o.add("Low FPS detected: ".concat(a)):o.delete("Low FPS detected: ".concat(a)),t>100&&o.add("Frame rendering lag detected"),performance.memory){var l=Math.round(performance.memory.usedJSHeapSize/1024/1024);m(l),l>100&&o.add("High memory usage: ".concat(l,"MB"))}x.current=o,v(Array.from(o)),b.current=0,M.current=e}}),[r,i]),E=e.useCallback((function(){b.current++,P()}),[P]),C=e.useCallback((function(){var e=[];return d<30&&(e.push("Reduce animation complexity"),e.push("Lower FPS target"),e.push("Use simpler blend modes")),u>100&&(e.push("Reduce particle count"),e.push("Optimize canvas size")),e}),[d,u]),k=S(d);return{fps:l,avgFps:d,memoryUsage:u,performanceLevel:k,warnings:p,isOptimal:"excellent"===k||"good"===k,recordFrame:E,getOptimizationSuggestions:C,reset:function(){w.current=[],v([]),x.current.clear()}}},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.effect,r=void 0===a?"attract":a,n=t.strength,i=void 0===n?.5:n,o=t.radius,l=void 0===o?100:o,h=t.continuous,c=void 0!==h&&h,d=!1,s=[],f=new Map,u=function(t){var a=e.getBoundingClientRect(),r=e.width/a.width,n=e.height/a.height;if(t.type.startsWith("touch")){var i=t.touches[0]||t.changedTouches[0];return{x:(i.clientX-a.left)*r,y:(i.clientY-a.top)*n,force:i.force||.5,type:"touch"}}return{x:(t.clientX-a.left)*r,y:(t.clientY-a.top)*n,force:.5,type:"mouse"}},g=function(e){d=!0;var t=u(e);t&&(s=[t])},m=function(e){if(d||c){var t=u(e);t&&(s=[t])}},y=function(){d=!1,c||(s=[])},p=function(t){t.preventDefault(),Array.from(t.touches).forEach((function(t,a){var r={x:(t.clientX-e.getBoundingClientRect().left)*(e.width/e.getBoundingClientRect().width),y:(t.clientY-e.getBoundingClientRect().top)*(e.height/e.getBoundingClientRect().height),force:t.force||.5,type:"touch"};f.set(t.identifier,r)})),s=Array.from(f.values())},v=function(t){t.preventDefault(),Array.from(t.touches).forEach((function(t){var a={x:(t.clientX-e.getBoundingClientRect().left)*(e.width/e.getBoundingClientRect().width),y:(t.clientY-e.getBoundingClientRect().top)*(e.height/e.getBoundingClientRect().height),force:t.force||.5,type:"touch"};f.set(t.identifier,a)})),s=Array.from(f.values())},b=function(e){e.preventDefault(),Array.from(e.changedTouches).forEach((function(e){f.delete(e.identifier)})),s=Array.from(f.values())};return{attachListeners:function(){e.addEventListener("mousedown",g),e.addEventListener("mousemove",m),e.addEventListener("mouseup",y),e.addEventListener("mouseleave",y),e.addEventListener("touchstart",p,{passive:!1}),e.addEventListener("touchmove",v,{passive:!1}),e.addEventListener("touchend",b,{passive:!1}),e.addEventListener("touchcancel",b,{passive:!1})},removeListeners:function(){e.removeEventListener("mousedown",g),e.removeEventListener("mousemove",m),e.removeEventListener("mouseup",y),e.removeEventListener("mouseleave",y),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",v),e.removeEventListener("touchend",b),e.removeEventListener("touchcancel",b)},calculateInteractionForce:function(e,t){var a=t.x-e.x,n=t.y-e.y,o=Math.sqrt(a*a+n*n);if(0===o||o>l)return{fx:0,fy:0,distance:o};var h=(1-o/l)*i*t.force;switch(r){case"attract":h*=1;break;case"repel":h*=-1;break;case"gravity":h*=1/(o*o+1);break;case"burst":h*=o<.3*l?-2:0;break;default:h=0}return{fx:a/o*h,fy:n/o*h,distance:o}},getInteractionPoints:function(){return s},isInteracting:function(){return d},updateConfig:function(e){Object.assign(t,e)}}},K={detectPinch:function(e){if(2!==e.touches.length)return null;var t=e.touches[0],a=e.touches[1];return{distance:Math.sqrt(Math.pow(a.clientX-t.clientX,2)+Math.pow(a.clientY-t.clientY,2)),centerX:(t.clientX+a.clientX)/2,centerY:(t.clientY+a.clientY)/2,rotation:Math.atan2(a.clientY-t.clientY,a.clientX-t.clientX)}},detectSwipe:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=t.x-e.x,n=t.y-e.y,i=Math.sqrt(r*r+n*n);if(i<a)return null;var o=Math.atan2(n,r)*(180/Math.PI);return{direction:o>=-45&&o<45?"right":o>=45&&o<135?"down":o>=135||o<-135?"left":"up",distance:i,deltaX:r,deltaY:n,velocity:i/(t.time-e.time)}}},Q={cyberpunk:{name:"Cyberpunk",colors:["#ff0080","#00ffff","#ff8000","#8000ff","#ff0040"],gradients:{primary:["#ff0080","#8000ff"],secondary:["#00ffff","#ff8000"],accent:["#ff0040","#ff0080"]},effects:{glow:"#00ffff",highlight:"#ff0080",shadow:"#000040"}},nature:{name:"Nature",colors:["#4a7c59","#a7d0cd","#f2e7d5","#6d9773","#99c7a1"],gradients:{primary:["#4a7c59","#99c7a1"],secondary:["#a7d0cd","#f2e7d5"],accent:["#6d9773","#a7d0cd"]},effects:{glow:"#a7d0cd",highlight:"#f2e7d5",shadow:"#2d4832"}},ocean:{name:"Ocean",colors:["#003d5c","#0074b7","#0099cc","#00bfff","#87ceeb"],gradients:{primary:["#003d5c","#0099cc"],secondary:["#0074b7","#87ceeb"],accent:["#00bfff","#87ceeb"]},effects:{glow:"#00bfff",highlight:"#87ceeb",shadow:"#001f2e"}},sunset:{name:"Sunset",colors:["#ff6b35","#f7931e","#ffd23f","#ee4266","#540d6e"],gradients:{primary:["#ff6b35","#ffd23f"],secondary:["#f7931e","#ee4266"],accent:["#ee4266","#540d6e"]},effects:{glow:"#ffd23f",highlight:"#ff6b35",shadow:"#2a0637"}},monochrome:{name:"Monochrome",colors:["#000000","#333333","#666666","#999999","#ffffff"],gradients:{primary:["#000000","#666666"],secondary:["#333333","#999999"],accent:["#666666","#ffffff"]},effects:{glow:"#ffffff",highlight:"#cccccc",shadow:"#000000"}},neon:{name:"Neon",colors:["#ff073a","#39ff14","#ffff00","#ff1493","#00ffff"],gradients:{primary:["#ff073a","#39ff14"],secondary:["#ffff00","#ff1493"],accent:["#ff1493","#00ffff"]},effects:{glow:"#39ff14",highlight:"#ffff00",shadow:"#0a0a0a"}},space:{name:"Space",colors:["#0b0c2a","#1b263b","#415a77","#778da9","#e0e1dd"],gradients:{primary:["#0b0c2a","#415a77"],secondary:["#1b263b","#778da9"],accent:["#415a77","#e0e1dd"]},effects:{glow:"#778da9",highlight:"#e0e1dd",shadow:"#050511"}},retro:{name:"Retro",colors:["#ff6b9d","#c44569","#f8b500","#40e0d0","#ee82ee"],gradients:{primary:["#ff6b9d","#f8b500"],secondary:["#c44569","#40e0d0"],accent:["#40e0d0","#ee82ee"]},effects:{glow:"#f8b500",highlight:"#ff6b9d",shadow:"#2d1b3d"}}},V={gaming:{name:"Gaming",colorScheme:Q.cyberpunk,animationSettings:{intensity:"high",speed:1.2,particleCount:150,glowEffect:!0},recommendedAnimations:["matrixRain","electricStorm","neonPulse","particleNetwork"]},portfolio:{name:"Portfolio",colorScheme:Q.monochrome,animationSettings:{intensity:"medium",speed:.8,particleCount:80,glowEffect:!1},recommendedAnimations:["geometricShapes","floatingBubbles","gradientWave"]},landing:{name:"Landing Page",colorScheme:Q.sunset,animationSettings:{intensity:"medium",speed:1,particleCount:100,glowEffect:!0},recommendedAnimations:["galaxySpiral","rainbowWaves","auroraBorealis"]},presentation:{name:"Presentation",colorScheme:Q.space,animationSettings:{intensity:"low",speed:.6,particleCount:50,glowEffect:!1},recommendedAnimations:["starryNight","cosmicDust","quantumField"]},wellness:{name:"Wellness",colorScheme:Q.nature,animationSettings:{intensity:"low",speed:.7,particleCount:60,glowEffect:!1},recommendedAnimations:["oceanWaves","autumnLeaves","fireflyForest"]},party:{name:"Party",colorScheme:Q.neon,animationSettings:{intensity:"high",speed:1.5,particleCount:200,glowEffect:!0},recommendedAnimations:["rainbowWaves","neonPulse","electricStorm"]}},Z=function(){return l((function e(){i(this,e),this.currentTheme=null,this.customThemes=new Map}),[{key:"applyTheme",value:function(e){var t=V[e]||this.customThemes.get(e);return t?(this.currentTheme=t,t):(console.warn('Theme "'.concat(e,'" not found. Using default.')),V.portfolio)}},{key:"getRandomColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"colors";if(!this.currentTheme)return"#ffffff";var t,a=this.currentTheme.colorScheme;switch(e){case"primary":t=a.gradients.primary;break;case"secondary":t=a.gradients.secondary;break;case"accent":t=a.gradients.accent;break;default:t=a.colors}return t[Math.floor(Math.random()*t.length)]}},{key:"createGradient",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"primary",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x1:0,y1:0,x2:0,y2:100};if(!this.currentTheme)return null;var r=this.currentTheme.colorScheme.gradients[t],n=e.createLinearGradient(a.x1,a.y1,a.x2,a.y2);return r.forEach((function(e,t){n.addColorStop(t/(r.length-1),e)})),n}},{key:"createCustomTheme",value:function(e,t){this.customThemes.set(e,t)}},{key:"getEffectColor",value:function(e){return this.currentTheme&&this.currentTheme.colorScheme.effects[e]||"#ffffff"}},{key:"getAnimationSettings",value:function(e){if(!this.currentTheme)return{};var t=this.currentTheme.animationSettings,a=f({},t);switch(e){case"particleNetwork":case"matrixRain":a.particleCount=Math.floor(1.2*t.particleCount);break;case"starryNight":case"cosmicDust":a.particleCount=Math.floor(.8*t.particleCount);break;case"electricStorm":case"neonPulse":a.glowEffect=!0,a.intensity="high"}return a}},{key:"getAvailableThemes",value:function(){return[].concat(m(Object.keys(V)),m(Array.from(this.customThemes.keys())))}},{key:"getRecommendedAnimations",value:function(){return this.currentTheme&&this.currentTheme.recommendedAnimations||[]}}])}(),ee=new Z,te=a.default.memo((function(t){var r=t.animationName,n=t.fallbackAnimation,i=void 0===n?"geometricShapes":n,o=t.fps,l=void 0===o?60:o,h=t.blendMode,c=void 0===h?"normal":h,d=t.style,s=t.interactive,u=void 0!==s&&s,g=t.interactionConfig,m=void 0===g?{}:g,y=t.theme;t.preset;var p=t.animationControls,U=t.enablePerformanceMonitoring,K=void 0!==U&&U,Q=t.adaptivePerformance,V=void 0!==Q&&Q,Z=e.useRef(null),te=e.useRef(null),ae=e.useRef(null),re=K?J():null;e.useEffect((function(){y&&ee.applyTheme(y)}),[y]);var ne=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=e.useMemo((function(){return{starryNight:v,floatingBubbles:b,gradientWave:M,particleNetwork:w,galaxySpiral:x,rainbowWaves:S,geometricShapes:T,fireflies:z,matrixRain:I,quantumField:R,electricStorm:k,cosmicDust:C,neonPulse:E,auroraBorealis:P,oceanWaves:O,neuralNetwork:A,dnaHelix:F,snowFall:L,realisticRain:G,realisticClouds:B,fireflyForest:j,autumnLeaves:W,fallingFoodFiesta:Y,hauntedForest:X,ghostlyApparitions:D,spiderwebOverlay:N,undeadGraveyard:q,bloodRain:H,creepyCrawlies:_}}),[]),oe=e.useCallback((function(){var e=Z.current,t=e.getContext("2d");e.width=window.innerWidth,e.height=window.innerHeight,t.globalCompositeOperation=ne.includes(c)?c:"normal";var a=ie[r];a||(console.warn('Animation "'.concat(r,'" not found. Using fallback animation.')),a=ie[i]||ie.geometricShapes),u&&!ae.current&&(ae.current=$(e,m),ae.current.attachListeners());var n=y?ee.getAnimationSettings(r):{};return a(e,t,f({themeManager:y?ee:null,interactionHandler:ae.current,performanceMonitor:re,adaptivePerformance:V},n))}),[r,i,c,u,y,ie]);return e.useEffect((function(){var e=oe(),t=0,a=1e3/l;return te.current=requestAnimationFrame((function r(n){if(!p||p.isPlaying){te.current=requestAnimationFrame(r);var i=n-t,o=p?p.speed:1,l=a/o;if(i>=l&&(t=n-i%l,re&&re.recordFrame(),e(),V&&re)){var h=re.avgFps;"poor"===re.performanceLevel&&h<20&&console.warn("Poor performance detected. Consider reducing animation complexity.")}}else te.current=requestAnimationFrame(r)})),function(){te.current&&cancelAnimationFrame(te.current)}}),[oe,l,p]),e.useEffect((function(){var e=function(){Z.current&&(Z.current.width=window.innerWidth,Z.current.height=window.innerHeight,oe())};return window.addEventListener("resize",e),function(){ae.current&&ae.current.removeListeners(),window.removeEventListener("resize",e)}}),[oe]),a.default.createElement("canvas",{ref:Z,style:f({position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:-1},d)})}));exports.AnimatedBackground=te,exports.AnimatedText=function(t){var r=t.text,n=void 0===r?"":r,i=t.effect,o=void 0===i?"typewriter":i,l=t.config,h=void 0===l?{}:l,c=t.styles,d=void 0===c?{}:c,s=f({speed:100,loop:!1,delay:0,color:"currentColor"},h),u={base:{display:"inline-block",fontFamily:"inherit",color:s.color},typewriter:{whiteSpace:"pre",overflow:"hidden",borderRight:"0.15em solid currentColor"},fadeIn:{opacity:0,animation:"fadeIn 2s forwards"},bounce:{display:"inline-block"},glitch:{position:"relative",animation:"glitch 1s linear infinite"},rainbow:{background:"linear-gradient(to right, #6666ff, #0099ff , #00ff00, #ff3399, #6666ff)",backgroundSize:"400%",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",animation:"rainbow 8s ease infinite"}},m={typewriter:function(t){var r=g(e.useState(""),2),n=r[0],i=r[1],o=g(e.useState(!0),2),l=o[0],h=o[1];return e.useEffect((function(){if(t){var e=setTimeout((function e(){var a=0;i(""),h(!0);var r=setInterval((function(){try{a<t.length?(i((function(e){return e+t[a]})),a++):(h(!1),s.loop&&setTimeout(e,s.delay),clearInterval(r))}catch(e){console.error("Animation error:",e),clearInterval(r),h(!1)}}),s.speed);return r}),s.delay);return function(){return clearTimeout(e)}}h(!1)}),[t,s.loop,s.speed,s.delay]),a.default.createElement("span",{style:f(f(f(f({},u.base),u.typewriter),d),{},{borderRight:l?"0.15em solid currentColor":"none"}),"aria-label":t},n)},fadeIn:function(e){return a.default.createElement("span",{style:f(f(f({},u.base),u.fadeIn),d)},e)},bounce:function(e){return a.default.createElement("span",{style:f(f({},u.base),d)},e.split("").map((function(e,t){return a.default.createElement("span",{key:t,style:f(f({},u.bounce),{},{animation:"bounce 0.5s ease infinite",animationDelay:"".concat(.1*t,"s")})},e)})))},glitch:function(e){return a.default.createElement("span",{style:f(f(f({},u.base),u.glitch),d)},e,a.default.createElement("span",{className:"glitch-effect","data-text":e}))},rainbow:function(e){return a.default.createElement("span",{style:f(f(f({},u.base),u.rainbow),d)},e)}};e.useEffect((function(){var e=document.createElement("style");return e.textContent="\n @keyframes fadeIn {\n to { opacity: 1; }\n }\n @keyframes bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-10px); }\n }\n @keyframes glitch {\n 2%, 64% { transform: translate(2px,0) skew(0deg); }\n 4%, 60% { transform: translate(-2px,0) skew(0deg); }\n 62% { transform: translate(0,0) skew(5deg); }\n }\n @keyframes rainbow { \n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e),function(){return document.head.removeChild(e)}}),[]);var y="string"==typeof n?n:String(n||""),p=m.hasOwnProperty(o)?o:"typewriter";return a.default.createElement(U,null,m[p](y))},exports.COLOR_SCHEMES=Q,exports.GestureRecognizer=K,exports.LayeredBackground=function(t){var r=t.layers,n=void 0===r?[]:r,i=t.fps,o=void 0===i?60:i,l=t.style;t.enablePerformanceMonitoring;var h=e.useRef(null),c=e.useRef(null),d=e.useRef([]),s={starryNight:v,floatingBubbles:b,gradientWave:M,particleNetwork:w,galaxySpiral:x,rainbowWaves:S,geometricShapes:T,fireflies:z,matrixRain:I,quantumField:R,electricStorm:k,cosmicDust:C,neonPulse:E,auroraBorealis:P,oceanWaves:O,neuralNetwork:A,dnaHelix:F,snowFall:L,realisticRain:G,realisticClouds:B,fireflyForest:j,autumnLeaves:W,fallingFoodFiesta:Y,hauntedForest:X,ghostlyApparitions:D,spiderwebOverlay:N,undeadGraveyard:q,bloodRain:H,creepyCrawlies:_},u=e.useCallback((function(){var e=h.current;return e.getContext("2d"),e.width=window.innerWidth,e.height=window.innerHeight,d.current=n.map((function(t,a){var r=s[t.animation];if(!r)return console.warn('Animation "'.concat(t.animation,'" not found in layer ').concat(a)),null;var n=document.createElement("canvas");n.width=e.width,n.height=e.height;var i=n.getContext("2d");return{canvas:n,ctx:i,animation:r(n,i,t.config||{}),opacity:t.opacity||1,blendMode:t.blendMode||"normal",speed:t.speed||1,lastUpdate:0}})).filter(Boolean),d.current}),[n]),g=e.useCallback((function(e){var t=h.current,a=t.getContext("2d");a.clearRect(0,0,t.width,t.height),d.current.forEach((function(t,r){n[r];var i=1e3/o/t.speed;e-t.lastUpdate>=i&&(t.ctx.clearRect(0,0,t.canvas.width,t.canvas.height),t.animation(),t.lastUpdate=e),a.save(),a.globalAlpha=t.opacity,a.globalCompositeOperation=t.blendMode,a.drawImage(t.canvas,0,0),a.restore()}))}),[n,o]);return e.useEffect((function(){u();var e;e=0,c.current=requestAnimationFrame((function t(a){c.current=requestAnimationFrame(t),a-e>=16&&(g(a),e=a)}));var t=function(){h.current&&(h.current.width=window.innerWidth,h.current.height=window.innerHeight,u())};return window.addEventListener("resize",t),function(){c.current&&cancelAnimationFrame(c.current),window.removeEventListener("resize",t)}}),[u,g]),a.default.createElement("canvas",{ref:h,style:f({position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:-1},l)})},exports.THEMES=V,exports.ThemeManager=Z,exports.auroraBorealis=P,exports.bloodRain=H,exports.cosmicDust=C,exports.createInteractionHandler=$,exports.creepyCrawlies=_,exports.electricStorm=k,exports.fallingFoodFiesta=Y,exports.fireflies=z,exports.floatingBubbles=b,exports.galaxySpiral=x,exports.geometricShapes=T,exports.ghostlyApparitions=D,exports.gradientWave=M,exports.hauntedForest=X,exports.matrixRain=I,exports.neonPulse=E,exports.particleNetwork=w,exports.quantumField=R,exports.rainbowWaves=S,exports.spiderwebOverlay=N,exports.starryNight=v,exports.themeManager=ee,exports.undeadGraveyard=q,exports.useAnimationControls=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=t.initialSpeed,r=void 0===a?1:a,n=t.autoPlay,i=void 0===n||n,o=g(e.useState(i),2),l=o[0],h=o[1],c=g(e.useState(r),2),d=c[0],s=c[1],f=e.useRef(null),u=e.useRef(0);return{isPlaying:l,speed:d,play:e.useCallback((function(){h(!0)}),[]),pause:e.useCallback((function(){h(!1)}),[]),reset:e.useCallback((function(){h(!1),u.current=0}),[]),setSpeed:e.useCallback((function(e){var t=Math.max(.1,Math.min(5,e));s(t)}),[]),toggle:e.useCallback((function(){h((function(e){return!e}))}),[]),animationRef:f,lastTimeRef:u}},exports.usePerformanceMonitor=J;
//# sourceMappingURL=index.js.map