Skip to content

Commit 580e244

Browse files
committed
Implement Video section and style Skills cards
1 parent ed70b27 commit 580e244

7 files changed

Lines changed: 77 additions & 5 deletions

File tree

content/videos/videoq.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"id": "8tDqHPajY8o",
4+
"title": "KiCad 9 Tutorial for Beginners | Learn PCB Design Step by Step",
5+
"description": "Learn PCB Design Step by Step with KiCad 9.",
6+
"videoUrl": "https://www.youtube.com/embed/8tDqHPajY8o"
7+
},
8+
{
9+
"id": "eruujRirdkI",
10+
"title": "Top 8 Best KiCad 9 Plugins for Beginners | Boost Your PCB Design Workflow in 2026",
11+
"description": "Boost Your PCB Design Workflow with these top KiCad plugins.",
12+
"videoUrl": "https://www.youtube.com/embed/eruujRirdkI"
13+
}
14+
]

src/app/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@ import Hero from '@/components/Hero/Hero'
33
import ProjectSection from '@/components/Projects/ProjectSection'
44
import ServiceSection from '@/components/Services/ServiceSection'
55
import TestimonialSection from '@/components/Testimonials/TestimonialSection'
6-
import { getAllProjects, getAllTestimonials } from '@/services'
6+
import VideoSection from '@/components/Videos/VideoSection'
7+
import { getAllProjects, getAllTestimonials, getVideos } from '@/services'
78

89
export default async function Home() {
910
const projects = await getAllProjects()
1011
const testimonials = await getAllTestimonials()
12+
const videos = await getVideos()
1113

1214
return (
1315
<main>
1416
<Hero />
1517
<div className="mx-auto my-8 max-w-[1200px] px-4 md:my-[3.75rem]">
1618
<ProjectSection projects={projects} />
19+
<VideoSection videos={videos} />
1720
<ServiceSection />
1821
{/* <TestimonialSection testimonials={testimonials} /> */}
1922
<ContactSection />

src/components/Navbar/Navbar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const navItems = [
1515
label: 'PROJECTS',
1616
href: '/#projects',
1717
},
18+
{
19+
label: 'VIDEO',
20+
href: '/#videos',
21+
},
1822
{
1923
label: 'SKILLS',
2024
href: '/#skills',

src/components/Services/ServiceCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const ServiceCard: React.FC<ServiceCardTypes> = ({ title, shortDescription, icon
1111
<div className="bg-secondary border-border flex flex-col items-center rounded-[14px] border p-5">
1212
<Image src={icon} alt={title} className="my-1 size-14" />
1313
<h5 className="text-accent mt-2 mb-5 text-center text-base font-semibold">{title}</h5>
14-
<div className="bg-primary rounded-2xl p-4">
15-
<p className="text-primary-content text-center text-sm font-normal">{shortDescription}</p>
14+
<div className="bg-primary text-primary-content my-4 h-[80px] w-full overflow-scroll rounded-2xl px-4 py-2">
15+
<p className="text-center text-[14px] font-normal md:text-base">{shortDescription}</p>
1616
</div>
1717
</div>
1818
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Video } from '@/lib/types'
2+
import SectionHeading from '../SectionHeading/SectionHeading'
3+
4+
const VideoSection = ({ videos }: { videos: Video[] }) => {
5+
return (
6+
<section id="videos" className="mb-24 scroll-mt-24">
7+
<SectionHeading title="Videos" subtitle="My Recent Videos" />
8+
<div className="my-8 grid grid-cols-1 gap-8 md:my-12 md:grid-cols-2">
9+
{videos.map((video) => (
10+
<div
11+
key={video.id}
12+
className="border-border bg-secondary flex flex-col gap-4 rounded-2xl border p-4 transition-all duration-300 hover:border-accent">
13+
<div className="relative aspect-video w-full overflow-hidden rounded-xl">
14+
<iframe
15+
src={`https://www.youtube.com/embed/${video.id}`}
16+
title={video.title}
17+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
18+
allowFullScreen
19+
className="absolute top-0 left-0 h-full w-full border-0"
20+
/>
21+
</div>
22+
<div className="flex flex-col gap-2 p-2">
23+
<h3 className="text-secondary-content text-xl font-bold">{video.title}</h3>
24+
<p className="text-neutral font-light">{video.description}</p>
25+
</div>
26+
</div>
27+
))}
28+
</div>
29+
</section>
30+
)
31+
}
32+
33+
export default VideoSection

src/lib/types.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ export interface Heading {
2929
items: Heading[]
3030
}
3131

32+
export interface Video {
33+
id: string
34+
title: string
35+
description: string
36+
videoUrl: string
37+
}
38+
3239
export interface Testimonial {
3340
name: string
3441
title?: string

src/services/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Project, Testimonial } from '@/lib/types'
1+
import { Project, Testimonial, Video } from '@/lib/types'
22
import { promises as fs } from 'fs'
33
import path from 'path'
44

@@ -62,4 +62,15 @@ const getProjectBySlug = async (slug: string): Promise<Project | undefined> => {
6262
return projects.find((project) => project.slug === slug)
6363
}
6464

65-
export { getAllProjects, getAllTestimonials, getProjectBySlug }
65+
const getVideos = async (): Promise<Video[]> => {
66+
try {
67+
const filePath = path.join(process.cwd(), '/content/videos/videoq.json')
68+
const fileContent = await fs.readFile(filePath, 'utf8')
69+
return JSON.parse(fileContent)
70+
} catch (error) {
71+
console.error('Error fetching videos:', error)
72+
return []
73+
}
74+
}
75+
76+
export { getAllProjects, getAllTestimonials, getProjectBySlug, getVideos }

0 commit comments

Comments
 (0)