mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-16 06:46:12 +00:00
feat: Apply padding top when animating elements, b=(no-bug), c=workspaces
This commit is contained in:
@@ -2096,11 +2096,13 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
const offset = -(newWorkspaceIndex - elementWorkspaceIndex) * 100;
|
const offset = -(newWorkspaceIndex - elementWorkspaceIndex) * 100;
|
||||||
const newTransform = `translateX(${offset}%)`;
|
const newTransform = `translateX(${offset}%)`;
|
||||||
if (shouldAnimate) {
|
if (shouldAnimate) {
|
||||||
|
const existingPaddingTop = element.style.paddingTop;
|
||||||
animations.push(
|
animations.push(
|
||||||
gZenUIManager.motion.animate(
|
gZenUIManager.motion.animate(
|
||||||
element,
|
element,
|
||||||
{
|
{
|
||||||
transform: existingTransform ? [existingTransform, newTransform] : newTransform,
|
transform: existingTransform ? [existingTransform, newTransform] : newTransform,
|
||||||
|
paddingTop: existingTransform ? [existingPaddingTop, existingPaddingTop] : existingPaddingTop,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'spring',
|
type: 'spring',
|
||||||
|
Reference in New Issue
Block a user