-
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 #197 from nwplus/daniel/redesign-who-we-are
Redesign who we are section
- Loading branch information
Showing
10 changed files
with
5,781 additions
and
5,399 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
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,73 @@ | ||
import styled from 'styled-components'; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
`; | ||
|
||
const ImageTileRow = styled.div` | ||
position: relative; | ||
display: flex; | ||
height: calc(50% - 8px); | ||
gap: 16px; | ||
z-index: 1; | ||
${(p) => | ||
p.withMascots && | ||
` | ||
&:before { | ||
z-index: -1; | ||
content: ''; | ||
position: absolute; | ||
top: -100px; | ||
right: 0; | ||
background: url('assets/about-us-mascots.svg'); | ||
background-position: top right; | ||
background-repeat: no-repeat; | ||
width: 300px; | ||
height: 152px; | ||
} | ||
`} | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
height: auto; | ||
&:before { | ||
display: none; | ||
} | ||
} | ||
`; | ||
|
||
const GalleryImage = styled.img` | ||
width: ${(p) => (p.small ? '33%' : '66%')}; | ||
border-radius: 6px; | ||
object-fit: cover; | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
height: 115px; | ||
} | ||
`; | ||
|
||
/** | ||
* @typedef {{leftImg: string, rightImg: string}} ImageTileRow | ||
*/ | ||
|
||
/** | ||
* | ||
* @param {{rows: ImageTileRow[]}} props | ||
*/ | ||
const ImageTileContainer = ({ rows }) => { | ||
return ( | ||
<Container> | ||
{rows.map((row, i) => ( | ||
<ImageTileRow withMascots={i == 0} key={i}> | ||
<GalleryImage small={i % 2 == 0} src={row.leftImg} /> | ||
<GalleryImage small={i % 2 == 1} src={row.rightImg} /> | ||
</ImageTileRow> | ||
))} | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ImageTileContainer; |
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 |
---|---|---|
@@ -1,30 +1,55 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Title1 } from './Typography'; | ||
|
||
const PC_STATS = 'assets/webStats.png'; | ||
const MOBILE_STATS = 'assets/mobileStats.svg' | ||
const StatsContainer = styled.div` | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 20px; | ||
justify-content: center; | ||
`; | ||
|
||
const Image = styled.img` | ||
width: 100%; | ||
` | ||
const StatContainer = styled.div` | ||
width: 250px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
padding: 80px 20px; | ||
background-image: linear-gradient(to bottom, #e9e2ff4d, #4836814d); | ||
border-radius: 8px; | ||
text-align: center; | ||
export default function Stats () { | ||
const [width, setWidth] = useState(window.innerWidth); | ||
const mobileBreakpoint = 768; | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
width: 150px; | ||
padding: 40px 16px; | ||
} | ||
`; | ||
|
||
useEffect(() => { | ||
window.addEventListener("resize", () => setWidth(window.innerWidth)); | ||
}, []); | ||
const StatDescription = styled.div` | ||
font-size: 21px; | ||
color: #e2d6ff; | ||
text-transform: uppercase; | ||
font-weight: bold; | ||
return ( | ||
<> | ||
{ | ||
width <= mobileBreakpoint ? ( | ||
<Image src={MOBILE_STATS} /> | ||
) : ( | ||
<Image src={PC_STATS} /> | ||
) | ||
} | ||
</> | ||
) | ||
} | ||
${(p) => p.theme.mediaQueries.mobile} { | ||
font-size: 16px; | ||
} | ||
`; | ||
/** | ||
* | ||
* @param {{ stats: { title: string, description: string }[] }} props | ||
* @returns | ||
*/ | ||
export default function Stats(props) { | ||
|
||
return ( | ||
<StatsContainer numRows={props.stats.length}> | ||
{props.stats.map((s, i) => ( | ||
<StatContainer key={i}> | ||
<Title1 withGradient>{s.title}</Title1> | ||
<StatDescription>{s.description}</StatDescription> | ||
</StatContainer> | ||
))} | ||
</StatsContainer> | ||
); | ||
} |
Oops, something went wrong.