fix: remove toast stacking logic to list notifications vertically
Some checks failed
Build MIPS Binary / build (push) Has been cancelled
Some checks failed
Build MIPS Binary / build (push) Has been cancelled
This commit is contained in:
@@ -66,29 +66,18 @@ pub fn SonnerTrigger(
|
|||||||
_ => "bg-primary",
|
_ => "bg-primary",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Stacking & Expansion Logic
|
// List Layout Logic (No stacking/overlapping)
|
||||||
let style = move || {
|
let style = move || {
|
||||||
let is_bottom = position.to_string().contains("Bottom");
|
let is_bottom = position.to_string().contains("Bottom");
|
||||||
let y_direction = if is_bottom { -1.0 } else { 1.0 };
|
let y_direction = if is_bottom { -1.0 } else { 1.0 };
|
||||||
|
|
||||||
let (translate_y, scale, opacity) = if is_expanded.get() {
|
// Dynamic Y position based on index (index 0 is the newest/bottom-most in the view)
|
||||||
// Expanded state: Full list layout
|
let y = index as f64 * 72.0; // Height (approx 64px) + Gap (8px)
|
||||||
let y = index as f64 * 80.0; // Increased height + gap
|
|
||||||
(y * y_direction, 1.0, 1.0)
|
|
||||||
} else {
|
|
||||||
// Stacked state: Sonner look
|
|
||||||
let y = index as f64 * 12.0;
|
|
||||||
let s = 1.0 - (index as f64 * 0.05);
|
|
||||||
let o = if index > 3 { 0.0 } else { 1.0 - (index as f64 * 0.1) };
|
|
||||||
(y * y_direction, s, o)
|
|
||||||
};
|
|
||||||
|
|
||||||
format!(
|
format!(
|
||||||
"z-index: {}; transform: translateY({}px) scale({}); opacity: {};",
|
"z-index: {}; transform: translateY({}px); opacity: 1; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;",
|
||||||
total - index,
|
total - index,
|
||||||
translate_y,
|
y * y_direction
|
||||||
scale,
|
|
||||||
opacity
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user