Compare commits

...
3 Commits
3 changed files with 70 additions and 4 deletions

No files matched your search

+16 -3
View File
@@ -701,20 +701,24 @@ function renderRoster() {
// the first row is always someone new: the way back to a blank card from anyone's
const fresh = () => { S.fresh = true; syncNew(); openSheet("#card"); $("#nc-name").focus({ preventScroll: true }); };
tb.append(h("tr", { class: "opens newrow", onclick: (e) => { if (!e.target.closest("button, a")) fresh(); } },
h("td", { class: "rface" }, h("span", { class: "face plus", "aria-hidden": "true", text: "+" })),
h("th", { scope: "row" }, linkish("+ new character", fresh, { class: "linkish rowname" })),
h("td", { text: "write one here" }), h("td", { text: "" }),
h("td", { class: "from", text: "write one here" }), h("td", { class: "lic", text: "" }),
h("td", { class: "files" }, linkish("import a card", () => $("#import").click()))));
queueMicrotask(syncNew);
for (const c of S.cards) {
const on = cur && c.id === cur.id;
const from = c.engine.venice_character ? "venice, as a link with credit" : c.lineage[0] ? C.creditLine(c.lineage[0]) : "written here";
const go = (tab) => () => { selectCard(c.id); openCard(tab); };
const face = h("span", { class: "face", "aria-hidden": "true", "data-i": (c.name || "?").trim().charAt(0).toUpperCase() });
paintFace(face, portraitSrc(c));
// the whole row opens their card; the links in it do what they say
tb.append(h("tr", { "data-id": c.id, class: "opens", onclick: (e) => { if (!e.target.closest("button, a")) go("edit")(); } },
h("td", { class: "rface" }, face),
h("th", { scope: "row" }, linkish(c.name, go("edit"), { class: "linkish rowname" }), c.adult ? h("span", { class: "x18", title: "adult content label", text: "18+" }) : null,
on ? h("span", { class: "now", text: "talking" }) : null),
h("td", { text: from }),
h("td", { text: C.LICENSES[c.license] }),
h("td", { class: "from", text: from }),
h("td", { class: "lic", text: C.LICENSES[c.license] }),
h("td", { class: "files" }, slashed([
linkish("talk", () => selectCard(c.id, { talk: true, scroll: true }), { "aria-label": `Talk to ${c.name}` }),
linkish("card", go("edit"), { "aria-label": `${c.name}'s card` }),
@@ -902,6 +906,15 @@ function renderChat() {
function renderChatMeta() {
const c = card(), t = thread(), meta = $("#who-meta");
meta.textContent = "";
// their face beside their name, at the top of the chat (painted again only when it changes)
const wf = $("#who-face"), src = c && !c.plain ? portraitSrc(c) || "" : null;
wf.hidden = src === null;
wf.parentNode.classList.toggle("withface", !wf.hidden);
if (src !== null && (wf.dataset.src !== src || wf.dataset.i !== (c.name || "?").trim().charAt(0).toUpperCase())) {
wf.dataset.src = src;
wf.dataset.i = (c.name || "?").trim().charAt(0).toUpperCase();
paintFace(wf, src);
}
if (!c) return;
meta.append(...slashed([
c.adult ? "18+" : null,
+2 -1
View File
@@ -86,7 +86,7 @@
<p class="filters mono chars-note">every character you have, kept in this browser. export a file to keep one anywhere else.</p>
<div class="tablewrap">
<table class="table">
<thead><tr><th scope="col">NAME</th><th scope="col">FROM</th><th scope="col">LICENSE</th><th scope="col">FILE</th></tr></thead>
<thead><tr><th scope="col"><span class="sr">FACE</span></th><th scope="col">NAME</th><th scope="col">FROM</th><th scope="col">LICENSE</th><th scope="col">FILE</th></tr></thead>
<tbody id="roster"></tbody>
</table>
</div>
@@ -98,6 +98,7 @@
<section class="chat" id="chat" aria-labelledby="who-name">
<div class="sechead">
<button type="button" class="linkish back" id="chat-back">← characters</button>
<span class="face whoface" id="who-face" aria-hidden="true" hidden></span>
<h2 id="who-name">CHAT</h2>
<span class="meta" id="who-meta"></span>
</div>
+52
View File
@@ -971,3 +971,55 @@ a:hover, a:focus-visible, .linkish:hover, .linkish:focus-visible { color: var(--
.pill.on .keyicon { display: block; }
.pill.on #keybtn-text { display: none; }
.verdict.fresh { background: var(--ink); border-color: var(--ink); color: var(--paper); }
/* ---------- the harbor, as a list of faces ---------- */
#harbor .tablewrap { padding: 10px var(--gut) 18px; overflow: visible; }
#harbor .table, #harbor .table tbody { display: block; }
#harbor .table thead { display: none; }
#roster { display: flex; flex-direction: column; gap: 8px; }
#roster tr {
display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-rows: auto auto auto; column-gap: 14px; row-gap: 1px;
align-items: center; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper);
transition: border-color 0.15s, box-shadow 0.15s;
}
#roster tr:hover { background: var(--paper); border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); box-shadow: var(--shadow); }
#roster tr[aria-current="true"] { background: var(--paper); border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
#roster th, #roster td { display: block; padding: 0; border: 0; }
#roster .rface { grid-column: 1; grid-row: 1 / span 3; }
#roster th { grid-column: 2; grid-row: 1; font: 650 16px/1.3 var(--ui); }
#roster .from { grid-column: 2; grid-row: 2; color: var(--dim); font: 13.5px/1.4 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#roster .lic { grid-column: 2; grid-row: 3; color: var(--dim); font: 12px/1.4 var(--ui); opacity: 0.8; }
#roster .lic:empty { display: none; }
#roster .files { grid-column: 3; grid-row: 1 / span 3; font-size: 0; white-space: normal; text-align: right; max-width: 330px; }
#roster .files .linkish {
display: inline-block; margin: 3px 0 3px 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
font: 600 12px/1 var(--ui); text-decoration: none; color: var(--ink); background: var(--paper);
}
#roster .files .linkish:hover, #roster .files .linkish:focus-visible { background: var(--well); text-decoration: none; }
#roster .files .linkish[aria-label^="Delete"] { color: var(--dim); border-color: transparent; }
#roster .files .linkish[aria-label^="Delete"]:hover { color: var(--bad); background: none; }
#roster .rowname { text-decoration: none; color: var(--ink); }
#roster .now, #roster .x18 { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font: 600 10.5px/1.5 var(--ui); color: var(--dim); vertical-align: 2px; }
#roster .now { border-color: var(--ink); color: var(--ink); }
#roster .face { width: 56px; height: 56px; border-radius: 50%; }
#roster tr.newrow { border-style: dashed; background: none; }
#roster tr.newrow .face.plus { display: grid; place-items: center; background: var(--well); color: var(--dim); font: 300 28px/1 var(--ui); }
/* no picture yet: their initial, not an empty frame */
.face.noface[data-i] { display: grid; place-items: center; background: var(--well2); color: var(--dim); }
.face.noface[data-i]::after { content: attr(data-i); font: 650 22px/1 var(--brand); }
/* their face at the top of the chat */
.chat .sechead.withface { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; }
.chat .sechead.withface .back { display: none; }
.chat .sechead.withface #who-face { grid-column: 1; grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 50%; align-self: start; }
.chat .sechead.withface #who-name, .chat .sechead.withface #who-meta { grid-column: 2; }
.chat .sechead.withface .face.noface[data-i]::after { font-size: 18px; }
@media (max-width: 640px) {
#roster tr { grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto auto auto; padding: 12px; }
#roster .rface { grid-row: 1 / span 3; }
#roster .face { width: 48px; height: 48px; }
#roster .files { grid-column: 1 / span 2; grid-row: 4; text-align: left; max-width: none; margin-top: 8px; }
#roster .files .linkish { margin: 3px 6px 3px 0; }
.chat .sechead.withface { grid-template-columns: 38px minmax(0, 1fr); }
.chat .sechead.withface #who-face { width: 38px; height: 38px; }
}
#roster tr.newrow[aria-current="true"] { background: none; box-shadow: none; border-color: var(--line); }