Skip to content

Commit 69d0576

Browse files
committed
Update HackathonList component with styled card and FontAwesome icons; upgrade dependencies in package.json and package-lock.json
1 parent 0dc800a commit 69d0576

File tree

3 files changed

+110
-40
lines changed

3 files changed

+110
-40
lines changed

package-lock.json

Lines changed: 17 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"@fortawesome/fontawesome-free": "^6.7.2",
77
"@fortawesome/fontawesome-svg-core": "^6.5.1",
88
"@fortawesome/free-brands-svg-icons": "^6.5.1",
9-
"@fortawesome/free-solid-svg-icons": "^6.5.1",
10-
"@fortawesome/react-fontawesome": "^0.2.0",
9+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
10+
"@fortawesome/react-fontawesome": "^0.2.2",
1111
"@headlessui/react": "^2.2.0",
1212
"@testing-library/jest-dom": "^5.17.0",
1313
"@testing-library/react": "^16.0.1",

src/Page/OpportunitiesHub/HackathonList.jsx

Lines changed: 91 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import React from 'react';
2+
import styled from 'styled-components';
3+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4+
import { faFlag, faMapMarkerAlt, faCalendarAlt } from '@fortawesome/free-solid-svg-icons';
25

36
const hackathons = [
47
{
@@ -76,20 +79,68 @@ const hackathons = [
7679
// ... Add others similarly
7780
];
7881

79-
const HackathonCardComponent = ({
80-
organizer,
81-
title,
82-
location,
83-
date,
84-
domains,
85-
applyLink,
86-
poster, // 👈 Destructure the `poster` prop
87-
}) => {
82+
const StyledHackathonCard = styled.div`
83+
position: relative;
84+
border: 1px solid rgb(182, 228, 250);
85+
background: linear-gradient(to right, rgba(15, 27, 53, 0.44), rgba(0, 43, 62, 0.43));
86+
border-radius: 0.5rem;
87+
overflow: hidden;
88+
transition:
89+
transform 0.3s,
90+
box-shadow 0.3s;
91+
width: 100%;
92+
max-width: 300px;
93+
94+
&:hover {
95+
transform: scale(1.05);
96+
box-shadow: 0 0 20px rgba(0, 172, 255, 0.6);
97+
}
98+
99+
.dot {
100+
width: 5px;
101+
aspect-ratio: 1;
102+
position: absolute;
103+
background-color: #fff;
104+
box-shadow: 0 0 10px #ffffff;
105+
border-radius: 100px;
106+
z-index: 2;
107+
right: 0;
108+
top: 0;
109+
animation: moveDot 6s linear infinite;
110+
}
111+
112+
@keyframes moveDot {
113+
0% {
114+
top: 0;
115+
right: 0;
116+
}
117+
25% {
118+
top: 0;
119+
right: calc(100% - 5px);
120+
}
121+
50% {
122+
top: calc(100% - 5px);
123+
right: calc(100% - 5px);
124+
}
125+
75% {
126+
top: calc(100% - 5px);
127+
right: 0;
128+
}
129+
100% {
130+
top: 0;
131+
right: 0;
132+
}
133+
}
134+
`;
135+
136+
const HackathonCardComponent = ({ organizer, title, location, date, domains, applyLink, poster }) => {
88137
return (
89-
<div className="flex w-72 flex-col justify-between gap-2 rounded-xl border bg-white p-4 shadow-md">
90-
{/* Top Row */}
91-
<div className="flex items-center justify-between">
92-
<span className="text-sm font-semibold text-red-600">🚩 {organizer}</span>
138+
<StyledHackathonCard>
139+
{/* <div className="dot"></div> */}
140+
<div className="flex items-center justify-between p-4">
141+
<span className="text-sm font-semibold text-[#00a6fb]">
142+
<FontAwesomeIcon icon={faFlag} className="mr-1" /> {organizer}
143+
</span>
93144
<a
94145
href={applyLink}
95146
target="_blank"
@@ -100,37 +151,49 @@ const HackathonCardComponent = ({
100151
</a>
101152
</div>
102153

103-
{/* Poster Image */}
104-
<div className="h-32 w-full overflow-hidden rounded-lg">
154+
<div className="h-40 w-full overflow-hidden rounded-xl p-2 shadow-md">
105155
<img
106156
src={poster}
107157
alt={`${title} Poster`}
108-
className="h-full w-full object-cover"
158+
className="h-full w-full rounded-lg object-cover"
109159
onError={(e) => {
110160
e.target.onerror = null;
111-
e.target.src = '/images/default.png'; // fallback image
161+
e.target.src = '/images/default.png';
112162
}}
113163
/>
114164
</div>
115165

116-
{/* Title */}
117-
<h2 className="mt-2 text-lg font-bold">{title}</h2>
166+
<h2 className="mt-2 p-4 text-center text-lg font-bold text-white">{title}</h2>
118167

119-
{/* Location + Date */}
120-
<div className="flex justify-between text-sm text-gray-600">
121-
<span>📍 {location}</span>
122-
<span>📅 {date}</span>
168+
<div className="flex justify-between p-4 text-sm text-gray-600">
169+
<span>
170+
<FontAwesomeIcon icon={faMapMarkerAlt} /> {location}
171+
</span>
172+
<span>
173+
<FontAwesomeIcon icon={faCalendarAlt} /> {date}
174+
</span>
123175
</div>
124176

125-
{/* Domains/Tags */}
126-
<div className="mt-2 flex flex-wrap gap-2">
177+
{/* <div className="text-sm text-gray-600 p-4">
178+
<div className="mb-2">
179+
<FontAwesomeIcon icon={faMapMarkerAlt} /> {location}
180+
</div>
181+
<div>
182+
<FontAwesomeIcon icon={faCalendarAlt} /> {date}
183+
</div>
184+
</div> */}
185+
186+
<div className="mt-2 flex flex-wrap gap-2 p-4">
127187
{domains.map((domain, idx) => (
128-
<span key={idx} className="rounded-full border border-gray-300 bg-gray-100 px-2 py-1 text-xs">
129-
{domain}
188+
<span
189+
key={idx}
190+
className="bg-gray-1000 rounded-full border border-[#00a6fb] px-2 py-1 text-xs text-gray-300"
191+
>
192+
{domain}
130193
</span>
131194
))}
132195
</div>
133-
</div>
196+
</StyledHackathonCard>
134197
);
135198
};
136199

0 commit comments

Comments
 (0)