{"version":3,"file":"GFFMotion.CW2-_GC8.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/TRRUpCsKwLJGuWCqGHRg/nz81JZ03nVNZFY5Bnx0t/GFFMotion.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{RenderTarget}from\"framer\";// ─── Movimento condiviso per le pagine interne ───────────────────────────────\n// Override da mettere su un contenitore (griglia, stack, elenco). Non tocca\n// testi ne' struttura: anima solo i figli che ci sono gia'.\n//   withCards  → i figli entrano in sequenza in prospettiva; col mouse hanno\n//                uno spotlight che segue il cursore e una leggera inclinazione\n//   withSteps  → i figli compaiono uno dopo l'altro, piu' distanziati\n//   withRise   → i figli salgono in dissolvenza (elenchi, blocchi di testo)\n// Tutto parte una volta sola, quando l'elemento entra nello schermo. Con\n// reduced motion, sul canvas e per cio' che e' gia' visibile al caricamento\n// non succede nulla: si vede subito lo stato finale.\nconst EASE=\"cubic-bezier(.16,1,.3,1)\";const STYLE_ID=\"gff-motion\";const CSS=`\n@property --gff-spot { syntax: \"<number>\"; inherits: false; initial-value: 0; }\n[data-gff-glow] {\n  background-image: radial-gradient(420px circle at var(--gff-mx, 50%) var(--gff-my, 0%), rgba(255,255,255,calc(var(--gff-spot) * .08)), transparent 60%);\n  transition: --gff-spot .35s ease, transform .6s ${EASE};\n}\n[data-gff-glow][data-gff-hover] { --gff-spot: 1; }\n`;const KEYFRAMES={cards:[{opacity:0,transform:\"perspective(1200px) translateY(32px) rotateX(10deg) scale(.97)\"},{opacity:1,transform:\"none\"}],steps:[{opacity:0,transform:\"translateY(18px) scale(.96)\"},{opacity:1,transform:\"none\"}],rise:[{opacity:0,transform:\"translateY(20px)\"},{opacity:1,transform:\"none\"}]};const TIMING={cards:{duration:850,stagger:90},steps:{duration:600,stagger:160},rise:{duration:700,stagger:70}};const allowed=()=>typeof window!==\"undefined\"&&RenderTarget.current()!==RenderTarget.canvas&&!window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches&&typeof IntersectionObserver!==\"undefined\";function injectStyle(){if(document.getElementById(STYLE_ID))return;const tag=document.createElement(\"style\");tag.id=STYLE_ID;tag.textContent=CSS;document.head.appendChild(tag);}// Entrata: i figli ancora sotto la piega partono nascosti e si animano quando\n// arrivano; quelli che entrano insieme si sfalsano tra loro.\nfunction reveal(container,kind){const items=Array.from(container.children).filter(el=>el instanceof HTMLElement&&el.getClientRects().length>0);const pending=items.filter(el=>el.getBoundingClientRect().top>window.innerHeight*.92);if(!pending.length)return()=>{};for(const el of pending)el.style.opacity=\"0\";const{duration,stagger}=TIMING[kind];const observer=new IntersectionObserver(entries=>{const now=entries.filter(e=>e.isIntersecting).map(e=>e.target);now.sort((a,b)=>pending.indexOf(a)-pending.indexOf(b));now.forEach((el,i)=>{observer.unobserve(el);el.style.opacity=\"\";el.animate(KEYFRAMES[kind],{duration,delay:i*stagger,easing:EASE,fill:\"backwards\"});});},{threshold:.15,rootMargin:\"0px 0px -8% 0px\"});pending.forEach(el=>observer.observe(el));return()=>{observer.disconnect();for(const el of pending)el.style.opacity=\"\";};}// Spotlight e inclinazione: solo con un mouse vero e solo sulle card senza\n// immagine di sfondo, per non coprire un fill di Framer.\nfunction glow(container){if(!window.matchMedia?.(\"(hover: hover)\").matches)return()=>{};injectStyle();const cards=Array.from(container.children).filter(el=>el instanceof HTMLElement&&getComputedStyle(el).backgroundImage===\"none\");const cleanups=[];for(const card of cards){card.setAttribute(\"data-gff-glow\",\"\");const move=e=>{if(e.pointerType!==\"mouse\")return;const r=card.getBoundingClientRect();const x=(e.clientX-r.left)/r.width;const y=(e.clientY-r.top)/r.height;card.style.setProperty(\"--gff-mx\",`${(x*100).toFixed(1)}%`);card.style.setProperty(\"--gff-my\",`${(y*100).toFixed(1)}%`);card.style.transform=`perspective(1000px) rotateX(${((.5-y)*4).toFixed(2)}deg) rotateY(${((x-.5)*4).toFixed(2)}deg)`;card.setAttribute(\"data-gff-hover\",\"\");};const leave=()=>{card.style.transform=\"\";card.removeAttribute(\"data-gff-hover\");};card.addEventListener(\"pointermove\",move);card.addEventListener(\"pointerleave\",leave);cleanups.push(()=>{card.removeEventListener(\"pointermove\",move);card.removeEventListener(\"pointerleave\",leave);card.removeAttribute(\"data-gff-glow\");leave();});}return()=>cleanups.forEach(fn=>fn());}function motion(kind,withGlow){return Component=>{return props=>{const ref=useRef(null);useEffect(()=>{const container=ref.current?.firstElementChild;if(!container||!allowed())return;const stopReveal=reveal(container,kind);const stopGlow=withGlow?glow(container):()=>{};return()=>{stopReveal();stopGlow();};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props})});};};}export function withCards(Component){return motion(\"cards\",true)(Component);}export function withSteps(Component){return motion(\"steps\",false)(Component);}export function withRise(Component){return motion(\"rise\",false)(Component);}\nexport const __FramerMetadata__ = {\"exports\":{\"withRise\":{\"type\":\"reactHoc\",\"name\":\"withRise\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCards\":{\"type\":\"reactHoc\",\"name\":\"withCards\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSteps\":{\"type\":\"reactHoc\",\"name\":\"withSteps\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GFFMotion.map"],"mappings":"wLAiB8mB,SAAS,GAAa,CAAC,GAAG,SAAS,eAAe,CAAQ,EAAE,OAAO,IAAM,EAAI,SAAS,cAAc,OAAO,EAAE,EAAI,GAAG,EAAS,EAAI,YAAY,EAAI,SAAS,KAAK,YAAY,CAAG,CAAE,CAE9xB,SAAS,EAAO,EAAU,EAAK,CAAgH,IAAM,EAAzG,MAAM,KAAK,EAAU,QAAQ,CAAC,CAAC,OAAO,GAAI,aAAc,aAAa,EAAG,eAAe,CAAC,CAAC,OAAO,CAAqB,CAAC,CAAC,OAAO,GAAI,EAAG,sBAAsB,CAAC,CAAC,IAAI,EAAO,YAAY,G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