feat: Animate background from numbers, not strings, b=(no-bug), c=workspaces

This commit is contained in:
Mr. M
2025-05-20 19:38:54 +02:00
parent d3ec41d73f
commit 1e1f02c764

View File

@@ -2276,14 +2276,19 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
let previousBackgroundOpacity = document.documentElement.style.getPropertyValue(
'--zen-background-opacity'
);
if (previousBackgroundOpacity === '1') {
previousBackgroundOpacity = '0';
try {
previousBackgroundOpacity = parseFloat(previousBackgroundOpacity);
} catch (e) {
previousBackgroundOpacity = 1;
}
if (previousBackgroundOpacity == 1) {
previousBackgroundOpacity = 0;
}
animations.push(
gZenUIManager.motion.animate(
document.documentElement,
{
'--zen-background-opacity': [previousBackgroundOpacity, '1'],
'--zen-background-opacity': [previousBackgroundOpacity, 1],
},
{
type: 'spring',