site/components/slack.js
2021-08-17 10:33:10 +08:00

145 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Button, Box, Container, Heading, Flex, Grid, Text } from 'theme-ui'
import styled from '@emotion/styled'
import usePrefersMotion from '../lib/use-prefers-motion'
import useHasMounted from '../lib/use-has-mounted'
let Highlight = styled(Text)`
color: inherit;
border-radius: 1em 0 1em 0;
background: linear-gradient(
-100deg,
rgba(250, 247, 133, 0.33),
rgba(250, 247, 133, 0.66) 95%,
rgba(250, 247, 133, 0.1)
);
`
Highlight = Highlight.withComponent('mark')
const Content = () => (
<Container
sx={{
textAlign: 'center',
zIndex: 999,
py: 6,
color: 'white',
'h2,p': { textShadow: 'text' },
textAlign: [null, 'center'],
position: 'relative',
overflow: 'hidden'
}}
>
<Text as="p" variant="eyebrow" sx={{ color: 'white', opacity: 0.75 }}>
~ The Hack Club Slack ~
</Text>
<Heading as="h2" variant="title">
Come for the skills, <br /> stay for the people.
</Heading>
<Text as="p" variant="lead" sx={{ maxWidth: 'copyPlus', mx: 'auto' }}>
Coding is often seen as an isolating activity, whilst one may join a team
to play football or a club to play chess, the stereotype of a
programmer is a person alone in a dark room. But it doesn't have to be
that way, youll find some <Highlight>fabulous people to talk</Highlight>{' '}
to in our global Slack (Discord-style online groupchat) with 11,000+
members, active at all hours. For leaders, you'll be able to connect with
other leaders and support one another.
</Text>
<Button
as="a"
href="https://hackclub.com/slack/"
variant="ctaLg"
sx={{
background: 'linear-gradient(-132deg, #338eda 14%, #33d6a6 82%)'
}}
>
Join our Slack
</Button>
</Container>
)
const Cover = () => (
<Box
sx={{
position: 'absolute',
bottom: 0,
top: 0,
left: 0,
right: 0,
backgroundImage: t => t.util.gx('cyan', 'purple'),
opacity: 0.825,
zIndex: 1
}}
/>
)
const Static = ({
img = 'https://cloud-nykwtt0z7.vercel.app/2020-07-25_a1tcva4ch6mmr6j2cfmcb4e9ync3yhar.png'
// img="https://cloud-re5hkabx0.vercel.app/2020-07-25_hn13qhejqrzu4n1jy9yacxxgrgp3wf5u.png"
}) => (
<Box
as="section"
id="slack"
sx={{
position: 'relative',
overflow: 'hidden',
backgroundImage: `url(${img})`,
backgroundSize: 'cover'
}}
>
<Cover />
<Content />
</Box>
)
const Slack = () => {
const hasMounted = useHasMounted()
const prefersMotion = usePrefersMotion()
if (hasMounted && prefersMotion) {
return (
<Box
as="section"
id="slack"
sx={{ overflow: 'hidden', position: 'relative' }}
>
<Box
as="video"
autoPlay
muted
loop
playsInline
poster="https://cloud-nykwtt0z7.vercel.app/2020-07-25_a1tcva4ch6mmr6j2cfmcb4e9ync3yhar.png"
duration={2000}
sx={{
position: 'absolute',
bottom: 0,
top: 0,
left: 0,
right: 0,
height: '100%',
zIndex: -1,
width: '100vw',
objectFit: 'cover'
}}
>
<source
src="https://cdn.glitch.com/2d637c98-ed35-417a-bf89-cecc165d7398%2Foutput-no-duplicate-frames.hecv.mp4?v=1590780967658"
type="video/mp4; codecs=hevc"
/>
<source
src="https://cdn.glitch.com/2d637c98-ed35-417a-bf89-cecc165d7398%2Foutput-no-duplicate-frames.webm?v=1590781698834"
type="video/webm; codecs=vp9,opus"
/>
<source
src="https://cdn.glitch.com/2d637c98-ed35-417a-bf89-cecc165d7398%2Foutput-no-duplicate-frames.mov?v=1590781491717"
type="video/quicktime"
/>
</Box>
<Cover />
<Content />
</Box>
)
} else {
return <Static />
}
}
export default Slack