{"version":3,"file":"Rotor_Gallery.CuPwOGAS.mjs","names":["React.useMemo","React.useRef"],"sources":["https:/framerusercontent.com/modules/NUo7QeDWja6E9040rXgM/K8xbHjYFTF61tn3eJLi6/Rotor_Gallery.js"],"sourcesContent":["// FlipFanGallery.tsx\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function Rotor_Gallery(props){const{images=[],count=8,cardColor=\"#dcdcdc\",cardWidth=620,cardHeight=400,borderRadius=14,speedSec=10,staggerMs=300,perspective=1e3,camX=-30,camY=-8,camZ=90,offsetX=0,offsetY=0,imgRotateDeg=0,width=\"100%\",height=\"100%\"}=props;const list=React.useMemo(()=>{const out=[];for(let i=0;i<Math.max(0,Math.floor(count));i++)out.push(images[i]||\"\");return out;},[images,count]);const sceneRef=React.useRef(null);const last=React.useRef({w:Number(cardWidth)||620,h:Number(cardHeight)||400});// Обновляем width/height императивно, только когда значения валидны\nReact.useLayoutEffect(()=>{const el=sceneRef.current;if(!el)return;const w=Number(cardWidth);const h=Number(cardHeight);const wOk=Number.isFinite(w)&&w>0;const hOk=Number.isFinite(h)&&h>0;if(wOk&&w!==last.current.w){el.style.width=`${w}px`;last.current.w=w;}if(hOk&&h!==last.current.h){el.style.height=`${h}px`;last.current.h=h;}},[cardWidth,cardHeight]);const isAnimating=speedSec>0;return /*#__PURE__*/_jsxs(\"div\",{style:{width,height,display:\"grid\",placeItems:\"center\",perspective:`${perspective}px`,overflow:\"visible\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        .ffg-scene{position:relative; transform-style:preserve-3d}\n        .ffg-ul{position:relative; transform-style:preserve-3d; list-style:none; padding:0; margin:0}\n        .ffg-li{\n          position:absolute; inset:0; transform-style:preserve-3d;\n          transform-origin: top center;\n          will-change: transform;\n        }\n        .ffg-li.animating{\n          animation: ffgTurn var(--dur) linear infinite;\n        }\n        .ffg-li::before, .ffg-li::after {\n          content: \"\";\n          position:absolute; inset:0; border-radius:var(--radius);\n          backface-visibility:hidden; -webkit-backface-visibility:hidden;\n          overflow:hidden; background-position:center; background-size:cover; background-repeat:no-repeat;\n          transform: rotate(var(--imgrot));\n          background-image: var(--bg-img); background-color: var(--bg-col);\n        }\n        .ffg-li::after{ transform: rotateX(180deg) rotate(var(--imgrot)); }\n        @keyframes ffgTurn{\n          from{ transform: rotateZ(90deg) rotateX(1turn); }\n          to  { transform: rotateZ(90deg) rotateX(0turn); }\n        }\n      `}),/*#__PURE__*/_jsx(\"div\",{ref:sceneRef,className:\"ffg-scene\",style:{// стартовые размеры один раз; дальше — через useLayoutEffect\nwidth:`${last.current.w}px`,height:`${last.current.h}px`,transform:`translate3d(${offsetX}px, ${offsetY}px, 0) rotateX(${camX}deg) rotateY(${camY}deg) rotateZ(${camZ}deg)`},children:/*#__PURE__*/_jsx(\"ul\",{className:\"ffg-ul\",style:{width:\"100%\",height:\"100%\"},children:list.map((url,i)=>{const delay=`${i*-staggerMs}ms`;return /*#__PURE__*/_jsx(\"li\",{className:`ffg-li ${isAnimating?\"animating\":\"\"}`,style:{[\"--dur\"]:isAnimating?`${speedSec}s`:undefined,[\"--radius\"]:`${borderRadius}px`,[\"--imgrot\"]:`${imgRotateDeg}deg`,animationDelay:isAnimating?delay:undefined,[\"--bg-img\"]:url?`url(${url})`:\"none\",[\"--bg-col\"]:url?\"transparent\":cardColor}},i);})})})]});}addPropertyControls(Rotor_Gallery,{images:{title:\"Images\",type:ControlType.Array,control:{type:ControlType.Image}},count:{title:\"Count\",type:ControlType.Number,min:1,max:24,step:1},cardColor:{title:\"Fallback\",type:ControlType.Color},cardWidth:{title:\"Card W\",type:ControlType.Number,min:50,max:600,unit:\"px\"},cardHeight:{title:\"Card H\",type:ControlType.Number,min:50,max:600,unit:\"px\"},borderRadius:{title:\"Radius\",type:ControlType.Number,min:0,max:500,unit:\"px\"},speedSec:{title:\"Speed\",type:ControlType.Number,min:0,max:20,step:.25,unit:\"s\"},staggerMs:{title:\"Stagger\",type:ControlType.Number,min:0,max:6e3,step:10,unit:\"ms\"},perspective:{title:\"Perspective\",type:ControlType.Number,min:200,max:3e3,step:10,unit:\"px\"},camX:{title:\"Cam X\",type:ControlType.Number,min:-90,max:90,unit:\"\\xb0\"},camY:{title:\"Cam Y\",type:ControlType.Number,min:-90,max:90,unit:\"\\xb0\"},camZ:{title:\"Cam Z\",type:ControlType.Number,min:-180,max:180,unit:\"\\xb0\"},offsetX:{title:\"Offset X\",type:ControlType.Number,min:-800,max:800,step:1,unit:\"px\"},offsetY:{title:\"Offset Y\",type:ControlType.Number,min:-800,max:800,step:1,unit:\"px\"},imgRotateDeg:{title:\"Image Angle\",type:ControlType.Number,min:-180,max:180,step:1,unit:\"\\xb0\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Rotor_Gallery\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Rotor_Gallery.map"],"mappings":"0LACyI,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,EAAE,QAAM,EAAE,YAAU,UAAU,YAAU,IAAI,aAAW,IAAI,eAAa,GAAG,WAAS,GAAG,YAAU,IAAI,cAAY,IAAI,OAAK,IAAI,OAAK,GAAG,OAAK,GAAG,UAAQ,EAAE,UAAQ,EAAE,eAAa,EAAE,QAAM,OAAO,SAAO,QAAQ,EAAY,EAAKA,MAAkB,CAAC,IAAM,EAAI,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,CAAK,CAAC,EAAE,IAAI,EAAI,KAAK,EAAO,IAAI,EAAE,EAAE,OAAO,CAAI,EAAE,CAAC,EAAO,CAAK,CAAC,EAAQ,EAASC,EAAa,IAAI,EAAQ,EAAKA,EAAa,CAAC,EAAE,OAAO,CAAS,GAAG,IAAI,EAAE,OAAO,CAAU,GAAG,G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