File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -304,9 +304,14 @@ const App: React.FC = () => {
304304 < div className = "absolute inset-4 pointer-events-none" >
305305 < AnimatePresence >
306306 { tiles . map ( ( tile ) => {
307- const tileSize = `calc(25% - 12px)` ;
308- const xPos = `calc(${ tile . col * 25 } % + ${ tile . col * 16 } px)` ;
309- const yPos = `calc(${ tile . row * 25 } % + ${ tile . row * 16 } px)` ;
307+ // Each cell is 25% of container width
308+ // Gap between cells is 16px (gap-4)
309+ // Position = (index * (cell_width + gap))
310+ const cellPercent = 25 ; // 100% / 4 cells
311+ const gapPx = 16 ;
312+ const xPos = `calc(${ tile . col * cellPercent } % + ${ tile . col * gapPx } px)` ;
313+ const yPos = `calc(${ tile . row * cellPercent } % + ${ tile . row * gapPx } px)` ;
314+ const tileSize = `calc(${ cellPercent } % - ${ gapPx } px)` ;
310315
311316 return (
312317 < motion . div
You can’t perform that action at this time.
0 commit comments