diff --git a/public/dasomMain.png b/public/dasomMain.png deleted file mode 100644 index 3c780cf..0000000 Binary files a/public/dasomMain.png and /dev/null differ diff --git a/public/dasomMain.webp b/public/dasomMain.webp new file mode 100644 index 0000000..7849430 Binary files /dev/null and b/public/dasomMain.webp differ diff --git a/public/index.html b/public/index.html index 9419994..647316f 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,6 @@ - {
hero background {/* Particles layer (absolute), outside of Reveal to avoid transform effects */} diff --git a/src/pages/Main.tsx b/src/pages/Main.tsx index bb38c2d..017b2bd 100644 --- a/src/pages/Main.tsx +++ b/src/pages/Main.tsx @@ -1,16 +1,64 @@ -import React from 'react' +import React, { Suspense, lazy, useEffect, useRef, useState } from 'react' import HeroSection from '../components/sections/HeroSection' import CoreValuesSection from '../components/sections/CoreValuesSection' -import ActivitiesSection from '../components/sections/ActivitiesSection' -import RecruitingSection from '../components/sections/RecruitingSection' + +const ActivitiesSection = lazy(() => import('../components/sections/ActivitiesSection')) +const RecruitingSection = lazy(() => import('../components/sections/RecruitingSection')) + +type DeferredSectionProps = { + children: React.ReactNode + minHeight: number +} + +const DeferredSection: React.FC = ({ children, minHeight }) => { + const [shouldRender, setShouldRender] = useState(false) + const containerRef = useRef(null) + + useEffect(() => { + const node = containerRef.current + if (!node || shouldRender) return + + const observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + setShouldRender(true) + observer.disconnect() + } + }) + }, + { rootMargin: '200px 0px' } + ) + + observer.observe(node) + + return () => observer.disconnect() + }, [shouldRender]) + + return ( +
+ {shouldRender ? ( + + ) : ( + + ) +} const Main: React.FC = () => { return (
- - + + + + + +
) } diff --git a/src/pages/intro/IntroCurriculum.tsx b/src/pages/intro/IntroCurriculum.tsx index a4b165c..7860e06 100644 --- a/src/pages/intro/IntroCurriculum.tsx +++ b/src/pages/intro/IntroCurriculum.tsx @@ -47,7 +47,7 @@ const IntroCurriculum: React.FC = () => { key={index} className="bg-[#26262D] flex items-center px-4 sm:px-6 md:px-[54px] w-full max-w-[562px] mx-auto h-auto min-h-[60px] sm:min-h-[72px] py-3 sm:py-0" > - + {String(index + 1).padStart(2, '0')}