aboutsummaryrefslogtreecommitdiffstats
path: root/src/style.css
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-28 22:58:40 -0700
committerAdam Soltys <[email protected]>2026-09-28 22:58:40 -0700
commitc0e428aff3ff34fec56a434bc1837e49ab9c1a81 (patch)
tree63bb5e1f314d2a53b9551be17bf6fa4a261958e4 /src/style.css
parent86d5609a188ce4dae248d1b56c4563bae299af31 (diff)
downloadcoinosv3-c0e428aff3ff34fec56a434bc1837e49ab9c1a81.tar.gz
coinosv3-c0e428aff3ff34fec56a434bc1837e49ab9c1a81.zip
Polls (NIP-88): options with each one's share of the vote, votable from the feed and the thread.
A kind 1068 poll showed as "an event this app doesn't show". Now its options are rows with the vote share behind them (kind 1018 votes, each person's latest counts, single/multiple choice, endsAt honored); a tap votes, marked as yours at once. A quoted poll is pictured in its card. Feeds and profiles list polls alongside notes, and a thread's root is looked up by id with any kind, so replies to a poll find it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Du1qT1wbkYwYK6zkGH79Rp
Diffstat (limited to 'src/style.css')
-rw-r--r--src/style.css18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/style.css b/src/style.css
index 15fcad0..9b0bf45 100644
--- a/src/style.css
+++ b/src/style.css
@@ -768,6 +768,24 @@ html.no-scroll { overflow: hidden; scrollbar-gutter: auto; }
.quote-card.clickable { cursor: pointer; }
.quote-card.clickable:hover { border-color: var(--line-strong); }
.quote-loading { flex-direction: row; align-items: center; gap: 8px; }
+/* A poll (NIP-88): each option a row with its share of the vote as a bar
+ behind the label. Only the bar's width changes as votes arrive, so the
+ post never changes height under the reader. */
+.poll { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
+.poll-opt {
+ position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px;
+ width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
+ background: var(--surface2); color: inherit; font: inherit; text-align: left; cursor: pointer;
+}
+.poll-opt.static { cursor: inherit; min-height: 34px; padding: 6px 10px; }
+.poll-opt:not(.static):hover { border-color: var(--line-strong); }
+.poll-opt.mine { border-color: var(--accent); }
+.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--line); transition: width .3s ease; pointer-events: none; }
+.poll-opt.mine .poll-bar { background: var(--line-strong); }
+.poll-label { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; }
+.poll-opt.mine .poll-label { font-weight: 600; }
+.poll-pct { position: relative; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
+.poll-foot { margin-top: 2px; }
/* Posts that landed while you were reading further down. Floats over the
feed near the top, out of the way of the thumb, and takes you up to them
when tapped. Fixed, not sticky: the feed is the page scroller, and a