Remove animation attribute when not animating and enhance toolbar color mixing logic for dark mode

This commit is contained in:
mr. M
2024-12-17 21:39:22 +01:00
parent a1cef01c22
commit 848091097e
2 changed files with 9 additions and 1 deletions

View File

@@ -179,6 +179,8 @@ var gZenCompactModeManager = {
});
}, 400);
});
} else {
this.sidebar.removeAttribute("animate"); // remove the attribute if we are not animating
}
});
},

View File

@@ -497,11 +497,17 @@
this.updateCurrentWorkspace();
}
getToolbarModifiedBase() {
return this.isDarkMode ?
'color-mix(in srgb, var(--zen-themed-toolbar-bg) 70%, #fff 30%)'
: 'color-mix(in srgb, var(--zen-themed-toolbar-bg) 95%, #000 5%)';
}
getSingleRGBColor(color, forToolbar = false) {
if (color.isCustom) {
return color.c;
}
const toolbarBg = forToolbar ? 'var(--zen-themed-toolbar-bg)' : 'var(--zen-themed-toolbar-bg-transparent)';
const toolbarBg = forToolbar ? this.getToolbarModifiedBase() : 'var(--zen-themed-toolbar-bg-transparent)';
return `color-mix(in srgb, rgb(${color.c[0]}, ${color.c[1]}, ${color.c[2]}) ${this.currentOpacity * 100}%, ${toolbarBg} ${(1 - this.currentOpacity) * 100}%)`;
}