diff --git a/crates/client/src/gui/parts.rs b/crates/client/src/gui/parts.rs index a55de7c..11de514 100644 --- a/crates/client/src/gui/parts.rs +++ b/crates/client/src/gui/parts.rs @@ -324,7 +324,7 @@ pub fn popover(t: Tokens) -> Div { } pub fn quick(t: Tokens) -> Div { - popover(t).w(px(size::SHEET)).gap(px(space::SM)) + popover(t).w(px(size::POPOVER)).gap(px(space::SM)) } 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 .min_h(px(size::CONTROL)) .child( words(label, Text::Label, Ink::Faint, t) - .w(px(size::ROW + space::XL)) + .w(px(size::ROW + space::SM)) .flex_none(), ) .child(div().flex_1().min_w_0().child(control)) diff --git a/crates/client/src/gui/share_view.rs b/crates/client/src/gui/share_view.rs index 4c42129..290aadb 100644 --- a/crates/client/src/gui/share_view.rs +++ b/crates/client/src/gui/share_view.rs @@ -888,6 +888,7 @@ fn settings_card(entity: &Entity, yumush: &Yumush, palette: Palette) -> let t = palette.tokens; super::parts::quick(t) + .w(px(size::SHEET)) .child(super::parts::quick_row( "Resolution", segmented( diff --git a/crates/client/src/gui/sidebar.rs b/crates/client/src/gui/sidebar.rs index 414aba4..1900887 100644 --- a/crates/client/src/gui/sidebar.rs +++ b/crates/client/src/gui/sidebar.rs @@ -1318,17 +1318,53 @@ enum Doing { Offline, } +const S_WIDTH: f32 = 0.5; +const CEDILLA_DROP: f32 = 0.45; +const H_SHRINK: f32 = 0.6; +const MORPH: std::time::Duration = std::time::Duration::from_millis(420); + fn wordmark_tail(flips: u32) -> AnyElement { - let tail = div() - .relative() - .child(if flips % 2 == 1 { "ş" } else { "sh" }); + let em = super::style::text::TITLE / super::style::text::UI; + let turkish = flips % 2 == 1; + let progress = move |delta: f32| if turkish { delta } else { 1. - delta }; + let s = move |p: f32| div().opacity(1. - p).child("s"); + let cedilla = move |p: f32| div().absolute().top_0().left_0().opacity(p).child("ş"); + let h = move |p: f32| { + div() + .absolute() + .top(gpui_kit::rems(p * CEDILLA_DROP * em)) + .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) + .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) + .opacity(1. - p) + .child("h") + }; + let tail = div().relative(); if flips == 0 { - return tail.into_any_element(); + return tail + .child(s(0.)) + .child(cedilla(0.)) + .child(h(0.)) + .into_any_element(); } - tail.with_animation( - ("wordmark", flips), - super::parts::motion(), - |tail, delta| tail.opacity(delta).top(px((1. - delta) * -space::SM)), + let animation = || gpui_kit::Animation::new(MORPH).with_easing(gpui_kit::ease_in_out); + tail.child( + s(0.).with_animation(("wordmark_s", flips), animation(), move |el, delta| { + el.opacity(1. - progress(delta)) + }), + ) + .child(cedilla(0.).with_animation( + ("wordmark_cedilla", flips), + animation(), + move |el, delta| el.opacity(progress(delta)), + )) + .child( + h(0.).with_animation(("wordmark_h", flips), animation(), move |el, delta| { + let p = progress(delta); + el.top(gpui_kit::rems(p * CEDILLA_DROP * em)) + .left(gpui_kit::rems(S_WIDTH * em * (1. - p))) + .text_size(gpui_kit::rems(em * (1. - H_SHRINK * p))) + .opacity(1. - p) + }), ) .into_any_element() }