{"version":3,"file":"RotatingChanges.5aAVUdVx.mjs","names":["_Fragment","useState","useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/9e6fmdB17OsJ1gllNAyy/COsRMHfjYoBdMOTrD8vH/RotatingChanges.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls}from\"framer\";import{useState,useEffect,useCallback,useRef}from\"react\";const changes=[{iconBg:\"rgba(232,69,60,0.08)\",iconColor:\"#e8453c\",title:\"Stripe updated Terms of Service\",desc:\"Dispute resolution clause now requires mandatory arbitration in all regions\",tag:\"High Impact\",tagColor:\"#e8453c\",tagBg:\"rgba(232,69,60,0.07)\",time:\"2 hours ago\"},{iconBg:\"rgba(245,166,35,0.08)\",iconColor:\"#f5a623\",title:\"AWS modified Privacy Policy\",desc:\"Data retention period extended from 2 years to 5 years for all services\",tag:\"Medium Impact\",tagColor:\"#f5a623\",tagBg:\"rgba(245,166,35,0.07)\",time:\"5 hours ago\"},{iconBg:\"rgba(99,91,255,0.08)\",iconColor:\"#635bff\",title:\"Shopify revised Acceptable Use Policy\",desc:\"New restrictions on AI-generated content in product descriptions\",tag:\"Review\",tagColor:\"#635bff\",tagBg:\"rgba(99,91,255,0.07)\",time:\"1 day ago\"},{iconBg:\"rgba(232,69,60,0.08)\",iconColor:\"#e8453c\",title:\"Slack changed Data Processing Agreement\",desc:\"Third-party data sharing expanded to include analytics partners\",tag:\"High Impact\",tagColor:\"#e8453c\",tagBg:\"rgba(232,69,60,0.07)\",time:\"1 day ago\"},{iconBg:\"rgba(16,185,129,0.08)\",iconColor:\"#10b981\",title:\"Notion updated Security Policy\",desc:\"Added SOC 2 Type II compliance for enterprise plans\",tag:\"Positive\",tagColor:\"#10b981\",tagBg:\"rgba(16,185,129,0.07)\",time:\"2 days ago\"}];const STEP=112// card height ~100 + 12 gap\n;function AlertIcon({color}){return /*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:color,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 2L2 7l10 5 10-5-10-5Z\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M2 17l10 5 10-5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M2 12l10 5 10-5\"})]});}function CardInner({item}){return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{width:38,height:38,borderRadius:10,background:item.iconBg,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:0},children:/*#__PURE__*/_jsx(AlertIcon,{color:item.iconColor})}),/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,minWidth:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14,fontWeight:600,color:\"#0a2540\",lineHeight:1.35,marginBottom:4},children:item.title}),/*#__PURE__*/_jsx(\"p\",{style:{fontSize:13,color:\"#546681\",margin:\"0 0 10px\",lineHeight:1.5},children:item.desc}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:8},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:11,fontWeight:600,color:item.tagColor,padding:\"3px 8px\",borderRadius:6,background:item.tagBg},children:item.tag}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:11,color:\"#94a3b8\"},children:item.time})]})]})]});}// We render 4 cards: the exiting one (slot -1) + 3 visible (slots 0,1,2)\n// During transition all 4 shift up by one STEP simultaneously\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function RotatingChanges(){const[baseIndex,setBaseIndex]=useState(0);const[shifted,setShifted]=useState(false);const timeoutRef=useRef(null);const advance=useCallback(()=>{// Phase 1: shift everything up (CSS transition handles animation)\nsetShifted(true);// Phase 2: after transition completes, snap to new base without animation\ntimeoutRef.current=setTimeout(()=>{setBaseIndex(prev=>(prev+1)%changes.length);setShifted(false);},600);},[]);useEffect(()=>{const id=setInterval(advance,3200);return()=>{clearInterval(id);if(timeoutRef.current)clearTimeout(timeoutRef.current);};},[advance]);// 4 slots: current top (will exit), next 3 (will become top, queued, far)\nconst slots=[0,1,2,3];// Dim levels per visual position (0=top, 1=queued, 2=far)\nconst dimForPos=[0,.42,.7,.88];const scaleForPos=[1,.97,.94,.91];return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",fontFamily:\"'Inter', system-ui, sans-serif\",overflow:\"hidden\",padding:\"4px 16px\"},children:slots.map(slot=>{const itemIndex=(baseIndex+slot)%changes.length;const item=changes[itemIndex];// Visual position: normally slot 0,1,2,3. When shifted, slot-1 = -1,0,1,2\nconst visualPos=shifted?slot-1:slot;const y=visualPos*STEP;const scale=scaleForPos[Math.max(0,Math.min(3,shifted?slot:slot))];const dim=dimForPos[Math.max(0,Math.min(3,shifted?slot-1:slot))];// Exiting card (visualPos = -1): fade out\nconst isExiting=visualPos<0;// Entering card (slot 3, not shifted): start invisible below\nconst isEntering=slot===3&&!shifted;const cardOpacity=isExiting?0:isEntering?0:1;// When we snap (shifted=false after index change), disable transition briefly\n// We achieve this by always having transition on — the snap is instant because\n// positions don't actually change (new slot 0 is at same y as old slot 1 was)\nreturn /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:12,right:12,top:0,transform:`translateY(${y}px) scale(${shifted?scaleForPos[Math.max(0,slot-1)]:scaleForPos[Math.min(3,slot)]})`,opacity:cardOpacity,transition:shifted?\"all 0.55s cubic-bezier(0.4,0,0.2,1)\":\"none\",zIndex:10-slot,transformOrigin:\"top center\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",background:\"white\",borderRadius:16,padding:\"18px 20px\",display:\"flex\",gap:14,alignItems:\"flex-start\",boxShadow:visualPos===0?\"0 4px 16px rgba(10,37,64,0.06), 0 1px 3px rgba(10,37,64,0.04)\":\"0 1px 4px rgba(10,37,64,0.03)\",border:\"1px solid rgba(10,37,64,0.06)\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(CardInner,{item:item}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,borderRadius:16,background:`rgba(248,249,251,${dim})`,pointerEvents:\"none\",transition:shifted?\"background 0.55s cubic-bezier(0.4,0,0.2,1)\":\"none\"}})]})},itemIndex);})});}addPropertyControls(RotatingChanges,{});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingChanges\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RotatingChanges.map"],"mappings":"sMACC,SAAS,EAAU,CAAC,SAAO,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,EAAM,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,SAAS,CAAc,EAAK,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAc,EAAK,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAc,EAAK,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAE,SAAS,EAAU,CAAC,QAAM,CAAC,OAAoB,EAAMA,EAAU,CAAC,SAAS,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,EAAK,OAAO,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,WAAW,EAAE,CAAC,SAAsB,EAAK,EAAU,CAAC,MAAM,EAAK,UAAU,CAAC,CAAC,CAAC,CAAc,EAAM,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,SAAS,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,IAAI,MAAM,UAAU,WAAW,KAA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