forge
Explore
Log in

Don't you dare go Hollow

Arriving member row only glows, no grow

Browse files at this commit

2902fa229b86d0da272abdebf80b71a94fcda30fAhmet Kaan GümüşParent: cf285c3
  • style
    • arriving member row only glows, no grow
Show full message
💄 style: arriving member row only glows, no grow
crates/client/src/gui/chat.rsmodified+2 -13
@@ -3110,7 +3110,7 @@ impl Moves {
3110 }3110 }
3111 3111
3112 const GROW: Duration = Duration::from_millis(160);3112 const GROW: Duration = Duration::from_millis(160);
3113-const ARRIVE: Duration = Duration::from_millis(1060);3113+const ARRIVE: Duration = Duration::from_millis(900);
3114 const ROW_MAX: f32 = size::CONTROL * 2.;3114 const ROW_MAX: f32 = size::CONTROL * 2.;
3115 3115
3116 fn members_column(3116 fn members_column(
@@ -3257,24 +3257,13 @@ fn members_column(
3257 }3257 }
3258 let place = member.place();3258 let place = member.place();
3259 let glow = palette.accent;3259 let glow = palette.accent;
3260- let grown = GROW.as_secs_f32() / ARRIVE.as_secs_f32();
3261 div()3260 div()
3262- .overflow_hidden()
3263 .rounded(px(radius::MD))3261 .rounded(px(radius::MD))
3264 .child(row(member))3262 .child(row(member))
3265 .with_animation(3263 .with_animation(
3266 format!("member_arrive_{user_id}_{place:?}"),3264 format!("member_arrive_{user_id}_{place:?}"),
3267 gpui_kit::Animation::new(ARRIVE),3265 gpui_kit::Animation::new(ARRIVE),
3268- move |row, delta| {3266+ move |row, delta| row.bg(glow.opacity(0.24 * (1. - delta))),
3269- let grow = gpui_kit::ease_out_quint()((delta / grown).min(1.));
3270- let fade = ((delta - grown) / (1. - grown)).max(0.);
3271- let row = row.max_h(px(grow * ROW_MAX));
3272- if delta < grown {
3273- row
3274- } else {
3275- row.bg(glow.opacity(0.24 * (1. - fade)))
3276- }
3277- },
3278 )3267 )
3279 .into_any_element()3268 .into_any_element()
3280 };3269 };