Skip to content

Commit 6f647bc

Browse files
committed
Change to fixed-size cards with grid breakpoint
1 parent e9ea69e commit 6f647bc

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

src/components/landing/Events/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Container, Card, SectionHeading } from 'components/common';
3-
import { Wrapper, SmallWrapper, Grid, Item, EventsHeader, AttributeItem, EventImage} from './styles';
3+
import { Wrapper, SmallWrapper, Grid, Item, EventsHeader, AttributeItem, EventImage, FillerDiv} from './styles';
44
import funinthesun from 'assets/images/funinthesun.jpeg'
55
import opendataday from 'assets/images/opendataday.png'
66
import codeforthecount from 'assets/images/codeforthecount.jpeg'
@@ -75,6 +75,7 @@ function EventCard(props) {
7575
{props.location}
7676
</AttributeItem>
7777
<p>{props.description}</p>
78+
<FillerDiv></FillerDiv>
7879
<EventImage>
7980
<img src={props.image}></img>
8081
</EventImage>

src/components/landing/Events/styles.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,32 @@ export const EventsHeader = styled.div`
2626

2727
export const Grid = styled.div`
2828
display: grid;
29-
align-items: center;
3029
grid-template-columns: repeat(2, 1fr);
3130
grid-template-rows: 8fr;
3231
gap: 1.2rem 1.2rem;
32+
align-items: center;
33+
justify-items: center;
3334
p {
3435
margin-top: 2em;
3536
}
3637
37-
@media (max-width: 960px) {
38-
grid-template-columns: repeat(2, 1fr);
39-
}
38+
// @media (max-width: 960px) {
39+
// grid-template-columns: repeat(2, 1fr);
40+
// }
4041
41-
@media (max-width: 800px) {
42+
@media (max-width: 1328px) {
4243
grid-template-columns: 1fr;
4344
}
4445
`;
4546

4647
export const Item = styled.div`
47-
width: 100%;
4848
height: 100%;
4949
overflow: hidden;
5050
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.11);
5151
color: inherit;
52+
position: relative;
53+
width: 520px;
54+
display: flex;
5255
5356
h4 {
5457
color: #212121;
@@ -72,11 +75,13 @@ img {
7275
export const EventImage = styled.div`
7376
height: 368px;
7477
text-align: center;
75-
position: relative;
78+
position: absolute;
79+
bottom: 30px;
80+
right: 50%;
7681
7782
img {
7883
max-width: none;
79-
height: inherit;
84+
height: 80%;
8085
transition: height 0.5s ease-in-out, filter 0.5s ease-in-out;
8186
display: block;
8287
position: absolute;
@@ -87,9 +92,14 @@ img {
8792
}
8893
8994
img:hover {
90-
height: 280px;
91-
filter: brightness(50%);
95+
height: 83.5%;
96+
filter: brightness(70%);
9297
}
93-
9498
}
99+
`
100+
101+
export const FillerDiv = styled.div`
102+
height:360px;
103+
width:100%;
104+
position:relative;
95105
`

0 commit comments

Comments
 (0)