Fix grid viewer zoom: fixed cell px size + overflow-x scroll
Cells are sized in CSS px to fit at load time. Browser zoom now scales everything uniformly; grid scrolls horizontally instead of reflowing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1191,7 +1191,10 @@ function render_grid_viewer() {
|
||||
));
|
||||
|
||||
const cells_el = document.getElementById('grid-cells');
|
||||
cells_el.style.gridTemplateColumns = `repeat(${grid.cols}, 1fr)`;
|
||||
const gap = 4;
|
||||
const available = cells_el.parentElement.clientWidth;
|
||||
const cell_px = Math.floor((available - gap * (grid.cols - 1)) / grid.cols);
|
||||
cells_el.style.gridTemplateColumns = `repeat(${grid.cols}, ${cell_px}px)`;
|
||||
|
||||
const all_cells = grid.cells.flat().map((filename, idx) => {
|
||||
const row = Math.floor(idx / grid.cols);
|
||||
|
||||
@@ -1338,6 +1338,10 @@ nav {
|
||||
}
|
||||
|
||||
|
||||
.grid-viewer {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.grid-cells {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
|
||||
Reference in New Issue
Block a user