Updated pet calcs to be more accurate
Fixed some layout issues
Updated profile popup
This commit is contained in:
fraxle
2026-07-30 00:01:51 +01:00
parent f356954f40
commit b10e0da25f
8 changed files with 150 additions and 33 deletions
+16
View File
@@ -29,6 +29,7 @@ export function useTableScroll({
bodyTableRef,
bodyScrollRef,
headTrackRef,
tableWrapRef,
forecast,
visibleCols,
selectedDay,
@@ -111,6 +112,15 @@ export function useTableScroll({
const body = bodyScrollRef.current;
if (!track || !body) return;
track.style.transform = `translate3d(${-body.scrollLeft}px, 0, 0)`;
// The Hour column's header cells (one per thead row) need to stay
// pinned to the left edge even though the track they live in is
// being shifted above - cancel that shift with an equal-and-opposite
// translate so they hold still while the rest of the header scrolls.
const headTable = headTableRef.current;
if (headTable) {
const pinnedCells = headTable.querySelectorAll('thead th:first-child');
pinnedCells.forEach(c => { c.style.transform = `translate3d(${body.scrollLeft}px, 0, 0)`; });
}
updateTableScrollIndicators();
};
@@ -198,6 +208,12 @@ export function useTableScroll({
// column N in the body, no drift as you scroll right.
headTable.style.width = `${totalWidth}px`;
bodyTable.style.width = `${totalWidth}px`;
// Expose the pinned Hour column's width as a CSS var so the left
// scroll-fade indicator can start after it, over the first column
// that actually scrolls, rather than over the pinned column itself.
if (tableWrapRef && tableWrapRef.current) {
tableWrapRef.current.style.setProperty('--hour-col-w', `${finalW[0]}px`);
}
// Re-apply current horizontal offset so column alignment survives.
handleBodyScroll();
};