forge
Explore
Log in

Don't you dare go Hollow

the family hides behind the logo: the in · im · iz row under the signed-in wordmark goes, and the siblings become a flyout that drops under the im mark on hover and on keyboard focus — the mark carries a tabindex for that, the flyout stays in the DOM at opacity zero so Tab reaches its links and focus-within opens it, no gap between mark and flyout so the pointer can travel down into it, no script; a family with no siblings renders the bare mark, and the landing and the public profile page both use the new view in place of wordmark plus trio

Browse files at this commit

3581cafaf50bc5f3ca40a2eae2fba1929a8fd1f1Ahmet Kaan GümüşParent: 6ccb056
crates/im-web/assets/main.cssmodified+28 -6
@@ -319,12 +319,38 @@ body:has(.auth-stage) > .auth-stage::-webkit-scrollbar {
319319 padding: 4px 0 10px;
320320 }
321321
322-.service-trio {
322+.wordmark-family {
323+ position: relative;
323324 display: flex;
324325 justify-content: center;
326+}
327+.wordmark-family .wordmark {
328+ cursor: default;
329+ outline: none;
330+}
331+.wordmark-family:hover .service-trio, .wordmark-family:focus-within .service-trio {
332+ opacity: 1;
333+ transform: translate(-50%, 0);
334+ pointer-events: auto;
335+}
336+
337+.service-trio {
338+ position: absolute;
339+ top: 100%;
340+ left: 50%;
341+ z-index: 2;
342+ display: flex;
325343 align-items: baseline;
326344 gap: 10px;
327- padding: 0 0 2px;
345+ padding: 6px 12px;
346+ background: var(--surface);
347+ border: 1px solid var(--border);
348+ border-radius: var(--radius);
349+ box-shadow: var(--shadow-2);
350+ opacity: 0;
351+ transform: translate(-50%, -4px);
352+ pointer-events: none;
353+ transition: opacity 120ms ease, transform 120ms ease;
328354 }
329355
330356 .trio-mark {
@@ -338,10 +364,6 @@ body:has(.auth-stage) > .auth-stage::-webkit-scrollbar {
338364 .trio-mark:hover {
339365 color: var(--ink);
340366 }
341-.trio-mark-on {
342- color: var(--ink);
343- box-shadow: inset 0 -2px 0 var(--accent);
344-}
345367
346368 .trio-sep {
347369 color: var(--muted-soft);
crates/im-web/src/layout.rsmodified+26 -25
@@ -24,35 +24,36 @@ pub async fn wordmark(cx: &Cx) -> Result {
2424 }
2525 }
2626
27-/// The signed-in chrome's app trio: every family service's wordmark,
28-/// middots between, the home one (`im`) inked and marked current, its
29-/// siblings plain links. A family with no members renders nothing — the
30-/// single mark above stays the whole chrome. The list is the stored one,
31-/// the same rows `/family` serves.
32-pub async fn service_trio(cx: &Cx) -> Result {
27+/// The signed-in chrome's wordmark with the family behind it: the `im`
28+/// mark as above, and the sibling services' wordmarks in a flyout that
29+/// opens under it on hover and on keyboard focus (the mark is focusable
30+/// for that), middots between, each a plain link. No script: the flyout
31+/// is CSS on `:hover` / `:focus-within`. A family with no siblings renders
32+/// the bare mark — nothing to reveal. The list is the stored one, the same
33+/// rows `/family` serves, minus im's own row.
34+pub async fn family_wordmark(cx: &Cx) -> Result {
3335 let services = im_core::services::list(&server::app(cx).store).await?;
34- let marks = (!services.is_empty()).then(|| {
35- services
36- .iter()
37- .map(|service| {
38- let key = crate::pages::escape(&service.key);
39- if service.key == "im" {
40- format!(
41- r#"<span class="trio-mark trio-mark-on" aria-current="page">{key}</span>"#
42- )
43- } else {
44- let url = crate::pages::escape(&service.url);
45- format!(r#"<a class="trio-mark" href="{url}">{key}</a>"#)
46- }
47- })
48- .collect::<Vec<_>>()
49- .join(r#"<span class="trio-sep">·</span>"#)
50- });
36+ let siblings = services
37+ .iter()
38+ .filter(|service| service.key != "im")
39+ .map(|service| {
40+ let key = crate::pages::escape(&service.key);
41+ let url = crate::pages::escape(&service.url);
42+ format!(r#"<a class="trio-mark" href="{url}">{key}</a>"#)
43+ })
44+ .collect::<Vec<_>>();
45+ if siblings.is_empty() {
46+ return wordmark(cx).await;
47+ }
48+ let marks = siblings.join(r#"<span class="trio-sep">·</span>"#);
5149 view! {
5250 cx =>
53- if let Some(marks) = marks {
51+ <div class="wordmark-family">
52+ <span class="wordmark" tabindex="0">
53+ <span class="wordmark-text">"im"</span>
54+ </span>
5455 <nav class="service-trio">(topcoat::view::Unescaped::new_unchecked(marks))</nav>
55- }
56+ </div>
5657 }
5758 }
5859
crates/im-web/src/pages.rsmodified+3 -4
@@ -12,7 +12,7 @@ use topcoat::router::{page, path_param, route};
1212 use topcoat::view::view;
1313
1414 use crate::i18n::{Key, Lang, lang_of, t};
15-use crate::layout::{avatar, service_trio, shell, wordmark};
15+use crate::layout::{avatar, family_wordmark, shell, wordmark};
1616 use crate::server::{self, PendingPurpose};
1717
1818 path_param!(token);
@@ -602,15 +602,14 @@ async fn signed_in(cx: &Cx, user: &im_core::model::User) -> Result {
602602 )
603603 })
604604 .collect::<String>();
605- // The family lives in the chrome — the wordmark trio under the
605+ // The family lives in the chrome — the siblings' flyout under the
606606 // wordmark — and its editing in the admin panel; the landing is the
607607 // account's own page and carries no directory of its own.
608608 let stage = view! {
609609 cx =>
610610 <main class="auth-stage landing-stage">
611611 <div class="auth-column">
612- (wordmark(cx).await?)
613- (service_trio(cx).await?)
612+ (family_wordmark(cx).await?)
614613 <nav class="admin-tabs landing-nav">(topcoat::view::Unescaped::new_unchecked(nav))</nav>
615614 if let Some(code) = ok {
616615 <div class="auth-ok">(ok_text(&code, lang))</div>
crates/im-web/src/people.rsmodified+2 -3
@@ -14,7 +14,7 @@ use topcoat::view::view;
1414 use im_core::accounts;
1515
1616 use crate::i18n::{Key, lang_of, t};
17-use crate::layout::{avatar, service_trio, shell, wordmark};
17+use crate::layout::{avatar, family_wordmark, shell};
1818 use crate::server;
1919
2020 path_param!(user_id);
@@ -39,8 +39,7 @@ async fn people_page(cx: &Cx) -> Result {
3939 cx =>
4040 <main class="auth-stage">
4141 <div class="auth-column">
42- (wordmark(cx).await?)
43- (service_trio(cx).await?)
42+ (family_wordmark(cx).await?)
4443 <div class="auth-card">
4544 <div class="profile-head">
4645 if person.has_photo {
style/main.scssmodified+35 -10
@@ -279,15 +279,45 @@ body:has(.auth-stage) {
279279 padding: 4px 0 10px;
280280 }
281281
282-// The app trio under the signed-in wordmark: lower-case marks in the
283-// wordmark's mono, the home one inked, its siblings quiet links. The
284-// middots are part of the mark, not decoration between cards.
285-.service-trio {
282+// The family behind the signed-in wordmark: the siblings' marks in the
283+// wordmark's mono, middots between, in a flyout that hangs under the mark
284+// and shows on hover or keyboard focus (the mark carries tabindex for it).
285+// Absolutely placed so the chrome keeps the bare wordmark's height; it
286+// stays in the DOM so the links are reachable by tab, which is what opens
287+// it for a keyboard. No gap between mark and flyout, so the pointer can
288+// travel down into it without it closing.
289+.wordmark-family {
290+ position: relative;
286291 display: flex;
287292 justify-content: center;
293+
294+ .wordmark { cursor: default; outline: none; }
295+
296+ &:hover .service-trio,
297+ &:focus-within .service-trio {
298+ opacity: 1;
299+ transform: translate(-50%, 0);
300+ pointer-events: auto;
301+ }
302+}
303+
304+.service-trio {
305+ position: absolute;
306+ top: 100%;
307+ left: 50%;
308+ z-index: 2;
309+ display: flex;
288310 align-items: baseline;
289311 gap: 10px;
290- padding: 0 0 2px;
312+ padding: 6px 12px;
313+ background: var(--surface);
314+ border: 1px solid var(--border);
315+ border-radius: var(--radius);
316+ box-shadow: var(--shadow-2);
317+ opacity: 0;
318+ transform: translate(-50%, -4px);
319+ pointer-events: none;
320+ transition: opacity 120ms ease, transform 120ms ease;
291321 }
292322
293323 .trio-mark {
@@ -299,11 +329,6 @@ body:has(.auth-stage) {
299329 color: var(--muted);
300330
301331 &:hover { color: var(--ink); }
302-
303- &-on {
304- color: var(--ink);
305- box-shadow: inset 0 -2px 0 var(--accent);
306- }
307332 }
308333
309334 .trio-sep { color: var(--muted-soft); }