DesignCoder / eval /api_baselines_200 /pages /deepseek-v4-pro /dashboard-014-developer-first-minimal.html
xingxm's picture
DesignCoder UI bench 200: 1400 cells, judge=deepseek-v4.1-flash-expires-on-0910
58ca566 verified
Raw History Blame Contribute Delete
63.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Mailrail β€” Delivery Console</title> <style> :root { --bg: #0B1020; --bg-elevated: #0F1529; --bg-inset: #080C18; --border: #1A2342; --border-strong: #243052; --text: #E2E8F0; --text-secondary: #94A3B8; --text-muted: #64748B; --text-dim: #3D4A6B; --accent: #3B82F6; --accent-glow: rgba(59, 130, 246, 0.18); --green: #10B981; --green-bg: rgba(16, 185, 129, 0.12); --red: #EF4444; --red-bg: rgba(239, 68, 68, 0.12); --yellow: #F59E0B; --yellow-bg: rgba(245, 158, 11, 0.12); --orange: #F97316; --orange-bg: rgba(249, 115, 22, 0.12); --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Courier New', monospace; --sans: 'Inter', 'SF Pro Display', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --radius: 6px; --radius-sm: 4px; --transition: 150ms cubic-bezier(0.2, 0, 0, 1); } *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } html { font-size: 13px; } body { background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; display: flex; flex-direction: column; line-height: 1.45; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } ::selection { background: rgba(59, 130, 246, 0.35); color: #fff; } ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: var(--bg-inset); } ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #2E3B63; } :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); } /* ── TOP BAR ─────────────────────────────────── */ .topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 52px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-shrink: 0; position: sticky; top: 0; z-index: 100; } .topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; white-space: nowrap; } .topbar-brand svg { width: 22px; height: 22px; color: var(--accent); } .topbar-brand .version { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--text-dim); background: var(--bg-inset); padding: 2px 6px; border-radius: 4px; letter-spacing: 0.03em; } .topbar-search { flex: 1; max-width: 420px; position: relative; display: flex; align-items: center; margin-left: 8px; } .topbar-search .slash-prefix { position: absolute; left: 12px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); font-weight: 600; pointer-events: none; user-select: none; } .topbar-search input { width: 100%; height: 34px; background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 0 12px 0 30px; transition: border-color var(--transition), box-shadow var(--transition); letter-spacing: 0.02em; } .topbar-search input::placeholder { color: var(--text-dim); font-family: var(--mono); font-size: 12px; } .topbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; } .topbar-search .search-hint { position: absolute; right: 10px; font-family: var(--mono); font-size: 9px; color: var(--text-dim); background: var(--border); padding: 2px 6px; border-radius: 3px; pointer-events: none; letter-spacing: 0.04em; } .topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; } .live-indicator { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--text-secondary); letter-spacing: 0.06em; text-transform: uppercase; } .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); animation: livePulse 2s ease-in-out infinite; } @keyframes livePulse { 0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); } 50% { opacity: 0.5; box-shadow: 0 0 2px rgba(16, 185, 129, 0.2); } } /* ── SEGMENTED CHIPS ─────────────────────────── */ .segmented { display: flex; gap: 0; background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; flex-shrink: 0; } .segmented button { appearance: none; background: transparent; border: none; color: var(--text-muted); font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 5px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition), color var(--transition); letter-spacing: 0.04em; text-transform: uppercase; } .segmented button:hover { color: var(--text-secondary); background: var(--border); } .segmented button.active { background: var(--accent); color: #fff; box-shadow: 0 0 12px rgba(59, 130, 246, 0.3); } /* ── RETRY BANNER ────────────────────────────── */ .retry-banner { display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: var(--yellow-bg); border-bottom: 1px solid rgba(245, 158, 11, 0.3); font-family: var(--mono); font-size: 11px; color: var(--yellow); flex-shrink: 0; letter-spacing: 0.02em; animation: bannerGlow 3s ease-in-out infinite; } @keyframes bannerGlow { 0%, 100% { border-color: rgba(245, 158, 11, 0.25); } 50% { border-color: rgba(245, 158, 11, 0.45); } } .retry-banner .banner-icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(245, 158, 11, 0.18); flex-shrink: 0; } .retry-banner .banner-icon svg { width: 13px; height: 13px; color: var(--yellow); } .retry-banner .banner-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; } .retry-banner .banner-domain { color: #fff; font-weight: 600; } .retry-banner .banner-countdown { color: #fff; font-weight: 600; background: rgba(245, 158, 11, 0.2); padding: 1px 8px; border-radius: 3px; min-width: 32px; text-align: center; } .retry-banner .banner-progress { width: 140px; height: 3px; background: rgba(245, 158, 11, 0.2); border-radius: 2px; overflow: hidden; flex-shrink: 0; } .retry-banner .banner-progress-fill { height: 100%; background: var(--yellow); border-radius: 2px; transition: width 1s linear; } .retry-banner .banner-attempts { color: var(--text-secondary); white-space: nowrap; } /* ── MAIN CONTENT ────────────────────────────── */ .main { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px 20px; overflow-y: auto; } /* ── KPI ROW ─────────────────────────────────── */ .kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; flex-shrink: 0; } .kpi-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; transition: border-color var(--transition); } .kpi-card:hover { border-color: var(--border-strong); } .kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); display: flex; align-items: center; gap: 6px; } .kpi-label .kpi-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; } .kpi-value-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; } .kpi-value { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; } .kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; letter-spacing: 0.03em; line-height: 1.3; } .kpi-delta.good { background: var(--green-bg); color: var(--green); } .kpi-delta.bad { background: var(--red-bg); color: var(--red); } .kpi-delta svg { width: 10px; height: 10px; flex-shrink: 0; } .kpi-sub { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.03em; } /* ── CHART CARDS ─────────────────────────────── */ .chart-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; } .chart-card-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; } .chart-card-title { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: 0.03em; display: flex; align-items: center; gap: 6px; } .chart-card-title .title-badge { font-family: var(--mono); font-size: 9px; color: var(--text-muted); background: var(--bg-inset); padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em; text-transform: uppercase; } .chart-legend { display: flex; gap: 14px; align-items: center; } .chart-legend-item { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--text-secondary); } .chart-legend-item .legend-line { width: 16px; height: 2px; border-radius: 1px; } .chart-legend-item .legend-dash { width: 16px; height: 0; border-top: 2px dashed var(--red); } .chart-legend-item .legend-dot { width: 6px; height: 6px; border-radius: 50%; } .chart-container { width: 100%; border-radius: var(--radius-sm); overflow: hidden; } #timeseries-chart { height: 260px; } #provider-chart { height: 220px; } /* ── DOMAIN TABLE ────────────────────────────── */ .table-section { flex: 1; display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 300px; } .table-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; } .table-header-left { display: flex; align-items: center; gap: 10px; } .table-title { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; } .table-count { font-family: var(--mono); font-size: 10px; color: var(--text-muted); background: var(--bg-inset); padding: 2px 8px; border-radius: 4px; } .table-scroll { flex: 1; overflow-y: auto; overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11px; min-width: 900px; } thead { position: sticky; top: 0; z-index: 10; background: var(--bg-inset); } thead th { text-align: left; padding: 8px 12px; font-weight: 500; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); white-space: nowrap; cursor: default; user-select: none; } thead th.sortable { cursor: pointer; transition: color var(--transition); } thead th.sortable:hover { color: var(--text-secondary); } thead th .sort-arrow { font-size: 8px; margin-left: 3px; opacity: 0.6; } tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); cursor: pointer; } tbody tr:hover { background: rgba(59, 130, 246, 0.05); } tbody tr:last-child { border-bottom: none; } tbody tr.drilled { background: rgba(59, 130, 246, 0.07); border-left: 3px solid var(--accent); } tbody td { padding: 9px 12px; white-space: nowrap; color: var(--text-secondary); font-size: 11px; letter-spacing: 0.02em; } tbody td.domain-cell { color: var(--text); font-weight: 500; } .badge { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 3px; letter-spacing: 0.05em; text-transform: uppercase; font-family: var(--mono); } .badge.pass { background: var(--green-bg); color: var(--green); } .badge.fail { background: var(--red-bg); color: var(--red); } .badge.warn { background: var(--yellow-bg); color: var(--yellow); } .badge svg { width: 9px; height: 9px; flex-shrink: 0; } .owner-cell { display: flex; align-items: center; gap: 8px; } .owner-cell .identicon { flex-shrink: 0; border-radius: 3px; overflow: hidden; width: 22px; height: 22px; } .owner-cell .identicon svg { display: block; width: 100%; height: 100%; } .owner-cell .owner-name { font-size: 10px; color: var(--text-secondary); } .status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; } .status-dot.healthy { background: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); } .status-dot.warning { background: var(--yellow); box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); } .status-dot.critical { background: var(--red); box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); animation: criticalBlink 1.2s ease-in-out infinite; } @keyframes criticalBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } } /* ── DRILL-DOWN ROW ──────────────────────────── */ .drill-row { display: none; background: var(--bg-inset); border-bottom: 1px solid var(--border-strong); border-left: 3px solid var(--accent); padding: 10px 16px 14px 28px; } .drill-row.visible { display: table-row; } .drill-row td { padding: 0; } .drill-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; font-family: var(--mono); font-size: 10px; color: var(--text-secondary); letter-spacing: 0.03em; white-space: normal; } .drill-item { display: flex; flex-direction: column; gap: 3px; } .drill-item-label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); } .drill-item-value { color: var(--text); font-size: 10px; } .drill-item-value.red { color: var(--red); } .drill-item-value.green { color: var(--green); } .drill-item-value.yellow { color: var(--yellow); } /* ── FOOTER ──────────────────────────────────── */ .console-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 6px 20px; background: var(--bg-elevated); border-top: 1px solid var(--border); font-family: var(--mono); font-size: 9px; color: var(--text-dim); letter-spacing: 0.04em; } .footer-left { display: flex; gap: 16px; align-items: center; } .footer-right { display: flex; gap: 10px; align-items: center; } .footer-indicator { display: flex; align-items: center; gap: 4px; } .footer-indicator .fi-dot { width: 5px; height: 5px; border-radius: 50%; } .footer-indicator .fi-dot.on { background: var(--green); } .footer-indicator .fi-dot.off { background: var(--red); } /* ── ANIMATIONS / REDUCED MOTION ─────────────── */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } } /* ── RESPONSIVE ADJUSTMENTS ──────────────────── */ @media (max-width: 1100px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } .topbar-search { max-width: 280px; } } @media (max-width: 700px) { .kpi-row { grid-template-columns: 1fr; } .topbar-search { max-width: 160px; } .chart-card-header { flex-direction: column; align-items: flex-start; gap: 4px; } } </style> </head> <body> <!-- ═══ TOP BAR ═══ --> <header class="topbar" role="banner"> <a class="topbar-brand" href="#" aria-label="Mailrail home"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></svg> mailrail<span class="version">v2.4.1</span> </a> <div class="topbar-search" role="search"> <span class="slash-prefix" aria-hidden="true">/</span> <input type="text" id="domain-search" placeholder="filter domains..." aria-label="Search sending domains" autocomplete="off" spellcheck="false"> <span class="search-hint" aria-hidden="true">ESC to clear</span> </div> <div class="topbar-right"> <div class="live-indicator"> <span class="live-dot" aria-hidden="true"></span> LIVE </div> <nav class="segmented" aria-label="Time range selection" role="tablist"> <button class="active" role="tab" aria-selected="true" data-range="1h">1h</button> <button role="tab" aria-selected="false" data-range="24h">24h</button> <button role="tab" aria-selected="false" data-range="7d">7d</button> </nav> </div> </header> <!-- ═══ RETRY BANNER ═══ --> <div class="retry-banner" role="alert" aria-live="polite"> <span class="banner-icon" aria-hidden="true"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg> </span> <span class="banner-text"> <span>THROTTLE DETECTED:</span> <span class="banner-domain">outlook-com</span> <span>retry in</span> <span class="banner-countdown" id="retry-countdown">42s</span> <span class="banner-attempts" id="retry-attempts">backoff &times;4 &mdash; 3 attempts remaining</span> </span> <span class="banner-progress" aria-hidden="true"> <span class="banner-progress-fill" id="retry-progress" style="width:70%"></span> </span> </div> <!-- ═══ MAIN CONTENT ═══ --> <main class="main" role="main"> <!-- KPI Row --> <section class="kpi-row" aria-label="Key performance indicators"> <div class="kpi-card"> <span class="kpi-label"><span class="kpi-dot" style="background:var(--green)" aria-hidden="true"></span>Delivered</span> <div class="kpi-value-row"> <span class="kpi-value">98.42%</span> <span class="kpi-delta good"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>+0.18%</span> </div> <span class="kpi-sub">4.82M / 4.90M msgs</span> </div> <div class="kpi-card"> <span class="kpi-label"><span class="kpi-dot" style="background:var(--orange)" aria-hidden="true"></span>Hard Bounce</span> <div class="kpi-value-row"> <span class="kpi-value">0.47%</span> <span class="kpi-delta good"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>-0.03%</span> </div> <span class="kpi-sub">23.1K rejected</span> </div> <div class="kpi-card"> <span class="kpi-label"><span class="kpi-dot" style="background:var(--yellow)" aria-hidden="true"></span>Complaint Rate</span> <div class="kpi-value-row"> <span class="kpi-value">0.021%</span> <span class="kpi-delta good"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>-0.004%</span> </div> <span class="kpi-sub">1.03K reports</span> </div> <div class="kpi-card"> <span class="kpi-label"><span class="kpi-dot" style="background:var(--red)" aria-hidden="true"></span>Queue Latency</span> <div class="kpi-value-row"> <span class="kpi-value">847<span style="font-size:14px;color:var(--text-muted)">ms</span></span> <span class="kpi-delta bad"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>+132ms</span> </div> <span class="kpi-sub">p95 &middot; 5.3M in queue</span> </div> </section> <!-- Time-series Chart --> <section class="chart-card" aria-label="Accepted versus deferred messages time-series"> <div class="chart-card-header"> <span class="chart-card-title">Accepted vs Deferred <span class="title-badge">msgs/hour</span></span> <div class="chart-legend" aria-hidden="true"> <span class="chart-legend-item"><span class="legend-line" style="background:var(--green)"></span>Accepted</span> <span class="chart-legend-item"><span class="legend-line" style="background:var(--orange)"></span>Deferred</span> <span class="chart-legend-item"><span class="legend-dash"></span>Deferral threshold</span> </div> </div> <div id="timeseries-chart" class="chart-container" role="img" aria-label="Time series chart of accepted and deferred message volumes with a deferral threshold line"></div> </section> <!-- Provider Bar Chart --> <section class="chart-card" aria-label="Inbox placement by provider"> <div class="chart-card-header"> <span class="chart-card-title">Inbox Placement by Provider <span class="title-badge">% delivered to inbox</span></span> <div class="chart-legend" aria-hidden="true"> <span class="chart-legend-item"><span class="legend-dot" style="background:#EA4335"></span>Gmail</span> <span class="chart-legend-item"><span class="legend-dot" style="background:#0078D4"></span>Outlook</span> <span class="chart-legend-item"><span class="legend-dot" style="background:#5F01D1"></span>Yahoo</span> <span class="chart-legend-item"><span class="legend-dot" style="background:#A2AAAD"></span>Apple</span> </div> </div> <div id="provider-chart" class="chart-container" role="img" aria-label="Bar chart of inbox placement rates by email provider"></div> </section> <!-- Domain Table --> <section class="table-section" aria-label="Sending domains authentication and delivery status"> <div class="table-header"> <div class="table-header-left"> <span class="table-title">Sending Domains</span> <span class="table-count" id="table-count">7 of 7</span> </div> </div> <div class="table-scroll"> <table aria-label="Sending domains table"> <thead> <tr> <th class="sortable" data-sort="domain">Domain <span class="sort-arrow">&#9650;</span></th> <th>SPF</th> <th>DKIM</th> <th>DMARC</th> <th class="sortable" data-sort="volume">Volume <span class="sort-arrow">&#9650;</span></th> <th class="sortable" data-sort="bounce">Bounce % <span class="sort-arrow">&#9650;</span></th> <th>Owner</th> <th>Status</th> </tr> </thead> <tbody id="domain-table-body"> <!-- Rendered by JS --> </tbody> </table> </div> </section> </main> <!-- ═══ FOOTER ═══ --> <footer class="console-footer"> <div class="footer-left"> <span>mailrail-core v2.4.1</span> <span class="footer-indicator"><span class="fi-dot on" aria-hidden="true"></span>redis:connected</span> <span class="footer-indicator"><span class="fi-dot on" aria-hidden="true"></span>amqp:5 workers</span> <span class="footer-indicator"><span class="fi-dot on" aria-hidden="true"></span>smtp:12 pools</span> </div> <div class="footer-right"> <span>uptime 99.98%</span> <span>region: us-east-1</span> <span>node: mr-prod-07</span> </div> </footer> <!-- ═══ CDN LIBRARIES ═══ --> <script src="https://registry.npmmirror.com/echarts/5.5.1/files/dist/echarts.min.js"> </script> <script src="https://registry.npmmirror.com/chart.js/4.4.7/files/dist/chart.umd.js"> </script> <script src="https://registry.npmmirror.com/lucide/0.468.0/files/dist/umd/lucide.min.js"> </script> <script> (function() { 'use strict'; /* ─── UTILITY: HASH ─────────────────────────── */ function hashString(str) { let hash = 0; for (let i = 0; i < str.length; i++) { hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0; } return Math.abs(hash); } /* ─── IDENTICON GENERATOR ───────────────────── */ function generateIdenticon(seed, size = 22) { const hash = hashString(seed); const palette = [ '#3B82F6', '#8B5CF6', '#EC4899', '#F97316', '#10B981', '#06B6D4', '#F59E0B', '#EF4444' ]; const color = palette[hash % palette.length]; const cells = []; for (let row = 0; row < 5; row++) { for (let col = 0; col < 5; col++) { const mirrorCol = col > 2 ? 4 - col : col; const bit = (hash >> (row * 3 + mirrorCol)) & 1; if (bit) { cells.push( '<rect x="' + (col * 4) + '" y="' + (row * 4) + '" width="4" height="4" rx="0.6" fill="' + color + '" />' ); } } } return '<svg width="' + size + '" height="' + size + '" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">' + cells.join('') + '</svg>'; } /* ─── DOMAIN DATA ───────────────────────────── */ const domains = [ { domain: 'mailrail.io', spf: 'pass', dkim: 'pass', dmarc: 'pass', volume: 248412, bounce: 0.41, owner: 'alicia@mailrail.io', status: 'healthy' }, { domain: 'sendmailer.net', spf: 'pass', dkim: 'fail', dmarc: 'pass', volume: 127304, bounce: 1.23, owner: 'dev@sendmailer.net', status: 'warning' }, { domain: 'relaykit.dev', spf: 'pass', dkim: 'pass', dmarc: 'fail', volume: 89012, bounce: 0.87, owner: 'ops@relaykit.dev', status: 'warning' }, { domain: 'postbox-app.com', spf: 'fail', dkim: 'pass', dmarc: 'pass', volume: 342760, bounce: 2.15, owner: 'team@postbox-app.com', status: 'critical' }, { domain: 'smtpflow.co', spf: 'pass', dkim: 'pass', dmarc: 'pass', volume: 73342, bounce: 0.28, owner: 'infra@smtpflow.co', status: 'healthy' }, { domain: 'deliverpro.io', spf: 'pass', dkim: 'pass', dmarc: 'pass', volume: 198201, bounce: 0.63, owner: 'support@deliverpro.io', status: 'healthy' }, { domain: 'mxpilot.sh', spf: 'pass', dkim: 'pass', dmarc: 'pass', volume: 41290, bounce: 0.19, owner: 'hello@mxpilot.sh', status: 'healthy' }, { domain: 'mailforge.dev', spf: 'pass', dkim: 'pass', dmarc: 'pass', volume: 156342, bounce: 0.54, owner: 'build@mailforge.dev', status: 'healthy' } ]; /* ─── PROVIDER DATA ────────────────────────── */ const providers = [ { name: 'Gmail', rate: 97.8, color: '#EA4335' }, { name: 'Outlook', rate: 94.2, color: '#0078D4' }, { name: 'Yahoo', rate: 96.1, color: '#5F01D1' }, { name: 'Apple Mail', rate: 98.3, color: '#A2AAAD' } ]; /* ─── TIME SERIES DATA GENERATORS ──────────── */ function generateTimeData(range) { let points, labelFn, threshold; if (range === '1h') { points = 60; threshold = 500; labelFn = i => { const d = new Date(); d.setMinutes(d.getMinutes() - (59 - i)); return d.toTimeString().slice(0, 5); }; } else if (range === '7d') { points = 14; threshold = 420000; labelFn = i => { const d = new Date(); d.setHours(d.getHours() - (13 - i) * 12); return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }); }; } else { // 24h default points = 24; threshold = 28000; labelFn = i => { const d = new Date(); d.setHours(d.getHours() - (23 - i)); return d.toTimeString().slice(0, 5); }; } const labels = []; const accepted = []; const deferred = []; let acceptedBase, acceptedAmp, deferredBase, deferredAmp; if (range === '1h') { acceptedBase = 4000; acceptedAmp = 1200; deferredBase = 180; deferredAmp = 120; } else if (range === '7d') { acceptedBase = 6000000; acceptedAmp = 1800000; deferredBase = 220000; deferredAmp = 160000; } else { acceptedBase = 250000; acceptedAmp = 70000; deferredBase = 14000; deferredAmp = 9000; } for (let i = 0; i < points; i++) { labels.push(labelFn(i)); const wave = Math.sin(i / points * Math.PI * 2); const drift = Math.sin(i / points * Math.PI * 4 + 0.5); const acceptedVal = Math.round(acceptedBase + wave * acceptedAmp + drift * acceptedAmp * 0.3 + (Math.random() - 0.5) * acceptedAmp * 0.2); let deferredVal = Math.round(deferredBase + Math.abs(wave * deferredAmp) + Math.abs(drift * deferredAmp * 0.5) + (Math.random() - 0.5) * deferredAmp * 0.3); if (i % 7 === 3 && (range === '24h' || range === '1h')) { deferredVal = Math.round(threshold * (1.3 + Math.random() * 0.5)); } if (i % 5 === 2 && range === '7d') { deferredVal = Math.round(threshold * (1.2 + Math.random() * 0.4)); } accepted.push(acceptedVal); deferred.push(deferredVal); } return { labels, accepted, deferred, threshold }; } /* ─── ECHARTS TIME-SERIES ──────────────────── */ let tsChart = null; const tsContainer = document.getElementById('timeseries-chart'); function initTimeSeries() { if (!tsContainer) return; tsChart = echarts.init(tsContainer); updateTimeSeries('24h'); } function updateTimeSeries(range) { if (!tsChart) return; const data = generateTimeData(range); const option = { backgroundColor: 'transparent', textStyle: { color: '#94A3B8', fontFamily: 'JetBrains Mono, monospace' }, tooltip: { trigger: 'axis', backgroundColor: '#0F1529', borderColor: '#1A2342', borderWidth: 1, textStyle: { color: '#E2E8F0', fontSize: 11 }, formatter: function(params) { let html = '<div style="font-weight:600;margin-bottom:4px">' + params[0].axisValue + '</div>'; params.forEach(function(p) { const color = p.seriesName === 'Accepted' ? '#10B981' : '#F97316'; html += '<div style="display:flex;align-items:center;gap:6px;margin:2px 0"><span style="width:8px;height:8px;border-radius:50%;background:' + color + '"></span>' + p.seriesName + ': <b>' + Number(p.value) .toLocaleString() + '</b></div>'; }); html += '<div style="display:flex;align-items:center;gap:6px;margin:2px 0;color:#EF4444"><span style="width:8px;height:0;border-top:2px dashed #EF4444"></span>Threshold: <b>' + Number(data.threshold).toLocaleString() + '</b></div>'; return html; } }, legend: { show: false }, grid: { left: 58, right: 16, top: 16, bottom: 24 }, xAxis: { type: 'category', data: data.labels, axisLine: { lineStyle: { color: '#1A2342' } }, axisTick: { show: false }, axisLabel: { color: '#64748B', fontSize: 9, interval: Math.floor(data.labels.length / 12), rotate: 0 } }, yAxis: { type: 'value', axisLine: { show: false }, axisTick: { show: false }, axisLabel: { color: '#64748B', fontSize: 9, formatter: function(v) { if (v >= 1000000) return (v / 1000000).toFixed(1) + 'M'; if (v >= 1000) return (v / 1000).toFixed(0) + 'K'; return v; } }, splitLine: { lineStyle: { color: '#0F1529', type: 'dashed' } } }, series: [{ name: 'Accepted', type: 'line', data: data.accepted, smooth: true, symbol: 'none', lineStyle: { color: '#10B981', width: 2 }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: 'rgba(16,185,129,0.15)' }, { offset: 1, color: 'rgba(16,185,129,0)' } ] } } }, { name: 'Deferred', type: 'line', data: data.deferred, smooth: true, symbol: 'none', lineStyle: { color: '#F97316', width: 2 }, markLine: { symbol: 'none', label: { formatter: 'THRESHOLD ' + Number(data.threshold).toLocaleString(), color: '#EF4444', fontSize: 9, position: 'insideEndTop', backgroundColor: 'rgba(239,68,68,0.12)', padding: [3, 6], borderRadius: 3, fontFamily: 'JetBrains Mono, monospace' }, lineStyle: { color: '#EF4444', type: 'dashed', width: 1.5, opacity: 0.7 }, data: [{ yAxis: data.threshold }] } }] }; tsChart.setOption(option, true); } /* ─── CHART.JS PROVIDER BAR ─────────────────── */ let providerChart = null; function initProviderChart() { const canvas = document.getElementById('provider-chart'); if (!canvas || typeof Chart === 'undefined') return; const ctx = canvas.getContext('2d'); Chart.defaults.color = '#94A3B8'; Chart.defaults.font.family = 'JetBrains Mono, monospace'; Chart.defaults.font.size = 10; providerChart = new Chart(ctx, { type: 'bar', data: { labels: providers.map(p => p.name), datasets: [{ data: providers.map(p => p.rate), backgroundColor: providers.map(p => p.color + 'CC'), borderColor: providers.map(p => p.color), borderWidth: 1.5, borderRadius: 4, barThickness: 48, }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, tooltip: { backgroundColor: '#0F1529', borderColor: '#1A2342', borderWidth: 1, titleColor: '#E2E8F0', bodyColor: '#E2E8F0', titleFont: { family: 'JetBrains Mono, monospace', size: 11 }, bodyFont: { family: 'JetBrains Mono, monospace', size: 11 }, callbacks: { label: function(context) { return 'Inbox placement: ' + context.parsed.y.toFixed(1) + '%'; } } } }, scales: { x: { border: { color: '#1A2342' }, grid: { display: false }, ticks: { color: '#94A3B8', font: { size: 11, weight: '600' }, padding: 6 } }, y: { beginAtZero: false, min: 88, max: 100, border: { color: '#1A2342', display: false }, grid: { color: '#0F1529', drawTicks: false }, ticks: { color: '#64748B', font: { size: 9 }, callback: function(v) { return v + '%'; }, stepSize: 2 } } }, animation: { duration: 600, easing: 'easeOutQuart' } } }); } /* ─── DOMAIN TABLE RENDER ──────────────────── */ const tableBody = document.getElementById('domain-table-body'); const tableCount = document.getElementById('table-count'); let currentSort = 'domain'; let sortAsc = true; let drilledDomain = null; let searchQuery = ''; function renderTable() { if (!tableBody) return; let filtered = domains.filter(d => { if (!searchQuery) return true; const q = searchQuery.toLowerCase(); return d.domain.toLowerCase().includes(q) || d.owner.toLowerCase().includes(q); }); filtered.sort((a, b) => { let av = a[currentSort]; let bv = b[currentSort]; if (currentSort === 'volume' || currentSort === 'bounce') { av = typeof av === 'string' ? parseFloat(av) : av; bv = typeof bv === 'string' ? parseFloat(bv) : bv; } if (av < bv) return sortAsc ? -1 : 1; if (av > bv) return sortAsc ? 1 : -1; return 0; }); tableCount.textContent = filtered.length + ' of ' + domains.length; let html = ''; filtered.forEach(d => { const isDrilled = drilledDomain === d.domain; const spfBadge = d.spf === 'pass' ? '<span class="badge pass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>PASS</span>' : '<span class="badge fail"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>FAIL</span>'; const dkimBadge = d.dkim === 'pass' ? '<span class="badge pass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>PASS</span>' : '<span class="badge fail"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>FAIL</span>'; const dmarcBadge = d.dmarc === 'pass' ? '<span class="badge pass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>PASS</span>' : d.dmarc === 'warn' ? '<span class="badge warn">!WARN</span>' : '<span class="badge fail"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>FAIL</span>'; const statusDot = '<span class="status-dot ' + d.status + '" aria-label="' + d.status + '"></span>'; const identicon = generateIdenticon(d.owner, 22); html += '<tr data-domain="' + d.domain + '" class="' + (isDrilled ? 'drilled' : '') + '" tabindex="0" role="button" aria-expanded="' + isDrilled + '">'; html += '<td class="domain-cell">' + d.domain + '</td>'; html += '<td>' + spfBadge + '</td>'; html += '<td>' + dkimBadge + '</td>'; html += '<td>' + dmarcBadge + '</td>'; html += '<td>' + Number(d.volume).toLocaleString() + '</td>'; html += '<td>' + d.bounce.toFixed(2) + '%</td>'; html += '<td><span class="owner-cell"><span class="identicon">' + identicon + '</span><span class="owner-name">' + d.owner + '</span></span></td>'; html += '<td>' + statusDot + '</td>'; html += '</tr>'; if (isDrilled) { html += '<tr class="drill-row visible"><td colspan="8"><div class="drill-content">'; html += '<div class="drill-item"><span class="drill-item-label">SPF Record</span><span class="drill-item-value green">v=spf1 include:_spf.' + d.domain + ' ~all</span></div>'; html += '<div class="drill-item"><span class="drill-item-label">DKIM Selector</span><span class="drill-item-value">mr2024._domainkey.' + d.domain + '</span></div>'; html += '<div class="drill-item"><span class="drill-item-label">DMARC Policy</span><span class="drill-item-value ' + (d.dmarc === 'pass' ? 'green' : 'yellow') + '">' + (d.dmarc === 'pass' ? 'p=reject; pct=100' : 'p=none (monitor)') + '</span></div>'; html += '<div class="drill-item"><span class="drill-item-label">Recent Throttle</span><span class="drill-item-value ' + (d.status === 'critical' ? 'red' : d.status === 'warning' ? 'yellow' : 'green') + '">' + (d.status === 'critical' ? 'active β€” provider deferral' : d.status === 'warning' ? 'elevated β€” watch queue' : 'none β€” clean delivery') + '</span></div>'; html += '<div class="drill-item"><span class="drill-item-label">Subdomains</span><span class="drill-item-value">' + (d.volume > 200000 ? '4 active (track, notify, billing, alert)' : '2 active (app, status)') + '</span></div>'; html += '</div></td></tr>'; } }); tableBody.innerHTML = html; tableBody.querySelectorAll('tr[data-domain]').forEach(row => { row.addEventListener('click', function(e) { e.stopPropagation(); const domain = this.dataset.domain; drilledDomain = (drilledDomain === domain) ? null : domain; renderTable(); }); row.addEventListener('keydown', function(e) { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); const domain = this.dataset.domain; drilledDomain = (drilledDomain === domain) ? null : domain; renderTable(); } }); }); } /* ─── SEARCH ───────────────────────────────── */ const searchInput = document.getElementById('domain-search'); function setupSearch() { if (!searchInput) return; searchInput.addEventListener('input', function() { searchQuery = this.value.trim(); renderTable(); }); searchInput.addEventListener('keydown', function(e) { if (e.key === 'Escape') { this.value = ''; searchQuery = ''; renderTable(); this.blur(); } if (e.key === '/' && document.activeElement !== this) { e.preventDefault(); this.focus(); } }); document.addEventListener('keydown', function(e) { if (e.key === '/' && document.activeElement !== searchInput && !['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName)) { e.preventDefault(); searchInput.focus(); } }); } /* ─── SEGMENTED CHIPS ──────────────────────── */ function setupSegmented() { const buttons = document.querySelectorAll('.segmented button'); buttons.forEach(btn => { btn.addEventListener('click', function() { buttons.forEach(b => { b.classList.remove('active'); b.setAttribute('aria-selected', 'false'); }); this.classList.add('active'); this.setAttribute('aria-selected', 'true'); const range = this.dataset.range; updateTimeSeries(range); }); }); } /* ─── RETRY BANNER ─────────────────────────── */ function setupBanner() { const countdownEl = document.getElementById('retry-countdown'); const progressEl = document.getElementById('retry-progress'); const attemptsEl = document.getElementById('retry-attempts'); if (!countdownEl || !progressEl || !attemptsEl) return; let seconds = 42; const total = 60; const interval = setInterval(() => { seconds--; if (seconds <= 0) { clearInterval(interval); countdownEl.textContent = '0s'; progressEl.style.width = '0%'; attemptsEl.textContent = 'final attempt β€” dispatching'; return; } countdownEl.textContent = seconds + 's'; const pct = (seconds / total) * 100; progressEl.style.width = pct + '%'; if (seconds < 15) { attemptsEl.textContent = 'backoff \u00D74 β€” final attempt imminent'; } }, 1000); } /* ─── SORTING ──────────────────────────────── */ function setupSorting() { const sortableHeaders = document.querySelectorAll('thead th.sortable'); sortableHeaders.forEach(th => { th.addEventListener('click', function() { const sortKey = this.dataset.sort; if (currentSort === sortKey) { sortAsc = !sortAsc; } else { currentSort = sortKey; sortAsc = true; } sortableHeaders.forEach(h => { h.querySelector('.sort-arrow').textContent = '\u25B4'; }); this.querySelector('.sort-arrow').textContent = sortAsc ? '\u25B2' : '\u25BC'; renderTable(); }); }); } /* ─── ECHARTS RESIZE ───────────────────────── */ function setupResize() { window.addEventListener('resize', function() { if (tsChart) tsChart.resize(); if (providerChart) providerChart.resize(); }); } /* ─── INIT ─────────────────────────────────── */ function init() { initTimeSeries(); initProviderChart(); renderTable(); setupSearch(); setupSegmented(); setupBanner(); setupSorting(); setupResize(); if (window.lucide) { lucide.createIcons(); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })(); </script> </body> </html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mailrail β€” Delivery Console</title>
<style>
:root {
--bg: #0B1020;
--bg-elevated: #0F1529;
--bg-inset: #080C18;
--border: #1A2342;
--border-strong: #243052;
--text: #E2E8F0;
--text-secondary: #94A3B8;
--text-muted: #64748B;
--text-dim: #3D4A6B;
--accent: #3B82F6;
--accent-glow: rgba(59, 130, 246, 0.18);
--green: #10B981;
--green-bg: rgba(16, 185, 129, 0.12);
--red: #EF4444;
--red-bg: rgba(239, 68, 68, 0.12);
--yellow: #F59E0B;
--yellow-bg: rgba(245, 158, 11, 0.12);
--orange: #F97316;
--orange-bg: rgba(249, 115, 22, 0.12);
--mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
--sans: 'Inter', 'SF Pro Display', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
--radius: 6px;
--radius-sm: 4px;
--transition: 150ms cubic-bezier(0.2, 0, 0, 1);
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 13px;
}
body {
background: var(--bg);
color: var(--text);
font-family: var(--sans);
min-height: 100vh;
display: flex;
flex-direction: column;
line-height: 1.45;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
::selection {
background: rgba(59, 130, 246, 0.35);
color: #fff;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: var(--bg-inset);
}
::-webkit-scrollbar-thumb {
background: var(--border-strong);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #2E3B63;
}
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
border-radius: var(--radius-sm);
}
/* ── TOP BAR ─────────────────────────────────── */
.topbar {
display: flex;
align-items: center;
gap: 16px;
padding: 0 20px;
height: 52px;
background: var(--bg-elevated);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
position: sticky;
top: 0;
z-index: 100;
}
.topbar-brand {