Files
Ghost_Kitchen/src/components/orders/OrderStatusView.module.scss
T
2026-10-04 21:51:50 +02:00

405 lines
6.8 KiB
SCSS

@use '../../styles/variables' as *;
.page {
max-width: 720px;
margin: 0 auto;
padding: $space-5 $space-3;
}
.backLink {
display: inline-flex;
align-items: center;
gap: $space-1;
margin: 0 0 $space-3;
color: $color-text-muted;
font-size: 0.85rem;
text-decoration: none;
&:hover {
color: $color-primary;
.backArrow {
transform: translateX(-3px);
}
}
}
.backArrow {
height: 1rem;
width: 1rem;
flex-shrink: 0;
transition: transform 0.15s ease;
}
.heading {
margin: 0 0 $space-1;
}
.orderStatus {
margin: 0 0 $space-1;
color: $color-text-muted;
text-transform: capitalize;
}
.orderDate {
margin: 0 0 $space-4;
color: $color-text-muted;
font-size: 0.85rem;
}
.simulateButton {
margin: 0 0 $space-4;
padding: $space-1 $space-3;
border: 1px dashed $color-text-muted;
border-radius: $radius;
background: none;
color: $color-text-muted;
font-size: 0.85rem;
cursor: pointer;
transition:
border-color 0.15s ease,
color 0.15s ease;
&:hover:not(:disabled) {
border-color: $color-primary;
color: $color-primary;
}
&:disabled {
opacity: 0.6;
cursor: not-allowed;
}
}
.error {
color: $color-danger;
}
.items {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: $space-3;
}
.item {
padding: $space-3;
border: 1px solid $color-border;
border-radius: $radius;
background: $color-surface;
}
.itemHeader {
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 600;
margin-bottom: $space-2;
}
.menuButton {
display: inline-flex;
flex-shrink: 0;
margin: (-$space-2) (-$space-2) (-$space-2) $space-2;
padding: $space-2;
border: none;
border-radius: $radius;
background: none;
color: $color-text-muted;
cursor: pointer;
svg {
width: 1.25rem;
height: 1.25rem;
stroke-width: 3;
}
&:hover {
color: $color-text;
}
}
.menu {
position: fixed;
position-area: bottom span-left;
position-try-fallbacks: flip-block;
inset: auto;
margin: $space-1 0;
padding: $space-1;
min-width: 160px;
border: 1px solid $color-border;
border-radius: $radius;
background: $color-surface;
color: $color-text;
font-weight: 400;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.menuItem {
display: flex;
align-items: center;
gap: $space-2;
width: 100%;
padding: $space-2 $space-3;
border: none;
border-radius: calc(#{$radius} - 2px);
background: none;
color: inherit;
font: inherit;
font-size: 0.9rem;
text-align: left;
text-decoration: none;
cursor: pointer;
&:hover:not(:disabled) {
background: $color-background;
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
svg {
width: 1rem;
height: 1rem;
flex-shrink: 0;
}
}
.itemOptions {
margin: 0 0 $space-2;
font-size: 0.85rem;
color: $color-text-muted;
}
// The negative margin + matching padding leaves room for the in-progress
// dot's sonar ping, which the collapse animation's overflow would clip.
.timelineWrapper {
overflow: hidden;
margin: (-$space-2);
padding: $space-2;
}
.bannerRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: $space-2;
margin: 0 0 $space-2;
}
.timeline {
margin: 0 0 $space-2;
padding: 0;
list-style: none;
}
.step {
position: relative;
display: grid;
grid-template-columns: $space-3 1fr;
column-gap: $space-2;
padding-bottom: $space-3;
font-size: 0.85rem;
color: $color-text-muted;
&:last-child {
padding-bottom: 0;
}
}
.stepMarker {
position: relative;
display: flex;
justify-content: center;
}
.stepDot {
position: relative;
width: 10px;
height: 10px;
margin-top: 3px;
border: 2px solid $color-border;
border-radius: 50%;
background: $color-background;
z-index: 1;
}
.stepConnector {
position: absolute;
top: 15px;
bottom: -$space-3;
left: 50%;
width: 2px;
background: $color-border;
transform: translateX(-50%);
overflow: hidden;
}
.stepConnectorFill {
position: absolute;
inset: 0;
background: $color-success;
transform-origin: top;
}
.step:last-child .stepConnector {
display: none;
}
.stepContent {
display: flex;
flex-direction: column;
gap: $space-1;
padding-top: 1px;
}
.stepMeta {
font-size: 0.75rem;
}
.step[data-status='done'] {
opacity: 0.3;
.stepDot {
border-color: $color-success;
background: $color-success;
}
.stepLabel {
color: $color-text;
}
}
.step[data-status='in_progress'] {
.stepDot {
border-color: $color-success;
background: $color-success;
@media (prefers-reduced-motion: no-preference) {
animation: dotPopIn 0.4s ease-out 0.6s backwards;
&::after {
content: '';
position: absolute;
inset: 0;
border-radius: 50%;
background: $color-success;
opacity: 0;
animation: sonarPing 1.6s ease-out 1s infinite;
}
}
}
}
// Animates the box size instead of transform: scale, which Chrome
// rasterizes at a low resolution mid-animation and renders the tiny dot square.
@keyframes dotPopIn {
0% {
border-color: $color-border;
background: $color-background;
}
50% {
width: 14px;
height: 14px;
margin-top: 1px;
}
}
@keyframes sonarPing {
0% {
transform: scale(1);
opacity: 0.6;
}
100% {
transform: scale(2.8);
opacity: 0;
}
}
.step[data-status='pending'] {
opacity: 0.6;
}
.actions {
display: flex;
flex-wrap: wrap;
gap: $space-2;
align-items: center;
button,
a {
display: inline-flex;
align-items: center;
gap: $space-1;
padding: $space-2 $space-4;
border: 1px solid $color-border;
border-radius: $radius;
background: $color-background;
color: $color-text;
text-decoration: none;
cursor: pointer;
transition: border-color 0.15s ease;
&:hover:not(:disabled) {
border-color: $color-primary;
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
.pickupButton {
overflow: hidden;
white-space: nowrap;
transition: opacity 0.3s ease;
border-color: $color-text;
background: $color-text;
color: $color-background;
font-weight: 600;
&:hover:not(:disabled) {
border-color: $color-text;
opacity: 0.9;
}
@media (max-width: $breakpoint-tablet) {
flex-basis: 100%;
justify-content: center;
margin-top: $space-2;
margin-bottom: $space-2;
}
}
.actionIcon {
width: 1rem;
height: 1rem;
flex-shrink: 0;
}
// The shackle lifts above the 24-unit viewBox when unlocked.
.lockIcon {
overflow: visible;
}
.cancelButton {
padding: $space-1 $space-2;
border: none;
background: none;
color: $color-text-muted;
font-size: 0.85rem;
text-decoration: underline;
&:hover:not(:disabled) {
color: $color-danger;
}
}
}