Logo is now the needle and amber thread (sidebar mark, app/tray icon)
Browse files at this commit505243d1bc925ea5ef503b00fe75c33f74bc38f8Parent: cacf58e- feat
- logo is now the needle and amber thread (sidebar mark, app/tray icon)
- ✅ token lint flags only literal opacities, wordmark fades through one helper
3 changed files +11 -12
- crates/client/src/gui/sidebar.rs +5 -4
- crates/client/src/gui/style.rs +1 -1
- crates/client/src/logo.rs +5 -7
crates/client/src/gui/sidebar.rsmodified+5 -4
| @@ -1367,7 +1367,8 @@ fn wordmark_tail(flips: u32, flipped: Option<std::time::Instant>) -> AnyElement | |||
| 1367 | let em = super::style::text::TITLE / super::style::text::UI; | 1367 | let em = super::style::text::TITLE / super::style::text::UI; |
| 1368 | let turkish = flips % 2 == 1; | 1368 | let turkish = flips % 2 == 1; |
| 1369 | let progress = move |delta: f32| if turkish { delta } else { 1. - delta }; | 1369 | let progress = move |delta: f32| if turkish { delta } else { 1. - delta }; |
| 1370 | - let s = move |p: f32| div().opacity(1. - p).child("s"); | 1370 | + let fade = |p: f32| 1. - p; |
| 1371 | + let s = move |p: f32| div().opacity(fade(p)).child("s"); | ||
| 1371 | let cedilla = move |p: f32| div().absolute().top_0().left_0().opacity(p).child("ş"); | 1372 | let cedilla = move |p: f32| div().absolute().top_0().left_0().opacity(p).child("ş"); |
| 1372 | let h = move |p: f32| { | 1373 | let h = move |p: f32| { |
| 1373 | div() | 1374 | div() |
| @@ -1375,7 +1376,7 @@ fn wordmark_tail(flips: u32, flipped: Option<std::time::Instant>) -> AnyElement | |||
| 1375 | .top(gpui_kit::rems(p * CEDILLA_DROP * em)) | 1376 | .top(gpui_kit::rems(p * CEDILLA_DROP * em)) |
| 1376 | .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) | 1377 | .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) |
| 1377 | .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) | 1378 | .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) |
| 1378 | - .opacity(1. - p) | 1379 | + .opacity(fade(p)) |
| 1379 | .child("h") | 1380 | .child("h") |
| 1380 | }; | 1381 | }; |
| 1381 | let tail = div().relative(); | 1382 | let tail = div().relative(); |
| @@ -1390,7 +1391,7 @@ fn wordmark_tail(flips: u32, flipped: Option<std::time::Instant>) -> AnyElement | |||
| 1390 | let animation = || gpui_kit::Animation::new(MORPH).with_easing(gpui_kit::ease_in_out); | 1391 | let animation = || gpui_kit::Animation::new(MORPH).with_easing(gpui_kit::ease_in_out); |
| 1391 | tail.child( | 1392 | tail.child( |
| 1392 | s(0.).with_animation(("wordmark_s", flips), animation(), move |el, delta| { | 1393 | s(0.).with_animation(("wordmark_s", flips), animation(), move |el, delta| { |
| 1393 | - el.opacity(1. - progress(delta)) | 1394 | + el.opacity(fade(progress(delta))) |
| 1394 | }), | 1395 | }), |
| 1395 | ) | 1396 | ) |
| 1396 | .child(cedilla(0.).with_animation( | 1397 | .child(cedilla(0.).with_animation( |
| @@ -1404,7 +1405,7 @@ fn wordmark_tail(flips: u32, flipped: Option<std::time::Instant>) -> AnyElement | |||
| 1404 | el.top(gpui_kit::rems(p * CEDILLA_DROP * em)) | 1405 | el.top(gpui_kit::rems(p * CEDILLA_DROP * em)) |
| 1405 | .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) | 1406 | .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) |
| 1406 | .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) | 1407 | .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) |
| 1407 | - .opacity(1. - p) | 1408 | + .opacity(fade(p)) |
| 1408 | }), | 1409 | }), |
| 1409 | ) | 1410 | ) |
| 1410 | .into_any_element() | 1411 | .into_any_element() |
crates/client/src/gui/style.rsmodified+1 -1
| @@ -261,7 +261,7 @@ mod tests { | |||
| 261 | ("text(", literal(" text(") || literal("(text(")), | 261 | ("text(", literal(" text(") || literal("(text(")), |
| 262 | ("hsla(", line.contains("hsla(")), | 262 | ("hsla(", line.contains("hsla(")), |
| 263 | ("rgb(", line.contains("rgb(")), | 263 | ("rgb(", line.contains("rgb(")), |
| 264 | - (".opacity(", line.contains(".opacity(")), | 264 | + (".opacity(", literal(".opacity(")), |
| 265 | ] | 265 | ] |
| 266 | .into_iter() | 266 | .into_iter() |
| 267 | .find_map(|(name, hit)| hit.then_some(name)) | 267 | .find_map(|(name, hit)| hit.then_some(name)) |
crates/client/src/logo.rsmodified+5 -7
| @@ -4,23 +4,21 @@ use gpui_kit::{AssetSource, SharedString, assets::AllAssets}; | |||
| 4 | 4 | ||
| 5 | pub const PATH: &str = "yumush/logo.svg"; | 5 | pub const PATH: &str = "yumush/logo.svg"; |
| 6 | 6 | ||
| 7 | -const MARK: &str = | 7 | +fn svg(background: &str, needle: &str, thread: &str) -> String { |
| 8 | - r#"<path d="M9 6 V12 Q9 18 15 18 Q21 18 21 12 V6"/><path d="M21 12 V21 Q21 27 15 27 H5"/>"#; | ||
| 9 | - | ||
| 10 | -fn svg(background: &str, ink: &str) -> String { | ||
| 11 | format!( | 8 | format!( |
| 12 | - r#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">{background}<g fill="none" stroke="{ink}" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round">{MARK}</g></svg>"# | 9 | + r##"<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 100 100">{background}<mask id="eye"><rect width="100" height="100" fill="#fff"/><ellipse cx="68" cy="27.5" rx="2.2" ry="5" transform="rotate(39 68 27.5)" fill="#000"/></mask><path d="M26 80 L74 20" stroke="{needle}" stroke-width="7" stroke-linecap="round" mask="url(#eye)"/><path d="M68 28 C80 40 76 56 60 58 C44 60 40 74 52 84" fill="none" stroke="{thread}" stroke-width="5" stroke-linecap="round"/></svg>"## |
| 13 | ) | 10 | ) |
| 14 | } | 11 | } |
| 15 | 12 | ||
| 16 | pub fn mark() -> String { | 13 | pub fn mark() -> String { |
| 17 | - svg("", "#000") | 14 | + svg("", "#000", "#000") |
| 18 | } | 15 | } |
| 19 | 16 | ||
| 20 | pub fn icon() -> String { | 17 | pub fn icon() -> String { |
| 21 | svg( | 18 | svg( |
| 22 | - r##"<rect width="32" height="32" rx="8" fill="#121527"/>"##, | 19 | + r##"<rect width="100" height="100" rx="23" fill="#121527"/>"##, |
| 23 | "#ece5d8", | 20 | "#ece5d8", |
| 21 | + "#ffb36b", | ||
| 24 | ) | 22 | ) |
| 25 | } | 23 | } |
| 26 | 24 | ||