feat: introduce the compact vehicle HUD
This commit is contained in:
@@ -133,187 +133,317 @@
|
||||
|
||||
.journey-hud {
|
||||
position: fixed;
|
||||
z-index: 4;
|
||||
inset: auto 1rem 1rem auto;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, auto);
|
||||
gap: 0.25rem 0.9rem;
|
||||
min-inline-size: 12rem;
|
||||
padding: 0.75rem 0.9rem;
|
||||
border: 1px solid rgb(128 217 230 / 38%);
|
||||
background: rgb(4 9 18 / 84%);
|
||||
z-index: var(--z-hud);
|
||||
inset: auto max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) auto;
|
||||
display: flex;
|
||||
min-block-size: 44px;
|
||||
align-items: center;
|
||||
gap: 0.72rem;
|
||||
padding: 0.48rem 0.72rem;
|
||||
border: 1px solid rgb(126 220 232 / 25%);
|
||||
border-radius: 2px;
|
||||
background: var(--surface-strong);
|
||||
box-shadow: 0 0.8rem 2.4rem rgb(0 5 14 / 28%);
|
||||
color: var(--text-muted);
|
||||
font: 600 var(--step--1)/1.2 var(--mono);
|
||||
letter-spacing: 0.06em;
|
||||
font: 560 0.72rem/1 var(--mono);
|
||||
letter-spacing: 0.08em;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.journey-hud__route {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.journey-hud__route span {
|
||||
color: rgb(170 185 194 / 70%);
|
||||
font-size: 0.61rem;
|
||||
}
|
||||
|
||||
.journey-hud__route strong {
|
||||
color: var(--text);
|
||||
font-size: 0.76rem;
|
||||
}
|
||||
|
||||
.journey-hud__section,
|
||||
.journey-hud__arrival {
|
||||
color: var(--cyan);
|
||||
}
|
||||
|
||||
.journey-hud__section::before {
|
||||
margin-inline-end: 0.72rem;
|
||||
color: rgb(126 220 232 / 35%);
|
||||
content: '/';
|
||||
}
|
||||
|
||||
.journey-hud__arrival {
|
||||
grid-column: 1 / -1;
|
||||
padding-inline-start: 0.12rem;
|
||||
color: var(--amber);
|
||||
}
|
||||
|
||||
.drive-controls {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
inset: auto auto 1rem 1rem;
|
||||
z-index: var(--z-popover);
|
||||
inset: auto auto max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.55rem;
|
||||
max-inline-size: calc(100vw - 2rem);
|
||||
padding: 0.55rem;
|
||||
border: 1px solid rgb(128 217 230 / 32%);
|
||||
background: rgb(4 9 18 / 88%);
|
||||
gap: 0.38rem;
|
||||
max-inline-size: calc(100vw - 1.5rem);
|
||||
font-family: var(--mono);
|
||||
font-size: var(--step--1);
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
|
||||
.drive-controls__audio-start,
|
||||
.drive-controls__audio {
|
||||
.drive-controls__dock {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.55rem;
|
||||
gap: 1px;
|
||||
padding: 3px;
|
||||
border: 1px solid rgb(126 220 232 / 24%);
|
||||
border-radius: 3px;
|
||||
background: var(--surface-strong);
|
||||
box-shadow: 0 0.8rem 2.4rem rgb(0 5 14 / 28%);
|
||||
}
|
||||
|
||||
.drive-controls__audio-start span,
|
||||
.drive-controls__audio-status {
|
||||
.drive-start,
|
||||
.drive-control-button {
|
||||
min-block-size: 44px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 2px;
|
||||
font-weight: 620;
|
||||
cursor: pointer;
|
||||
transition: opacity var(--transition), transform var(--transition);
|
||||
}
|
||||
|
||||
.drive-start {
|
||||
display: inline-flex;
|
||||
min-inline-size: 12.5rem;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding-inline: 1rem;
|
||||
border-color: rgb(120 216 229 / 72%);
|
||||
background: rgb(120 216 229 / 94%);
|
||||
box-shadow: 0 0 1.5rem rgb(77 201 220 / 17%);
|
||||
color: #041017;
|
||||
letter-spacing: 0.1em;
|
||||
}
|
||||
|
||||
.drive-start:hover:not(:disabled) {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.drive-start:disabled {
|
||||
cursor: wait;
|
||||
opacity: 0.64;
|
||||
}
|
||||
|
||||
.drive-control-button {
|
||||
position: relative;
|
||||
display: inline-grid;
|
||||
inline-size: 44px;
|
||||
place-items: center;
|
||||
padding: 0;
|
||||
background: rgb(8 17 29 / 92%);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.drive-controls button,
|
||||
.drive-controls select,
|
||||
.drive-controls input {
|
||||
min-block-size: 44px;
|
||||
border: 1px solid var(--line-strong);
|
||||
background: #101925;
|
||||
color: var(--text);
|
||||
.drive-control-button:hover {
|
||||
color: var(--cyan);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.drive-controls input[type="range"] {
|
||||
inline-size: 7rem;
|
||||
.drive-controls__settings-trigger {
|
||||
border-color: rgb(126 220 232 / 24%);
|
||||
background: var(--surface-strong);
|
||||
box-shadow: 0 0.8rem 2.4rem rgb(0 5 14 / 28%);
|
||||
}
|
||||
|
||||
.drive-start:focus-visible,
|
||||
.drive-start:focus,
|
||||
.drive-control-button:focus-visible,
|
||||
.drive-control-button:focus,
|
||||
.drive-popover input:focus-visible,
|
||||
.drive-popover select:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: inset 0 0 0 2px var(--focus), 0 0 0 1px rgb(3 8 17 / 90%);
|
||||
}
|
||||
|
||||
.drive-control-button::after {
|
||||
position: absolute;
|
||||
inset: auto auto calc(100% + 0.5rem) 50%;
|
||||
padding: 0.32rem 0.46rem;
|
||||
transform: translate(-50%, 4px);
|
||||
border: 1px solid rgb(126 220 232 / 18%);
|
||||
background: rgb(3 8 17 / 96%);
|
||||
color: var(--text);
|
||||
content: attr(data-tooltip);
|
||||
font: 520 0.65rem/1 var(--mono);
|
||||
letter-spacing: 0.02em;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity var(--transition), transform var(--transition);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.drive-control-button:hover::after,
|
||||
.drive-control-button:focus-visible::after {
|
||||
transform: translate(-50%, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.drive-popover {
|
||||
position: absolute;
|
||||
inset: auto auto calc(100% + 0.7rem) 0;
|
||||
display: grid;
|
||||
transform-origin: left bottom;
|
||||
border: 1px solid rgb(126 220 232 / 27%);
|
||||
border-radius: 3px;
|
||||
background: var(--surface-strong);
|
||||
box-shadow: 0 1.4rem 3rem rgb(0 4 12 / 42%);
|
||||
color: var(--text);
|
||||
animation: drive-popover-in var(--transition) both;
|
||||
}
|
||||
|
||||
@keyframes drive-popover-in {
|
||||
from {
|
||||
transform: translateY(6px);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.drive-popover--volume {
|
||||
grid-template-columns: auto minmax(8rem, 1fr) auto;
|
||||
min-inline-size: 16.5rem;
|
||||
align-items: center;
|
||||
gap: 0.7rem;
|
||||
padding: 0.7rem;
|
||||
}
|
||||
|
||||
.drive-popover--settings {
|
||||
grid-template-columns: auto minmax(7rem, 1fr);
|
||||
min-inline-size: 15rem;
|
||||
gap: 0.55rem 1rem;
|
||||
padding: 0.85rem;
|
||||
}
|
||||
|
||||
.drive-popover strong,
|
||||
.drive-popover label {
|
||||
color: var(--text-muted);
|
||||
font-size: 0.64rem;
|
||||
font-weight: 560;
|
||||
letter-spacing: 0.1em;
|
||||
}
|
||||
|
||||
.drive-popover strong {
|
||||
grid-column: 1 / -1;
|
||||
padding-block-end: 0.45rem;
|
||||
border-block-end: 1px solid rgb(126 220 232 / 14%);
|
||||
color: var(--cyan);
|
||||
}
|
||||
|
||||
.drive-popover input,
|
||||
.drive-popover select {
|
||||
min-block-size: 44px;
|
||||
}
|
||||
|
||||
.drive-popover input[type="range"] {
|
||||
inline-size: 100%;
|
||||
accent-color: var(--cyan);
|
||||
}
|
||||
|
||||
.drive-controls button {
|
||||
padding-inline: 0.8rem;
|
||||
.drive-popover select {
|
||||
border: 1px solid rgb(126 220 232 / 24%);
|
||||
border-radius: 2px;
|
||||
background: #08111d;
|
||||
color: var(--text);
|
||||
padding-inline: 0.65rem;
|
||||
}
|
||||
|
||||
.drive-controls label {
|
||||
.drive-popover output {
|
||||
color: var(--cyan);
|
||||
font-size: 0.68rem;
|
||||
}
|
||||
|
||||
.drive-controls__audio-status {
|
||||
display: inline-flex;
|
||||
min-block-size: 44px;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
}
|
||||
|
||||
.drive-controls select {
|
||||
padding-inline: 0.45rem;
|
||||
margin: 0;
|
||||
padding-inline: 0.85rem;
|
||||
border: 1px solid rgb(244 173 103 / 26%);
|
||||
border-radius: 2px;
|
||||
background: var(--surface-strong);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.drive-controls__status {
|
||||
grid-column: 1 / -1;
|
||||
margin: 0;
|
||||
padding-block-start: 0.4rem;
|
||||
border-block-start: 1px solid rgb(126 220 232 / 14%);
|
||||
color: var(--text-muted);
|
||||
font-size: 0.66rem;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
html {
|
||||
scroll-padding-block-end: 11rem;
|
||||
scroll-padding-block-end: 7rem;
|
||||
}
|
||||
|
||||
#contact {
|
||||
padding-block-end: 11rem;
|
||||
padding-block-end: 7rem;
|
||||
}
|
||||
|
||||
#contact a {
|
||||
scroll-margin-block-end: 11rem;
|
||||
}
|
||||
|
||||
.journey-hud__quality {
|
||||
display: none;
|
||||
scroll-margin-block-end: 7rem;
|
||||
}
|
||||
|
||||
.drive-controls {
|
||||
inset: auto 0.5rem 0.5rem;
|
||||
}
|
||||
|
||||
.drive-controls__status {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.drive-controls__audio-start span {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) and (min-height: 421px) {
|
||||
.site-header {
|
||||
padding-block-start: calc(
|
||||
var(--space-4) + var(--site-navigation-block-size) + 32px
|
||||
);
|
||||
inset-inline-start: max(0.5rem, env(safe-area-inset-left));
|
||||
inset-block-end: max(0.5rem, env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.journey-hud {
|
||||
inset: var(--site-navigation-block-size) 0 auto;
|
||||
display: flex;
|
||||
min-block-size: 32px;
|
||||
min-inline-size: 0;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.6rem;
|
||||
padding: 0.35rem 0.75rem;
|
||||
border-inline: 0;
|
||||
font-size: 0.7rem;
|
||||
inset-inline-end: max(0.5rem, env(safe-area-inset-right));
|
||||
inset-block-end: max(0.5rem, env(safe-area-inset-bottom));
|
||||
max-inline-size: 6.5rem;
|
||||
gap: 0.3rem;
|
||||
padding-inline: 0.55rem;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.journey-hud__arrival {
|
||||
grid-column: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) and (min-height: 421px) {
|
||||
.drive-controls {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
inline-size: calc(100% - 1rem);
|
||||
gap: 0.35rem;
|
||||
font-size: 0.72rem;
|
||||
.journey-hud__route span,
|
||||
.journey-hud__section::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.drive-controls__audio-start,
|
||||
.drive-controls__audio {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.drive-controls > button,
|
||||
.drive-controls__audio-start button,
|
||||
.drive-controls__audio button {
|
||||
inline-size: 100%;
|
||||
padding-inline: 0.45rem;
|
||||
}
|
||||
|
||||
.drive-controls__audio-start span,
|
||||
.drive-controls__audio > label {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.drive-controls > label {
|
||||
min-inline-size: 0;
|
||||
gap: 0.25rem;
|
||||
.journey-hud__section {
|
||||
max-inline-size: 4.25rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.drive-controls > label select {
|
||||
inline-size: 4.6rem;
|
||||
min-inline-size: 0;
|
||||
.journey-hud__arrival {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.drive-controls__status {
|
||||
grid-column: 2;
|
||||
margin: 0;
|
||||
align-self: center;
|
||||
.drive-start {
|
||||
min-inline-size: 9rem;
|
||||
gap: 0.6rem;
|
||||
padding-inline: 0.62rem;
|
||||
font-size: 0.6rem;
|
||||
}
|
||||
|
||||
.drive-popover {
|
||||
position: fixed;
|
||||
inset: auto 0.5rem calc(max(0.5rem, env(safe-area-inset-bottom)) + 3.25rem);
|
||||
max-inline-size: calc(100vw - 1rem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,13 +455,19 @@
|
||||
.drive-controls {
|
||||
position: relative;
|
||||
inset: auto;
|
||||
max-inline-size: calc(100% - 1rem);
|
||||
margin: 0.5rem;
|
||||
inline-size: fit-content;
|
||||
max-inline-size: calc(100% - 1.5rem);
|
||||
margin: 0.75rem;
|
||||
}
|
||||
|
||||
#contact {
|
||||
padding-block-end: var(--space-3);
|
||||
}
|
||||
|
||||
.drive-popover {
|
||||
position: absolute;
|
||||
inset: auto auto calc(100% + 0.5rem) 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
Reference in New Issue
Block a user