Skip to content

Commit 48720b3

Browse files
fix: In mobile view, moves the play pause button to the top left (#868)
* In mobile view, moves the play button to the top left * Snapshot * Refactor media query --------- Co-authored-by: Andy E Phipps <a.phipps@comicrelief.com>
1 parent 3a4220f commit 48720b3

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/components/Atoms/AmbientVideo/AmbientVideo.style.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ const PlayPauseIcon = styled.span`
7777

7878
const PlayPauseButton = styled.button`
7979
position: absolute;
80-
bottom: 15px;
80+
top: 15px;
81+
bottom: auto;
8182
left: 15px;
8283
width: 35px;
8384
height: 35px;
@@ -100,6 +101,15 @@ const PlayPauseButton = styled.button`
100101
transform: translateX(2px);
101102
}
102103
104+
// Play icon needs to go to the top left on mobile
105+
// as with the hero banner, the text container can
106+
// overlap it. Here in desktop view it can come
107+
// back to the bottom.
108+
@media ${({ theme }) => theme.allBreakpoints('L')} {
109+
bottom: 15px;
110+
top: auto;
111+
}
112+
103113
@media (prefers-reduced-motion: reduce) {
104114
display: none;
105115
}

src/components/Molecules/PictureOrVideo/__snapshots__/PictureOrVideo.test.js.snap

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ exports[`renders AmbientVideo when video props are provided correctly 1`] = `
4040
4141
.c6 {
4242
position: absolute;
43-
bottom: 15px;
43+
top: 15px;
44+
bottom: auto;
4445
left: 15px;
4546
width: 35px;
4647
height: 35px;
@@ -94,6 +95,13 @@ exports[`renders AmbientVideo when video props are provided correctly 1`] = `
9495
}
9596
}
9697
98+
@media (min-width:1024px) {
99+
.c6 {
100+
bottom: 15px;
101+
top: auto;
102+
}
103+
}
104+
97105
@media (prefers-reduced-motion:reduce) {
98106
.c6 {
99107
display: none;

0 commit comments

Comments
 (0)