Files
plugins/packages/notify/page/style.css
T
yetone 8adf0a7d79 notify 0.1.4: a sidebar page to edit channels and settings, and a switch that turns every push off (meili145 on X)
The page (magpie.page) edits the plugin's options without a file: add,
pause and remove channels per kind, when to send, agents, language, and an
on/off switch that saves at once (new option enabled, default true; off
sends no turn push and no sign-in push).

Run: bun test packages/notify (67 pass; the enabled test fails on the old
hook), scripts/check.mjs ok. Page tried in magpie's real window (dev build
of origin/main, sandbox HOME, plugin added from the folder) in chromium:
add ntfy channel, Save and the switch wrote plugins.json options, 5
languages at 1000px and 420px with no overflow. Not tried: WebKit (its
launch failed on mote), a real push from the page.
2026-11-11 13:13:40 +08:00

57 lines
4.4 KiB
CSS

:root {
color-scheme: light dark;
--bg: var(--magpie-bg, #f6f6f5);
--card: var(--magpie-card, #ffffff);
--fg: var(--magpie-fg, #1d1d1f);
--muted: var(--magpie-muted, #6e6e73);
--line: var(--magpie-line, #dcdcdc);
--accent: var(--magpie-accent, #3a5f8f);
--soft: var(--magpie-accent-soft, #e8eef5);
--red: var(--magpie-red, #b3402f);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.45 var(--magpie-font, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif); }
main { max-width: 720px; margin: 0 auto; padding: 24px 20px 56px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 13px; font-weight: 600; margin: 0; }
section { margin-bottom: 24px; }
.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 12px; min-height: 40px; }
.row + .row, .fields { border-top: 1px solid var(--line); }
.row > label, .row > .name { flex: 1 1 auto; min-width: 0; }
.chan + .chan { margin-top: 8px; }
.chan-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.chan-head .title { font-weight: 600; flex: 1; }
.chan.paused .title, .chan.paused .fields { opacity: .55; }
.fields { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; padding: 10px 12px; align-items: center; }
.fields label { color: var(--muted); }
.warn { color: var(--red); font-size: 12px; }
input[type=text], input[type=password], input[type=number] { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font: inherit; color: inherit; }
input[type=number] { width: 90px; text-align: right; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; cursor: pointer; transition: border-color .15s ease, transform .12s cubic-bezier(.23,1,.32,1); }
button:active:not(:disabled) { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { button:hover:not(:disabled) { border-color: var(--muted); } }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.switch { position: relative; width: 34px; height: 20px; padding: 0; border-radius: 10px; background: var(--line); border: 0; flex: none; transition: background .15s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s cubic-bezier(.23,1,.32,1); }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true]::after { transform: translateX(14px); }
.menu { position: relative; display: inline-block; }
.menu > button::after { content: " \25BE"; color: var(--muted); }
.pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 150px; max-height: 280px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.14); transform-origin: top right; animation: pop .15s cubic-bezier(.23,1,.32,1); }
.pop[hidden] { display: none; }
.pop button { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 5px; padding: 5px 8px; }
.pop button[aria-selected=true] { background: var(--soft); color: var(--accent); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 0; background: var(--bg); }
.status { color: var(--muted); }
.status.error { color: var(--red); }
.empty { padding: 14px 12px; color: var(--muted); }
@media (max-width: 480px) { .fields { grid-template-columns: 1fr; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } .switch::after { transition: none; } }