{"version":3,"file":"Image_Rotation_Stack.REi6hPU6.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/QypiIVcsDSKjSdaA1h9g/5OBCbJLZU1Nv2E8GgKmh/Image_Rotation_Stack.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function RotatingStack(props){const{size,interval,rotationSpeed,rotationEnabled,images,squareSize,angleDeg}=props;const[topIndex,setTopIndex]=useState(0);useEffect(()=>{if(!images||images.length===0)return;const timer=setInterval(()=>{setTopIndex(prev=>(prev+1)%images.length);},interval*1e3);return()=>clearInterval(timer);},[interval,images?.length]);if(!images||images.length===0)return null;const count=images.length;return /*#__PURE__*/_jsxs(\"div\",{style:{width:size,height:size,position:\"relative\",animation:rotationEnabled?`spinLoop ${rotationSpeed}s linear infinite`:\"none\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes spinLoop {\n                    from { transform: rotate(0deg); }\n                    to { transform: rotate(360deg); }\n                }\n            `}),images.map((img,i)=>{const angle=i*angleDeg;let zIndex;if(i===topIndex){zIndex=count+1;}else{const behind=(i-topIndex+count)%count;zIndex=count-behind;}const src=typeof img===\"string\"?img:img?.src??img?.url??img?.file??null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:squareSize,height:squareSize,backgroundImage:src?`url(${src})`:\"none\",backgroundColor:src?\"transparent\":\"#aaa\",backgroundSize:\"cover\",backgroundPosition:\"center\",top:\"50%\",left:\"50%\",marginTop:-squareSize/2,marginLeft:-squareSize/2,transform:`rotate(${angle}deg)`,zIndex:zIndex}},i);})]});}addPropertyControls(RotatingStack,{size:{type:ControlType.Number,title:\"Container\",defaultValue:400,min:100,max:800},squareSize:{type:ControlType.Number,title:\"Quadratgr\\xf6\\xdfe\",defaultValue:300,min:50,max:600},angleDeg:{type:ControlType.Number,title:\"Winkel (\\xb0)\",defaultValue:15,min:1,max:90,step:1},interval:{type:ControlType.Number,title:\"Intervall (s)\",defaultValue:1,min:.1,max:10,step:.1},rotationEnabled:{type:ControlType.Boolean,title:\"Rotation\",defaultValue:true,enabledTitle:\"An\",disabledTitle:\"Aus\"},rotationSpeed:{type:ControlType.Number,title:\"Rotation (s)\",defaultValue:60,min:1,max:120,hidden:props=>!props.rotationEnabled},images:{type:ControlType.Array,title:\"Bilder\",control:{type:ControlType.Image},defaultValue:[],maxCount:12}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingStack\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Image_Rotation_Stack.map"],"mappings":"mLAAmJ,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,gBAAc,kBAAgB,SAAO,aAAW,YAAU,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAwM,GAAvM,MAAc,CAAC,GAAG,CAAC,GAAQ,EAAO,SAAS,EAAE,OAAO,IAAM,EAAM,gBAAgB,CAAC,EAAY,IAAO,EAAK,GAAG,EAAO,OAAO,EAAG,EAAS,IAAI,CAAC,UAAU,cAAc,EAAM,EAAG,CAAC,EAAS,GAAQ,OAAO,CAAC,CAAI,CAAC,GAAQ,EAAO,SAAS,EAAE,OAAO,KAAK,IAAM,EAAM,EAAO,OAAO,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,EAAK,OAAO,EAAK,SAAS,WAAW,UAAU,EAAgB,YAAY,EAAc,mBAAmB,OAAO,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SAAS;;;;;cAKzwB,CAAC,CAAC,EAAO,KAAK,EAAI,IAAI,CAAC,IAAM,EAAM,EAAE,EAAa,EAAO,AAA4E,EAAzE,IAAI,EAAiB,EAAM,EAAqD,GAA/B,EAAE,EAAS,GAAO,EAA2B,IAAM,EAAI,OAAO,GAAM,SAAS,EAAI,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