openvibers/openvibe.chat Commits

Chat home on a phone: a two-line lede, two actions, the numbers in one row (#402)

OP OpenVibers committed 6 days ago · 4703a5d889 · 2 files, +11 −6

The signed-out hero's lede ran six lines at 390 px and began with a fragment ("Vibe, OpenVibe's assistant."); it
now says what the place is in two. Rooms and Messages were hero buttons and navbar items both: the hero keeps Chat
with Vibe and Start a server. The numbers under the heading stop at three so they sit in one row (a fourth wrapped
alone), streams live now lead when there are any, and public servers count from three: "1 public server" undersold
the place.

Changes

ddiff --git a/server/web/home.js b/server/web/home.js
iindex 47b9c54..60a879d 100644
---- a/server/web/home.js
++++ b/server/web/home.js
@@@ -103,15 +103,20 @@ const FAQ = [
{ q: 'Who can message me?', a: 'You decide in your settings who may start a conversation with you and whether group conversations may add you. You can block anyone from a conversation.' },
];
--/** The numbers under the heading: only those that are known and not zero. */
++/**
++ * The numbers under the heading: only those that are known and say something, at most three so they sit in one row on
++ * a phone (a fourth wrapped onto a row of its own). Streams live now lead when there are any; public servers count
++ * from three ("1 public server" undersold the place).
++ */
function stats(a) {
++ const live = a.streams.filter((s) => s.live).length;
const items = [
++ live ? [n(live), live === 1 ? 'stream live now' : 'streams live now'] : null,
a.weekMessages ? [n(a.weekMessages), 'messages this week'] : null,
a.weekPeople ? [n(a.weekPeople), 'chatting this week'] : null,
a.totalMessages ? [n(a.totalMessages), 'messages in all'] : null,
-- a.servers.length ? [n(a.servers.length), a.servers.length === 1 ? 'public server' : 'public servers'] : null,
-- a.streams.some((s) => s.live) ? [n(a.streams.filter((s) => s.live).length), 'streams live now'] : null,
-- ].filter(Boolean);
++ a.servers.length >= 3 ? [n(a.servers.length), 'public servers'] : null,
++ ].filter(Boolean).slice(0, 3);
if (!items.length) return '';
return `<dl class="oc-stats">${items.map(([v, l]) => `<div><dt>${esc(l)}</dt><dd>${esc(v)}</dd></div>`).join('')}</dl>`;
}
ddiff --git a/server/web/pages.js b/server/web/pages.js
iindex c791bf7..02598b2 100644
---- a/server/web/pages.js
++++ b/server/web/pages.js
@@@ -313,8 +313,8 @@ ${parts.rooms}`;
footer: signedIn ? 'compact' : 'full',
body: signedIn ? appBody() : `<header class="oc-hero">
<h1>Chat with everyone on OpenVibe, or start your own server</h1>
--<p class="oc-lede">Vibe, OpenVibe's assistant. One chat for the whole network and every stream on OpenVibe.Live. Servers with text and voice channels, rooms, private messages and calls of up to eight, with AI members that join in. One free account, everywhere.</p>
--<p class="oc-hero-actions"><a class="oc-button" href="/vibe">Chat with Vibe</a> <a class="oc-button oc-button--quiet" href="${signedIn ? '/servers#oc-new-server' : '/auth/login?next=%2Fservers'}">Start a server</a> <a class="oc-button oc-button--quiet" href="/rooms">Rooms</a> <a class="oc-button oc-button--quiet" href="${signedIn ? '/messages' : '/auth/login?next=%2Fmessages'}">Messages</a></p>
++<p class="oc-lede">The chat on every stream, servers with voice channels, messages and calls, and Vibe, your assistant. One free account, everywhere.</p>
++<p class="oc-hero-actions"><a class="oc-button" href="/vibe">Chat with Vibe</a> <a class="oc-button oc-button--quiet" href="${signedIn ? '/servers#oc-new-server' : '/auth/login?next=%2Fservers'}">Start a server</a></p>
${parts.stats}</header>
${parts.vibe}
<section class="oc-room" aria-labelledby="oc-h">