mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-12 17:00:28 +00:00
feat: Add shadcn worker UI
This commit is contained in:
341
worker/src/layouts/BaseLayout.astro
Normal file
341
worker/src/layouts/BaseLayout.astro
Normal file
@@ -0,0 +1,341 @@
|
||||
---
|
||||
interface Props {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
const { title = "MeshCore SAR RX Stats" } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>{title}</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #ecf2f7;
|
||||
--panel: rgba(255, 255, 255, 0.86);
|
||||
--panel-strong: #ffffff;
|
||||
--text: #10212f;
|
||||
--muted: #607284;
|
||||
--line: rgba(16, 33, 47, 0.1);
|
||||
--brand: #0d8f8a;
|
||||
--brand-2: #235fa4;
|
||||
--accent: #ff8f3c;
|
||||
--danger: #b9384f;
|
||||
--shadow: 0 18px 48px rgba(16, 33, 47, 0.08);
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(13, 143, 138, 0.16), transparent 32%),
|
||||
radial-gradient(circle at top right, rgba(35, 95, 164, 0.12), transparent 26%),
|
||||
linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
|
||||
color: var(--text);
|
||||
}
|
||||
.shell {
|
||||
max-width: 1320px;
|
||||
margin: 0 auto;
|
||||
padding: 28px 20px 44px;
|
||||
}
|
||||
.hero,
|
||||
.kpi-grid,
|
||||
.content-grid {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
}
|
||||
.hero {
|
||||
grid-template-columns: 1.8fr 1fr;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
.kpi-grid {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.content-grid {
|
||||
grid-template-columns: 1.25fr 0.95fr;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.panel,
|
||||
.hero-card,
|
||||
.kpi {
|
||||
background: var(--panel);
|
||||
border: 1px solid rgba(255, 255, 255, 0.7);
|
||||
border-radius: 28px;
|
||||
backdrop-filter: blur(18px);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.hero-card,
|
||||
.panel,
|
||||
.kpi {
|
||||
padding: 24px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: clamp(2rem, 4vw, 3.4rem);
|
||||
line-height: 0.94;
|
||||
max-width: 10ch;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.eyebrow {
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.12em;
|
||||
font-size: 0.72rem;
|
||||
color: var(--muted);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.hero-copy {
|
||||
max-width: 58ch;
|
||||
color: var(--muted);
|
||||
line-height: 1.55;
|
||||
margin-top: 14px;
|
||||
}
|
||||
.window-tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 22px;
|
||||
}
|
||||
.window-tab {
|
||||
border: 1px solid var(--line);
|
||||
background: rgba(255, 255, 255, 0.48);
|
||||
color: var(--text);
|
||||
border-radius: 999px;
|
||||
padding: 10px 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
.window-tab[data-active="true"] {
|
||||
background: linear-gradient(135deg, var(--brand), var(--brand-2));
|
||||
color: #fff;
|
||||
border-color: transparent;
|
||||
}
|
||||
.hero-value,
|
||||
.kpi-value {
|
||||
font-weight: 700;
|
||||
}
|
||||
.hero-value {
|
||||
font-size: 2.3rem;
|
||||
line-height: 1;
|
||||
}
|
||||
.hero-note,
|
||||
.kpi-note,
|
||||
.empty,
|
||||
.legend {
|
||||
color: var(--muted);
|
||||
}
|
||||
.hero-note,
|
||||
.kpi-note,
|
||||
.legend,
|
||||
.table-note,
|
||||
.empty {
|
||||
font-size: 0.92rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.kpi-value {
|
||||
font-size: 2rem;
|
||||
margin: 8px 0 4px;
|
||||
}
|
||||
.bars {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(26px, 1fr));
|
||||
gap: 8px;
|
||||
align-items: end;
|
||||
min-height: 220px;
|
||||
}
|
||||
.bar-card {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
align-content: end;
|
||||
min-height: 220px;
|
||||
}
|
||||
.bar {
|
||||
min-height: 6px;
|
||||
border-radius: 14px 14px 8px 8px;
|
||||
background: linear-gradient(180deg, #235fa4 0%, #0d8f8a 100%);
|
||||
}
|
||||
.bar-label {
|
||||
font-size: 0.75rem;
|
||||
color: var(--muted);
|
||||
writing-mode: vertical-rl;
|
||||
transform: rotate(180deg);
|
||||
height: 72px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.bar-value {
|
||||
text-align: center;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.pill-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.pill {
|
||||
min-width: 150px;
|
||||
border-radius: 20px;
|
||||
padding: 12px 14px;
|
||||
background: rgba(13, 143, 138, 0.08);
|
||||
}
|
||||
.pill strong {
|
||||
display: block;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
text-align: left;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid var(--line);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
th {
|
||||
color: var(--muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
code {
|
||||
font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
|
||||
font-size: 0.88rem;
|
||||
}
|
||||
.meter-stack {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
.meter-row {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
}
|
||||
.meter-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
.meter-track {
|
||||
height: 12px;
|
||||
border-radius: 999px;
|
||||
overflow: hidden;
|
||||
background: rgba(35, 95, 164, 0.1);
|
||||
}
|
||||
.meter-fill {
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(90deg, #235fa4, #0d8f8a);
|
||||
}
|
||||
.map {
|
||||
position: relative;
|
||||
min-height: 320px;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(circle at 25% 35%, rgba(255, 255, 255, 0.14), transparent 16%),
|
||||
radial-gradient(circle at 72% 48%, rgba(255, 255, 255, 0.12), transparent 18%),
|
||||
linear-gradient(180deg, #10263d 0%, #173858 100%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
.map::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background:
|
||||
linear-gradient(transparent 49.5%, rgba(255, 255, 255, 0.05) 50%, transparent 50.5%),
|
||||
linear-gradient(90deg, transparent 49.5%, rgba(255, 255, 255, 0.05) 50%, transparent 50.5%);
|
||||
opacity: 0.5;
|
||||
}
|
||||
.continent {
|
||||
position: absolute;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
filter: blur(1px);
|
||||
}
|
||||
.continent.one {
|
||||
inset: 18% auto auto 8%;
|
||||
width: 26%;
|
||||
height: 22%;
|
||||
}
|
||||
.continent.two {
|
||||
inset: 20% auto auto 38%;
|
||||
width: 20%;
|
||||
height: 18%;
|
||||
}
|
||||
.continent.three {
|
||||
inset: 30% 10% auto auto;
|
||||
width: 26%;
|
||||
height: 26%;
|
||||
}
|
||||
.continent.four {
|
||||
inset: auto auto 12% 34%;
|
||||
width: 18%;
|
||||
height: 20%;
|
||||
}
|
||||
.map-dot {
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
border: 2px solid rgba(255, 255, 255, 0.92);
|
||||
transform: translate(-50%, -50%);
|
||||
box-shadow: 0 0 0 8px rgba(255, 143, 60, 0.16);
|
||||
}
|
||||
.map-dot::after {
|
||||
content: attr(data-label);
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
top: -8px;
|
||||
padding: 5px 8px;
|
||||
border-radius: 999px;
|
||||
background: rgba(16, 33, 47, 0.74);
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
.banner {
|
||||
margin-bottom: 16px;
|
||||
padding: 14px 16px;
|
||||
border-radius: 18px;
|
||||
background: rgba(185, 56, 79, 0.1);
|
||||
color: var(--danger);
|
||||
border: 1px solid rgba(185, 56, 79, 0.16);
|
||||
}
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
@media (max-width: 1040px) {
|
||||
.hero,
|
||||
.kpi-grid,
|
||||
.content-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.bar-label {
|
||||
writing-mode: initial;
|
||||
transform: none;
|
||||
height: auto;
|
||||
}
|
||||
.bars {
|
||||
grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<slot />
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user