{"version":3,"file":"PixelArrow.CTfB9rgL.mjs","names":["useState","c"],"sources":["https:/framerusercontent.com/modules/KhhxlV5dlXidrUMydht5/nytEHnEGC1p9t3UM4HJt/PixelArrow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";// 7x7 pixel arrows. Each one loops by sliding along its direction:\n// up moves rows up, up-right moves rows up and columns right.\nconst ARROWS={up:{rows:[\"...#...\",\"..#.#..\",\".#.#.#.\",\"#..#..#\",\"...#...\",\"...#...\",\"...#...\"],dx:0,dy:1},upRight:{rows:[\"..#####\",\".....##\",\"....#.#\",\"...#..#\",\"..#...#\",\".#.....\",\"#......\"],dx:1,dy:1}};const SIZE=7;const GAP=4;const PERIOD=SIZE+GAP;/**\n * Pixel Arrow\n *\n * A small arrow built from pixels, pointing up or up-right. Turn on Active\n * (e.g. in a hover variant) and it travels: the pixels step along the arrow's\n * direction, leave one edge and come back in from the opposite one.\n *\n * @framerIntrinsicWidth 14\n * @framerIntrinsicHeight 14\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PixelArrow(props){const{direction=\"up\",color,cell,active,speed,style}=props;const isStatic=useIsStaticRenderer();const[offset,setOffset]=useState(0);const arrow=ARROWS[direction]??ARROWS.up;useEffect(()=>{const reduced=typeof window!==\"undefined\"&&window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;if(!active||isStatic||reduced){setOffset(0);return;}// Start with one step straight away so the hover feels instant\nsetOffset(1);const id=window.setInterval(()=>setOffset(o=>(o+1)%PERIOD),Math.max(30,speed));return()=>window.clearInterval(id);},[active,isStatic,speed]);const isOn=(r,c)=>{const rr=(r+offset*arrow.dy)%PERIOD;const cc=((c-offset*arrow.dx)%PERIOD+PERIOD)%PERIOD;return rr<SIZE&&cc<SIZE&&arrow.rows[rr][cc]===\"#\";};// Only the lit pixels are drawn, as squares in one small vector graphic\nconst cells=[];for(let r=0;r<SIZE;r++)for(let c=0;c<SIZE;c++)if(isOn(r,c))cells.push([r,c]);return /*#__PURE__*/_jsx(\"svg\",{\"aria-hidden\":true,width:SIZE*cell,height:SIZE*cell,viewBox:`0 0 ${SIZE} ${SIZE}`,shapeRendering:\"crispEdges\",style:{...style,position:\"relative\",display:\"block\",flexShrink:0},children:cells.map(([r,c])=>/*#__PURE__*/_jsx(\"rect\",{x:c,y:r,width:1,height:1,fill:color},`${r}-${c}`))});}addPropertyControls(PixelArrow,{direction:{type:ControlType.Enum,title:\"Direction\",options:[\"up\",\"upRight\"],optionTitles:[\"Up\",\"Up-right\"],displaySegmentedControl:true,defaultValue:\"up\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},cell:{type:ControlType.Number,title:\"Pixel\",defaultValue:2,min:1,max:8,step:1,unit:\"px\"},active:{type:ControlType.Boolean,title:\"Active\",defaultValue:false,description:\"Turn on in the hover variant to make it travel.\"},speed:{type:ControlType.Number,title:\"Step\",defaultValue:70,min:30,max:300,step:5,unit:\"ms\",description:\"Time per step.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PixelArrow\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"14\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"14\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PixelArrow.map"],"mappings":"uMAaG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,YAAU,KAAK,QAAM,OAAK,SAAO,QAAM,SAAO,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAO,GAAWA,EAAS,CAAC,EAAQ,EAAM,EAAO,IAAY,EAAO,GAAG,MAAc,CAAC,IAAM,EAAe,IAAS,QAAa,EAAO,aAAa,kCAAkC,CAAC,CAAC,QAAQ,GAAG,CAAC,GAAQ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