Skip to content

Commit

Permalink
feat(pie-cookie-banner): DSW-2210 add entrance animation variants (#1579
Browse files Browse the repository at this point in the history
)

* feat(pie-cookie-banner): DSW-2210 add entrance animation variants

* productionise animation variant 3

* revert line breaks

* do not animate for prefers reduced motion

---------

Co-authored-by: personal <[email protected]>
  • Loading branch information
2 people authored and JoshuaNg2332 committed Jul 25, 2024
1 parent 667b174 commit 5df20f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-candles-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@justeattakeaway/pie-cookie-banner": minor
---

[Added] - An entrance animation to the cookie banner that makes it slide into the viewport from below.
10 changes: 10 additions & 0 deletions packages/components/pie-cookie-banner/src/cookie-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ $breakpoint-wide: 700px;
&[isCookieBannerHidden] {
display: none;
}

@media (prefers-reduced-motion: no-preference) {
@keyframes animate-enter {
0% { transform: translate3d(0, 75%, 0); }

100% { transform: translate3d(0, 0, 0); }
}

animation: 0.5s animate-enter ease-out;
}
}

.c-cookieBanner-title,
Expand Down

0 comments on commit 5df20f5

Please sign in to comment.