{"version":3,"file":"ImageTicker.DPm5SnU7.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/3DhBjkE6pC8IYR0zFHEr/K0JuruALjupg5QxjnW6B/ImageTicker.js"],"sourcesContent":["// Minimal editorial style image ticker with configurable parameters\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useRef,useState,useMemo}from\"react\";/**\n * Editorial Image Ticker\n *\n * A minimal image ticker that preserves original image formats and provides\n * comprehensive control over layout, animation, and visual presentation.\n * Supports images, videos, and GIFs.\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageTicker(props){const{images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Image 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Image 5\"}],mediaFiles=[\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\"],useMediaFiles=false,speed=.9,direction=\"left\",align=\"center\",gap=90,padding=0,sizing={width:200,height:200,objectFit:\"cover\"},clipping={enabled:true,fadeWidth:40,overflow:\"hidden\"},videoSettings={autoplay:true,muted:true,loop:true,controls:false}}=props;const containerRef=useRef(null);const isStatic=useIsStaticRenderer();const[loadedMedia,setLoadedMedia]=useState(new Set);const[errorMedia,setErrorMedia]=useState(new Set);const isHorizontal=direction===\"left\"||direction===\"right\";const isReverse=direction===\"right\"||direction===\"down\";// Determine media type from file extension or URL\nconst getMediaType=src=>{const extension=src.split(\".\").pop()?.toLowerCase();if(extension===\"gif\")return\"gif\";if([\"mp4\",\"webm\",\"mov\",\"avi\"].includes(extension||\"\"))return\"video\";return\"image\";};// Prepare media items based on selected mode\nconst mediaItems=useMediaFiles?mediaFiles.map((src,index)=>({src,alt:`Media ${index+1}`,type:getMediaType(src)})):images.map(img=>({...img,type:getMediaType(img.src)}));// Create duplicated items for seamless looping\nconst loopItems=[...mediaItems,...mediaItems];// Calculate animation duration and distance\nconst{animationDuration,animationDistance}=useMemo(()=>{const itemSize=isHorizontal?sizing.width:sizing.height;const totalSize=(itemSize+gap)*mediaItems.length;const duration=totalSize/(speed*100);return{animationDuration:duration,animationDistance:totalSize};},[isHorizontal,sizing.width,sizing.height,gap,mediaItems.length,speed]);const containerStyle={position:\"relative\",width:\"100%\",height:\"100%\",overflow:clipping.overflow,padding:`${padding}px`};// CSS animation keyframes\nconst getAnimationKeyframes=()=>{if(isHorizontal){return isReverse?`@keyframes tickerRight { from { transform: translateX(0px); } to { transform: translateX(-${animationDistance}px); } }`:`@keyframes tickerLeft { from { transform: translateX(0px); } to { transform: translateX(-${animationDistance}px); } }`;}else{return isReverse?`@keyframes tickerDown { from { transform: translateY(-${animationDistance}px); } to { transform: translateY(0px); } }`:`@keyframes tickerUp { from { transform: translateY(0px); } to { transform: translateY(-${animationDistance}px); } }`;}};const getAnimationName=()=>{if(isHorizontal){return isReverse?\"tickerRight\":\"tickerLeft\";}else{return isReverse?\"tickerDown\":\"tickerUp\";}};const scrollContainerStyle={display:\"flex\",flexDirection:isHorizontal?\"row\":\"column\",alignItems:isHorizontal?align===\"start\"?\"flex-start\":align===\"end\"?\"flex-end\":\"center\":\"stretch\",justifyContent:isHorizontal?\"flex-start\":align===\"start\"?\"flex-start\":align===\"end\"?\"flex-end\":\"center\",gap:`${gap}px`,width:\"100%\",height:\"100%\",willChange:\"transform\",...!isStatic&&{animation:`${getAnimationName()} ${animationDuration}s linear infinite`}};const mediaStyle={width:isHorizontal?`${sizing.width}px`:\"100%\",height:isHorizontal?\"100%\":`${sizing.height}px`,objectFit:sizing.objectFit,flexShrink:0,borderRadius:0,willChange:\"transform, filter\"};const loadingStyle={...mediaStyle,backgroundColor:\"#f0f0f0\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#999\",fontSize:\"12px\"};const fadeGradient=clipping.enabled?isHorizontal?`linear-gradient(to right, transparent 0px, black ${clipping.fadeWidth}px, black calc(100% - ${clipping.fadeWidth}px), transparent 100%)`:`linear-gradient(to bottom, transparent 0px, black ${clipping.fadeWidth}px, black calc(100% - ${clipping.fadeWidth}px), transparent 100%)`:undefined;const renderMediaItem=(item,index)=>{const key=`${item.src}-${index}`;if(item.type===\"video\"){return /*#__PURE__*/_jsx(\"video\",{src:item.src,style:mediaStyle,autoPlay:true,muted:true,loop:videoSettings.loop,controls:videoSettings.controls,playsInline:true,draggable:false},key);}// For images and GIFs (GIFs are handled as images)\nreturn /*#__PURE__*/_jsx(\"img\",{src:item.src,alt:item.alt,style:mediaStyle,draggable:false},key);};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"style\",{children:getAnimationKeyframes()}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",...clipping.enabled&&{WebkitMask:fadeGradient,mask:fadeGradient}},children:/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:scrollContainerStyle,children:loopItems.map((item,index)=>renderMediaItem(item,index))})})]});}addPropertyControls(ImageTicker,{useMediaFiles:{type:ControlType.Boolean,title:\"Media Source\",defaultValue:false,enabledTitle:\"Files\",disabledTitle:\"Images\"},images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},maxCount:20,hidden:({useMediaFiles})=>useMediaFiles},mediaFiles:{type:ControlType.Array,title:\"Media Files\",control:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"mp4\",\"webm\",\"mov\"]},maxCount:20,hidden:({useMediaFiles})=>!useMediaFiles},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:.9,min:.1,max:5,step:.1},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"left\",\"right\",\"up\",\"down\"],optionTitles:[\"Left\",\"Right\",\"Up\",\"Down\"],defaultValue:\"left\",displaySegmentedControl:true},align:{type:ControlType.Enum,title:\"Align\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"center\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:90,min:0,max:200,step:1,unit:\"px\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},sizing:{type:ControlType.Object,title:\"Sizing\",controls:{width:{type:ControlType.Number,title:\"Width\",defaultValue:200,min:50,max:500,step:1,unit:\"px\"},height:{type:ControlType.Number,title:\"Height\",defaultValue:200,min:50,max:500,step:1,unit:\"px\"},objectFit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"cover\",\"contain\",\"fill\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\"],defaultValue:\"cover\"}}},videoSettings:{type:ControlType.Object,title:\"Video Settings\",controls:{autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:true},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true},controls:{type:ControlType.Boolean,title:\"Show Controls\",defaultValue:false}},hidden:({useMediaFiles})=>!useMediaFiles},clipping:{type:ControlType.Object,title:\"Clipping\",controls:{enabled:{type:ControlType.Boolean,title:\"Enable Fade\",defaultValue:true},fadeWidth:{type:ControlType.Number,title:\"Fade Width\",defaultValue:40,min:0,max:100,step:1,unit:\"px\"},overflow:{type:ControlType.Enum,title:\"Overflow\",options:[\"hidden\",\"visible\"],optionTitles:[\"Hidden\",\"Visible\"],defaultValue:\"hidden\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageTicker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"800\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageTicker.map"],"mappings":"uMAaG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,UAAU,CAAC,CAAC,IAAI,oEAAoE,IAAI,UAAU,CAAC,CAAC,IAAI,uEAAuE,IAAI,UAAU,CAAC,CAAC,IAAI,oEAAoE,IAAI,UAAU,CAAC,CAAC,IAAI,sEAAsE,IAAI,UAAU,CAAC,CAAC,aAAW,CAAC,sEAAsE,uEAAuE,CAAC,gBAAc,GAAM,QAAM,GAAG,YAAU,OAAO,QAAM,SAAS,MAAI,GAAG,UAAQ,EAAE,SAAO,CAAC,MAAM,IAAI,OAAO,IAAI,UAAU,QAAQ,CAAC,WAAS,CAAC,QAAQ,GAAK,UAAU,GAAG,SAAS,SAAS,CAAC,gBAAc,CAAC,SAAS,GAAK,MAAM,GAAK,KAAK,GAAK,SAAS,GAAM,EAAE,EAAY,EAAaA,EAAO,KAAK,CAAO,EAAS,GAAqB,CAAM,CAAC,EAAY,GAAgBC,EAAS,IAAI,IAAI,CAAM,CAAC,EAAW,GAAeA,EAAS,IAAI,IAAI,CAAO,EAAa,IAAY,QAAQ,IAAY,QAAc,EAAU,IAAY,SAAS,IAAY,OACrqC,EAAa,GAAK,CAAC,IAAM,EAAU,EAAI,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa,CAAsG,OAAlG,IAAY,MAAY,MAAS,CAA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