web: Updated deleted event style.
- Refactored event messages style - Added official z-index layering variables - Use a cool ghost for profile image of deleted content
This commit is contained in:
parent
e50f3e542b
commit
f5cd0e2e39
3 changed files with 57 additions and 40 deletions
|
@ -30,6 +30,12 @@
|
||||||
|
|
||||||
/* Font Families */
|
/* Font Families */
|
||||||
--ffDefault: "Noto Sans", sans-serif;
|
--ffDefault: "Noto Sans", sans-serif;
|
||||||
|
|
||||||
|
/* Z Layers */
|
||||||
|
--zDefault: 0;
|
||||||
|
--zPFP: 1;
|
||||||
|
--zGlobal: 3;
|
||||||
|
--zModal: 5;
|
||||||
}
|
}
|
||||||
*:focus-visible {
|
*:focus-visible {
|
||||||
/* Technically this is bad and something else should be done to indicate
|
/* Technically this is bad and something else should be done to indicate
|
||||||
|
@ -96,6 +102,12 @@ button.action {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
.event-message {
|
||||||
|
background: #f2f2f2;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 12px;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
/* Navigation */
|
/* Navigation */
|
||||||
#nav {
|
#nav {
|
||||||
|
@ -129,7 +141,7 @@ button.nav {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 55px;
|
bottom: 55px;
|
||||||
right: 55px;
|
right: 55px;
|
||||||
z-index: 3;
|
z-index: var(--zGlobal);
|
||||||
}
|
}
|
||||||
#gnav button {
|
#gnav button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -143,10 +155,10 @@ button.nav {
|
||||||
border: transparent 5px solid;
|
border: transparent 5px solid;
|
||||||
transition: top 0.05s linear;
|
transition: top 0.05s linear;
|
||||||
transform: translateX(-50%) translateY(-50%);
|
transform: translateX(-50%) translateY(-50%);
|
||||||
z-index: 2;
|
z-index: calc(var(--zGlobal) - 1);
|
||||||
}
|
}
|
||||||
#gnav button[role="open-gnav"] {
|
#gnav button[role="open-gnav"] {
|
||||||
z-index: 3;
|
z-index: var(--zGlobal);
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
#gnav.open button[role="sign-out"] {
|
#gnav.open button[role="sign-out"] {
|
||||||
|
@ -194,11 +206,24 @@ button.nav {
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
.pfp {
|
.pfp {
|
||||||
border-radius: 50%;
|
|
||||||
width: 64px;
|
width: 64px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
object-fit: fill;
|
position: relative;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: var(--zPFP);
|
||||||
font-size: 3.25em;
|
font-size: 3.25em;
|
||||||
|
object-fit: fill;
|
||||||
|
}
|
||||||
|
.pfp.deleted {
|
||||||
|
background: var(--clrText);
|
||||||
|
font-size: 32px;
|
||||||
|
color: var(--clrBg);
|
||||||
|
}
|
||||||
|
.pfp.deleted > i {
|
||||||
|
top: 40%;
|
||||||
|
left: 50%;
|
||||||
|
position: relative;
|
||||||
|
transform: translateX(-50%) translateY(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-content {
|
.event-content {
|
||||||
|
@ -215,19 +240,16 @@ button.nav {
|
||||||
.chatroom-name {
|
.chatroom-name {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deleted-comment {
|
.deleted-comment {
|
||||||
border: 2px dashed var(--clrBorder);
|
margin-top: 10px;
|
||||||
border-radius: 10px;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
}
|
||||||
.line-bot {
|
.line-bot {
|
||||||
width: 3px;
|
width: 3px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-top: -7px;
|
position: relative;
|
||||||
|
top: -7px;
|
||||||
|
left: calc(50% - 1px);
|
||||||
background-color: var(--clrBorder);
|
background-color: var(--clrBorder);
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
}
|
||||||
.quote {
|
.quote {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
@ -305,31 +327,20 @@ button.nav {
|
||||||
color: var(--clrHeart);
|
color: var(--clrHeart);
|
||||||
}
|
}
|
||||||
details.cw summary {
|
details.cw summary {
|
||||||
background: #f2f2f2;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 12px;
|
|
||||||
color: #444;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-bottom: 10px;
|
|
||||||
outline: none;
|
outline: none;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Thread Expansion */
|
/* Thread Expansion */
|
||||||
.thread-collapsed {
|
.thread-collapsed {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
.thread-summary {
|
|
||||||
background: #f2f2f2;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 12px;
|
|
||||||
color: #444;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Modal */
|
/* Modal */
|
||||||
.modal {
|
.modal {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1;
|
z-index: var(--zModal);
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -1126,7 +1126,7 @@ function format_content(ev, show_media)
|
||||||
const open = !!DAMUS.cw_open[ev.id]? "open" : ""
|
const open = !!DAMUS.cw_open[ev.id]? "open" : ""
|
||||||
return `
|
return `
|
||||||
<details class="cw" id="cw_${ev.id}" ${open}>
|
<details class="cw" id="cw_${ev.id}" ${open}>
|
||||||
<summary>${cwHTML}</summary>
|
<summary class="event-message">${cwHTML}</summary>
|
||||||
${body}
|
${body}
|
||||||
</details>
|
</details>
|
||||||
`
|
`
|
||||||
|
|
|
@ -54,7 +54,7 @@ function render_thread_collapsed(model, reply_ev, opts)
|
||||||
if (opts.is_composing)
|
if (opts.is_composing)
|
||||||
return ""
|
return ""
|
||||||
return `<div onclick="expand_thread('${reply_ev.id}')" class="thread-collapsed">
|
return `<div onclick="expand_thread('${reply_ev.id}')" class="thread-collapsed">
|
||||||
<div class="thread-summary">
|
<div class="thread-summary event-message">
|
||||||
More messages in thread available. Click to expand.
|
More messages in thread available. Click to expand.
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
|
@ -163,15 +163,18 @@ function render_boosted_by(model, ev, opts) {
|
||||||
|
|
||||||
function render_deleted_comment_body(ev, deleted) {
|
function render_deleted_comment_body(ev, deleted) {
|
||||||
if (deleted.content) {
|
if (deleted.content) {
|
||||||
const show_media = false
|
|
||||||
return `
|
return `
|
||||||
<div class="deleted-comment">
|
<div class="deleted-comment event-message">
|
||||||
This comment was deleted. Reason:
|
This content was deleted with reason:
|
||||||
<div class="quote">${format_content(deleted, show_media)}</div>
|
<div class="quote">${format_content(deleted, false)}</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
return `<div class="deleted-comment">This comment was deleted</div>`
|
return `
|
||||||
|
<div class="deleted-comment event-message">
|
||||||
|
This content was deleted.
|
||||||
|
</div>
|
||||||
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_event(model, ev, opts={}) {
|
function render_event(model, ev, opts={}) {
|
||||||
|
@ -192,7 +195,7 @@ function render_event(model, ev, opts={}) {
|
||||||
|
|
||||||
const replied_events = render_replied_events(model, ev, opts)
|
const replied_events = render_replied_events(model, ev, opts)
|
||||||
|
|
||||||
let name = "???"
|
let name = ""
|
||||||
if (!deleted) {
|
if (!deleted) {
|
||||||
name = render_name_plain(ev.pubkey, profile)
|
name = render_name_plain(ev.pubkey, profile)
|
||||||
}
|
}
|
||||||
|
@ -222,11 +225,6 @@ function render_event(model, ev, opts={}) {
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_pfp(pk, profile) {
|
|
||||||
const name = render_name_plain(pk, profile)
|
|
||||||
return `<img class="pfp" title="${name}" onerror="this.onerror=null;this.src='${robohash(pk)}';" src="${get_picture(pk, profile)}">`
|
|
||||||
}
|
|
||||||
|
|
||||||
function render_react_onclick(our_pubkey, reacting_to, emoji, reactions) {
|
function render_react_onclick(our_pubkey, reacting_to, emoji, reactions) {
|
||||||
const reaction = reactions[our_pubkey]
|
const reaction = reactions[our_pubkey]
|
||||||
if (!reaction) {
|
if (!reaction) {
|
||||||
|
@ -329,11 +327,19 @@ function render_name(pk, profile) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_deleted_name() {
|
function render_deleted_name() {
|
||||||
return "???"
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function render_pfp(pk, profile) {
|
||||||
|
const name = render_name_plain(pk, profile)
|
||||||
|
return `<img class="pfp" title="${name}" onerror="this.onerror=null;this.src='${robohash(pk)}';" src="${get_picture(pk, profile)}">`
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_deleted_pfp() {
|
function render_deleted_pfp() {
|
||||||
return `<div class="pfp pfp-normal">😵</div>`
|
return `
|
||||||
|
<div class="pfp deleted">
|
||||||
|
<i class="fa-solid fa-fw fa-ghost"></i>
|
||||||
|
</div>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue