|
|
@@ -0,0 +1,62 @@
|
|
|
+import React, {useState, useEffect} from 'react';
|
|
|
+
|
|
|
+const images = [
|
|
|
+ '/hero.jpg',
|
|
|
+ // '/hero2.png',
|
|
|
+ '/hero.jpg',
|
|
|
+];
|
|
|
+
|
|
|
+const Hero = () => {
|
|
|
+ const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ const timer = setInterval(() => {
|
|
|
+ setCurrentImageIndex((prevIndex) =>
|
|
|
+ prevIndex === images.length - 1 ? 0 : prevIndex + 1
|
|
|
+ );
|
|
|
+ }, 5000);
|
|
|
+
|
|
|
+ return () => clearInterval(timer);
|
|
|
+ }, [currentImageIndex]);
|
|
|
+
|
|
|
+ const handleDotClick = (index) => {
|
|
|
+ setCurrentImageIndex(index);
|
|
|
+ };
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div
|
|
|
+ style={{backgroundImage: `url(${images[currentImageIndex]})`}}
|
|
|
+ className={`bg-cover bg-center w-full h-[747px] px-20 py-14 inline-flex flex-col justify-center items-center gap-20 overflow-hidden transition-all duration-500`}>
|
|
|
+ <div
|
|
|
+ className="px-2.5 pt-20 pb-2.5 flex flex-col justify-start items-start gap-8 overflow-hidden">
|
|
|
+ <div
|
|
|
+ className="text-center justify-center text-white text-6xl font-semibold font-['Inter']">스마트
|
|
|
+ 네트워크 리더 반도산전
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ className="self-stretch text-center justify-start text-zinc-100 text-xl font-normal font-['Inter']">부·울·경
|
|
|
+ 시공능력평가 1위를 넘어 대한민국 시공능력평가 1위로 도약합니다.<br/>고객의 스마트 네트워크 산업을 더욱 가치있게 만들어 나갑니다.
|
|
|
+ </div>
|
|
|
+ <div className="self-stretch p-2.5 inline-flex justify-center items-center gap-4 overflow-hidden">
|
|
|
+ <div
|
|
|
+ className="w-44 px-8 py-3 outline outline-offset-[-0.50px] outline-white flex justify-center items-center overflow-hidden">
|
|
|
+ <div
|
|
|
+ className="w-28 text-center justify-start text-white text-base font-semibold font-['Inter']">ABOUT
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="w-[846px] h-6 p-2.5 inline-flex justify-center items-center gap-2 overflow-hidden">
|
|
|
+ {images.map((_, index) => (
|
|
|
+ <div
|
|
|
+ key={index}
|
|
|
+ onClick={() => handleDotClick(index)}
|
|
|
+ className={`w-2 h-2 relative select-none ${index === currentImageIndex ? 'bg-white' : 'bg-white/50'} rounded cursor-pointer`}
|
|
|
+ />
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default Hero;
|