This commit is contained in:
jpmvaz
2026-09-13 20:09:20 +01:00
commit 9b5cc30fb4
482 changed files with 57569 additions and 0 deletions
+869
View File
@@ -0,0 +1,869 @@
/* ======================================================================
AlertHub — IT operations console aesthetic
Typography: JetBrains Mono (display/mono), Space Grotesk avoided in favour
of system stack with mono accents to keep the terminal vibe.
====================================================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');
:root {
--font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
--font-sans: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 14px;
--tx-h: 1.15;
--tx-b: 1.55;
}
/* ---------- Dark theme (default) ---------- */
[data-theme="dark"] {
--bg-base: #0a0e14;
--bg-elev-1: #0f141b;
--bg-elev-2: #141a23;
--bg-elev-3: #1a212c;
--grid-line: rgba(0, 212, 170, 0.04);
--border: #1f2733;
--border-strong: #2a3442;
--text-primary: #d8e2ec;
--text-secondary: #8b96a5;
--text-dim: #5a6371;
--accent: #00d4aa; /* signal green */
--accent-soft: rgba(0, 212, 170, 0.12);
--accent-hot: #00ffcc;
--magenta: #ff3e8b; /* alert magenta */
--amber: #ffb454;
--danger: #ff5c5c;
--info: #4ad8ff;
--shadow-1: 0 1px 0 rgba(255,255,255,0.03), 0 8px 24px rgba(0,0,0,0.5);
--glow-accent: 0 0 0 1px rgba(0,212,170,0.3), 0 0 20px rgba(0,212,170,0.15);
}
/* ---------- Light theme ---------- */
[data-theme="light"] {
--bg-base: #f4f6f9;
--bg-elev-1: #ffffff;
--bg-elev-2: #f9fbfd;
--bg-elev-3: #f0f3f7;
--grid-line: rgba(0, 130, 100, 0.05);
--border: #e2e8ef;
--border-strong: #c8d2dd;
--text-primary: #0e1620;
--text-secondary: #4a5566;
--text-dim: #8693a3;
--accent: #008f74;
--accent-soft: rgba(0, 143, 116, 0.08);
--accent-hot: #00b388;
--magenta: #d92671;
--amber: #d97a13;
--danger: #d93939;
--info: #1f9ec5;
--shadow-1: 0 1px 2px rgba(15, 30, 45, 0.06), 0 8px 20px rgba(15, 30, 45, 0.05);
--glow-accent: 0 0 0 1px rgba(0, 143, 116, 0.25);
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: var(--bg-base);
color: var(--text-primary);
font-family: var(--font-sans);
font-size: 15px;
line-height: var(--tx-b);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
}
body {
position: relative;
overflow-x: hidden;
}
/* Decorative grid background */
.grid-bg {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 0;
background-image:
linear-gradient(var(--grid-line) 1px, transparent 1px),
linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
background-size: 32px 32px;
mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
-webkit-mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hot); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 {
font-family: var(--font-sans);
font-weight: 700;
letter-spacing: -0.01em;
line-height: var(--tx-h);
margin: 0 0 .6em;
}
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
/* ---------- Top bar ---------- */
.topbar {
position: sticky;
top: 0;
z-index: 50;
backdrop-filter: blur(10px) saturate(140%);
-webkit-backdrop-filter: blur(10px) saturate(140%);
background: color-mix(in srgb, var(--bg-elev-1) 82%, transparent);
border-bottom: 1px solid var(--border);
}
.topbar-inner {
max-width: 1320px;
margin: 0 auto;
padding: 12px 24px;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 24px;
}
.brand {
display: inline-flex;
align-items: center;
gap: 10px;
color: var(--text-primary);
font-family: var(--font-mono);
font-weight: 700;
letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
color: var(--accent);
font-size: 1.1em;
letter-spacing: -2px;
filter: drop-shadow(0 0 6px var(--accent));
}
.brand-name { font-size: 1.05rem; }
.brand-tag {
font-family: var(--font-mono);
font-size: .65rem;
font-weight: 500;
letter-spacing: 0.15em;
padding: 2px 7px;
border-radius: 4px;
background: var(--accent-soft);
color: var(--accent);
margin-left: 6px;
}
body.is-backoffice .brand-tag {
background: color-mix(in srgb, var(--magenta) 14%, transparent);
color: var(--magenta);
}
.topbar-nav {
display: flex;
gap: 4px;
justify-self: center;
}
.navlink {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 14px;
font-family: var(--font-mono);
font-size: .85rem;
font-weight: 500;
color: var(--text-secondary);
border-radius: var(--radius-sm);
transition: all .15s ease;
}
.navlink:hover { color: var(--text-primary); background: var(--bg-elev-2); text-decoration: none; }
.navlink.active { color: var(--accent); background: var(--accent-soft); }
.navlink.active .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-dim);
}
.dot-admin { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.navlink-cross { border: 1px solid var(--border); }
.navlink-cross:hover { border-color: var(--border-strong); color: var(--magenta); }
.navlink-cross.active { color: var(--magenta); background: color-mix(in srgb, var(--magenta) 12%, transparent); }
.navlink-cross.active .dot-admin { background: var(--magenta); }
.topbar-right { display: inline-flex; gap: 10px; align-items: center; justify-self: end; }
.icon-btn {
background: transparent;
border: 1px solid var(--border);
color: var(--text-secondary);
width: 36px; height: 36px;
border-radius: var(--radius-sm);
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all .15s ease;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-elev-2); }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }
.user-chip {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 4px 12px 4px 4px;
border: 1px solid var(--border);
border-radius: 999px;
color: var(--text-primary);
background: var(--bg-elev-2);
}
.user-chip:hover { border-color: var(--border-strong); text-decoration: none; }
.user-avatar {
width: 28px; height: 28px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--info));
color: #061218;
font-family: var(--font-mono);
font-size: .72rem;
font-weight: 700;
display: inline-flex;
align-items: center;
justify-content: center;
}
.user-avatar-img {
object-fit: cover;
padding: 0;
border: 1px solid var(--border-strong);
background: var(--bg-elev-3);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-name { font-size: .85rem; }
.user-role {
font-family: var(--font-mono);
font-size: .6rem;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.user-role.role-admin { color: var(--magenta); }
.user-role.role-user { color: var(--text-dim); }
.inline-form { display: inline; }
/* ---------- Container ---------- */
.container {
max-width: 1320px;
margin: 0 auto;
padding: 32px 24px 64px;
position: relative;
z-index: 1;
}
/* ---------- Buttons ---------- */
.btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 9px 16px;
border-radius: var(--radius-sm);
font-family: var(--font-mono);
font-size: .85rem;
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
transition: all .15s ease;
white-space: nowrap;
text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
background: var(--accent);
color: #02181a;
border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hot); box-shadow: var(--glow-accent); color: #02181a; }
.btn-ghost {
background: transparent;
color: var(--text-primary);
border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-elev-2); }
.btn-danger {
background: transparent;
color: var(--danger);
border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* ---------- Cards / Panels ---------- */
.panel {
background: var(--bg-elev-1);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-1);
}
.panel-header {
padding: 16px 20px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 20px; }
.section-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 16px;
margin: 0 0 24px;
padding-bottom: 16px;
border-bottom: 1px dashed var(--border);
}
.section-head .lead { color: var(--text-secondary); margin: 6px 0 0; font-size: .95rem; }
.section-tag {
font-family: var(--font-mono);
font-size: .65rem;
letter-spacing: 0.15em;
color: var(--accent);
text-transform: uppercase;
margin-bottom: 6px;
display: block;
}
/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form label {
display: block;
font-family: var(--font-mono);
font-size: .78rem;
font-weight: 500;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 6px;
}
.form input[type=text],
.form input[type=email],
.form input[type=password],
.form input[type=number],
.form input[type=date],
.form select,
.form textarea {
width: 100%;
padding: 10px 12px;
background: var(--bg-elev-2);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-primary);
font-family: var(--font-sans);
font-size: .95rem;
transition: all .15s ease;
}
.form textarea { font-family: var(--font-sans); resize: vertical; min-height: 90px; }
.form input:focus, .form select:focus, .form textarea:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-soft);
background: var(--bg-elev-1);
}
.form .check-row {
display: inline-flex;
align-items: center;
gap: 10px;
}
.form .check-row label {
margin: 0;
text-transform: none;
letter-spacing: 0;
font-family: var(--font-sans);
font-size: .95rem;
font-weight: 500;
color: var(--text-primary);
}
.help { color: var(--text-dim); font-size: .82rem; margin-top: 4px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .form-grid-2 { grid-template-columns: 1fr; } }
.error { color: var(--danger); font-size: .82rem; margin-top: 4px; }
/* ---------- Flash messages ---------- */
.flash-stack { display: grid; gap: 10px; margin-bottom: 24px; }
.flash {
padding: 12px 16px;
border-radius: var(--radius-sm);
border: 1px solid;
display: flex;
align-items: center;
gap: 12px;
background: var(--bg-elev-1);
font-size: .92rem;
}
.flash-icon {
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.flash-success { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.flash-success .flash-icon { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.flash-error .flash-icon { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.flash-info { border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.flash-info .flash-icon { background: var(--info); }
/* ---------- Auth pages ---------- */
.auth-shell {
min-height: calc(100vh - 200px);
display: flex;
align-items: center;
justify-content: center;
padding: 40px 16px;
}
.auth-card {
width: 100%;
max-width: 420px;
background: var(--bg-elev-1);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 32px;
box-shadow: var(--shadow-1);
position: relative;
}
.auth-card::before {
content: '';
position: absolute;
inset: -1px;
border-radius: inherit;
padding: 1px;
background: linear-gradient(135deg, var(--accent), transparent 40%, var(--magenta));
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
opacity: .5;
pointer-events: none;
}
.auth-prompt {
font-family: var(--font-mono);
font-size: .8rem;
color: var(--accent);
margin-bottom: 6px;
letter-spacing: 0.06em;
}
.auth-prompt::before { content: '> '; opacity: .7; }
.auth-card h1 { margin-bottom: 6px; font-size: 1.5rem; }
.auth-sub { color: var(--text-secondary); font-size: .9rem; margin-bottom: 24px; }
/* ---------- ALERT cards (the heart of the View page) ---------- */
.alerts-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
gap: 18px;
}
.alert-card {
background: var(--bg-elev-1);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 20px;
position: relative;
overflow: hidden;
transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.alert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); border-color: var(--border-strong); }
.alert-card::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 2px;
background: var(--accent);
opacity: .8;
}
.alert-card.is-warning::before { background: var(--amber); }
.alert-card.is-critical::before { background: var(--danger); }
.alert-card.is-expired::before { background: var(--text-dim); }
.alert-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.alert-title { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.alert-cat {
display: inline-block;
font-family: var(--font-mono);
font-size: .65rem;
letter-spacing: 0.1em;
text-transform: uppercase;
padding: 3px 8px;
border-radius: 3px;
background: var(--bg-elev-3);
color: var(--text-secondary);
}
.alert-desc {
color: var(--text-secondary);
font-size: .9rem;
margin: 0 0 16px;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.alert-message {
font-family: var(--font-mono);
font-size: .85rem;
color: var(--text-secondary);
margin-bottom: 16px;
padding: 10px 12px;
background: var(--bg-elev-2);
border-left: 2px solid var(--accent);
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.alert-card.is-warning .alert-message { border-left-color: var(--amber); }
.alert-card.is-critical .alert-message { border-left-color: var(--danger); }
.alert-card.is-expired .alert-message { border-left-color: var(--text-dim); }
/* The countdown timer */
.countdown {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 6px;
}
.countdown-segment {
background: var(--bg-elev-2);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 10px 4px 8px;
text-align: center;
position: relative;
}
.countdown-value {
font-family: var(--font-mono);
font-size: 1.5rem;
font-weight: 700;
color: var(--accent);
line-height: 1;
display: block;
letter-spacing: -0.02em;
font-variant-numeric: tabular-nums;
}
.alert-card.is-warning .countdown-value { color: var(--amber); }
.alert-card.is-critical .countdown-value {
color: var(--danger);
animation: pulse-num 1.4s ease-in-out infinite;
}
.alert-card.is-expired .countdown-value { color: var(--text-dim); }
.countdown-label {
font-family: var(--font-mono);
font-size: .55rem;
font-weight: 500;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--text-dim);
display: block;
margin-top: 4px;
}
@keyframes pulse-num {
0%, 100% { opacity: 1; }
50% { opacity: .55; }
}
.alert-meta {
margin-top: 14px;
display: flex;
justify-content: space-between;
align-items: center;
font-family: var(--font-mono);
font-size: .72rem;
color: var(--text-dim);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.alert-status-dot {
display: inline-block;
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--accent);
margin-right: 6px;
box-shadow: 0 0 6px var(--accent);
}
.alert-card.is-warning .alert-status-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.alert-card.is-critical .alert-status-dot {
background: var(--danger);
box-shadow: 0 0 8px var(--danger);
animation: blink 1s ease-in-out infinite;
}
.alert-card.is-expired .alert-status-dot { background: var(--text-dim); box-shadow: none; }
@keyframes blink { 50% { opacity: .25; } }
/* Empty state */
.empty {
text-align: center;
padding: 60px 20px;
color: var(--text-secondary);
border: 1px dashed var(--border);
border-radius: var(--radius-md);
}
.empty .empty-icon { font-size: 2rem; opacity: .5; margin-bottom: 12px; }
/* ---------- Tables ---------- */
.table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: var(--bg-elev-1);
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: hidden;
}
.table th, .table td {
padding: 12px 16px;
text-align: left;
border-bottom: 1px solid var(--border);
vertical-align: middle;
}
.table thead th {
background: var(--bg-elev-2);
font-family: var(--font-mono);
font-size: .72rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--text-secondary);
}
.table tbody tr:hover { background: var(--bg-elev-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { text-align: right; white-space: nowrap; }
.role-badge {
display: inline-block;
font-family: var(--font-mono);
font-size: .68rem;
letter-spacing: 0.1em;
text-transform: uppercase;
padding: 3px 8px;
border-radius: 3px;
}
.role-badge.role-admin { background: color-mix(in srgb, var(--magenta) 14%, transparent); color: var(--magenta); }
.role-badge.role-user { background: var(--bg-elev-3); color: var(--text-secondary); }
.status-badge {
display: inline-flex;
align-items: center;
gap: 6px;
font-family: var(--font-mono);
font-size: .7rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.status-badge .led { width: 6px; height: 6px; border-radius: 50%; }
.status-active .led { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-inactive .led { background: var(--text-dim); }
/* ---------- Stat cards ---------- */
.stat-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
margin-bottom: 28px;
}
.stat {
background: var(--bg-elev-1);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 18px;
position: relative;
}
.stat-label {
font-family: var(--font-mono);
font-size: .68rem;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--text-dim);
}
.stat-value {
font-family: var(--font-mono);
font-size: 2rem;
font-weight: 700;
color: var(--text-primary);
line-height: 1.1;
margin-top: 6px;
}
.stat-accent .stat-value { color: var(--accent); }
.stat-warn .stat-value { color: var(--amber); }
/* ---------- QR / MFA pages ---------- */
.mfa-qr {
display: block;
margin: 0 auto;
width: 200px;
height: 200px;
background: white;
padding: 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
}
.mfa-secret {
font-family: var(--font-mono);
font-size: .9rem;
background: var(--bg-elev-2);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 8px 12px;
user-select: all;
word-break: break-all;
text-align: center;
}
/* ---------- Footer ---------- */
.footer {
max-width: 1320px;
margin: 0 auto;
padding: 18px 24px 36px;
display: flex;
align-items: center;
gap: 10px;
font-family: var(--font-mono);
font-size: .75rem;
color: var(--text-dim);
border-top: 1px solid var(--border);
}
/* ---------- Avatar panel (account page) ---------- */
.avatar-row {
display: flex;
gap: 24px;
align-items: flex-start;
flex-wrap: wrap;
}
.avatar-preview {
width: 96px; height: 96px;
border-radius: 50%;
overflow: hidden;
flex: 0 0 auto;
border: 1px solid var(--border-strong);
background: var(--bg-elev-3);
display: inline-flex;
align-items: center;
justify-content: center;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initials {
font-family: var(--font-mono);
font-size: 1.8rem;
font-weight: 700;
color: var(--accent);
}
.avatar-actions { flex: 1 1 260px; min-width: 260px; }
/* ---------- Log export / email actions ---------- */
.log-actions {
display: flex;
gap: 12px;
align-items: center;
flex-wrap: wrap;
}
.log-email-form {
display: inline-flex;
gap: 8px;
align-items: center;
}
.log-email-form input[type="text"],
.log-email-form input[type="email"] { margin: 0; min-width: 220px; }
@media (max-width: 720px) {
.log-actions { width: 100%; }
.log-email-form { width: 100%; }
.log-email-form input { flex: 1; min-width: 0; }
}
.footer-sep { opacity: .5; }
.footer-copy {
margin-left: auto;
color: var(--text-secondary);
letter-spacing: .02em;
}
.footer .status-pill { margin-left: 18px; }
@media (max-width: 720px) {
.footer { flex-wrap: wrap; }
.footer-copy { margin-left: 0; flex-basis: 100%; order: 3; }
.footer .status-pill { margin-left: auto; }
}
.kbd {
background: var(--bg-elev-2);
border: 1px solid var(--border);
border-radius: 3px;
padding: 1px 6px;
font-size: .72rem;
color: var(--text-secondary);
}
.status-pill {
margin-left: auto;
display: inline-flex;
align-items: center;
gap: 6px;
text-transform: uppercase;
}
.status-pill .led {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 6px var(--accent);
animation: led-pulse 2.5s ease-in-out infinite;
}
@keyframes led-pulse {
0%, 100% { opacity: 1; }
50% { opacity: .4; }
}
/* ---------- Pagination ---------- */
.pagination {
display: flex;
justify-content: center;
gap: 6px;
margin-top: 20px;
flex-wrap: wrap;
}
.pagination a, .pagination span {
font-family: var(--font-mono);
font-size: .82rem;
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-secondary);
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
/* ---------- Misc ---------- */
.row-spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-dim); }
hr { border: 0; border-top: 1px dashed var(--border); margin: 24px 0; }
@media (max-width: 800px) {
.topbar-inner { grid-template-columns: 1fr; gap: 12px; }
.topbar-nav { justify-self: flex-start; flex-wrap: wrap; }
.topbar-right { justify-self: flex-start; }
}
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="#0a0e14"/><path d="M9 9 h3 v14 h-3z M14 9 h3 v14 h-3z" fill="#00d4aa"/><circle cx="22" cy="11" r="2" fill="#ff3e8b"/></svg>

After

Width:  |  Height:  |  Size: 226 B

+73
View File
@@ -0,0 +1,73 @@
// ====== Theme toggle =======================================================
(function () {
const btn = document.getElementById('theme-toggle');
if (!btn) return;
btn.addEventListener('click', () => {
const root = document.documentElement;
const next = root.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';
root.setAttribute('data-theme', next);
try { localStorage.setItem('alerthub-theme', next); } catch (_) {}
});
})();
// ====== Countdown timer ====================================================
// Each .countdown element has data-expires="YYYY-MM-DD" and renders 4 cells
// for days / hours / minutes / seconds. Updates every second.
(function () {
const els = document.querySelectorAll('.countdown[data-expires]');
if (!els.length) return;
function pad(n) { return n < 10 ? '0' + n : '' + n; }
function render() {
const now = new Date();
els.forEach((el) => {
const target = new Date(el.dataset.expires + 'T23:59:59');
let diff = (target.getTime() - now.getTime()) / 1000;
const card = el.closest('.alert-card');
const negative = diff < 0;
diff = Math.abs(diff);
const days = Math.floor(diff / 86400);
const hours = Math.floor((diff % 86400) / 3600);
const minutes = Math.floor((diff % 3600) / 60);
const seconds = Math.floor(diff % 60);
const segs = el.querySelectorAll('.countdown-value');
if (segs.length === 4) {
segs[0].textContent = days;
segs[1].textContent = pad(hours);
segs[2].textContent = pad(minutes);
segs[3].textContent = pad(seconds);
}
if (card) {
card.classList.remove('is-warning', 'is-critical', 'is-expired');
if (negative) {
card.classList.add('is-expired');
} else if (days < 7) {
card.classList.add('is-critical');
} else if (days < 30) {
card.classList.add('is-warning');
}
}
const dotLabel = el.parentElement && el.parentElement.querySelector('.alert-state-text');
if (dotLabel) {
if (negative) dotLabel.textContent = 'EXPIRED';
else if (days < 7) dotLabel.textContent = 'CRITICAL';
else if (days < 30) dotLabel.textContent = 'WARNING';
else dotLabel.textContent = 'NOMINAL';
}
});
}
render();
setInterval(render, 1000);
})();
// ====== Confirm-on-click for destructive actions ===========================
document.querySelectorAll('form[data-confirm]').forEach((form) => {
form.addEventListener('submit', (e) => {
if (!window.confirm(form.dataset.confirm)) e.preventDefault();
});
});