-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from nwplus/www-enhancements
QA + mobile/animations
- Loading branch information
Showing
48 changed files
with
8,322 additions
and
1,158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import ImageTileContainer from './ImageTileContainer'; | ||
import Carousel from './Carousel'; | ||
import styled from 'styled-components'; | ||
|
||
const GalleryContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
height: 400px; | ||
width: 100%; | ||
gap: 16px; | ||
& > * { | ||
flex-basis: 50%; | ||
} | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
flex-direction: column; | ||
height: auto; | ||
& > * { | ||
flex-basis: auto; | ||
} | ||
} | ||
`; | ||
|
||
const GalleryVideo = styled.iframe` | ||
height: 400px; | ||
width: 100%; | ||
margin-bottom: 10px; | ||
border: none; | ||
border-radius: 6px; | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
height: 225px; | ||
} | ||
`; | ||
|
||
const Image = styled.img` | ||
height: 400px; | ||
width: 100%; | ||
margin-bottom: 10px; | ||
border-radius: 6px; | ||
object-fit: cover; | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
height: 225px; | ||
} | ||
`; | ||
|
||
/** | ||
* | ||
* @param {{ videoSrc: string, images: import('./ImageTileContainer').ImageTileRow[] }} param0 | ||
* @returns | ||
*/ | ||
function AboutUsGallery({ videoSrc, images }) { | ||
const [width, setWidth] = useState(0); | ||
const mobileBreakpoint = 768; | ||
|
||
useEffect(() => { | ||
setWidth(window.innerWidth); | ||
window.addEventListener('resize', () => setWidth(window.innerWidth)); | ||
}, []); | ||
|
||
return width <= mobileBreakpoint ? ( | ||
<Carousel | ||
items={[ | ||
<GalleryVideo | ||
src={videoSrc} | ||
title='YouTube video player' | ||
allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' | ||
referrerpolicy='strict-origin-when-cross-origin' | ||
allowFullScreen | ||
key='video' | ||
></GalleryVideo>, | ||
...images.flatMap((imgTileRow) => [ | ||
<Image src={imgTileRow.leftImg} key={imgTileRow.leftImg} />, | ||
<Image src={imgTileRow.rightImg} key={imgTileRow.rightImg} />, | ||
]), | ||
]} | ||
/> | ||
) : ( | ||
<GalleryContainer> | ||
<GalleryVideo | ||
src={videoSrc} | ||
title='YouTube video player' | ||
allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' | ||
referrerpolicy='strict-origin-when-cross-origin' | ||
allowFullScreen | ||
></GalleryVideo> | ||
<ImageTileContainer rows={images} />; | ||
</GalleryContainer> | ||
); | ||
} | ||
|
||
export default AboutUsGallery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.