Skip to content

Commit f18d91b

Browse files
7oSkaaacursoragent
andcommitted
Fix invisible session cards and add YouTube section to home page.
Cards were stuck at opacity 0 because slideUp keyframes were missing from the CSS bundle; also strengthened card backgrounds and surfaced all channel videos on the homepage. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7c936cb commit f18d91b

6 files changed

Lines changed: 88 additions & 16 deletions

File tree

website/src/components/Hero.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,16 @@ export default function Hero() {
3838
videos, problem sheets, articles, and everything you need to level up.
3939
</p>
4040
<div className="mt-8 flex flex-wrap gap-4">
41-
<a href="#sessions" className="btn-primary">
41+
<a href="#youtube-sessions" className="btn-primary">
42+
<Play className="h-4 w-4" />
43+
YouTube Sessions
44+
</a>
45+
<a href="#sessions" className="btn-ghost">
4246
Browse Sessions
4347
<ArrowRight className="h-4 w-4" />
4448
</a>
4549
<Link to="/youtube" className="btn-ghost">
46-
<Play className="h-4 w-4 text-red-400" />
47-
Watch on YouTube
50+
All Videos
4851
</Link>
4952
</div>
5053
</div>

website/src/components/SessionCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function SessionCard({ session }: SessionCardProps) {
5959
</span>
6060
</div>
6161

62-
<div className="mt-4 flex items-center gap-1 text-sm font-medium text-accent-light opacity-0 transition-opacity group-hover:opacity-100">
62+
<div className="mt-4 flex items-center gap-1 text-sm font-medium text-accent-light">
6363
View session
6464
<ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-1" />
6565
</div>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { Link } from "react-router-dom";
2+
import { ArrowRight, ExternalLink } from "lucide-react";
3+
import YouTubeCard from "@/components/YouTubeCard";
4+
import siteData from "@/data/site-data.json";
5+
import type { SiteData } from "@/types";
6+
7+
const data = siteData as SiteData;
8+
9+
export default function YouTubeSection() {
10+
const videos = data.youtubeVideos;
11+
12+
if (videos.length === 0) return null;
13+
14+
return (
15+
<section
16+
id="youtube-sessions"
17+
className="mx-auto max-w-7xl px-4 py-16 sm:px-6 lg:px-8"
18+
>
19+
<div className="mb-8 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
20+
<div>
21+
<p className="text-sm font-medium uppercase tracking-wider text-red-400">
22+
@7oSkaa on YouTube
23+
</p>
24+
<h2 className="section-heading mt-1">YouTube Sessions</h2>
25+
<p className="mt-2 max-w-xl text-slate-400">
26+
Watch CP Circus and session recordings on Ahmed Hossam&apos;s channel.
27+
</p>
28+
</div>
29+
<div className="flex flex-wrap gap-3">
30+
<Link to="/youtube" className="btn-ghost">
31+
View all {videos.length} videos
32+
<ArrowRight className="h-4 w-4" />
33+
</Link>
34+
<a
35+
href={data.config.youtubeChannel}
36+
target="_blank"
37+
rel="noopener noreferrer"
38+
className="btn-primary"
39+
>
40+
Open Channel
41+
<ExternalLink className="h-4 w-4" />
42+
</a>
43+
</div>
44+
</div>
45+
46+
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
47+
{videos.map((video) => (
48+
<YouTubeCard key={video.id} video={video} />
49+
))}
50+
</div>
51+
</section>
52+
);
53+
}

website/src/index.css

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838

3939
@layer components {
4040
.glass {
41-
@apply border border-white/10 bg-white/5 backdrop-blur-xl;
41+
@apply border border-white/10 bg-surface-raised/90 backdrop-blur-xl;
4242
}
4343

4444
.glass-hover {
45-
@apply glass transition-all duration-300 hover:border-accent/30 hover:bg-white/[0.07] hover:shadow-lg hover:shadow-accent/5;
45+
@apply border border-white/10 bg-surface-raised shadow-lg shadow-black/25 transition-all duration-300 hover:border-accent/40 hover:bg-surface-overlay hover:shadow-xl hover:shadow-accent/10;
4646
}
4747

4848
.gradient-text {
@@ -67,15 +67,26 @@
6767
}
6868

6969
@layer utilities {
70+
@keyframes slideUp {
71+
from {
72+
opacity: 0;
73+
transform: translateY(16px);
74+
}
75+
to {
76+
opacity: 1;
77+
transform: translateY(0);
78+
}
79+
}
80+
7081
.animate-stagger > * {
71-
animation: slideUp 0.5s ease-out forwards;
72-
opacity: 0;
82+
animation: slideUp 0.45s ease-out forwards;
7383
}
7484

75-
.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
76-
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
77-
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
78-
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
79-
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
80-
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }
85+
.animate-stagger > *:nth-child(1) { animation-delay: 0.03s; }
86+
.animate-stagger > *:nth-child(2) { animation-delay: 0.06s; }
87+
.animate-stagger > *:nth-child(3) { animation-delay: 0.09s; }
88+
.animate-stagger > *:nth-child(4) { animation-delay: 0.12s; }
89+
.animate-stagger > *:nth-child(5) { animation-delay: 0.15s; }
90+
.animate-stagger > *:nth-child(6) { animation-delay: 0.18s; }
91+
.animate-stagger > *:nth-child(n + 7) { animation-delay: 0.21s; }
8192
}

website/src/lib/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ export function getPrimaryVideos(links: ResourceLink[]): ResourceLink[] {
267267
}
268268

269269
export function formatDate(iso: string): string {
270-
return new Date(iso).toLocaleDateString("en-US", {
270+
if (!iso) return "Session recording";
271+
const date = new Date(iso);
272+
if (Number.isNaN(date.getTime())) return "Session recording";
273+
return date.toLocaleDateString("en-US", {
271274
year: "numeric",
272275
month: "short",
273276
day: "numeric",

website/src/pages/HomePage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useMemo, useState } from "react";
22
import Hero from "@/components/Hero";
3+
import YouTubeSection from "@/components/YouTubeSection";
34
import SearchBar from "@/components/SearchBar";
45
import CategoryFilter from "@/components/CategoryFilter";
56
import SessionCard from "@/components/SessionCard";
@@ -49,8 +50,9 @@ export default function HomePage() {
4950
return (
5051
<>
5152
<Hero />
53+
<YouTubeSection />
5254

53-
<section id="sessions" className="mx-auto max-w-7xl px-4 pb-24 sm:px-6 lg:px-8">
55+
<section id="sessions" className="mx-auto max-w-7xl border-t border-white/5 px-4 pb-24 pt-16 sm:px-6 lg:px-8">
5456
<div className="mb-8 space-y-6">
5557
<div>
5658
<h2 className="section-heading">All Sessions</h2>

0 commit comments

Comments
 (0)