Skip to content

Commit

Permalink
Refactor animation code for improved readability and maintainability
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Jan 27, 2025
1 parent 188fea0 commit e0376b8
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -217,24 +217,26 @@ var gZenVerticalTabsManager = {
return;
}
const isLastTab = aTab.nextElementSibling === null;
gZenUIManager.motion.animate(
aTab,
{
opacity: [0, 1],
transform: ['translateY(-20px)', 'translateY(0px)'],
marginBottom: isLastTab ? [] : ['-20px', '0px'],
},
{
duration: 0.2,
type: 'spring',
bounce: 0,
}
).then(() => {
aTab.style.removeProperty('margin-bottom');
aTab.style.removeProperty('transform');
aTab.style.removeProperty('opacity');
aTab.style.removeProperty('filter');
});
gZenUIManager.motion
.animate(
aTab,
{
opacity: [0, 1],
transform: ['translateY(-20px)', 'translateY(0px)'],
marginBottom: isLastTab ? [] : ['-20px', '0px'],
},
{
duration: 0.2,
type: 'spring',
bounce: 0,
}
)
.then(() => {
aTab.style.removeProperty('margin-bottom');
aTab.style.removeProperty('transform');
aTab.style.removeProperty('opacity');
aTab.style.removeProperty('filter');
});
},

get actualWindowButtons() {
Expand Down

0 comments on commit e0376b8

Please sign in to comment.