The card was always a receipt on a wide teal ground. A Background button
in the toolbar now opens a menu of 19 backdrops, all drawn on the canvas
the card is saved from:
- teal (as before), and 14 patterns: gingham, graph paper, kraft,
cyanotype, night dots, deckchair stripes, olive linen, seigaiha waves,
xuan paper, zigzag, terracotta, lilac lines, green velvet, apricot
polka;
- four landscape photos (alpine dawn, misty shore, dunes, forest lake),
1000x1500 JPEGs made for this plugin;
- a picture of the reader's own: pick it, drop it on the page or paste
it.
A slider sets the margin around the paper (24 to 160, 76 by default, in
place of the old fixed 207 a side and 4:3 height). A photo also has blur
and dim. The paper's shadow follows the ground.
The choice is kept in the plugin's options (magpie.options): saved a
moment after a slider settles, since magpie takes one write a second.
The reader's own picture is shrunk to a JPEG of at most ~44KB, within
the 64KB magpie keeps for a plugin's options.
The photos are JPEG data in page/bg/<id>.js, loaded when picked, not
image files: the frame's origin is opaque, so a picture loaded by URL
would taint the canvas, and Copy image and Save PNG would fail.
Thumbnails are in bg/thumbs.js, loaded when the menu first opens.
Run: bun test packages/day-card on the Linux test box (magpie-desktop,
via wsl-run; mote refused SSH at the time): 14 pass, 2 of them new
(names in every language and the photos' data; a saved choice made
sound). A Playwright harness served the page with magpie's plugin-page
CSP (sandbox allow-scripts, img-src own data:, connect-src 'none') and
a fake bridge, in Chromium and WebKit: each of the 19 backdrops drew
and saved a PNG through magpie.image (so the canvas was not tainted),
the menu picked dunes and saved {bg: dunes, pad: 120}, the blur and dim
sliders showed only for a photo, and a 2400px JPEG of one's own was
stored as 36-43KB data and drawn. No page errors in either engine. The
first run showed the menu's sliders over the card while closed
(display: flex beat [hidden]); fixed and run again.
Not tried: the real magpie app (WKWebView, WebKitGTK, WebView2), its
real options store, and the native file picker inside the frame.