{"version":3,"file":"SpriteLoop.CpyZ9U25.mjs","names":["React.useId","__esmMin","init_npm_react_18_3_1","ie","c","init_jsx_runtime","init_framer_DKgW_P28","ControlType","addPropertyControls","SpriteLoop","props","src","image","n","frames","name","style","color","url","dur","fps","end","init_SpriteLoop"],"sources":["https:/framerusercontent.com/modules/TE7E98WChKWoqtmUCTsA/BQRPxHiSMcGSsFgUFcDz/SpriteLoop.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Plays a picture that holds several frames side by side, in a loop. Used for the flame cursor.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 36\n * @framerIntrinsicHeight 36\n */export default function SpriteLoop(props){const{image,frames=4,fps=8,color,style}=props;const src=image?typeof image===\"string\"?image:image.src||\"\":\"\";const n=Math.max(1,Math.round(frames||1));const name=\"sl\"+React.useId().replace(/[^A-Za-z0-9]/g,\"\");if(!src)return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\"}});// With a colour set, the picture is used as a stencil and filled with that colour, so the flame can match the brand red exactly.\nif(color){const url=\"url(\"+JSON.stringify(src)+\")\";const dur=n/Math.max(1,fps||8)+\"s steps(\"+n+\") infinite\";const end=n/(n-1)*100+\"% 0\";return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{...style,width:\"100%\",height:\"100%\",pointerEvents:\"none\",backgroundColor:color,WebkitMaskImage:url,maskImage:url,WebkitMaskRepeat:\"no-repeat\",maskRepeat:\"no-repeat\",WebkitMaskSize:n*100+\"% 100%\",maskSize:n*100+\"% 100%\",WebkitMaskPosition:\"0% 0\",maskPosition:\"0% 0\",animation:n>1?name+\" \"+dur:\"none\"},children:n>1?/*#__PURE__*/_jsx(\"style\",{children:\"@keyframes \"+name+\"{from{-webkit-mask-position:0% 0;mask-position:0% 0}to{-webkit-mask-position:\"+end+\";mask-position:\"+end+\"}}\"}):null});}return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{...style,width:\"100%\",height:\"100%\",pointerEvents:\"none\",backgroundImage:\"url(\"+JSON.stringify(src)+\")\",backgroundRepeat:\"no-repeat\",backgroundSize:n*100+\"% 100%\",backgroundPosition:\"0% 0\",animation:n>1?name+\" \"+n/Math.max(1,fps||8)+\"s steps(\"+n+\") infinite\":\"none\"},children:n>1?/*#__PURE__*/_jsx(\"style\",{children:\"@keyframes \"+name+\"{from{background-position:0% 0}to{background-position:\"+n/(n-1)*100+\"% 0}}\"}):null});}addPropertyControls(SpriteLoop,{image:{type:ControlType.ResponsiveImage,title:\"Frames\",description:\"A picture with the frames side by side.\"},frames:{type:ControlType.Number,title:\"Frame count\",min:1,max:60,step:1,defaultValue:4},fps:{type:ControlType.Number,title:\"Speed\",min:1,max:30,step:1,unit:\"fps\",defaultValue:8},color:{type:ControlType.Color,title:\"Colour\",optional:true,description:\"Fills the picture's shape with this colour. Leave empty to show the picture as drawn.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SpriteLoop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"36\",\"framerIntrinsicWidth\":\"36\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SpriteLoop.map"],"mappings":"A,0KAOG,SAAwBS,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,SAAO,EAAE,MAAI,EAAE,QAAM,SAAOC,EAAYC,EAAIC,EAAM,OAAOA,GAAQ,SAASA,EAAMA,EAAM,KAAK,GAAG,GAASC,EAAE,KAAK,IAAI,EAAE,KAAK,MAAMC,GAAQ,CAAC,CAAC,EAAQC,EAAK,KAAKf,EAAY,CAAC,CAAC,QAAQ,gBAAg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