Mic/speaker cards narrower
Browse files at this commita504823515fb1d23baff0595d58edf2a843172cbParent: fb0a191- style
- mic/speaker cards narrower
- wordmark morph: h shrinks and slides under the s into its cedilla while ş fades in, reversed back to sh
3 changed files +47 -10
- crates/client/src/gui/parts.rs +2 -2
- crates/client/src/gui/share_view.rs +1 -0
- crates/client/src/gui/sidebar.rs +44 -8
crates/client/src/gui/parts.rsmodified+2 -2
| @@ -324,7 +324,7 @@ pub fn popover(t: Tokens) -> Div { | |||
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | pub fn quick(t: Tokens) -> Div { | 326 | pub fn quick(t: Tokens) -> Div { |
| 327 | - popover(t).w(px(size::SHEET)).gap(px(space::SM)) | 327 | + popover(t).w(px(size::POPOVER)).gap(px(space::SM)) |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | pub fn quick_row(label: &'static str, control: impl IntoElement, t: Tokens) -> Div { | 330 | pub fn quick_row(label: &'static str, control: impl IntoElement, t: Tokens) -> Div { |
| @@ -332,7 +332,7 @@ pub fn quick_row(label: &'static str, control: impl IntoElement, t: Tokens) -> D | |||
| 332 | .min_h(px(size::CONTROL)) | 332 | .min_h(px(size::CONTROL)) |
| 333 | .child( | 333 | .child( |
| 334 | words(label, Text::Label, Ink::Faint, t) | 334 | words(label, Text::Label, Ink::Faint, t) |
| 335 | - .w(px(size::ROW + space::XL)) | 335 | + .w(px(size::ROW + space::SM)) |
| 336 | .flex_none(), | 336 | .flex_none(), |
| 337 | ) | 337 | ) |
| 338 | .child(div().flex_1().min_w_0().child(control)) | 338 | .child(div().flex_1().min_w_0().child(control)) |
crates/client/src/gui/share_view.rsmodified+1 -0
| @@ -888,6 +888,7 @@ fn settings_card(entity: &Entity<Yumush>, yumush: &Yumush, palette: Palette) -> | |||
| 888 | 888 | ||
| 889 | let t = palette.tokens; | 889 | let t = palette.tokens; |
| 890 | super::parts::quick(t) | 890 | super::parts::quick(t) |
| 891 | + .w(px(size::SHEET)) | ||
| 891 | .child(super::parts::quick_row( | 892 | .child(super::parts::quick_row( |
| 892 | "Resolution", | 893 | "Resolution", |
| 893 | segmented( | 894 | segmented( |
crates/client/src/gui/sidebar.rsmodified+44 -8
| @@ -1318,17 +1318,53 @@ enum Doing { | |||
| 1318 | Offline, | 1318 | Offline, |
| 1319 | } | 1319 | } |
| 1320 | 1320 | ||
| 1321 | +const S_WIDTH: f32 = 0.5; | ||
| 1322 | +const CEDILLA_DROP: f32 = 0.45; | ||
| 1323 | +const H_SHRINK: f32 = 0.6; | ||
| 1324 | +const MORPH: std::time::Duration = std::time::Duration::from_millis(420); | ||
| 1325 | + | ||
| 1321 | fn wordmark_tail(flips: u32) -> AnyElement { | 1326 | fn wordmark_tail(flips: u32) -> AnyElement { |
| 1322 | - let tail = div() | 1327 | + let em = super::style::text::TITLE / super::style::text::UI; |
| 1323 | - .relative() | 1328 | + let turkish = flips % 2 == 1; |
| 1324 | - .child(if flips % 2 == 1 { "ş" } else { "sh" }); | 1329 | + let progress = move |delta: f32| if turkish { delta } else { 1. - delta }; |
| 1330 | + let s = move |p: f32| div().opacity(1. - p).child("s"); | ||
| 1331 | + let cedilla = move |p: f32| div().absolute().top_0().left_0().opacity(p).child("ş"); | ||
| 1332 | + let h = move |p: f32| { | ||
| 1333 | + div() | ||
| 1334 | + .absolute() | ||
| 1335 | + .top(gpui_kit::rems(p * CEDILLA_DROP * em)) | ||
| 1336 | + .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) | ||
| 1337 | + .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) | ||
| 1338 | + .opacity(1. - p) | ||
| 1339 | + .child("h") | ||
| 1340 | + }; | ||
| 1341 | + let tail = div().relative(); | ||
| 1325 | if flips == 0 { | 1342 | if flips == 0 { |
| 1326 | - return tail.into_any_element(); | 1343 | + return tail |
| 1344 | + .child(s(0.)) | ||
| 1345 | + .child(cedilla(0.)) | ||
| 1346 | + .child(h(0.)) | ||
| 1347 | + .into_any_element(); | ||
| 1327 | } | 1348 | } |
| 1328 | - tail.with_animation( | 1349 | + let animation = || gpui_kit::Animation::new(MORPH).with_easing(gpui_kit::ease_in_out); |
| 1329 | - ("wordmark", flips), | 1350 | + tail.child( |
| 1330 | - super::parts::motion(), | 1351 | + s(0.).with_animation(("wordmark_s", flips), animation(), move |el, delta| { |
| 1331 | - |tail, delta| tail.opacity(delta).top(px((1. - delta) * -space::SM)), | 1352 | + el.opacity(1. - progress(delta)) |
| 1353 | + }), | ||
| 1354 | + ) | ||
| 1355 | + .child(cedilla(0.).with_animation( | ||
| 1356 | + ("wordmark_cedilla", flips), | ||
| 1357 | + animation(), | ||
| 1358 | + move |el, delta| el.opacity(progress(delta)), | ||
| 1359 | + )) | ||
| 1360 | + .child( | ||
| 1361 | + h(0.).with_animation(("wordmark_h", flips), animation(), move |el, delta| { | ||
| 1362 | + let p = progress(delta); | ||
| 1363 | + el.top(gpui_kit::rems(p * CEDILLA_DROP * em)) | ||
| 1364 | + .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) | ||
| 1365 | + .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) | ||
| 1366 | + .opacity(1. - p) | ||
| 1367 | + }), | ||
| 1332 | ) | 1368 | ) |
| 1333 | .into_any_element() | 1369 | .into_any_element() |
| 1334 | } | 1370 | } |