mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 18:06:35 +00:00
enhance media controls: improve animations and adjust layout properties
This commit is contained in:
2255
package-lock.json
generated
2255
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -59,12 +59,13 @@
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
& #zen-media-main-vbox {
|
& #zen-media-main-vbox {
|
||||||
|
transition-delay: 0s;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show-on-hover {
|
.show-on-hover {
|
||||||
max-height: 50px;
|
max-height: 50px;
|
||||||
margin: 2px 6px;
|
padding: 2px 6px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
@@ -108,14 +109,13 @@
|
|||||||
.show-on-hover {
|
.show-on-hover {
|
||||||
max-height: 0;
|
max-height: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
overflow: hidden;
|
|
||||||
transform: translateY(5px);
|
transform: translateY(5px);
|
||||||
margin: 0 6px;
|
padding: 0 6px;
|
||||||
transition:
|
transition:
|
||||||
max-height 0.1s ease-in-out,
|
max-height 0.1s ease-in-out,
|
||||||
opacity 0.1s ease-in-out,
|
opacity 0.1s ease-in-out,
|
||||||
transform 0.05s ease-in-out,
|
transform 0.05s ease-in-out,
|
||||||
margin 0.15s ease-in-out;
|
padding 0.15s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#zen-media-current-time,
|
#zen-media-current-time,
|
||||||
@@ -127,24 +127,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes zen-media-controls-show {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(10px);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#zen-media-controls-toolbar {
|
#zen-media-controls-toolbar {
|
||||||
display: none;
|
display: none;
|
||||||
animation: none;
|
animation: none;
|
||||||
transition: none;
|
transition: none;
|
||||||
|
|
||||||
&:not([hidden]) {
|
&:not([hidden]) {
|
||||||
animation: zen-media-controls-show 0.2s ease-out;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 2.5rem;
|
height: 2.5rem;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
@@ -163,7 +151,7 @@
|
|||||||
|
|
||||||
#zen-media-service-title {
|
#zen-media-service-title {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
font-size: 13px;
|
font-size: math;
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
|
|
||||||
& label {
|
& label {
|
||||||
@@ -200,7 +188,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#zen-media-service-hbox {
|
#zen-media-service-hbox {
|
||||||
margin-top: 6px;
|
padding-top: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#zen-media-info-vbox {
|
#zen-media-info-vbox {
|
||||||
|
@@ -1174,7 +1174,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
& .titlebar-buttonbox-container {
|
& .titlebar-buttonbox-container {
|
||||||
margin-left: calc(-1 * var(--zen-toolbox-max-width)) !important;
|
margin-left: calc(-1 * var(--zen-toolbox-max-width) + var(--zen-toolbox-padding) / 2) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
& #zen-appcontent-wrapper {
|
& #zen-appcontent-wrapper {
|
||||||
|
@@ -31,14 +31,41 @@ class ZenMediaController {
|
|||||||
window.addEventListener('TabSelect', (event) => {
|
window.addEventListener('TabSelect', (event) => {
|
||||||
if (this._currentBrowser) {
|
if (this._currentBrowser) {
|
||||||
if (event.target.linkedBrowser.browserId === this._currentBrowser.browserId) {
|
if (event.target.linkedBrowser.browserId === this._currentBrowser.browserId) {
|
||||||
this.mediaControlBar.setAttribute('hidden', 'true');
|
gZenUIManager.motion
|
||||||
|
.animate(this.mediaControlBar, {
|
||||||
|
opacity: [1, 0],
|
||||||
|
y: [0, 10],
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.mediaControlBar.setAttribute('hidden', 'true');
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.mediaControlBar.removeAttribute('hidden');
|
this.mediaControlBar.removeAttribute('hidden');
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
this.mediaControlBar.style.height =
|
||||||
|
this.mediaControlBar.querySelector('toolbaritem').getBoundingClientRect().height + 'px';
|
||||||
|
gZenUIManager.motion.animate(
|
||||||
|
this.mediaControlBar,
|
||||||
|
{
|
||||||
|
opacity: [0, 1],
|
||||||
|
y: [10, 0],
|
||||||
|
},
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
gZenUIManager.updateTabsToolbar();
|
gZenUIManager.updateTabsToolbar();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('TabClose', (event) => {
|
||||||
|
if (this._currentBrowser) {
|
||||||
|
if (event.target.linkedBrowser.browserId === this._currentBrowser.browserId) {
|
||||||
|
this.deinitMediaController(this._currentMediaController);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user