previews on home
This commit is contained in:
@@ -273,8 +273,20 @@ body {
|
||||
.note-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
|
||||
.note-tags { color: var(--primary); font-size: 12px; margin-top: 4px; }
|
||||
|
||||
.note-common { border-left: 3px solid var(--secondary); }
|
||||
.common-badge {
|
||||
.note-item { display: flex; align-items: center; gap: 12px; }
|
||||
.note-body { flex: 1; min-width: 0; }
|
||||
.note-thumb {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
object-fit: cover;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.attach-count { color: var(--muted); margin-left: 8px; }
|
||||
|
||||
.note-common { border-left: 3px solid var(--secondary); }.common-badge {
|
||||
display: inline-block;
|
||||
background: color-mix(in srgb, var(--secondary) 18%, transparent);
|
||||
color: var(--secondary);
|
||||
|
||||
@@ -410,10 +410,15 @@ function noteList(notes) {
|
||||
const meta = el("div", { class: "note-meta" });
|
||||
if (isCommon) meta.appendChild(el("span", { class: "common-badge", text: "common" }));
|
||||
meta.appendChild(document.createTextNode(`${n.username} · ${relTime(n.updated_at)}`));
|
||||
ul.appendChild(el("li", { class: isCommon ? "note-item note-common" : "note-item", onclick: () => openNote(n.id) }, [
|
||||
if (n.attachments) meta.appendChild(el("span", { class: "attach-count", text: n.attachments + " attachment" + (n.attachments === 1 ? "" : "s") }));
|
||||
const bodyEl = el("div", { class: "note-body" }, [
|
||||
el("div", { class: "note-title", text: n.title || "Untitled" }),
|
||||
meta,
|
||||
el("div", { class: "note-tags", text: tags }),
|
||||
]);
|
||||
ul.appendChild(el("li", { class: isCommon ? "note-item note-common" : "note-item", onclick: () => openNote(n.id) }, [
|
||||
n.image ? el("img", { class: "note-thumb", src: n.image, alt: "", loading: "lazy" }) : null,
|
||||
bodyEl,
|
||||
]));
|
||||
}
|
||||
return ul;
|
||||
|
||||
Reference in New Issue
Block a user