Files
plugins/packages/day-card/page/style.css
T
yetone 7d5a68700e day-card: the card is a receipt, a Daily AI statement on paper (0.1.1)
A user installed the Day card and found it looked nothing like the
receipt in https://x.com/jasonaxb/status/2119432517170430196, and asked
for the same look. The card is now that receipt, with magpie's words in
place of the original's own:

- cream paper over a teal-to-mint ground, a zigzag torn bottom edge
  and a soft shadow; heavy monospace, letter-spaced labels and dashed
  rules;
- DATE and ISSUED, then the TOTAL API COST (API-equivalent, not an
  invoice), then STREAK, REQUESTS, ERRORS (only when there were any)
  and VS AVERAGE DAY (cost against the mean of the active days before
  this one; tokens when nothing was priced);
- AGENT / MODEL with logos printed in ink, by cost; then TOTAL TOKENS,
  INPUT, OUTPUT and CACHE HIT RATE;
- the original's tagline and App Store footer are magpie's own lines,
  and its RANK is left out: magpie has no ranking to read.

The frame can't fetch a font file (sandboxed, opaque origin), so the
face is a subset of JetBrains Mono 2.304 (OFL, license beside it) as
woff2 data in page/fonts.js, loaded with FontFace. About 13.5KB per
weight, 400/700/800.

The average now leaves out the day itself, and money(0) reads $0.00.

Run, on mote at this tree:
- bun test packages/day-card: 12 pass (tests rewritten for the receipt:
  fields, cost order, versus, dates with a held clock, fonts.js is
  woff2 and loads before app.js, only usage:day is read).
- bun test scripts: 22 pass; bun scripts/check.mjs: exit 0.
- The page in a sandboxed frame under the page CSP, with the
  reference's numbers and real magpie icons, in Chromium and WebKit
  (Playwright 1.62.0), en, zh, de and ja: all three weights load, no
  page errors, the long German title shrinks to fit; the English card
  checked side by side with the tweet's image.

Not tried: the real magpie app's WKWebView, and Copy/Save from it.
2026-11-10 01:35:35 +08:00

34 lines
2.7 KiB
CSS

:root {
--bg: var(--magpie-bg, #fff);
--card: var(--magpie-card, #f6f6f7);
--fg: var(--magpie-fg, #1d1d1f);
--muted: var(--magpie-muted, #6e6e73);
--line: var(--magpie-line, #e5e5ea);
--red: var(--magpie-red, #d70015);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { padding: 16px 20px 32px; font: 13px/1.45 var(--magpie-font, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif); }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; max-width: 760px; margin: 0 auto; }
.days, .share { display: flex; align-items: center; gap: 6px; }
button { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; cursor: default; transition: border-color .15s ease, transform .12s cubic-bezier(.23, 1, .32, 1); }
button:disabled { color: var(--muted); opacity: .6; }
button:active:not(:disabled) { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { button:hover:not(:disabled) { border-color: var(--muted); } }
svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.step { padding: 4px 6px; }
.pick { position: relative; }
#date { display: inline-flex; align-items: center; gap: 6px; min-width: 9em; justify-content: space-between; font-variant-numeric: tabular-nums; }
#menu { position: absolute; z-index: 2; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 300px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); transform-origin: top left; transition: opacity .15s cubic-bezier(.23, 1, .32, 1), transform .15s cubic-bezier(.23, 1, .32, 1); }
#menu.closing, #menu.opening { opacity: 0; transform: scale(.96); }
#menu.closing { transition-duration: .1s; }
#menu li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#menu li span:last-child { color: var(--muted); }
#menu li[aria-selected="true"], #menu li.on { background: var(--card); }
@media (hover: hover) and (pointer: fine) { #menu li:hover { background: var(--card); } }
.status { max-width: 760px; margin: 8px auto; min-height: 1.45em; color: var(--muted); overflow-wrap: anywhere; }
.status.bad { color: var(--red); }
main { max-width: 760px; margin: 0 auto; }
canvas { display: block; width: 100%; height: auto; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { #menu.closing, #menu.opening { transform: none; } button:active:not(:disabled) { transform: none; } }