feat: home pages adapted to mobile

This commit is contained in:
Lucas
2026-10-26 14:25:56 +01:00
parent 631a66ceb5
commit cb34e5ef41
50 changed files with 1219 additions and 7 deletions
+117
View File
@@ -265,3 +265,120 @@
var(--tab-close-size)
);
}
/* ---------- Phone / touch ---------- */
/* Touch has no real hover: stop highlights from sticking after a tap */
@media (hover: none) {
.tab:hover {
background: transparent;
color: var(--text-muted);
border-color: var(--border-hairline);
}
.tab--active:hover {
background: var(--bg-panel);
color: var(--text-primary);
border-color: var(--accent-brand);
}
.tab-action:hover {
background: transparent;
border-color: transparent;
}
.tab-close:hover {
background: transparent;
color: var(--text-muted);
}
}
/* Undo the global 44px min-height for TopBar buttons (sized by the bar instead) */
@media (pointer: coarse) {
.topbar button {
min-height: 0;
}
/* Bigger invisible tap areas without changing the look */
.tab-led,
.tab-close {
position: relative;
}
.tab-led::after,
.tab-close::after {
content: '';
position: absolute;
inset: -10px;
}
}
@media (max-width: 768px) {
.topbar {
--header-height: 56px;
--tab-height: 40px;
gap: var(--space-2);
padding-inline: var(--space-2);
}
.logo-slot {
height: 70%;
flex: 0 0 auto;
}
.tabstrip {
gap: var(--space-2);
padding-left: var(--space-2);
scroll-snap-type: x mandatory;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
overscroll-behavior-x: contain;
}
.tabstrip::-webkit-scrollbar {
display: none;
}
/* Fixed-ish tab width instead of 25%, so names stay readable and you swipe */
.tab,
.tab[data-step='6'],
.tab[data-step='8'],
.tab[data-step='10'] {
flex: 0 0 auto;
width: min(44vw, 180px);
max-width: none;
min-width: 0;
font-size: var(--font-sm, var(--font-xs));
padding: 0 var(--space-2);
}
.tab-led {
height: 60%;
}
.tab-close {
height: 60%;
}
.tabstrip-actions {
gap: var(--space-2);
}
/* Buttons at least ~40px wide */
.tab-add,
.crown-action {
height: 40px;
width: 40px;
}
/* Empty state: keep the full "Add DSP" button, but let it be a bit taller */
.tab-add-empty {
height: 40px;
padding-inline: var(--space-3);
}
}
/* Very narrow phones: the Add DSP label would crowd the logo */
@media (max-width: 380px) {
.tab-add-empty span {
display: none;
}
.tab-add-empty {
width: 40px;
padding-inline: 0;
}
}
+6
View File
@@ -176,6 +176,12 @@ function TopBar({
prevCount.current = dsps.length;
}, [dsps.length]);
useEffect(() => {
tabstripRef.current
?.querySelector<HTMLElement>('.tab--active')
?.scrollIntoView({ behavior: 'smooth', inline: 'nearest', block: 'nearest' });
}, [selected, page]);
return (
<header className="topbar">
<button