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

added current events section to home page #493

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
31 changes: 31 additions & 0 deletions src/components/Home/CurrEvents.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import '../../styles/Events.css';
import '../../styles/Home.css';
import hfamimg from '../../images/hack-fam-insta.png';
import schoolimg from '../../images/hack-school-insta.jpg';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename hfamimg and schoolimg to something along the lines of "img1" and "img2" respectively-- this is just so there's more reusability in the future.


const firstDescription =
'Join us in our beginner-friendly web development workshop series, where you build a website using tools such as HTML, CSS, and ReactJS!';

const secondDescription =
'Get placed in fam groups to meet people in the Hack community through smaller group socials!';

export default function CurrEvents() {
return (
<div>
<h1 className='section-title'>Current Events</h1>
<div className='events-container'>
<div className='event-column'>
<h2 className='event-title'>Hack School</h2>
<img className='event-img' src={schoolimg} alt='HackSchool' />
<p className='hack-description'>{firstDescription}</p>
</div>
<div className='event-column'>
<h2 className='event-title'>Hack Fam</h2>
<img className='event-img' src={hfamimg} alt='HackFam' />
<p className='hack-description'>{secondDescription}</p>
</div>
</div>
</div>
);
}
6 changes: 2 additions & 4 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import HackDescription from '../components/Home/HackDescription';
import PhotoCarousel from '../components/Home/PhotoCarousel';
import FAQSection from '../components/Home/FAQSection';
import Announcement from '../components/Home/Announcement';
import CurrEvents from '../components/Home/CurrEvents';

export default function Home() {
const Container1 = ({ children }) => (
Expand All @@ -26,11 +27,8 @@ export default function Home() {
<HackDescription />
</Container1>

{/* <Container2>
<h1>Fall 2024 Events</h1>
</Container2> */}

<Container2>
<CurrEvents />
<PhotoCarousel />
</Container2>

Expand Down
47 changes: 47 additions & 0 deletions src/styles/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,50 @@
max-height: 8rem;
}
}

/* ========== CurrEvents.jsx ========== */
.section-title {
font-weight: bold;
margin: 2rem 0;
font-size: 2.5rem;
margin-bottom: 0.2rem;
}

.events-container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
margin-bottom: 2rem;
}

.event-column {
flex: 1 1 45%;
padding: 1rem;
border-radius: 8px;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a CSS selector here for .event-img (which you've already defined in CurrEvents.jsx). We should make sure that the two images are the same size.

.event-title {
text-align: center;
font-size: 40px;
font-weight: 600;
background-image: linear-gradient(
to right,
#c960ff,
#ea43d4,
#f499da,
#e16db9,
#c960ff
);
color: transparent;
background-clip: text;
-webkit-background-clip: text;
background-size: 200% auto;
-webkit-text-fill-color: transparent;
background-position: 0% center;
transition: background-position 2s ease;
}

.event-title:hover {
background-position: 100% center;
transition: background-position 2s ease;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the bottom of this file, we should have a section for media queries to make sure that the images are centered when the screen enters a smaller window size. I've recorded a Loom here to explain better how you can test this locally, if you need some more context:

https://www.loom.com/share/5537c3fd45b74c4095783ac37fd06f52