{"version":3,"file":"AmbientGradient.B3jvWvKA.mjs","names":["e","_Fragment"],"sources":["https:/framerusercontent.com/modules/cmdeh2CTBgOuzWeKggAI/Rwdk8rmT78H8aOS3inGi/AmbientGradient.js"],"sourcesContent":["// Ambient gradient background with emoji burst animation\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import React,{useEffect,useState,useCallback,useRef,startTransition}from\"react\";// Module-level counter for unique IDs\nlet globalDropId=0;/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function AmbientGradient(props){const{color1=\"#EEF4A9\",color2=\"#FFFFFF\",speed=12,autoBurst=true,burstOnClick=true,emoji=\"😍\",emojiCount=20,fallDuration=6,style}=props;const isStatic=useIsStaticRenderer();const[drops,setDrops]=useState([]);const lastBurst=useRef(0);const maxConcurrentDrops=100// Prevent performance issues\n;// Check for reduced motion preference\nconst prefersReducedMotion=React.useMemo(()=>{if(typeof window===\"undefined\")return false;return!window.matchMedia(\"(prefers-reduced-motion: no-preference)\").matches;},[]);const shouldAnimate=!isStatic&&!prefersReducedMotion;const spawnBurst=useCallback(()=>{if(!shouldAnimate)return;const now=Date.now();if(now-lastBurst.current<500)return;// 0.5s guard\nlastBurst.current=now;// Prevent too many concurrent drops\nif(drops.length>=maxConcurrentDrops)return;const newDrops=Array.from({length:emojiCount}).map(()=>({id:++globalDropId,left:Math.random()*100,delay:Math.random()*.5,duration:fallDuration*(.8+Math.random()*.4),size:2.5+Math.random()*1.5,rotation:Math.random()*360}));startTransition(()=>{setDrops(prev=>[...prev,...newDrops]);});},[shouldAnimate,emojiCount,fallDuration,drops.length]);const handleAnimationEnd=useCallback(dropId=>{startTransition(()=>{setDrops(prev=>prev.filter(drop=>drop.id!==dropId));});},[]);const handleClick=useCallback(()=>{if(burstOnClick&&shouldAnimate){spawnBurst();}},[burstOnClick,shouldAnimate,spawnBurst]);const handleKeyDown=useCallback(e=>{if((e.key===\"Enter\"||e.key===\" \")&&burstOnClick&&shouldAnimate){e.preventDefault();spawnBurst();}},[burstOnClick,shouldAnimate,spawnBurst]);// Auto burst on mount - only once\nuseEffect(()=>{if(autoBurst&&shouldAnimate){// Reset the guard for initial burst\nlastBurst.current=0;const timer=setTimeout(()=>{spawnBurst();},100);return()=>clearTimeout(timer);}},[autoBurst,shouldAnimate])// Removed spawnBurst from dependencies\n;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",background:`linear-gradient(270deg, ${color1} 0%, ${color2} 100%)`,backgroundSize:shouldAnimate?\"400% 400%\":\"100% 100%\",animation:shouldAnimate?`gradientMove ${speed}s ease-in-out infinite`:\"none\",cursor:burstOnClick&&shouldAnimate?\"pointer\":\"default\",...style},onClick:handleClick,onKeyDown:handleKeyDown,tabIndex:burstOnClick&&shouldAnimate?0:-1,role:burstOnClick&&shouldAnimate?\"button\":undefined,\"aria-label\":burstOnClick&&shouldAnimate?\"Trigger emoji burst\":undefined,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n          @keyframes gradientMove {\n            0%   { background-position: 0% 50%; }\n            50%  { background-position: 100% 50%; }\n            100% { background-position: 0% 50%; }\n          }\n          \n          @keyframes fallBurst {\n            0%   { \n              top: -10%; \n              transform: rotate(var(--start-rotation)); \n              opacity: 0; \n            }\n            10%  { opacity: 1; }\n            90%  { opacity: 1; }\n            100% { \n              top: 110%; \n              transform: rotate(calc(var(--start-rotation) + 360deg)); \n              opacity: 0; \n            }\n          }\n        `}),drops.map(drop=>/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:\"-10%\",left:`${drop.left}%`,fontSize:`${drop.size}rem`,userSelect:\"none\",pointerEvents:\"none\",filter:\"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15))\",// @ts-ignore\n    \"--start-rotation\":`${drop.rotation}deg`,animation:`fallBurst ${drop.duration}s cubic-bezier(.3,.6,.4,1) forwards`,animationDelay:`${drop.delay}s`,contain:\"layout style paint\",willChange:\"transform, opacity\"// Hint for GPU acceleration\n    },onAnimationEnd:()=>handleAnimationEnd(drop.id),children:emoji},drop.id)),isStatic&&(autoBurst||burstOnClick)&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:\"20%\",left:\"15%\",fontSize:\"3rem\",userSelect:\"none\",pointerEvents:\"none\",filter:\"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25))\",opacity:.8},children:emoji}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:\"60%\",left:\"70%\",fontSize:\"2.8rem\",userSelect:\"none\",pointerEvents:\"none\",filter:\"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25))\",opacity:.6},children:emoji}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:\"40%\",left:\"45%\",fontSize:\"3.2rem\",userSelect:\"none\",pointerEvents:\"none\",filter:\"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25))\",opacity:.7},children:emoji})]})]});}addPropertyControls(AmbientGradient,{color1:{type:ControlType.Color,title:\"Color 1\",defaultValue:\"#EEF4A9\"},color2:{type:ControlType.Color,title:\"Color 2\",defaultValue:\"#FFFFFF\"},speed:{type:ControlType.Number,title:\"Gradient Speed\",defaultValue:12,min:2,max:60,step:1,unit:\"s\"},autoBurst:{type:ControlType.Boolean,title:\"Auto Burst\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},burstOnClick:{type:ControlType.Boolean,title:\"Burst on Click\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},emoji:{type:ControlType.String,title:\"Emoji\",defaultValue:\"😍\",placeholder:\"😍\"},emojiCount:{type:ControlType.Number,title:\"Emoji Count\",defaultValue:20,min:5,max:50,step:1,hidden:({autoBurst,burstOnClick})=>!autoBurst&&!burstOnClick},fallDuration:{type:ControlType.Number,title:\"Fall Duration\",defaultValue:6,min:2,max:15,step:.5,unit:\"s\",hidden:({autoBurst,burstOnClick})=>!autoBurst&&!burstOnClick}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AmbientGradient\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AmbientGradient.map"],"mappings":"kXAKG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,SAAO,UAAU,SAAO,UAAU,QAAM,GAAG,aAAU,EAAK,gBAAa,EAAK,QAAM,KAAK,aAAW,GAAG,eAAa,EAAE,QAAM,CAAC,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAM,EAAS,CAAC,EAAS,CAAE,EAAC,CAAO,EAAU,EAAO,EAAE,CAAO,EAAmB,IAE9S,EAAqB,EAAM,QAAQ,IAAe,YAA4B,GAAa,EAAO,WAAW,0CAA0C,CAAC,QAAU,CAAE,EAAC,CAAO,GAAe,IAAW,EAA2B,EAAW,EAAY,IAAI,CAAC,IAAI,EAAc,OAAO,IAAM,EAAI,KAAK,KAAK,CAEhT,GAFoT,EAAI,EAAU,QAAQ,MAC1U,EAAU,QAAQ,EACf,EAAM,QAAQ,GAAmB,OAAO,IAAM,EAAS,MAAM,KAAK,CAAC,OAAO,CAAW,EAAC,CAAC,IAAI,KAAK,CAAC,GAAG,EAAE,EAAa,KAAK,KAAK,QAAQ,CAAC,IAAI,MAAM,KAAK,QAAQ,CAAC,GAAG,SAAS,GAAc,GAAG,KAAK,QAAQ,CAAC,IAAI,KAAK,IAAI,KAAK,QAAQ,CAAC,IAAI,SAAS,KAAK,QAAQ,CAAC,GAAI,GAAE,CAAC,EAAgB,IAAI,CAAC,EAAS,GAAM,CAAC,GAAG,EAAK,GAAG,CAAS,EAAC,AAAE,EAAC,AAAE,EAAC,CAAC,EAAc,EAAW,EAA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