mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 17:36:34 +00:00
Worked on animations
This commit is contained in:
@@ -30,21 +30,24 @@
|
|||||||
#navigator-toolbox {
|
#navigator-toolbox {
|
||||||
--zen-toolbox-max-width: 54px !important;
|
--zen-toolbox-max-width: 54px !important;
|
||||||
--zen-compact-float: calc(var(--zen-element-separation) - 1px);
|
--zen-compact-float: calc(var(--zen-element-separation) - 1px);
|
||||||
position: absolute;
|
|
||||||
z-index: 10;
|
|
||||||
transition: transform 0.25s ease, opacity 0.1s ease-in-out;
|
|
||||||
top: 0;
|
|
||||||
bottom: var(--zen-element-separation);
|
|
||||||
opacity: 0;
|
|
||||||
padding-left: var(--zen-compact-float) !important;
|
|
||||||
padding-bottom: 0 !important;
|
|
||||||
padding-top: 0 !important;
|
|
||||||
|
|
||||||
:root[zen-single-toolbar='true'] & {
|
&:not([animate='true']) {
|
||||||
top: var(--zen-element-separation);
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
transition: transform 0.25s ease, opacity 0.1s ease-in-out;
|
||||||
|
top: 0;
|
||||||
|
bottom: var(--zen-element-separation);
|
||||||
|
opacity: 0;
|
||||||
|
padding-left: var(--zen-compact-float) !important;
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
padding-top: 0 !important;
|
||||||
|
|
||||||
& #nav-bar {
|
:root[zen-single-toolbar='true'] & {
|
||||||
margin-left: calc(var(--zen-toolbox-padding) / 2) !important;
|
top: var(--zen-element-separation);
|
||||||
|
|
||||||
|
& #nav-bar {
|
||||||
|
margin-left: calc(var(--zen-toolbox-padding) / 2) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,7 +79,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#titlebar {
|
#navigator-toolbox:not([animate='true']) #titlebar {
|
||||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
|
||||||
border-radius: calc(var(--zen-border-radius) - 2px);
|
border-radius: calc(var(--zen-border-radius) - 2px);
|
||||||
padding: var(--zen-toolbox-padding) !important;
|
padding: var(--zen-toolbox-padding) !important;
|
||||||
|
@@ -227,11 +227,11 @@
|
|||||||
transition: scale 0.1s ease-in-out;
|
transition: scale 0.1s ease-in-out;
|
||||||
&[fadein='true']:not([zen-essential='true']) {
|
&[fadein='true']:not([zen-essential='true']) {
|
||||||
#tabbrowser-tabs[zen-workspace-animation='previous'] & {
|
#tabbrowser-tabs[zen-workspace-animation='previous'] & {
|
||||||
animation: zen-slide-in 0.2s ease-in-out;
|
animation: zen-slide-in 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
#tabbrowser-tabs[zen-workspace-animation='next'] & {
|
#tabbrowser-tabs[zen-workspace-animation='next'] & {
|
||||||
animation: zen-slide-in-reverse 0.2s ease-in-out;
|
animation: zen-slide-in-reverse 0.2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
/* Branding */
|
/* Branding */
|
||||||
--zen-branding-dark: #202020;
|
--zen-branding-dark: #202020;
|
||||||
--zen-branding-coral: #F76F53;
|
--zen-branding-coral: #F76F53;
|
||||||
--zen-branding-paper: #F2F0E3;
|
--zen-branding-paper: #ebebeb;
|
||||||
|
|
||||||
--zen-branding-bg: light-dark(var(--zen-branding-paper), var(--zen-branding-dark));
|
--zen-branding-bg: light-dark(var(--zen-branding-paper), var(--zen-branding-dark));
|
||||||
--zen-branding-bg-reverse: light-dark(var(--zen-branding-dark), var(--zen-branding-paper));
|
--zen-branding-bg-reverse: light-dark(var(--zen-branding-dark), var(--zen-branding-paper));
|
||||||
|
@@ -104,79 +104,82 @@ var gZenCompactModeManager = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._isAnimating = true;
|
this._isAnimating = true;
|
||||||
let sidebarWidth = this.sidebar.getBoundingClientRect().width;
|
// Do this so we can get the correct width ONCE compact mode styled have been applied
|
||||||
if (sidebarWidth < 300) {
|
this.sidebar.setAttribute("animate", "true");
|
||||||
sidebarWidth += sidebarWidth < 210 ? 9 : 11; // Bug: IF sidebar is too small, it will not animate properly
|
window.requestAnimationFrame(() => {
|
||||||
}
|
let sidebarWidth = Math.max(this.sidebar.getAttribute("width"), this.sidebar.getBoundingClientRect().width);
|
||||||
if (canHideSidebar && isCompactMode) {
|
if (canHideSidebar && isCompactMode) {
|
||||||
this.sidebar.style.position = "relative";
|
this.sidebar.style.position = "relative";
|
||||||
this.sidebar.style.transition = "margin .3s ease, opacity .3s ease";
|
this.sidebar.style.transition = "margin .4s ease, opacity .4s ease";
|
||||||
this.sidebar.style.left = "0";
|
this.sidebar.style.left = "0";
|
||||||
this.sidebar.style.setProperty("opacity", "1", "important");
|
this.sidebar.style.setProperty("opacity", "1", "important");
|
||||||
if (!this.sidebarIsOnRight) {
|
|
||||||
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
|
|
||||||
} else {
|
|
||||||
this.sidebar.style.marginRight = `${-1 * sidebarWidth}px`;
|
|
||||||
}
|
|
||||||
this.sidebar.style.pointerEvents = "none";
|
|
||||||
|
|
||||||
window.requestAnimationFrame(() => {
|
|
||||||
this.sidebar.style.removeProperty("opacity");
|
|
||||||
setTimeout(() => {
|
|
||||||
window.requestAnimationFrame(() => {
|
|
||||||
this._isAnimating = false;
|
|
||||||
this.sidebar.style.removeProperty("opacity");
|
|
||||||
this.sidebar.style.removeProperty("position");
|
|
||||||
this.sidebar.style.removeProperty("transition");
|
|
||||||
this.sidebar.style.removeProperty("pointer-events");
|
|
||||||
this.sidebar.style.removeProperty("margin-left");
|
|
||||||
this.sidebar.style.removeProperty("margin-right");
|
|
||||||
this.sidebar.style.removeProperty("transform");
|
|
||||||
this.sidebar.style.removeProperty("left");
|
|
||||||
document.getElementById('browser').style.removeProperty("overflow");
|
|
||||||
});
|
|
||||||
}, 400);
|
|
||||||
});
|
|
||||||
} else if (canHideSidebar && !isCompactMode) {
|
|
||||||
document.getElementById('browser').style.overflow = "hidden";
|
|
||||||
this.sidebar.style.position = "relative";
|
|
||||||
this.sidebar.style.left = "0";
|
|
||||||
|
|
||||||
if (!this.sidebarIsOnRight) {
|
|
||||||
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
|
|
||||||
} else {
|
|
||||||
this.sidebar.style.marginRight = `${-1 * sidebarWidth}px`;
|
|
||||||
this.sidebar.style.transform = `translateX(${sidebarWidth}px)`;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.requestAnimationFrame(() => {
|
|
||||||
this.sidebar.style.transition = "margin .3s ease, transform .4s ease, opacity .3s ease";
|
|
||||||
// we are in compact mode and we are exiting it
|
|
||||||
if (!this.sidebarIsOnRight) {
|
if (!this.sidebarIsOnRight) {
|
||||||
this.sidebar.style.marginLeft = "0";
|
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
|
||||||
} else {
|
} else {
|
||||||
this.sidebar.style.marginRight = "0";
|
this.sidebar.style.marginRight = `${-1 * sidebarWidth}px`;
|
||||||
this.sidebar.style.transform = "translateX(0)";
|
|
||||||
}
|
}
|
||||||
this.sidebar.style.pointerEvents = "none";
|
this.sidebar.style.pointerEvents = "none";
|
||||||
|
|
||||||
setTimeout(() => {
|
window.requestAnimationFrame(() => {
|
||||||
window.requestAnimationFrame(() => {
|
this.sidebar.style.opacity = "0";
|
||||||
this._isAnimating = false;
|
setTimeout(() => {
|
||||||
this.sidebar.style.removeProperty("position");
|
window.requestAnimationFrame(() => {
|
||||||
this.sidebar.style.removeProperty("pointer-events");
|
this._isAnimating = false;
|
||||||
this.sidebar.style.removeProperty("opacity");
|
this.sidebar.style.removeProperty("opacity");
|
||||||
this.sidebar.style.removeProperty("margin-left");
|
this.sidebar.style.removeProperty("position");
|
||||||
this.sidebar.style.removeProperty("margin-right");
|
this.sidebar.style.removeProperty("transition");
|
||||||
this.sidebar.style.removeProperty("transform");
|
this.sidebar.style.removeProperty("pointer-events");
|
||||||
this.sidebar.style.removeProperty("transition");
|
this.sidebar.style.removeProperty("margin-left");
|
||||||
this.sidebar.style.removeProperty("left");
|
this.sidebar.style.removeProperty("margin-right");
|
||||||
|
this.sidebar.style.removeProperty("transform");
|
||||||
|
this.sidebar.style.removeProperty("left");
|
||||||
|
document.getElementById('browser').style.removeProperty("overflow");
|
||||||
|
this.sidebar.removeAttribute("animate");
|
||||||
|
});
|
||||||
|
}, 450);
|
||||||
|
});
|
||||||
|
} else if (canHideSidebar && !isCompactMode) {
|
||||||
|
document.getElementById('browser').style.overflow = "hidden";
|
||||||
|
this.sidebar.style.position = "relative";
|
||||||
|
this.sidebar.style.left = "0";
|
||||||
|
|
||||||
document.getElementById('browser').style.removeProperty("overflow");
|
if (!this.sidebarIsOnRight) {
|
||||||
});
|
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
|
||||||
}, 400);
|
} else {
|
||||||
});
|
this.sidebar.style.marginRight = `${-1 * sidebarWidth}px`;
|
||||||
}
|
this.sidebar.style.transform = `translateX(${sidebarWidth}px)`;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
this.sidebar.style.transition = "margin .3s ease, transform .4s ease, opacity .3s ease";
|
||||||
|
// we are in compact mode and we are exiting it
|
||||||
|
if (!this.sidebarIsOnRight) {
|
||||||
|
this.sidebar.style.marginLeft = "0";
|
||||||
|
} else {
|
||||||
|
this.sidebar.style.marginRight = "0";
|
||||||
|
this.sidebar.style.transform = "translateX(0)";
|
||||||
|
}
|
||||||
|
this.sidebar.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
this._isAnimating = false;
|
||||||
|
this.sidebar.style.removeProperty("position");
|
||||||
|
this.sidebar.style.removeProperty("pointer-events");
|
||||||
|
this.sidebar.style.removeProperty("opacity");
|
||||||
|
this.sidebar.style.removeProperty("margin-left");
|
||||||
|
this.sidebar.style.removeProperty("margin-right");
|
||||||
|
this.sidebar.style.removeProperty("transform");
|
||||||
|
this.sidebar.style.removeProperty("transition");
|
||||||
|
this.sidebar.style.removeProperty("left");
|
||||||
|
|
||||||
|
document.getElementById('browser').style.removeProperty("overflow");
|
||||||
|
this.sidebar.removeAttribute("animate");
|
||||||
|
});
|
||||||
|
}, 400);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
updateContextMenu() {
|
updateContextMenu() {
|
||||||
|
@@ -39,7 +39,7 @@ body {
|
|||||||
#welcome .zen-branding-title,
|
#welcome .zen-branding-title,
|
||||||
#thanks .zen-branding-title {
|
#thanks .zen-branding-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 11rem;
|
font-size: 9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#buttons-footer {
|
#buttons-footer {
|
||||||
|
Reference in New Issue
Block a user