Refactor tab animation styles for improved performance and smoother transitions

This commit is contained in:
mr. M
2025-01-02 17:00:16 +01:00
parent 73e9b64926
commit b4b26979de
3 changed files with 13 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@@ -237,15 +237,22 @@
& .tabbrowser-tab {
transition: scale 0.07s ease;
#tabbrowser-tabs:not([dont-animate-tabs='true']) &[fadein='true']:not([zen-essential='true']) {
#tabbrowser-tabs &:not([zen-essential='true']) {
#tabbrowser-tabs[zen-workspace-animation='previous'] & {
animation: zen-slide-in 0.4s ease;
animation-delay: 0.2s;
animation: zen-slide-in;
}
#tabbrowser-tabs[zen-workspace-animation='next'] & {
animation: zen-slide-in-reverse 0.4s ease;
animation: zen-slide-in-reverse;
}
#tabbrowser-tabs[zen-workspace-animation] & {
opacity: 0;
transform: translateX(-100%);
animation-delay: 0.2s;
animation-fill-mode: forwards;
animation-duration: 0.2s;
animation-timing-function: ease;
}
}

View File

@@ -1327,7 +1327,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const visibleTabs = new Set();
const lastSelectedTab = this._lastSelectedWorkspaceTabs[workspaceUuid];
this.tabContainer.setAttribute('dont-animate-tabs', 'true');
for (const tab of gBrowser.tabs) {
const tabWorkspaceId = tab.getAttribute('zen-workspace-id');
const isEssential = tab.getAttribute("zen-essential") === "true";
@@ -1351,10 +1350,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
gBrowser.hideTab(tab, undefined, true);
}
}
window.requestAnimationFrame(() => {
this.tabContainer.removeAttribute('dont-animate-tabs');
});
return visibleTabs;
}