/* eslint-disable @next/next/no-img-element */ 'use client'; import { useEffect, useMemo, useRef, useState } from 'react'; import MainLogoSvg from './svgs/mainlogosvg'; export default function Home() { const containerRef = useRef(null); const [currentIndex, setCurrentIndex] = useState(0); // 코스, 공지사항 더미 데이터 const courseCards = useMemo( () => [ { id: 'c1', title: '원자력 운영 기초', meta: 'VOD • 초급 • 4시간 20분', image: 'https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?q=80&w=1200&auto=format&fit=crop', }, { id: 'c2', title: '반도체', meta: 'VOD • 중급 • 3시간 10분', image: 'https://images.unsplash.com/photo-1581092921461-eab62e97a780?q=80&w=1200&auto=format&fit=crop', }, { id: 'c3', title: '방사선 안전', meta: 'VOD • 중급 • 4시간 20분', image: 'https://images.unsplash.com/photo-1581090464777-f3220bbe1b8b?q=80&w=1200&auto=format&fit=crop', }, { id: 'c4', title: '방사선 폐기물', meta: 'VOD • 중급 • 4시간 20분', image: 'https://images.unsplash.com/photo-1581091220351-5a6a4e6f22c1?q=80&w=1200&auto=format&fit=crop', }, { id: 'c5', title: '원자력 운전 개론', meta: 'VOD • 초급 • 3시간 00분', image: 'https://images.unsplash.com/photo-1581090463520-5d09f3c456d2?q=80&w=1200&auto=format&fit=crop', }, { id: 'c6', title: '안전 표지와 표준', meta: 'VOD • 초급 • 2시간 40분', image: 'https://images.unsplash.com/photo-1470167290877-7d5d3446de4c?q=80&w=1200&auto=format&fit=crop', }, { id: 'c7', title: '발전소 운영', meta: 'VOD • 중급 • 4시간 20분', image: 'https://images.unsplash.com/photo-1581092160562-40aa08e78837?q=80&w=1200&auto=format&fit=crop', }, { id: 'c8', title: '방사선 안전 실습', meta: 'VOD • 중급 • 3시간 30분', image: 'https://images.unsplash.com/photo-1581093458791-9d181f5842fd?q=80&w=1200&auto=format&fit=crop', }, { id: 'c9', title: '실험실 안전', meta: 'VOD • 초급 • 2시간 10분', image: 'https://images.unsplash.com/photo-1559757175-08c6d5b3f4b4?q=80&w=1200&auto=format&fit=crop', }, { id: 'c10', title: '기초 장비 운용', meta: 'VOD • 초급 • 2시간 50분', image: 'https://images.unsplash.com/photo-1581092338398-16e5b28a2b13?q=80&w=1200&auto=format&fit=crop', }, ] as Array<{ id: string; title: string; meta: string; image: string }>, [] ); const noticeRows = useMemo( () => [ { id: 5, title: '(공지)시스템 개선이 완료되었...', date: '2025-09-10', views: 1320, writer: '운영팀' }, { id: 4, title: '(공지)서버 점검 안내(9/10 새벽)', date: '2025-09-10', views: 1210, writer: '운영팀' }, { id: 3, title: '(공지)서비스 개선 안내', date: '2025-09-10', views: 1230, writer: '운영팀' }, { id: 2, title: '(공지)시장점검 공지', date: '2025-09-10', views: 1320, writer: '관리자' }, { id: 1, title: '뉴: 봉사시간 안내 및 한눈에 보는 현황 정리', date: '2025-08-28', views: 594, writer: '운영팀' }, ], [] ); // NOTE: 실제 이미지 자산 연결 시 해당 src를 교체하세요. const slides = useMemo( () => [ { id: 1, title: '시스템 점검 안내', description: '11월 10일 새벽 2시~4시 시스템 점검이 진행됩니다.', imageSrc: 'https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?q=80&w=1600&auto=format&fit=crop', }, { id: 2, title: '신규 과정 오픈', description: '최신 커리큘럼으로 업스킬링하세요.', imageSrc: 'https://images.unsplash.com/photo-1550602921-a0d9a4d5b1a9?q=80&w=1600&auto=format&fit=crop', }, { id: 3, title: '수강 이벤트', description: '이번 달 수강 혜택을 확인해보세요.', imageSrc: 'https://images.unsplash.com/photo-1545235617-9465d2a55698?q=80&w=1600&auto=format&fit=crop', }, ], [] ); useEffect(() => { const containerEl = containerRef.current; if (!containerEl) return; const handleScroll = () => { const width = containerEl.clientWidth; const index = Math.round(containerEl.scrollLeft / Math.max(width, 1)); setCurrentIndex(index); }; containerEl.addEventListener('scroll', handleScroll, { passive: true }); return () => { containerEl.removeEventListener('scroll', handleScroll); }; }, []); const scrollToIndex = (index: number) => { const containerEl = containerRef.current; if (!containerEl) return; const clamped = Math.max(0, Math.min(index, slides.length - 1)); const width = containerEl.clientWidth; containerEl.scrollTo({ left: clamped * width, behavior: 'smooth' }); }; const handlePrev = () => scrollToIndex(currentIndex - 1); const handleNext = () => scrollToIndex(currentIndex + 1); return (
{/* 메인 컨테이너 */}
{/* 배너 + 사이드 */}
{/* 배너 */}
{slides.map((slide) => (
{slide.title}
{slide.title}
{slide.description}
))}
{/* 좌/우 내비게이션 버튼 */} {/* 인디케이터 */}
{slides.map((_, idx) => ( ))}
{/* 사이드 패널 (피그마 디자인 적용) */}
{/* 교육 과정 */}

교육 과정

총 28건
전체보기 ›
{courseCards.map((c) => (
{c.title}
{c.title}
{c.meta}
))}
{/* 공지사항 */}

공지사항

총 102건
전체보기 ›
{['번호', '제목', '작성일', '조회수', '작성자'].map((h) => (
{h}
))}
{noticeRows.map((r, idx) => (
{r.id}
{r.title}
{r.date}
{r.views}
{r.writer}
))}
{/* 푸터 */}
); }