The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | --- |
| 2 | /** |
| 3 | * `<StatGrid />` — a row of headline numbers for blog posts: a big value, |
| 4 | * what it measures, and where it started. |
| 5 | * |
| 6 | * Usage in MDX: |
| 7 | * <StatGrid stats={[{ value: "−33%", label: "bundle size", detail: "57.1 → 38.3 KB" }]} /> |
| 8 | */ |
| 9 | interface Props { |
| 10 | title?: string; |
| 11 | stats: ReadonlyArray<{ value: string; label: string; detail?: string }>; |
| 12 | } |
| 13 | |
| 14 | const { title, stats } = Astro.props; |
| 15 | --- |
| 16 | |
| 17 | {title && <p class="alc-stats__title">{title}</p>} |
| 18 | <ul class="alc-stats" data-nosnippet> |
| 19 | { |
| 20 | stats.map((s) => ( |
| 21 | <li class="alc-stats__item"> |
| 22 | <span class="alc-stats__value">{s.value}</span> |
| 23 | <span class="alc-stats__label">{s.label}</span> |
| 24 | {s.detail && <span class="alc-stats__detail">{s.detail}</span>} |
| 25 | </li> |
| 26 | )) |
| 27 | } |
| 28 | </ul> |
| 29 | |
| 30 | <style> |
| 31 | .alc-stats__title { |
| 32 | margin: 2rem 0 -1.25rem; |
| 33 | font-weight: 700; |
| 34 | font-size: 1.05rem; |
| 35 | color: var(--alc-fg-1); |
| 36 | } |
| 37 | |
| 38 | .alc-stats { |
| 39 | display: grid; |
| 40 | grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); |
| 41 | gap: 0.75rem; |
| 42 | margin: 2rem 0; |
| 43 | padding: 0; |
| 44 | list-style: none; |
| 45 | } |
| 46 | |
| 47 | .alc-stats__item { |
| 48 | display: flex; |
| 49 | flex-direction: column; |
| 50 | gap: 0.2rem; |
| 51 | margin: 0; |
| 52 | padding: 1rem 1.1rem; |
| 53 | background: var(--alc-bg-elev-1); |
| 54 | border: 1px solid var(--alc-hairline-2); |
| 55 | border-radius: 10px; |
| 56 | } |
| 57 | |
| 58 | .alc-stats__value { |
| 59 | font-family: var(--alc-font-mono); |
| 60 | font-size: 2rem; |
| 61 | font-weight: 800; |
| 62 | line-height: 1.1; |
| 63 | color: var(--alc-accent-text); |
| 64 | } |
| 65 | |
| 66 | .alc-stats__label { |
| 67 | font-weight: 600; |
| 68 | color: var(--alc-fg-1); |
| 69 | line-height: 1.3; |
| 70 | } |
| 71 | |
| 72 | .alc-stats__detail { |
| 73 | font-family: var(--alc-font-mono); |
| 74 | font-size: 0.78rem; |
| 75 | color: var(--alc-fg-3); |
| 76 | } |
| 77 | </style> |