Skip to content

Commit e3481fa

Browse files
kaylahamaKayla Hamakawa
and
Kayla Hamakawa
authored
added current events section to home page (#493)
* added current events section to home page * changed css formatting for media queries --------- Co-authored-by: Kayla Hamakawa <kaylahamakawa@MacBook-Pro.local>
1 parent b33b616 commit e3481fa

File tree

3 files changed

+119
-4
lines changed

3 files changed

+119
-4
lines changed

src/components/Home/CurrEvents.jsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import '../../styles/Home.css';
3+
import img1 from '../../images/hack-school-insta.jpg';
4+
import img2 from '../../images/hack-fam-insta.png';
5+
6+
const firstDescription =
7+
'Join us in our beginner-friendly web development workshop series, where you build a website using tools such as HTML, CSS, and ReactJS!';
8+
9+
const secondDescription =
10+
'Get placed in fam groups to meet people in the Hack community through smaller group socials!';
11+
12+
export default function CurrEvents() {
13+
return (
14+
<div>
15+
<h1 className='section-title'>Current Events</h1>
16+
<div className='events-container'>
17+
<div className='event-column'>
18+
<h2 className='event-title'>Hack School</h2>
19+
<img className='event-img' src={img1} alt='HackSchool' />
20+
<p className='event-description'>{firstDescription}</p>
21+
</div>
22+
<div className='event-column'>
23+
<h2 className='event-title'>Hack Fam</h2>
24+
<img className='event-img' src={img2} alt='HackFam' />
25+
<p className='event-description'>{secondDescription}</p>
26+
</div>
27+
</div>
28+
</div>
29+
);
30+
}

src/pages/Home.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import HackDescription from '../components/Home/HackDescription';
44
import PhotoCarousel from '../components/Home/PhotoCarousel';
55
import FAQSection from '../components/Home/FAQSection';
66
import Announcement from '../components/Home/Announcement';
7+
import CurrEvents from '../components/Home/CurrEvents';
78
import useTitle from '../components/General/useTitle';
89

910
export default function Home() {
@@ -29,11 +30,8 @@ export default function Home() {
2930
<HackDescription />
3031
</Container1>
3132

32-
{/* <Container2>
33-
<h1>Fall 2024 Events</h1>
34-
</Container2> */}
35-
3633
<Container2>
34+
<CurrEvents />
3735
<PhotoCarousel />
3836
</Container2>
3937

src/styles/Home.css

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,90 @@
147147
max-height: 8rem;
148148
}
149149
}
150+
151+
/* ========== CurrEvents.jsx ========== */
152+
.section-title {
153+
font-weight: bold;
154+
margin: 2rem 0;
155+
font-size: 2.5rem;
156+
margin-bottom: 0.2rem;
157+
}
158+
159+
.events-container {
160+
display: flex;
161+
flex-wrap: wrap;
162+
gap: 1rem;
163+
margin-bottom: 2rem;
164+
}
165+
166+
.event-column {
167+
display: flex;
168+
flex-direction: column;
169+
align-items: center;
170+
flex: 1 1 45%;
171+
padding: 1rem;
172+
border-radius: 8px;
173+
max-width: 500px;
174+
margin: 0 auto;
175+
}
176+
177+
.event-img {
178+
width: 100%;
179+
max-width: 25rem;
180+
aspect-ratio: 1 / 1;
181+
object-fit: cover;
182+
border-radius: 1rem;
183+
box-shadow: 0 0 0.7rem 0.3rem #e6e6e6;
184+
}
185+
186+
.event-description {
187+
width: 100%;
188+
max-width: 25rem;
189+
text-align: justify;
190+
flex-basis: 80%;
191+
flex-grow: 1;
192+
line-height: 1.8rem;
193+
}
194+
195+
.event-title {
196+
text-align: center;
197+
font-size: 40px;
198+
font-weight: 600;
199+
background-image: linear-gradient(
200+
to right,
201+
#c960ff,
202+
#ea43d4,
203+
#f499da,
204+
#e16db9,
205+
#c960ff
206+
);
207+
color: transparent;
208+
background-clip: text;
209+
-webkit-background-clip: text;
210+
background-size: 200% auto;
211+
-webkit-text-fill-color: transparent;
212+
background-position: 0% center;
213+
transition: background-position 2s ease;
214+
}
215+
216+
.event-title:hover {
217+
background-position: 100% center;
218+
transition: background-position 2s ease;
219+
}
220+
221+
@media (max-width: 750px) {
222+
.events-container {
223+
flex-direction: column;
224+
gap: 1.5rem;
225+
}
226+
}
227+
228+
@media (max-width: 450px) {
229+
.event-img {
230+
width: 100%;
231+
height: auto;
232+
}
233+
.event-title {
234+
font-size: 2rem;
235+
}
236+
}

0 commit comments

Comments
 (0)