Skip to content

Commit

Permalink
DropZone: Smooth animation (#49517)
Browse files Browse the repository at this point in the history
* Tweak animation

* Add space between drop-zone icon and text

* Update CHANGELOG.md
  • Loading branch information
richtabor committed Apr 4, 2023
1 parent f5fd962 commit bb5b306
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- `DropZone`: Smooth animation ([#49517](https://github.com/WordPress/gutenberg/pull/49517)).

## 23.7.0 (2023-03-29)

- `ImageSizeControl`: Remove the "Image Dimensions" label ([#49414](https://github.com/WordPress/gutenberg/pull/49414)).
Expand Down
20 changes: 12 additions & 8 deletions packages/components/src/drop-zone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,34 @@ export function DropZoneComponent( {

let children;
const backdrop = {
hidden: { scaleY: 0, opacity: 0 },
hidden: { opacity: 0 },
show: {
scaleY: 1,
opacity: 1,
transition: {
type: 'tween',
duration: 0.2,
delay: 0.1,
delayChildren: 0.2,
delay: 0,
delayChildren: 0.1,
},
},
exit: {
scaleY: 1,
opacity: 0,
transition: {
duration: 0.3,
duration: 0.2,
delayChildren: 0,
},
},
};

const foreground = {
hidden: { opacity: 0, scale: 0.75 },
show: { opacity: 1, scale: 1 },
hidden: { opacity: 0, scale: 0.9 },
show: {
opacity: 1,
scale: 1,
transition: {
duration: 0.1,
},
},
exit: { opacity: 0, scale: 0.9 },
};

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/drop-zone/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}

.components-drop-zone__content-icon {
margin: 0 auto;
margin: 0 auto $grid-unit-10;
line-height: 0;
fill: currentColor;
pointer-events: none;
Expand Down

1 comment on commit bb5b306

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in bb5b306.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4611984996
📝 Reported issues:

Please sign in to comment.