Fix dashboard swipe and visual details
This commit is contained in:
+44
-1
@@ -955,7 +955,8 @@ body.page-dashboard .content {
|
||||
gap: 0.25rem;
|
||||
min-width: 0;
|
||||
flex: 0 0 var(--sleep-segment-width, auto);
|
||||
padding: 0.35rem 0.65rem;
|
||||
width: var(--sleep-segment-width, auto);
|
||||
padding: 0.35rem 0.45rem;
|
||||
color: rgba(255, 255, 255, 0.94);
|
||||
font-size: 0.82rem;
|
||||
white-space: nowrap;
|
||||
@@ -964,6 +965,15 @@ body.page-dashboard .content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sleep-phase-bar__segment.is-compact {
|
||||
padding-inline: 0.12rem;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.sleep-phase-bar__segment.is-compact strong {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sleep-phase-bar__segment::after {
|
||||
content: attr(data-tooltip);
|
||||
position: fixed;
|
||||
@@ -1962,6 +1972,39 @@ body.page-dashboard .content {
|
||||
color: rgba(18, 48, 75, 0.9);
|
||||
}
|
||||
|
||||
.day-summary-card__label,
|
||||
.day-chip,
|
||||
.range-day-card__score,
|
||||
.score-scale,
|
||||
.signal-scale {
|
||||
color: rgba(18, 48, 75, 0.72);
|
||||
}
|
||||
|
||||
.day-chip {
|
||||
background: rgba(18, 48, 75, 0.07);
|
||||
border-color: rgba(18, 48, 75, 0.14);
|
||||
}
|
||||
|
||||
.signal-pill {
|
||||
color: rgba(18, 48, 75, 0.92);
|
||||
}
|
||||
|
||||
.signal-pill strong,
|
||||
.signal-pill span {
|
||||
color: rgba(18, 48, 75, 0.92);
|
||||
}
|
||||
|
||||
.overlay-signal-card h3,
|
||||
.overlay-signal-card p,
|
||||
.overlay-signal-card__ring,
|
||||
.overlay-signal-card__buttons button {
|
||||
color: rgba(18, 48, 75, 0.92);
|
||||
}
|
||||
|
||||
.overlay-signal-card__ring {
|
||||
background: rgba(255, 255, 255, 0.68);
|
||||
}
|
||||
|
||||
.range-moment-list__item span span,
|
||||
.timeline-card__value,
|
||||
.timeline-card--empty p {
|
||||
|
||||
+20
-3
@@ -1450,22 +1450,29 @@
|
||||
let pointerStartX = 0;
|
||||
let pointerStartY = 0;
|
||||
let dragging = false;
|
||||
let ignoreSwipe = false;
|
||||
let didSwipe = false;
|
||||
|
||||
const handleSwipe = (deltaX, deltaY) => {
|
||||
if (ignoreSwipe || document.body.classList.contains("is-dashboard-overlay-open") || Math.abs(deltaX) < 70 || Math.abs(deltaY) > 50) {
|
||||
if (document.body.classList.contains("is-dashboard-overlay-open") || Math.abs(deltaX) < 70 || Math.abs(deltaY) > 50) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (deltaX < 0 && swipeContainer.dataset.nextDate) {
|
||||
didSwipe = true;
|
||||
window.location.href = dashboardDayPath(swipeContainer.dataset.nextDate);
|
||||
} else if (deltaX > 0 && swipeContainer.dataset.prevDate) {
|
||||
didSwipe = true;
|
||||
window.location.href = dashboardDayPath(swipeContainer.dataset.prevDate);
|
||||
}
|
||||
};
|
||||
|
||||
swipeContainer.addEventListener("pointerdown", event => {
|
||||
ignoreSwipe = Boolean(event.target.closest("a, button, input, textarea, select, label, [data-event-editable]"));
|
||||
if (event.target.closest("input, textarea, select, label, [data-stepper], .dashboard-overlay")) {
|
||||
dragging = false;
|
||||
return;
|
||||
}
|
||||
|
||||
didSwipe = false;
|
||||
dragging = true;
|
||||
pointerStartX = event.clientX;
|
||||
pointerStartY = event.clientY;
|
||||
@@ -1484,6 +1491,16 @@
|
||||
dragging = false;
|
||||
});
|
||||
|
||||
swipeContainer.addEventListener("click", event => {
|
||||
if (!didSwipe) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
didSwipe = false;
|
||||
}, true);
|
||||
|
||||
window.addEventListener("keydown", event => {
|
||||
if (document.body.classList.contains("is-dashboard-overlay-open")) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user