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 commit3581cafaf50bc5f3ca40a2eae2fba1929a8fd1f1Parent: 6ccb0565 changed files +94 -48
- crates/im-web/assets/main.css +28 -6
- crates/im-web/src/layout.rs +26 -25
- crates/im-web/src/pages.rs +3 -4
- crates/im-web/src/people.rs +2 -3
- style/main.scss +35 -10
crates/im-web/assets/main.cssmodified+28 -6
| @@ -319,12 +319,38 @@ body:has(.auth-stage) > .auth-stage::-webkit-scrollbar { | |||
| 319 | padding: 4px 0 10px; | 319 | padding: 4px 0 10px; |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | -.service-trio { | 322 | +.wordmark-family { |
| 323 | + position: relative; | ||
| 323 | display: flex; | 324 | display: flex; |
| 324 | justify-content: center; | 325 | 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; | ||
| 325 | align-items: baseline; | 343 | align-items: baseline; |
| 326 | gap: 10px; | 344 | 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; | ||
| 328 | } | 354 | } |
| 329 | 355 | ||
| 330 | .trio-mark { | 356 | .trio-mark { |
| @@ -338,10 +364,6 @@ body:has(.auth-stage) > .auth-stage::-webkit-scrollbar { | |||
| 338 | .trio-mark:hover { | 364 | .trio-mark:hover { |
| 339 | color: var(--ink); | 365 | color: var(--ink); |
| 340 | } | 366 | } |
| 341 | -.trio-mark-on { | ||
| 342 | - color: var(--ink); | ||
| 343 | - box-shadow: inset 0 -2px 0 var(--accent); | ||
| 344 | -} | ||
| 345 | 367 | ||
| 346 | .trio-sep { | 368 | .trio-sep { |
| 347 | color: var(--muted-soft); | 369 | color: var(--muted-soft); |
crates/im-web/src/layout.rsmodified+26 -25
| @@ -24,35 +24,36 @@ pub async fn wordmark(cx: &Cx) -> Result { | |||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | -/// The signed-in chrome's app trio: every family service's wordmark, | 27 | +/// The signed-in chrome's wordmark with the family behind it: the `im` |
| 28 | -/// middots between, the home one (`im`) inked and marked current, its | 28 | +/// mark as above, and the sibling services' wordmarks in a flyout that |
| 29 | -/// siblings plain links. A family with no members renders nothing — the | 29 | +/// opens under it on hover and on keyboard focus (the mark is focusable |
| 30 | -/// single mark above stays the whole chrome. The list is the stored one, | 30 | +/// for that), middots between, each a plain link. No script: the flyout |
| 31 | -/// the same rows `/family` serves. | 31 | +/// is CSS on `:hover` / `:focus-within`. A family with no siblings renders |
| 32 | -pub async fn service_trio(cx: &Cx) -> Result { | 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 { | ||
| 33 | let services = im_core::services::list(&server::app(cx).store).await?; | 35 | let services = im_core::services::list(&server::app(cx).store).await?; |
| 34 | - let marks = (!services.is_empty()).then(|| { | 36 | + let siblings = services |
| 35 | - services | 37 | + .iter() |
| 36 | - .iter() | 38 | + .filter(|service| service.key != "im") |
| 37 | - .map(|service| { | 39 | + .map(|service| { |
| 38 | - let key = crate::pages::escape(&service.key); | 40 | + let key = crate::pages::escape(&service.key); |
| 39 | - if service.key == "im" { | 41 | + let url = crate::pages::escape(&service.url); |
| 40 | - format!( | 42 | + format!(r#"<a class="trio-mark" href="{url}">{key}</a>"#) |
| 41 | - r#"<span class="trio-mark trio-mark-on" aria-current="page">{key}</span>"# | 43 | + }) |
| 42 | - ) | 44 | + .collect::<Vec<_>>(); |
| 43 | - } else { | 45 | + if siblings.is_empty() { |
| 44 | - let url = crate::pages::escape(&service.url); | 46 | + return wordmark(cx).await; |
| 45 | - format!(r#"<a class="trio-mark" href="{url}">{key}</a>"#) | 47 | + } |
| 46 | - } | 48 | + let marks = siblings.join(r#"<span class="trio-sep">·</span>"#); |
| 47 | - }) | ||
| 48 | - .collect::<Vec<_>>() | ||
| 49 | - .join(r#"<span class="trio-sep">·</span>"#) | ||
| 50 | - }); | ||
| 51 | view! { | 49 | view! { |
| 52 | cx => | 50 | 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> | ||
| 54 | <nav class="service-trio">(topcoat::view::Unescaped::new_unchecked(marks))</nav> | 55 | <nav class="service-trio">(topcoat::view::Unescaped::new_unchecked(marks))</nav> |
| 55 | - } | 56 | + </div> |
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| 58 | 59 | ||
crates/im-web/src/pages.rsmodified+3 -4
| @@ -12,7 +12,7 @@ use topcoat::router::{page, path_param, route}; | |||
| 12 | use topcoat::view::view; | 12 | use topcoat::view::view; |
| 13 | 13 | ||
| 14 | use crate::i18n::{Key, Lang, lang_of, t}; | 14 | 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}; |
| 16 | use crate::server::{self, PendingPurpose}; | 16 | use crate::server::{self, PendingPurpose}; |
| 17 | 17 | ||
| 18 | path_param!(token); | 18 | path_param!(token); |
| @@ -602,15 +602,14 @@ async fn signed_in(cx: &Cx, user: &im_core::model::User) -> Result { | |||
| 602 | ) | 602 | ) |
| 603 | }) | 603 | }) |
| 604 | .collect::<String>(); | 604 | .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 |
| 606 | // wordmark — and its editing in the admin panel; the landing is the | 606 | // wordmark — and its editing in the admin panel; the landing is the |
| 607 | // account's own page and carries no directory of its own. | 607 | // account's own page and carries no directory of its own. |
| 608 | let stage = view! { | 608 | let stage = view! { |
| 609 | cx => | 609 | cx => |
| 610 | <main class="auth-stage landing-stage"> | 610 | <main class="auth-stage landing-stage"> |
| 611 | <div class="auth-column"> | 611 | <div class="auth-column"> |
| 612 | - (wordmark(cx).await?) | 612 | + (family_wordmark(cx).await?) |
| 613 | - (service_trio(cx).await?) | ||
| 614 | <nav class="admin-tabs landing-nav">(topcoat::view::Unescaped::new_unchecked(nav))</nav> | 613 | <nav class="admin-tabs landing-nav">(topcoat::view::Unescaped::new_unchecked(nav))</nav> |
| 615 | if let Some(code) = ok { | 614 | if let Some(code) = ok { |
| 616 | <div class="auth-ok">(ok_text(&code, lang))</div> | 615 | <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; | |||
| 14 | use im_core::accounts; | 14 | use im_core::accounts; |
| 15 | 15 | ||
| 16 | use crate::i18n::{Key, lang_of, t}; | 16 | use crate::i18n::{Key, lang_of, t}; |
| 17 | -use crate::layout::{avatar, service_trio, shell, wordmark}; | 17 | +use crate::layout::{avatar, family_wordmark, shell}; |
| 18 | use crate::server; | 18 | use crate::server; |
| 19 | 19 | ||
| 20 | path_param!(user_id); | 20 | path_param!(user_id); |
| @@ -39,8 +39,7 @@ async fn people_page(cx: &Cx) -> Result { | |||
| 39 | cx => | 39 | cx => |
| 40 | <main class="auth-stage"> | 40 | <main class="auth-stage"> |
| 41 | <div class="auth-column"> | 41 | <div class="auth-column"> |
| 42 | - (wordmark(cx).await?) | 42 | + (family_wordmark(cx).await?) |
| 43 | - (service_trio(cx).await?) | ||
| 44 | <div class="auth-card"> | 43 | <div class="auth-card"> |
| 45 | <div class="profile-head"> | 44 | <div class="profile-head"> |
| 46 | if person.has_photo { | 45 | if person.has_photo { |
style/main.scssmodified+35 -10
| @@ -279,15 +279,45 @@ body:has(.auth-stage) { | |||
| 279 | padding: 4px 0 10px; | 279 | padding: 4px 0 10px; |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | -// The app trio under the signed-in wordmark: lower-case marks in the | 282 | +// The family behind the signed-in wordmark: the siblings' marks in the |
| 283 | -// wordmark's mono, the home one inked, its siblings quiet links. The | 283 | +// wordmark's mono, middots between, in a flyout that hangs under the mark |
| 284 | -// middots are part of the mark, not decoration between cards. | 284 | +// and shows on hover or keyboard focus (the mark carries tabindex for it). |
| 285 | -.service-trio { | 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; | ||
| 286 | display: flex; | 291 | display: flex; |
| 287 | justify-content: center; | 292 | 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; | ||
| 288 | align-items: baseline; | 310 | align-items: baseline; |
| 289 | gap: 10px; | 311 | 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; | ||
| 291 | } | 321 | } |
| 292 | 322 | ||
| 293 | .trio-mark { | 323 | .trio-mark { |
| @@ -299,11 +329,6 @@ body:has(.auth-stage) { | |||
| 299 | color: var(--muted); | 329 | color: var(--muted); |
| 300 | 330 | ||
| 301 | &:hover { color: var(--ink); } | 331 | &:hover { color: var(--ink); } |
| 302 | - | ||
| 303 | - &-on { | ||
| 304 | - color: var(--ink); | ||
| 305 | - box-shadow: inset 0 -2px 0 var(--accent); | ||
| 306 | - } | ||
| 307 | } | 332 | } |
| 308 | 333 | ||
| 309 | .trio-sep { color: var(--muted-soft); } | 334 | .trio-sep { color: var(--muted-soft); } |