A new page plugin, @magpie-community/page-day-card, for JungleyYeh on X, who asked for a "daily AI statement". - It shows a chosen day (today by default, others from a date menu): its tokens, cost, calls and errors, then each agent with its models and icons. Below them come the streak, the average active day and the last two weeks. - Copy puts the card on the clipboard as an image; Save writes it as a PNG. - The design is quiet, with no gradients and no coloured accents, in light and dark. It speaks en, zh, zh-TW, ja and de. - It asks for one read, usage:day, and needs magpie 0.1.3427 (623e797fd) for that read and for magpie.image.copy/save. What was run (mote): - bun test packages/day-card: 11 pass, 0 fail. Before engines.magpie was set, the guard test was red on the placeholder. - bun scripts/check.mjs: exit 0. - Real use: the page in magpie's real GUI server with a sandbox HOME holding a copy of real usage, in Chromium and WebKit, light and dark, en/zh/zh-TW/ja/de, at 420 and 1100 px, with an earlier day picked and Copy pressed. No page errors (magpie 623e797fd's body has the rest).
32 lines
1.4 KiB
HTML
32 lines
1.4 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Day card</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<script src="_magpie/bridge.js"></script>
|
|
<script src="view.js"></script>
|
|
<script src="app.js" defer></script>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="days">
|
|
<button type="button" class="step" id="prev" aria-label="Previous day" data-t-label="prev"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5"/></svg></button>
|
|
<div class="pick">
|
|
<button type="button" id="date" aria-haspopup="listbox" aria-expanded="false"><span id="date-text"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m4.5 6.5 3.5 3.5 3.5-3.5"/></svg></button>
|
|
<ul id="menu" role="listbox" hidden></ul>
|
|
</div>
|
|
<button type="button" class="step" id="next" aria-label="Next day" data-t-label="next"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5"/></svg></button>
|
|
<button type="button" id="today" data-t="today">Today</button>
|
|
</div>
|
|
<div class="share">
|
|
<button type="button" id="copy" data-t="copy" disabled>Copy image</button>
|
|
<button type="button" id="save" data-t="save" disabled>Save PNG</button>
|
|
</div>
|
|
</header>
|
|
<p class="status" id="status" role="status"></p>
|
|
<main><canvas id="card"></canvas></main>
|
|
</body>
|
|
</html>
|