diff --git a/app/components/About.tsx b/app/components/About.tsx index 306b85e..0db4a66 100644 --- a/app/components/About.tsx +++ b/app/components/About.tsx @@ -1,6 +1,5 @@ "use client"; -import { useState, useEffect } from "react"; import { motion, Variants } from "framer-motion"; import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb } from "lucide-react"; @@ -16,24 +15,18 @@ const staggerContainer: Variants = { }; const fadeInUp: Variants = { - hidden: { opacity: 0, y: 30 }, + hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { - duration: 1, + duration: 0.5, ease: [0.25, 0.1, 0.25, 1], }, }, }; const About = () => { - const [mounted, setMounted] = useState(false); - - useEffect(() => { - setMounted(true); - }, []); - const techStack = [ { category: "Frontend & Mobile", @@ -64,8 +57,6 @@ const About = () => { { icon: Activity, text: "Jogging to clear my mind and stay active" }, ]; - if (!mounted) return null; - return (
{
{/* Section Header */}

@@ -173,10 +173,10 @@ const Contact = () => {
{/* Contact Information */}
@@ -196,12 +196,12 @@ const Contact = () => { { {/* Contact Form */}

diff --git a/app/components/Footer.tsx b/app/components/Footer.tsx index edf55b4..953feaa 100644 --- a/app/components/Footer.tsx +++ b/app/components/Footer.tsx @@ -30,10 +30,10 @@ const Footer = () => {
{/* Brand */} { {/* Social Links */} {socialLinks.map((social) => ( @@ -77,10 +77,10 @@ const Footer = () => { {/* Copyright */} © {currentYear} @@ -96,10 +96,10 @@ const Footer = () => { {/* Legal Links */}
diff --git a/app/components/Header.tsx b/app/components/Header.tsx index 1957cbf..ec7059e 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -12,7 +12,10 @@ const Header = () => { const [mounted, setMounted] = useState(false); useEffect(() => { - setMounted(true); + // Use requestAnimationFrame to ensure smooth transition + requestAnimationFrame(() => { + setMounted(true); + }); }, []); useEffect(() => { @@ -41,17 +44,16 @@ const Header = () => { { icon: Mail, href: "mailto:contact@dk0.dev", label: "Email" }, ]; - if (!mounted) { - return null; - } + // Always render to prevent flash, but use opacity transition return ( <>
{ }`} > { - const [mounted, setMounted] = useState(false); - - useEffect(() => { - setMounted(true); - }, []); - const features = [ { icon: Code, text: "Next.js & Flutter" }, { icon: Zap, text: "Docker Swarm & CI/CD" }, { icon: Rocket, text: "Self-Hosted Infrastructure" }, ]; - if (!mounted) { - return null; - } - return (
@@ -29,7 +18,7 @@ const Hero = () => {
@@ -111,7 +100,7 @@ const Hero = () => {
@@ -123,7 +112,7 @@ const Hero = () => { @@ -132,7 +121,7 @@ const Hero = () => { @@ -145,7 +134,7 @@ const Hero = () => {

@@ -160,7 +149,7 @@ const Hero = () => { Student and passionate{" "} @@ -182,7 +171,7 @@ const Hero = () => { {features.map((feature, index) => ( @@ -191,8 +180,8 @@ const Hero = () => { initial={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} transition={{ - duration: 0.8, - delay: 1.3 + index * 0.15, + duration: 0.5, + delay: 0.5 + index * 0.1, ease: [0.25, 0.1, 0.25, 1], }} whileHover={{ scale: 1.03, y: -3 }} @@ -210,7 +199,7 @@ const Hero = () => { { - const [mounted, setMounted] = useState(false); const [projects, setProjects] = useState([]); useEffect(() => { - setMounted(true); const loadProjects = async () => { try { const response = await fetch( @@ -58,7 +56,7 @@ const Projects = () => { const data = await response.json(); setProjects(data.projects || []); } - } catch (error) { + } catch (error) { if (process.env.NODE_ENV === "development") { console.error("Error loading projects:", error); } @@ -67,8 +65,6 @@ const Projects = () => { loadProjects(); }, []); - if (!mounted) return null; - return (
{ @@ -94,7 +90,7 @@ const Projects = () => {