diff --git a/src/components/DownloadSection.css b/src/components/DownloadSection.css index f71dbdb..887f654 100644 --- a/src/components/DownloadSection.css +++ b/src/components/DownloadSection.css @@ -44,6 +44,26 @@ transform: none; } +.btn-launcher-download { + display: inline-block; + margin-left: 12px; + padding: 18px 32px; + background: transparent; + color: #BACDB0; + border: 1px solid rgba(186, 205, 176, 0.4); + border-radius: 8px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: background 0.2s, transform 0.15s; + letter-spacing: 0.03em; +} + +.btn-launcher-download:hover { + background: rgba(186, 205, 176, 0.1); + transform: translateY(-1px); +} + .launch-hint { font-size: 0.78rem; color: rgba(255, 255, 255, 0.3); diff --git a/src/components/DownloadSection.jsx b/src/components/DownloadSection.jsx index f392eb4..6b0c6b6 100644 --- a/src/components/DownloadSection.jsx +++ b/src/components/DownloadSection.jsx @@ -7,7 +7,6 @@ import './DownloadSection.css'; export default function DownloadSection() { const [info, setInfo] = useState(null); const [ready, setReady] = useState(false); - const [launching, setLaunching] = useState(false); const { user } = useAuth(); const navigate = useNavigate(); @@ -23,24 +22,16 @@ export default function DownloadSection() { return; } - setLaunching(true); - - let launched = false; - const onBlur = () => { launched = true; }; - window.addEventListener('blur', onBlur); window.location.href = 'a301://launch?token=' + user.token; + }; - setTimeout(() => { - window.removeEventListener('blur', onBlur); - setLaunching(false); - if (!launched && info?.launcherUrl) { - // 런처 미설치 → launcher.exe 다운로드 - const a = document.createElement('a'); - a.href = info.launcherUrl; - a.download = 'launcher.exe'; - a.click(); - } - }, 2000); + const handleDownloadLauncher = () => { + if (info?.launcherUrl) { + const a = document.createElement('a'); + a.href = info.launcherUrl; + a.download = 'launcher.exe'; + a.click(); + } }; if (!ready) return null; @@ -54,11 +45,16 @@ export default function DownloadSection() {

{info.version} · {info.fileSize}

- + {info?.launcherUrl && ( + + )}

- 런처 미설치 시 자동으로 다운로드됩니다. 설치 후 다시 클릭하세요. + 처음이거나 게임이 실행되지 않으면 런처를 다운로드해주세요.

) : (