Skip to content

Commit e6b893e

Browse files
authored
Merge pull request #3 from natesabrown/master
Change to fixed-size grid elements
2 parents 4b489ec + 6f647bc commit e6b893e

File tree

8 files changed

+16568
-36
lines changed

8 files changed

+16568
-36
lines changed

src/assets/icons/calendar.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/icons/pinMarker.svg

Lines changed: 1 addition & 0 deletions
Loading
61.3 KB
Loading

src/assets/images/funinthesun.jpeg

6.85 KB
Loading

src/assets/images/opendataday.png

403 KB
Loading
Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,86 @@
11
import React from 'react';
2-
import AnchorLink from 'react-anchor-link-smooth-scroll';
32
import { Container, Card, SectionHeading } from 'components/common';
4-
import { Wrapper, Grid, Item, Content } from './styles';
5-
import jg from 'assets/images/jgonzales_from_unsplash.jpg';
3+
import { Wrapper, SmallWrapper, Grid, Item, EventsHeader, AttributeItem, EventImage, FillerDiv} from './styles';
4+
import funinthesun from 'assets/images/funinthesun.jpeg'
5+
import opendataday from 'assets/images/opendataday.png'
6+
import codeforthecount from 'assets/images/codeforthecount.jpeg'
7+
import pinMarker from 'assets/icons/pinMarker.svg';
8+
import calendar from 'assets/icons/calendar.svg';
69

7-
export function Events() {
8-
return (
9-
<Wrapper as={Container} id="events">
10-
<SectionHeading>Events</SectionHeading>
1110

12-
</Wrapper>
11+
export const Events = () => (
12+
<Wrapper as={Container} id="events">
13+
<SectionHeading>Events</SectionHeading>
14+
<SmallWrapper>
15+
<EventsHeader>
16+
<h2>
17+
Upcoming Events
18+
</h2>
19+
<hr></hr>
20+
</EventsHeader>
21+
<Grid>
22+
<EventCard
23+
url="#"
24+
name="Example Event"
25+
time="Sunday, March 16 2021"
26+
location="Dallas, TX"
27+
description="This is example text for a hypothetical fun event hosted by CFD"
28+
image={funinthesun}
29+
/>
30+
</Grid>
31+
</SmallWrapper>
32+
33+
<SmallWrapper>
34+
<EventsHeader>
35+
<h2>
36+
Past Events
37+
</h2>
38+
<hr></hr>
39+
</EventsHeader>
40+
<Grid>
41+
<EventCard
42+
url="https://www.meetup.com/Code-for-Dallas/events/268938364/"
43+
name="DFW Open Data Day 2020"
44+
time="Saturday, March 6 2020"
45+
location="UNT at Frisco"
46+
description="An event where we coded for city governments, using open and public data to gain valuable insights and do cool things."
47+
image={opendataday}
48+
/>
49+
<EventCard
50+
url="https://www.meetup.com/Code-for-Dallas/events/267278061/"
51+
name="Creatives for the Count"
52+
time="Thursday, January 9 2020"
53+
location="Dallas, TX"
54+
description="Creatives from around the Dallas area meet up and create cool resources to promote the 2020 census."
55+
image={codeforthecount}
56+
/>
57+
</Grid>
58+
</SmallWrapper>
59+
</Wrapper>
60+
);
61+
62+
function EventCard(props) {
63+
return (
64+
<Item as="a" href={props.url} target="_blank" rel="noopener noreferrer">
65+
66+
<Card>
67+
{/* <img style={{borderRadius: "50%", width: "50%"}} src={props.thumbnail} alt={"Picture of " + props.name} /> */}
68+
<h3>{props.name}</h3>
69+
<AttributeItem>
70+
<img src={calendar} alt="calendar" />
71+
{props.time}
72+
</AttributeItem>
73+
<AttributeItem>
74+
<img src={pinMarker} alt="pin marker"/>
75+
{props.location}
76+
</AttributeItem>
77+
<p>{props.description}</p>
78+
<FillerDiv></FillerDiv>
79+
<EventImage>
80+
<img src={props.image}></img>
81+
</EventImage>
82+
</Card>
83+
</Item>
84+
1385
)
14-
}
86+
}

src/components/landing/Events/styles.js

Lines changed: 71 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,54 @@ export const Wrapper = styled.div`
44
padding: 2rem 0;
55
`;
66

7+
export const SmallWrapper = styled.div`
8+
padding: 1rem 0;
9+
`;
10+
11+
export const EventsHeader = styled.div`
12+
text-align: center;
13+
h2 {
14+
margin: 0;
15+
margin: 0 auto;
16+
color:white;
17+
background-color: #6FACD5;
18+
padding: 1em;
19+
margin-bottom: 2rem;
20+
border-radius: 2rem;
21+
min-width: 3em;
22+
display: inline-block;
23+
}
24+
25+
`;
26+
727
export const Grid = styled.div`
828
display: grid;
9-
align-items: center;
10-
grid-template-columns: repeat(3, 1fr);
29+
grid-template-columns: repeat(2, 1fr);
1130
grid-template-rows: 8fr;
1231
gap: 1.2rem 1.2rem;
13-
14-
@media (max-width: 960px) {
15-
grid-template-columns: repeat(2, 1fr);
32+
align-items: center;
33+
justify-items: center;
34+
p {
35+
margin-top: 2em;
1636
}
1737
18-
@media (max-width: 680px) {
38+
// @media (max-width: 960px) {
39+
// grid-template-columns: repeat(2, 1fr);
40+
// }
41+
42+
@media (max-width: 1328px) {
1943
grid-template-columns: 1fr;
2044
}
2145
`;
2246

2347
export const Item = styled.div`
24-
width: 100%;
2548
height: 100%;
2649
overflow: hidden;
2750
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.11);
51+
color: inherit;
52+
position: relative;
53+
width: 520px;
54+
display: flex;
2855
2956
h4 {
3057
color: #212121;
@@ -35,27 +62,44 @@ export const Item = styled.div`
3562
}
3663
`;
3764

38-
export const Content = styled.div`
39-
padding: 1rem 0;
40-
`;
65+
export const AttributeItem = styled.div`
66+
margin-bottom: 12px;
4167
42-
export const Stats = styled.div`
43-
display: flex;
44-
align-items: center;
68+
img {
69+
width: 14px;
70+
margin-right: 12px;
71+
margin-bottom: 0px;
72+
}
73+
`
4574

46-
div {
47-
display: flex;
48-
&:first-child {
49-
margin-right: 0.5rem;
50-
}
75+
export const EventImage = styled.div`
76+
height: 368px;
77+
text-align: center;
78+
position: absolute;
79+
bottom: 30px;
80+
right: 50%;
5181
52-
img {
53-
margin: 0;
54-
}
82+
img {
83+
max-width: none;
84+
height: 80%;
85+
transition: height 0.5s ease-in-out, filter 0.5s ease-in-out;
86+
display: block;
87+
position: absolute;
88+
top: 50%;
89+
left: 50%;
90+
margin-right: -50%;
91+
transform: translate(-50%, -50%)
92+
}
5593
56-
span {
57-
color: #000;
58-
margin-left: 0.5rem;
59-
}
60-
}
61-
`;
94+
img:hover {
95+
height: 83.5%;
96+
filter: brightness(70%);
97+
}
98+
}
99+
`
100+
101+
export const FillerDiv = styled.div`
102+
height:360px;
103+
width:100%;
104+
position:relative;
105+
`

0 commit comments

Comments
 (0)