{"version":3,"file":"AmbientGradient.EL28vbWL.mjs","names":["useState","useRef","React","useCallback","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,YAAU,GAAK,eAAa,GAAK,QAAM,KAAK,aAAW,GAAG,eAAa,EAAE,SAAO,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAC,CAAO,EAAUC,EAAO,EAAE,CAEpR,EAAqBC,EAAM,YAAuB,IAAS,OAAmB,GAAY,CAAC,EAAO,WAAW,0CAA0C,CAAC,QAAU,EAAE,CAAC,CAAO,EAAc,CAAC,GAAU,CAAC,EAA2B,EAAWC,MAAgB,CAAC,GAAG,CAAC,EAAc,OAAO,IAAM,EAAI,KAAK,KAAK,CAEhT,GAFoT,EAAI,EAAU,QAAQ,MAC1U,EAAU,QAAQ,EACf,EAAM,QAAQ,KAAmB,OAAO,IAAM,EAAS,MAAM,KAAK,CAAC,OAAO,EAAW,CAAC,CAAC,SAAS,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,IAAI,EAAE,CAAC,MAAoB,CAAC,EAAS,GAAM,CAAC,GAAG,EAAK,GAAG,EAAS,CAAC,EAAG,EAAG,CAAC,EAAc,EAAW,EAAa,EAAM,OA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