picom: use spring physics for open/close animations

- Scale: spring with bounce (clamping=false) for a "pop" effect
- Opacity: spring with clamping=true to prevent going above 1 or below 0
- Close uses clamping=true on scale to avoid bounce when closing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 13:21:24 -08:00
parent dd3931249f
commit 2bcfa3df1a

View File

@@ -156,45 +156,42 @@ makeEnable config "myModules.xmonad" true {
end = 1; end = 1;
}; };
}, },
# Opacity fade animation # Window open/show animation with spring physics
{ {
triggers = ["open", "show"]; triggers = ["open", "show"];
# Opacity uses spring with clamping to prevent going above 1
opacity = { opacity = {
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; curve = "spring(150, 18, 1.5, true)";
duration = 0.2;
start = 0; start = 0;
end = "window-raw-opacity"; end = "window-raw-opacity";
}; };
# Scale uses spring with bounce for a nice "pop" effect
scale-x = { scale-x = {
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; curve = "spring(150, 18, 1.5, false)";
duration = 0.2; start = 0.85;
start = 0.9;
end = 1; end = 1;
}; };
scale-y = { scale-y = {
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; curve = "spring(150, 18, 1.5, false)";
duration = 0.2; start = 0.85;
start = 0.9;
end = 1; end = 1;
}; };
}, },
# Window close/hide animation with spring physics
{ {
triggers = ["close", "hide"]; triggers = ["close", "hide"];
opacity = { opacity = {
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; curve = "spring(150, 18, 1.5, true)";
duration = 0.2;
start = "window-raw-opacity"; start = "window-raw-opacity";
end = 0; end = 0;
}; };
scale-x = { scale-x = {
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; curve = "spring(150, 18, 1.5, true)";
duration = 0.2;
start = 1; start = 1;
end = 0.9; end = 0.9;
}; };
scale-y = { scale-y = {
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; curve = "spring(150, 18, 1.5, true)";
duration = 0.2;
start = 1; start = 1;
end = 0.9; end = 0.9;
}; };