openvibers/openvibe.chat Commits
Chat home on a phone: a two-line lede, two actions, the numbers in one row (#402)
Changes
@@@ -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>`;}@@@ -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">
@@ -103,15 +103,20 @@ const FAQ = [
@@ -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.' },
{ 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) {
function stats(a) {
+ const live = a.streams.filter((s) => s.live).length;
const items = [
const items = [
+ live ? [n(live), live === 1 ? 'stream live now' : 'streams live now'] : null,
a.weekMessages ? [n(a.weekMessages), 'messages this week'] : null,
a.weekMessages ? [n(a.weekMessages), 'messages this week'] : null,
a.weekPeople ? [n(a.weekPeople), 'chatting this week'] : null,
a.weekPeople ? [n(a.weekPeople), 'chatting this week'] : null,
a.totalMessages ? [n(a.totalMessages), 'messages in all'] : 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 '';
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>`;
return `<dl class="oc-stats">${items.map(([v, l]) => `<div><dt>${esc(l)}</dt><dd>${esc(v)}</dd></div>`).join('')}</dl>`;
}
}
@@ -313,8 +313,8 @@ ${parts.rooms}`;
@@ -313,8 +313,8 @@ ${parts.rooms}`;
footer: signedIn ? 'compact' : 'full',
footer: signedIn ? 'compact' : 'full',
body: signedIn ? appBody() : `<header class="oc-hero">
body: signedIn ? appBody() : `<header class="oc-hero">
<h1>Chat with everyone on OpenVibe, or start your own server</h1>
<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.stats}</header>
${parts.vibe}
${parts.vibe}
<section class="oc-room" aria-labelledby="oc-h">
<section class="oc-room" aria-labelledby="oc-h">