Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hackathons section #83

Merged
merged 7 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions components/HackathonCard.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import styled from "styled-components"
import Button from "./Button"

const BackgroundImageContainer = styled.div`
width: 100%;
height: 100%;
`

const CardContainer = styled.div`
width: 380px;
height: 500px;
overflow: hidden;
border-radius: 12px;
margin: 2em;
position: relative;
`

const BackgroundImageContainer = styled.div`
background: ${p => p.theme.colors.shadedGradient}, url(${p => p.imageLink}) center;
background-size: cover;
width: 100%;
height: 100%;
& > ${BackgroundImageContainer} {
background: ${p => p.theme.colors.shadedGradient}, url(${p => p.imageLink}) center;
background-size: cover;
}

${CardContainer}:hover & {
&:hover > ${BackgroundImageContainer} {
background: url(${p => p.imageLink}) center;
background-size: cover;
transform: scale(1.1);
}
`
Expand Down Expand Up @@ -59,7 +61,7 @@ const EventDateString = styled.div`

const HackathonCard = ({ registrationOpen, link, dateString, imageLink }) => {
return (
<CardContainer>
<CardContainer imageLink={imageLink}>
<OverlayContainer>
<OverLayFooterContainer>
<EventDataContainer>
Expand All @@ -73,7 +75,7 @@ const HackathonCard = ({ registrationOpen, link, dateString, imageLink }) => {
</Button>
</OverLayFooterContainer>
</OverlayContainer>
<BackgroundImageContainer imageLink={imageLink}/>
<BackgroundImageContainer/>
</CardContainer>
)
}
Expand Down
68 changes: 68 additions & 0 deletions components/Hackathons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { useContext, useState } from 'react'
import styled, { ThemeContext } from 'styled-components'
import HackathonCard from './HackathonCard'
import NewsletterModal from './NewsletterModal'
import { Body, LinkBody } from './Typography';

const HackCampData = {
imgSrc: '/assets/HackCamp2021.png',
link: 'https://hackcamp.nwplus.io',
date: 'TBA',
}
const nwHacksData = {
imgSrc: '/assets/nwHacks2021.png',
link: 'https://nwhacks.io',
date: 'TBA',
}
const cmdfData = {
imgSrc: '/assets/cmd-f2021.png',
link: 'https://cmd-f.nwplus.io',
date: 'TBA',
}
const subscribeCTAText = 'to our newsletter to stay up to date on our hackathons!';

export default function Hackathons() {
const themeContext = useContext(ThemeContext);
const [showModal, setShowModal] = useState(false);

const HackathonsContainer = styled.div`
display: flex;
justify-content: center;
margin-top: 2em;

${themeContext.mediaQueries.mobile} {
flex-direction: column;
align-items: center;
}
`;

return (
<>
<HackathonsContainer>
<HackathonCard
registrationOpen={false}
link={HackCampData.link}
dateString={HackCampData.date}
imageLink={HackCampData.imgSrc}
/>
<HackathonCard
registrationOpen={false}
link={nwHacksData.link}
dateString={nwHacksData.date}
imageLink={nwHacksData.imgSrc}
/>
<HackathonCard
registrationOpen={false}
link={cmdfData.link}
dateString={cmdfData.date}
imageLink={cmdfData.imgSrc}
/>
</HackathonsContainer>
<Body align="center"><LinkBody onClick={() => setShowModal(true)}>Subscribe</LinkBody> {subscribeCTAText}</Body>
<NewsletterModal
show={showModal}
onClose={() => setShowModal(false)}
/>
</>
)
}
17 changes: 4 additions & 13 deletions components/ResourceContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ const HeaderContainer = styled.div`
margin-bottom: 30px;
`

const BodyContainer = styled.div`
display: flex;
flex-direction: row;
${(p) => p.theme.mediaQueries.mobile} {
display: inline;
text-align: center;
}
`

const CardContainer = styled.div`
display: flex;
justify-content: space-between;
Expand Down Expand Up @@ -56,7 +47,7 @@ const FilterCardContainer = styled.div`
}
`
const RESOURCES_TITLE = 'Resources';
const RESOURCES_BODY = 'If you are looking to get started in Computer Science, check out our \u00a0';
const RESOURCES_BODY = 'If you are looking to get started in Computer Science, check out our ';
const RESOURCES_LINK = 'https://resources.nwplus.io/';
const RESOURCES_LINK_TEXT = 'Self-Learning Resources Wiki!';

Expand Down Expand Up @@ -177,12 +168,12 @@ export default function ResourceContainer() {
<Container>
<HeaderContainer>
<Title1 withGradient>{RESOURCES_TITLE}</Title1>
<BodyContainer>
<Body>{RESOURCES_BODY}</Body>
<Body>
{RESOURCES_BODY}
<a href={RESOURCES_LINK} target='_blank' rel="noreferrer">
<LinkBody>{RESOURCES_LINK_TEXT}</LinkBody>
</a>
</BodyContainer>
</Body>
</HeaderContainer>
<CardContainer>
<FilterContainer>
Expand Down
3 changes: 3 additions & 0 deletions components/Typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const Title1 = styled.h1.attrs((p) => ({
color: ${p.theme.colors.primary}
}`
}
${(p) => p.align ? `text-align: ${p.align}` : ''};
`;

export const Title2 = styled.h2.attrs((p) => ({
Expand Down Expand Up @@ -125,6 +126,7 @@ export const Body = styled.p.attrs((p) => ({
`background: -webkit-linear-gradient(92deg, #19cbcb 1.55%, #78ff96 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;`}
${(p) => p.align ? `text-align: ${p.align};` : ''}
${(p) => p.theme.mediaQueries.mobile} {
font-size: 14px;
line-height: 24px;
Expand All @@ -142,6 +144,7 @@ export const MixedTextParagraph = styled.div`
export const LinkBody = styled.p.attrs((p) => ({
color: p.color || p.theme.colors.typography.body,
}))`
display: inline;
font-style: normal;
font-weight: bold;
font-size: 18px;
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const theme = {
colors: {
primary: '#20FFAF',
primaryGradient: 'linear-gradient(92.58deg, #20FFAF 0%, #78FF96 100%)',
shadedGradient: 'linear-gradient( rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3) )',
shadedGradient: 'linear-gradient(180deg, rgba(0, 0, 0, 0) 47.69%, rgba(0, 0, 0, 0.8) 100%)',
secondary: '#fff',
tertiary: '#E2D6FF',
metadata: '#BDBAC3',
Expand Down
13 changes: 7 additions & 6 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Background } from '../components/Background'
import { ContentContainer } from '../components/ContentContainer';
import Carousel from '../components/Carousel'
import Footer from '../components/Footer'
import Hackathons from '../components/Hackathons'
import Hero from '../components/Hero'
import NewsletterModal from '../components/NewsletterModal';
// Typography
import {
Title1,
Expand All @@ -20,7 +20,6 @@ import {
export default function Home() {
const themeContext = useContext(ThemeContext);
const [activeTab, setActiveTab] = useState('Who We Are');
const [showModal, setShowModal] = useState(true);

const AboutHeader = styled.div`
display: flex;
Expand Down Expand Up @@ -95,10 +94,12 @@ export default function Home() {
<Body>This second part still needs to be done</Body>
}
</ContentContainer>
<NewsletterModal
show={showModal}
onClose={() => setShowModal(false)}
/>
<ContentContainer>
<Title1 withGradient align="center">
Hackathons
</Title1>
<Hackathons />
</ContentContainer>
<Footer />
</Background>
</>
Expand Down
Binary file added public/assets/HackCamp2021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/cmd-f2021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/nwHacks2021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.