Files
web-nuxt/app/components/LiveStatusBadge.vue
T
Noel Sabia 33063afbdf
ci / check (push) Successful in 50s
design: give PulseCast a shift-board identity
- replace default Onyx surfaces with paper/ink, signal orange and Archivo
- make /plan answer peak, staff-hours, cost vs flat and coverage above the fold
- add the weekly shift board, shared plan helpers and a pulse line
- rebuild /live as a phone-first dark board and /stage as a full-bleed projector
- label the real 14-20 Nov window; remove 'next week' claims
- keep Onyx components, SSR, live scenario updates and accessible states
2026-11-14 11:03:18 +01:00

129 lines
2.8 KiB
Vue

<script setup lang="ts">
import { LIVE_LABELS, liveAge } from '#shared/live'
import type { LiveConnection } from '#shared/live'
const props = withDefaults(
defineProps<{
status: LiveConnection
lastEventAt?: string
compact?: boolean
dark?: boolean
}>(),
{ lastEventAt: '', compact: false, dark: false },
)
const label = computed(() => LIVE_LABELS[props.status])
const age = computed(() => (props.lastEventAt ? liveAge(props.lastEventAt) : ''))
</script>
<template>
<span
class="pc-status"
:class="[`pc-status--${status}`, { 'pc-status--compact': compact, 'pc-status--dark': dark }]"
role="status"
aria-live="polite"
:title="lastEventAt ? `Last event ${age}` : undefined"
>
<span class="pc-status__dot" aria-hidden="true" />
<span class="pc-status__label">{{ label }}</span>
<span v-if="lastEventAt && !compact" class="pc-status__age">{{ age }}</span>
</span>
</template>
<style scoped>
.pc-status {
display: inline-flex;
align-items: center;
gap: 0.4rem;
color: var(--pc-muted, #6e665a);
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.04em;
line-height: 1;
text-transform: uppercase;
white-space: nowrap;
}
.pc-status__dot {
width: 0.45rem;
height: 0.45rem;
flex: none;
border-radius: 50%;
background: currentColor;
}
.pc-status__label {
color: var(--pc-ink, #16130f);
}
.pc-status--live .pc-status__dot {
background: var(--pc-green, #2e6b4f);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-green, #2e6b4f) 16%, transparent);
}
.pc-status--polling .pc-status__dot {
background: var(--pc-signal-text, #b63a00);
}
.pc-status--offline .pc-status__dot {
background: var(--pc-danger, #b3261e);
}
.pc-status--connecting .pc-status__dot {
background: var(--pc-muted, #6e665a);
}
.pc-status__age {
color: var(--pc-muted, #6e665a);
font-size: 0.66rem;
font-weight: 500;
letter-spacing: 0.02em;
text-transform: none;
}
.pc-status--compact .pc-status__label {
font-size: 0.66rem;
}
.pc-status--dark {
color: var(--pc-dark-muted, #b4ae9f);
}
.pc-status--dark .pc-status__label {
color: var(--pc-paper, #f4efe6);
}
.pc-status--dark .pc-status__age {
color: var(--pc-dark-muted, #b4ae9f);
}
.pc-status--dark.pc-status--live .pc-status__dot {
background: var(--pc-green-bright, #5fc99a);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-green-bright, #5fc99a) 18%, transparent);
}
.pc-status--dark.pc-status--polling .pc-status__dot {
background: var(--pc-signal-bright, #ff6a2a);
}
.pc-status--dark.pc-status--offline .pc-status__dot {
background: var(--pc-danger-bright, #ff7a6e);
}
@media (prefers-reduced-motion: no-preference) {
.pc-status--live .pc-status__dot {
animation: pc-status-pulse 2.4s ease-in-out infinite;
}
}
@keyframes pc-status-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.55;
}
}
</style>