redesign clock card on manual submission
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
const compassRose = document.querySelector("#manual-compass-rose");
|
||||
const compassHeading = document.querySelector("#manual-compass-heading");
|
||||
const reportTime = document.querySelector("#manual-report-time");
|
||||
const reportHours = document.querySelector("#report-clock-hours");
|
||||
const reportMinutes = document.querySelector("#report-clock-minutes");
|
||||
let orientationListener;
|
||||
let compassUnavailableTimeout;
|
||||
let compassRotation = null;
|
||||
@@ -34,7 +36,13 @@
|
||||
if (!reportTime) return;
|
||||
const now = new Date();
|
||||
reportTime.dateTime = now.toISOString();
|
||||
reportTime.textContent = now.toLocaleTimeString(document.documentElement.lang || undefined, { hour: "2-digit", minute: "2-digit" });
|
||||
const parts = new Intl.DateTimeFormat(document.documentElement.lang || undefined, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).formatToParts(now);
|
||||
const hours = parts.find((part) => part.type === "hour")?.value;
|
||||
const minutes = parts.find((part) => part.type === "minute")?.value;
|
||||
if (!hours || !minutes || !reportHours || !reportMinutes) return;
|
||||
reportHours.textContent = hours;
|
||||
reportMinutes.textContent = minutes;
|
||||
reportTime.setAttribute("aria-label", `${hours}:${minutes}`);
|
||||
};
|
||||
updateReportTime();
|
||||
if (reportTime) window.setInterval(updateReportTime, 60000);
|
||||
|
||||
@@ -151,8 +151,39 @@
|
||||
|
||||
.manual-report__heading-row { display: flex; align-items: center; gap: .7rem; }
|
||||
.manual-report__fire { flex: none; font-size: clamp(1.8rem, 5vw, 2.5rem); filter: drop-shadow(0 .2rem .65rem #ff703b88); }
|
||||
.manual-report__context { display: flex; align-items: center; gap: .35rem; margin: -.65rem 0 1.25rem; color: #bdafd8; font-size: .88rem; font-variant-numeric: tabular-nums; }
|
||||
.manual-report__context span { font-size: 1.1rem; }
|
||||
.manual-report__intro, .dashboard-report .manual-report__intro { margin-bottom: .85rem; }
|
||||
.report-clock {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 36rem;
|
||||
margin: 0 0 1rem;
|
||||
padding: .65rem .95rem .7rem;
|
||||
border: 1px solid #69539d;
|
||||
border-radius: .85rem;
|
||||
background: linear-gradient(115deg, #17162d, #10182c);
|
||||
box-shadow: inset 0 1px #ffffff0a;
|
||||
}
|
||||
.report-clock__label { color: #cbbce5; font-size: .66rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
|
||||
.report-clock__display { display: flex; align-items: end; justify-content: space-between; gap: .75rem; }
|
||||
.report-clock__time {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
color: #ffbf72;
|
||||
font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
|
||||
font-size: clamp(2rem, 9vw, 2.45rem);
|
||||
font-weight: 700;
|
||||
line-height: 1.1;
|
||||
letter-spacing: 0;
|
||||
font-variant-numeric: tabular-nums;
|
||||
text-shadow: 0 0 .7rem #ff963b55;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.report-clock__time span { display: inline-block; }
|
||||
.report-clock__time #report-clock-hours, .report-clock__time #report-clock-minutes { width: 2ch; }
|
||||
.report-clock__colon { width: 1ch; flex: none; margin-inline: -.08em; line-height: 1; text-align: center; transform: translateY(-.06em); animation: report-clock-blink 2s steps(1, end) infinite; }
|
||||
.report-clock__now { display: inline-flex; align-items: center; gap: .4rem; flex: none; padding: .2rem .45rem; border: 1px solid #93634d; border-radius: 999px; color: #ffd2a2; font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
|
||||
.report-clock__dot { width: .4rem; height: .4rem; border-radius: 50%; background: #ffab5d; }
|
||||
@keyframes report-clock-blink { 50% { opacity: 0; } }
|
||||
.manual-direction-panel__open { width: 100%; text-align: left; }
|
||||
.manual-direction-panel--open .manual-compass { width: 100%; margin: .5rem auto 1rem; }
|
||||
.manual-direction-panel--open .manual-compass__dial { width: min(100%, 12rem); border-color: #8b67d4; background: radial-gradient(circle, #302054 0 20%, #17132d 70%); box-shadow: 0 0 0 .35rem #6640a228, 0 0 2rem #ac6aff35; }
|
||||
@@ -178,9 +209,10 @@
|
||||
:root[data-theme="dark"] .manual-direction-panel[data-state="captured"] { border-color: #68dba1; }
|
||||
:root[data-theme="dark"] .manual-direction-panel[data-state="unavailable"] { border-color: #d38b7a; }
|
||||
|
||||
:root[data-theme="light"] .manual-report__context { color: #70466d; }
|
||||
:root[data-theme="light"] .report-clock { border-color: #8b6bab; background: linear-gradient(115deg, #221b37, #182039); }
|
||||
:root[data-theme="light"] .manual-direction-panel--open .manual-compass__dial { background: radial-gradient(circle, #f8ebf8 0 25%, #e8d7e9 75%); }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.manual-report__stepper button, .manual-direction-panel__open, .manual-direction-panel__close, .manual-report__submit { transition: none; }
|
||||
.manual-submission--success .manual-submission__icon { animation: none; }
|
||||
.report-clock__colon { animation: none; opacity: 1; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user