Files
techzaa-frontend/src/components/ProjectsSection.tsx
T

102 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-04-30 22:36:40 +06:00
import { Button } from "@/components/ui/button";
import { useProjects } from "@/hooks/queires/useProjects";
import { motion, useInView } from "framer-motion";
import { ArrowRight } from "lucide-react";
import { useRef } from "react";
2026-04-30 22:36:40 +06:00
import { Link } from "react-router-dom";
import { ProjectCard } from "./ProjectCard";
const gradientColors = [
2026-04-30 22:36:40 +06:00
"from-neon-blue/90",
"from-neon-purple/90",
"from-neon-green/90",
"from-neon-pink/90",
2026-03-30 20:20:21 +06:00
];
export default function ProjectsSection() {
const { data: projectsData } = useProjects({
2026-04-30 22:36:40 +06:00
fields: "category, title, image, liveUrl",
limit: 6,
});
2026-04-30 22:36:40 +06:00
const projects = projectsData?.data.data.result || [];
2026-03-30 20:20:21 +06:00
const ref = useRef<HTMLElement>(null);
2026-04-30 22:36:40 +06:00
const isInView = useInView(ref, { once: true, margin: "-100px" });
2026-03-30 20:20:21 +06:00
return (
2026-04-30 22:36:40 +06:00
<section
id="projects"
ref={ref}
className="py-24 relative overflow-hidden bg-secondary/30"
>
{/* Background Pattern */}
2026-03-30 20:20:21 +06:00
<div className="absolute inset-0 opacity-5">
2026-04-30 22:36:40 +06:00
<div
className="absolute inset-0"
style={{
backgroundImage: `radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)`,
backgroundSize: "40px 40px",
}}
/>
2026-03-30 20:20:21 +06:00
</div>
<div className="container mx-auto px-4 relative z-10">
{/* Section Header */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={isInView ? { opacity: 1, y: 0 } : {}}
2026-04-30 22:36:40 +06:00
transition={{ duration: 0.7 }}
className="text-center mb-20"
2026-03-30 20:20:21 +06:00
>
2026-04-30 22:36:40 +06:00
<span className="inline-block px-5 py-2 rounded-full glass text-sm font-medium text-primary mb-4 tracking-widest">
OUR PORTFOLIO
2026-03-30 20:20:21 +06:00
</span>
2026-04-30 22:36:40 +06:00
<h2 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6">
Featured{" "}
<span className="text-primary neon-text-glow">Projects</span>
2026-03-30 20:20:21 +06:00
</h2>
<p className="text-muted-foreground max-w-2xl mx-auto text-lg">
2026-04-30 22:36:40 +06:00
Crafted with passion. Delivered with excellence.
2026-03-30 20:20:21 +06:00
</p>
</motion.div>
{/* Projects Grid */}
2026-04-30 22:36:40 +06:00
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8 mb-16">
{projects.map((project, index) => {
const color = gradientColors[index % gradientColors.length];
return (
2026-04-30 22:36:40 +06:00
<ProjectCard
key={project._id}
2026-04-30 22:36:40 +06:00
project={project}
color={color}
index={index}
isInView={isInView}
/>
);
})}
2026-03-30 20:20:21 +06:00
</div>
{/* See All Button */}
<motion.div
2026-04-30 22:36:40 +06:00
initial={{ opacity: 0, y: 30 }}
2026-03-30 20:20:21 +06:00
animate={isInView ? { opacity: 1, y: 0 } : {}}
2026-04-30 22:36:40 +06:00
transition={{ duration: 0.7, delay: 0.3 }}
className="flex justify-center"
2026-03-30 20:20:21 +06:00
>
<Link to="/projects">
<Button
size="lg"
2026-04-30 22:36:40 +06:00
className="bg-primary hover:bg-primary/90 text-primary-foreground font-semibold px-10 py-7 text-lg rounded-full neon-glow hover:neon-glow-strong transition-all group flex items-center gap-3"
2026-03-30 20:20:21 +06:00
>
2026-04-30 22:36:40 +06:00
Explore All Projects
<ArrowRight className="w-6 h-6 group-hover:translate-x-1 transition-transform" />
2026-03-30 20:20:21 +06:00
</Button>
</Link>
</motion.div>
</div>
</section>
);
}