damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

commit 472681ae585fa72c4529def37f3d22b04a014692
parent 350771a75f7d909c89752cd7d615b7c297b729de
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 11 Nov 2022 18:03:10 -0800

web: dont render bottom event border with replies

Diffstat:
Mweb/damus.js | 15++++++++++-----
Mweb/index.html | 4++--
Mweb/styles.css | 7++++---
3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/web/damus.js b/web/damus.js @@ -684,8 +684,8 @@ function determine_event_refs(tags) { return {root, reply, pubkeys} } -function render_reply_line_top(invisible) { - const classes = invisible ? "invisible" : "" +function render_reply_line_top(has_top_line) { + const classes = has_top_line ? "" : "invisible" return `<div class="line-top ${classes}"></div>` } @@ -820,7 +820,10 @@ function render_boost(model, ev, opts) { } function shouldnt_render_event(model, ev, opts) { - return !opts.is_boost_event && !opts.is_composing && !model.expanded.has(ev.id) && model.rendered[ev.id] + return !opts.is_boost_event && + !opts.is_composing && + !model.expanded.has(ev.id) && + model.rendered[ev.id] } function render_deleted_name() { @@ -899,11 +902,13 @@ function render_event(model, ev, opts={}) { name = render_name_plain(ev.pubkey, profile) } + const has_top_line = replied_events !== "" + const border_bottom = has_bot_line ? "" : "bottom-border"; return ` ${replied_events} - <div id="ev${ev.id}" class="event"> + <div id="ev${ev.id}" class="event ${border_bottom}"> <div class="userpic"> - ${render_reply_line_top(replied_events === "")} + ${render_reply_line_top(has_top_line)} ${deleted ? render_deleted_pfp() : render_pfp(ev.pubkey, profile)} ${reply_line_bot} </div> diff --git a/web/index.html b/web/index.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Damus</title> - <link rel="stylesheet" href="styles.css?v=106"> + <link rel="stylesheet" href="styles.css?v=107"> <link rel="stylesheet" href="damus.css?v=210"> <link rel="stylesheet" href="fontawesome.css?v=2"> </head> @@ -63,7 +63,7 @@ <script src="noble-secp256k1.js?v=1"></script> <script src="bech32.js?v=1"></script> <script src="nostr.js?v=6"></script> - <script src="damus.js?v=61"></script> + <script src="damus.js?v=62"></script> <script> // I have to delay loading to wait for nos2x const relay = setTimeout(damus_web_init, 100) diff --git a/web/styles.css b/web/styles.css @@ -127,9 +127,6 @@ button.nav { } /* Events & Content */ -#events > .event { - border-bottom: solid 1px var(--clrBorder); -} .event { display: flex; flex-direction: row; @@ -326,6 +323,10 @@ input[type="text"].cw { cursor: pointer; } +.bottom-border { + border-bottom: solid 1px var(--clrBorder); +} + @media (max-width: 800px){ :root { --navPadding: 2px;