update to support user expire, timeout, and disconnect
This commit is contained in:
parent
fe65835f4a
commit
5fcd49e847
16 changed files with 744 additions and 238 deletions
|
|
@ -115,6 +115,9 @@ pub fn AvatarCanvas(
|
|||
/// Text size multiplier for display names, chat bubbles, and badges.
|
||||
#[prop(default = 1.0)]
|
||||
text_em_size: f64,
|
||||
/// Opacity for fade-out animation (0.0 to 1.0, default 1.0).
|
||||
#[prop(default = 1.0)]
|
||||
opacity: f64,
|
||||
) -> impl IntoView {
|
||||
let canvas_ref = NodeRef::<leptos::html::Canvas>::new();
|
||||
|
||||
|
|
@ -171,19 +174,24 @@ pub fn AvatarCanvas(
|
|||
let adjusted_y = canvas_y - bubble_extra;
|
||||
|
||||
// CSS positioning via transform (GPU-accelerated)
|
||||
// Disable pointer-events when fading (opacity < 1.0) so fading avatars aren't clickable
|
||||
let pointer_events = if opacity < 1.0 { "none" } else { "auto" };
|
||||
let style = format!(
|
||||
"position: absolute; \
|
||||
left: 0; top: 0; \
|
||||
transform: translate({}px, {}px); \
|
||||
z-index: {}; \
|
||||
pointer-events: auto; \
|
||||
pointer-events: {}; \
|
||||
width: {}px; \
|
||||
height: {}px;",
|
||||
height: {}px; \
|
||||
opacity: {};",
|
||||
canvas_x - (canvas_width - avatar_size) / 2.0,
|
||||
adjusted_y,
|
||||
z_index,
|
||||
pointer_events,
|
||||
canvas_width,
|
||||
canvas_height
|
||||
canvas_height,
|
||||
opacity
|
||||
);
|
||||
|
||||
// Store references for the effect
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue