Skip to content

Commit 1a712ff

Browse files
authored
feat: new card for hackathon (#495)
* feat: new card for hackathon * fix: changed to correct status * fix: update the ogr button
1 parent d536c43 commit 1a712ff

11 files changed

Lines changed: 273 additions & 349 deletions

File tree

app/(landing)/hackathons/preview/[orgId]/[draftId]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@ export default function DraftPreviewPage({ params }: PreviewPageProps) {
9595
resolvedParams.orgId,
9696
resolvedParams.draftId
9797
);
98-
let organizationData = { name: '', logo: '' };
98+
let organizationData = { name: '', logo: '', slug: '' };
9999
try {
100100
const orgRes = await getOrganization(resolvedParams.orgId);
101101
if (orgRes) {
102102
organizationData = {
103103
name: orgRes.name,
104104
logo: orgRes.logo || '',
105+
slug: orgRes.slug || '',
105106
};
106107
}
107108
} catch (orgErr) {
@@ -130,6 +131,7 @@ export default function DraftPreviewPage({ params }: PreviewPageProps) {
130131
id: resolvedParams.orgId,
131132
name: organizationData.name,
132133
logo: organizationData.logo,
134+
slug: organizationData.slug,
133135
},
134136

135137
status: 'DRAFT',

components/avatars/GroupAvatar.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@ const GroupAvatar = ({ members }: GroupAvatarProps) => {
1919
return (
2020
<AvatarGroup>
2121
{visibleMembers.map((member, index) => (
22-
<Avatar
23-
key={index}
24-
className='size-8 border-2 border-[#141517] sm:size-10'
25-
>
22+
<Avatar key={index} className='size-8 border-none! sm:size-6'>
2623
<AvatarImage src={member} alt={`Member ${index + 1}`} />
2724
<AvatarFallback className='bg-[#1E2329] text-[10px] text-white'>
2825
{member.slice(0, 2).toUpperCase()}
2926
</AvatarFallback>
3027
</Avatar>
3128
))}
3229
{remainingCount > 0 && (
33-
<AvatarGroupCount className='size-8 bg-[#1E2329] text-xs font-bold text-gray-400 ring-2 ring-[#141517] sm:size-10 sm:text-sm'>
30+
<AvatarGroupCount className='bg-background text-foreground ring-border size-8 text-xs font-bold ring-2 sm:size-6 sm:text-xs'>
3431
+{remainingCount}
3532
</AvatarGroupCount>
3633
)}

components/hackathons/HackathonsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import React, { useState } from 'react';
4-
import HackathonCard from '@/components/landing-page/hackathon/HackathonCard';
4+
import { HackathonCard } from '@/components/landing-page/hackathon/HackathonCard';
55
import HackathonsFiltersHeader from '@/components/hackathons/HackathonsFiltersHeader';
66
import LoadingSpinner from '@/components/LoadingSpinner';
77
import { useHackathonFilters } from '@/hooks/hackathon/use-hackathon-filters';

components/landing-page/Explore.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { cn } from '@/lib/utils';
44
import { ArrowRight } from 'lucide-react';
55
import Image from 'next/image';
66
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
7-
import HackathonCard from './hackathon/HackathonCard';
7+
import { HackathonCard } from './hackathon/HackathonCard';
88
import Link from 'next/link';
99
import { getPublicHackathonsList } from '@/lib/api/hackathons';
1010
import type { Hackathon } from '@/lib/api/hackathons';

components/landing-page/Hero2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from '../ui/shadcn-io/cursor';
1111
import Image from 'next/image';
1212
import { BoundlessButton } from '../buttons';
13-
import HackathonCard from '@/components/landing-page/hackathon/HackathonCard';
13+
import { HackathonCard } from '@/components/landing-page/hackathon/HackathonCard';
1414
import ProjectCard from '@/features/projects/components/ProjectCard';
1515
import { Crowdfunding } from '@/features/projects/types';
1616

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use client';
2+
3+
import { useRef } from 'react';
4+
import { gsap } from 'gsap';
5+
import { useGSAP } from '@gsap/react';
6+
import { Users } from 'lucide-react';
7+
8+
// Register the hook to prevent React strict-mode double-firing issues
9+
gsap.registerPlugin(useGSAP);
10+
11+
export default function AnimatedUsersButton() {
12+
const usersIconRef = useRef<SVGSVGElement>(null);
13+
14+
// 1. Mount Animation: Slides the background user in when the page loads
15+
useGSAP(
16+
() => {
17+
if (!usersIconRef.current) return;
18+
19+
// Selects elements inside this specific SVG
20+
const q = gsap.utils.selector(usersIconRef);
21+
22+
// Target the elements making up the background person
23+
// (Lucide draws the foreground person first, so the last path/circle belong to the background)
24+
gsap.from(q('path:last-of-type, circle:last-of-type'), {
25+
x: 10,
26+
opacity: 0,
27+
duration: 0.6,
28+
ease: 'back.out(1.5)',
29+
delay: 0.1, // Slight delay so it feels natural after the page loads
30+
});
31+
},
32+
{ scope: usersIconRef }
33+
);
34+
35+
// 2. Hover Animation: Makes both users "bounce" sequentially
36+
const handleMouseEnter = () => {
37+
if (!usersIconRef.current) return;
38+
39+
// Grab all the individual paths and circles inside the SVG
40+
const svgParts = usersIconRef.current.children;
41+
42+
gsap.to(svgParts, {
43+
y: -3,
44+
duration: 0.2,
45+
stagger: 0.05,
46+
yoyo: true,
47+
repeat: 1,
48+
ease: 'power2.out',
49+
transformOrigin: 'bottom center',
50+
});
51+
};
52+
53+
return (
54+
<button
55+
onMouseEnter={handleMouseEnter}
56+
className='group flex w-fit items-center gap-3 rounded-xl border border-neutral-800 bg-neutral-900 px-5 py-3 text-neutral-300 transition-colors hover:border-blue-500/50 hover:bg-neutral-800 hover:text-white'
57+
>
58+
<Users ref={usersIconRef} className='size-5 text-blue-400' />
59+
<span className='text-sm font-medium'>View Participants</span>
60+
</button>
61+
);
62+
}

0 commit comments

Comments
 (0)