1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! macOS dock animation presets
/// Dock magnification spring configuration
///
/// Based on macos-web reverse-engineering:
/// - Damping: 0.38 (high damping, minimal overshoot)
/// - Stiffness: 0.1 (low stiffness, smooth motion)
/// - Mass: 1.0 (standard mass)
/// Spring config for dock icon magnification
///
/// This creates a smooth, fluid animation with slight bounce
/// that matches macOS's iconic dock behavior.
pub const MAGNIFICATION_SPRING: DockSpringConfig = DockSpringConfig ;
/// Golden ratio used for peak magnification scale
///
/// macOS scales icons by approximately 2.618x at the cursor position,
/// then falls off with distance using a Gaussian-like curve.
pub const MAGNIFICATION_SCALE: f64 = 2.618;
/// Calculate dock icon scale based on distance from cursor
///
/// # Arguments
/// * `distance` - Distance from cursor to icon center (normalized, 0.0 = at cursor)
/// * `max_scale` - Peak scale at cursor (typically MAGNIFICATION_SCALE)
///
/// # Returns
/// Scale multiplier for the icon (1.0 = normal size)
/// Bounce animation for app launch from dock
///
/// Uses spring with overshoot for playful launch effect.
pub const LAUNCH_BOUNCE_SPRING: DockSpringConfig = DockSpringConfig ;
/// Number of bounces during app launch animation
pub const LAUNCH_BOUNCE_COUNT: u32 = 3;
/// Vertical displacement for launch bounce (in icon heights)
///
/// Icon bounces up to 0.5x its height, then settles.
pub const LAUNCH_BOUNCE_HEIGHT: f64 = 0.5;