{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/W4I53cIgriUNNz4KsNmR/wwQrpGA4l1Bjc6aUlgsp/TwinklingPlusPattern.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType,Frame}from\"framer\";export default function TwinklingPlusPattern({twinkleSpeed,twinkleAmount,twinkleColor,useGradient,gradientStart,gradientEnd,patternScale,startColor}){// Overall fixed dimensions.\nconst width=5e3;const height=2e3;// Base cell size (18px) multiplied by patternScale.\nconst baseCellSize=18;const cellSize=baseCellSize*patternScale;// Calculate how many cells are needed to fill the area.\nconst columns=Math.ceil(width/cellSize);const rows=Math.ceil(height/cellSize);const totalCells=columns*rows;// twinkleState: each index corresponds to a cell.\n// false = overlay hidden (base color only), true = overlay shown.\nconst[twinkleState,setTwinkleState]=useState(Array(totalCells).fill(false));// If the grid size changes, reset the state.\nuseEffect(()=>{setTwinkleState(Array(totalCells).fill(false));},[totalCells]);// On each interval, update state so that exactly `twinkleAmount` cells are active.\nuseEffect(()=>{const interval=setInterval(()=>{// Create a new state array with all cells set to false.\nconst newState=Array(totalCells).fill(false);// Clamp the count so it does not exceed the number of cells.\nconst count=Math.min(twinkleAmount,totalCells);// Create an array of cell indices.\nconst indices=Array.from({length:totalCells},(_,i)=>i);// Shuffle the array using Fisher\u2013Yates.\nfor(let i=indices.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[indices[i],indices[j]]=[indices[j],indices[i]];}// Activate exactly `count` cells.\nfor(let k=0;k<count;k++){newState[indices[k]]=true;}setTwinkleState(newState);},twinkleSpeed);return()=>clearInterval(interval);},[twinkleSpeed,totalCells,twinkleAmount]);return /*#__PURE__*/_jsx(Frame,{width:width,height:height,background:\"transparent\",children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:`0 0 ${width} ${height}`,// Disable text selection and pointer events.\nstyle:{userSelect:\"none\",MozUserSelect:\"none\",WebkitUserSelect:\"none\",msUserSelect:\"none\",pointerEvents:\"none\"},children:[useGradient&&/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"linearGradient\",{id:\"gradient\",x1:\"0%\",y1:\"0%\",x2:\"100%\",y2:\"100%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:gradientStart}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:gradientEnd})]})}),/*#__PURE__*/_jsx(\"style\",{children:`\n                        .plus-overlay {\n                            transition: opacity 1s ease-in-out;\n                            will-change: opacity;\n                            opacity: 0;\n                        }\n                        .plus-overlay.active {\n                            opacity: 1;\n                        }\n                    `}),twinkleState.map((isTwinkling,index)=>{const col=index%columns;const row=Math.floor(index/columns);// Center the plus mark within its cell.\nconst x=col*cellSize+cellSize/2;const y=row*cellSize+cellSize/2;return /*#__PURE__*/_jsxs(\"g\",{children:[/*#__PURE__*/_jsx(\"text\",{x:x,y:y,fontSize:cellSize,textAnchor:\"middle\",dominantBaseline:\"middle\",fill:startColor,children:\"+\"}),/*#__PURE__*/_jsx(\"text\",{x:x,y:y,fontSize:cellSize,textAnchor:\"middle\",dominantBaseline:\"middle\",fill:useGradient?\"url(#gradient)\":twinkleColor,className:`plus-overlay ${isTwinkling?\"active\":\"\"}`,children:\"+\"})]},index);})]})});}addPropertyControls(TwinklingPlusPattern,{twinkleSpeed:{type:ControlType.Number,title:\"Twinkle Speed (ms)\",defaultValue:2e3,min:500,max:5e3,step:100},twinkleAmount:{type:ControlType.Number,title:\"Twinkle Amount (count)\",defaultValue:3,min:1,max:100,step:1},twinkleColor:{type:ControlType.Color,title:\"Twinkle Color\",defaultValue:\"#ffdd57\"},useGradient:{type:ControlType.Boolean,title:\"Use Gradient\",defaultValue:false},gradientStart:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#ffdd57\",hidden:({useGradient})=>!useGradient},gradientEnd:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#ffffff\",hidden:({useGradient})=>!useGradient},patternScale:{type:ControlType.Number,title:\"Pattern Scale\",defaultValue:1,min:.1,max:3,step:.1},startColor:{type:ControlType.Color,title:\"Start Color\",defaultValue:\"#333\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TwinklingPlusPattern\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TwinklingPlusPattern.map"],
  "mappings": "qHAAwK,SAARA,EAAsC,CAAC,aAAAC,EAAa,cAAAC,EAAc,aAAAC,EAAa,YAAAC,EAAY,cAAAC,EAAc,YAAAC,EAAY,aAAAC,EAAa,WAAAC,CAAU,EAAE,CAExR,IAAMC,EAAS,GAAaF,EAC5CG,EAAQ,KAAK,KAAK,IAAMD,CAAQ,EAAQE,EAAK,KAAK,KAAK,IAAOF,CAAQ,EAAQG,EAAWF,EAAQC,EAElG,CAACE,EAAaC,CAAe,EAAEC,EAAS,MAAMH,CAAU,EAAE,KAAK,EAAK,CAAC,EAC1E,OAAAI,EAAU,IAAI,CAACF,EAAgB,MAAMF,CAAU,EAAE,KAAK,EAAK,CAAC,CAAE,EAAE,CAACA,CAAU,CAAC,EAC5EI,EAAU,IAAI,CAAC,IAAMC,EAAS,YAAY,IAAI,CAC9C,IAAMC,EAAS,MAAMN,CAAU,EAAE,KAAK,EAAK,EACrCO,EAAM,KAAK,IAAIjB,EAAcU,CAAU,EACvCQ,EAAQ,MAAM,KAAK,CAAC,OAAOR,CAAU,EAAE,CAACS,EAAEC,IAAIA,CAAC,EACrD,QAAQA,EAAEF,EAAQ,OAAO,EAAEE,EAAE,EAAEA,IAAI,CAAC,IAAMC,EAAE,KAAK,MAAM,KAAK,OAAO,GAAGD,EAAE,EAAE,EAAE,CAACF,EAAQE,CAAC,EAAEF,EAAQG,CAAC,CAAC,EAAE,CAACH,EAAQG,CAAC,EAAEH,EAAQE,C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SAAS,iBAAiB,SAAS,KAAKL,EAAY,iBAAiBD,EAAa,UAAU,gBAAgByB,EAAY,SAAS,EAAE,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,EAAEC,CAAK,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAACK,EAAoBlC,EAAqB,CAAC,aAAa,CAAC,KAAKmC,EAAY,OAAO,MAAM,qBAAqB,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,MAAM,yBAAyB,aAAa,EAAE,IAAI,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,aAAa,CAAC,KAAKA,EAAY,MAAM,MAAM,gBAAgB,aAAa,SAAS,EAAE,YAAY,CAAC,KAAKA,EAAY,QAAQ,MAAM,eAAe,aAAa,EAAK,EAAE,cAAc,CAAC,KAAKA,EAAY,MAAM,MAAM,iBAAiB,aAAa,UAAU,OAAO,CAAC,CAAC,YAAA/B,CAAW,IAAI,CAACA,CAAW,EAAE,YAAY,CAAC,KAAK+B,EAAY,MAAM,MAAM,eAAe,aAAa,UAAU,OAAO,CAAC,CAAC,YAAA/B,CAAW,IAAI,CAACA,CAAW,EAAE,aAAa,CAAC,KAAK+B,EAAY,OAAO,MAAM,gBAAgB,aAAa,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,CAAC,KAAKA,EAAY,MAAM,MAAM,cAAc,aAAa,MAAM,CAAC,CAAC",
  "names": ["TwinklingPlusPattern", "twinkleSpeed", "twinkleAmount", "twinkleColor", "useGradient", "gradientStart", "gradientEnd", "patternScale", "startColor", "cellSize", "columns", "rows", "totalCells", "twinkleState", "setTwinkleState", "ye", "ue", "interval", "newState", "count", "indices", "_", "i", "j", "k", "p", "Frame", "u", "isTwinkling", "index", "col", "row", "x", "y", "addPropertyControls", "ControlType"]
}
