/** * 모드팩 페이지 - GitHub Release 스타일 */ import React, { useState } from 'react'; import { Download, Package, ChevronDown, ChevronUp, Calendar, HardDrive, Gamepad2, Box, Image } from 'lucide-react'; import { motion, AnimatePresence } from 'framer-motion'; // 더미 데이터 const DUMMY_MODPACKS = [ { id: 1, version: '1.2.0', name: '테스트 서버 모드팩', minecraftVersion: '1.21.1', modLoader: 'NeoForge', modLoaderVersion: '21.1.213', changelog: `### 새로운 기능 - Create 모드 추가 - JEI (Just Enough Items) 추가 - Jade 모드 추가 ### 버그 수정 - 일부 텍스처 누락 문제 해결`, fileSize: 15728640, // 15MB downloadCount: 42, createdAt: '2024-12-20T10:30:00Z', contents: { mods: [ { name: 'Create', version: '0.5.1' }, { name: 'Just Enough Items', version: '15.2.0' }, { name: 'Jade', version: '11.7.1' }, { name: 'JourneyMap', version: '5.9.18' }, { name: 'Sodium', version: '0.5.8' }, ], resourcepacks: [ { name: 'Faithful 32x', version: '1.21' }, ], shaderpacks: [ { name: 'Complementary Shaders', version: '5.2.1' }, { name: 'BSL Shaders', version: '8.2.09' }, ], }, }, { id: 2, version: '1.1.0', name: '테스트 서버 모드팩', minecraftVersion: '1.21.1', modLoader: 'NeoForge', modLoaderVersion: '21.1.200', changelog: `### 변경사항 - JourneyMap 추가 - Sodium 성능 모드 추가`, fileSize: 12582912, // 12MB downloadCount: 128, createdAt: '2024-12-15T14:00:00Z', contents: { mods: [ { name: 'Just Enough Items', version: '15.1.0' }, { name: 'JourneyMap', version: '5.9.17' }, { name: 'Sodium', version: '0.5.7' }, ], resourcepacks: [], shaderpacks: [], }, }, { id: 3, version: '1.0.0', name: '테스트 서버 모드팩', minecraftVersion: '1.21.1', modLoader: 'NeoForge', modLoaderVersion: '21.1.180', changelog: `### 최초 릴리즈 - 기본 모드 구성`, fileSize: 8388608, // 8MB downloadCount: 256, createdAt: '2024-12-01T09:00:00Z', contents: { mods: [ { name: 'Just Enough Items', version: '15.0.0' }, ], resourcepacks: [], shaderpacks: [], }, }, ]; // 파일 크기 포맷 const formatFileSize = (bytes) => { if (bytes < 1024) return `${bytes} B`; if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`; if (bytes < 1073741824) return `${(bytes / 1048576).toFixed(1)} MB`; return `${(bytes / 1073741824).toFixed(2)} GB`; }; // 날짜 포맷 const formatDate = (dateString) => { const date = new Date(dateString); return date.toLocaleDateString('ko-KR', { year: 'numeric', month: 'long', day: 'numeric', }); }; // 모드팩 카드 컴포넌트 const ModpackCard = ({ modpack, isLatest }) => { const [showChangelog, setShowChangelog] = useState(isLatest); const [showContents, setShowContents] = useState(false); const totalMods = modpack.contents.mods.length; const totalResourcepacks = modpack.contents.resourcepacks.length; const totalShaderpacks = modpack.contents.shaderpacks.length; return (
{/* 헤더 */}

v{modpack.version}

{isLatest && ( 최신 )}

{modpack.name}

{/* 다운로드 버튼 */}
{/* 메타 정보 */}
MC {modpack.minecraftVersion}
{modpack.modLoader} {modpack.modLoaderVersion}
{formatFileSize(modpack.fileSize)}
{formatDate(modpack.createdAt)}
{/* 포함 콘텐츠 요약 */}
{totalMods > 0 && ( 모드 {totalMods}개 )} {totalResourcepacks > 0 && ( 리소스팩 {totalResourcepacks}개 )} {totalShaderpacks > 0 && ( 셰이더 {totalShaderpacks}개 )}
{/* 변경 로그 토글 */} {/* 변경 로그 내용 */} {showChangelog && (
{modpack.changelog.split('\n').map((line, i) => { if (line.startsWith('###')) { return

{line.replace('### ', '')}

; } if (line.startsWith('- ')) { return

• {line.replace('- ', '')}

; } return null; })}
)}
{/* 포함 콘텐츠 토글 */} {/* 포함 콘텐츠 내용 */} {showContents && (
{/* 모드 */} {modpack.contents.mods.length > 0 && (

모드

{modpack.contents.mods.map((mod, i) => (
{mod.name} {mod.version}
))}
)} {/* 리소스팩 */} {modpack.contents.resourcepacks.length > 0 && (

리소스팩

{modpack.contents.resourcepacks.map((pack, i) => (
{pack.name} {pack.version}
))}
)} {/* 셰이더 */} {modpack.contents.shaderpacks.length > 0 && (

셰이더

{modpack.contents.shaderpacks.map((shader, i) => (
{shader.name} {shader.version}
))}
)}
)}
); }; export default function Modpack() { const modpacks = DUMMY_MODPACKS; return (
{/* 헤더 */}

모드팩

서버 접속에 필요한 모드팩을 다운로드하세요

{/* 모드팩 목록 */}
{modpacks.map((modpack, index) => ( ))}
{/* 빈 상태 (모드팩이 없을 때) */} {modpacks.length === 0 && (

등록된 모드팩이 없습니다

)}
); }