{"version":3,"file":"Examples.DbZrlfLd.mjs","names":["useRef","useState"],"sources":["https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/ewpVgP4Q7M1g2eBd1xrN/UOTz23bgyHKE3eLqbqqp/Examples.js"],"sourcesContent":["export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{useEffect,useRef}from\"react\";import{motion}from\"framer-motion\";import{useState}from\"react\";const useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}export function withHorizontalScroll(Component){return props=>{const containerRef=useRef(null);const scrolling=useRef(false);const momentum=useRef(0);const lastScrollTime=useRef(Date.now());useEffect(()=>{const container=containerRef.current;if(!container)return;let animationFrame;const smoothScroll=()=>{if(!scrolling.current&&Math.abs(momentum.current)>.1){container.scrollLeft+=momentum.current;momentum.current*=.95;animationFrame=requestAnimationFrame(smoothScroll);}};const isAtEnd=()=>{const scrollWidth=container.scrollWidth;const clientWidth=container.clientWidth;const scrollLeft=container.scrollLeft;// Prüfen ob wir am Ende des scrollbaren Bereichs sind\nreturn Math.abs(scrollLeft+clientWidth-scrollWidth)<1;};const isAtStart=()=>{return container.scrollLeft===0;};const handleWheel=e=>{// Wenn wir am Ende sind und nach unten scrollen, oder\n// am Anfang sind und nach oben scrollen, lassen wir das normale Scrollverhalten zu\nif(isAtEnd()&&e.deltaY>0||isAtStart()&&e.deltaY<0){return;}e.preventDefault();const currentTime=Date.now();const timeDelta=currentTime-lastScrollTime.current;lastScrollTime.current=currentTime;const scrollSpeed=Math.min(Math.max(timeDelta/16,.5),1.5);momentum.current=e.deltaY*.5*scrollSpeed;scrolling.current=true;container.scrollLeft+=momentum.current;clearTimeout(container.scrollTimeout);container.scrollTimeout=setTimeout(()=>{scrolling.current=false;animationFrame=requestAnimationFrame(smoothScroll);},50);};container.addEventListener(\"wheel\",handleWheel,{passive:false});return()=>{container.removeEventListener(\"wheel\",handleWheel);cancelAnimationFrame(animationFrame);clearTimeout(container.scrollTimeout);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{overflowX:\"scroll\",scrollBehavior:\"auto\",WebkitOverflowScrolling:\"touch\",scrollbarWidth:\"none\",msOverflowStyle:\"none\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}export function withAutoHide3s(Component){return props=>{const[visible,setVisible]=useState(true);useEffect(()=>{const hideAfterMs=2500// Zeit in Millisekunden bis zum Ausblenden (3 Sekunden)\n;const timer=setTimeout(()=>{setVisible(false);},hideAfterMs);return()=>clearTimeout(timer)// Timer aufräumen, falls die Komponente unmountet\n;},[]);if(!visible)return null// Wenn nicht sichtbar, nichts rendern\n;return /*#__PURE__*/_jsx(motion.div,{initial:{opacity:1},animate:{opacity:0},transition:{delay:2.5,duration:1},children:/*#__PURE__*/_jsx(Component,{...props})});};}export function withAutoHide6s(Component){return props=>{const[visible,setVisible]=useState(true);useEffect(()=>{const hideAfterMs=5e3// Zeit in Millisekunden bis zum Ausblenden (3 Sekunden)\n;const timer=setTimeout(()=>{setVisible(false);},hideAfterMs);return()=>clearTimeout(timer)// Timer aufräumen, falls die Komponente unmountet\n;},[]);if(!visible)return null// Wenn nicht sichtbar, nichts rendern\n;return /*#__PURE__*/_jsx(motion.div,{initial:{opacity:1},animate:{opacity:0},transition:{delay:5,duration:1},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAutoHide3s\":{\"type\":\"reactHoc\",\"name\":\"withAutoHide3s\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAutoHide6s\":{\"type\":\"reactHoc\",\"name\":\"withAutoHide6s\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHorizontalScroll\":{\"type\":\"reactHoc\",\"name\":\"withHorizontalScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"gWAAa,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,SACf,CASY,EAAyB,CAClC,GAAG,EACH,SAAU,SACb,IChBi0B,SAAgB,E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