From e496de7e56a51aae4838eb581d15d0e36048a737 Mon Sep 17 00:00:00 2001 From: tolelom <98kimsungmin@naver.com> Date: Tue, 24 Feb 2026 22:48:47 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B2=8C=EC=9E=84=20=EC=8B=9C=EC=9E=91?= =?UTF-8?q?/=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=86=B5=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 단일 "게임 시작" 버튼으로 통합 - 런처 설치 시 게임 실행, 미설치 시 자동 다운로드 (blur 감지) Co-Authored-By: Claude Sonnet 4.6 --- src/components/DownloadSection.css | 32 ++++++----------------- src/components/DownloadSection.jsx | 41 ++++++++++++++++++------------ 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/components/DownloadSection.css b/src/components/DownloadSection.css index a45265d..f71dbdb 100644 --- a/src/components/DownloadSection.css +++ b/src/components/DownloadSection.css @@ -19,45 +19,29 @@ margin: 0 0 28px; } -.btn-download { +.btn-play { display: inline-block; - padding: 16px 48px; + padding: 18px 64px; background: #BACDB0; color: #2E2C2F; border: none; border-radius: 8px; - font-size: 1.1rem; + font-size: 1.2rem; font-weight: 700; - text-decoration: none; cursor: pointer; transition: opacity 0.2s, transform 0.15s; letter-spacing: 0.05em; } -.btn-download:hover { +.btn-play:hover { opacity: 0.9; transform: translateY(-1px); } -.btn-launch { - display: inline-block; - padding: 16px 48px; - background: transparent; - color: #BACDB0; - border: 2px solid #BACDB0; - border-radius: 8px; - font-size: 1.1rem; - font-weight: 700; - cursor: pointer; - transition: background 0.2s, color 0.2s, transform 0.15s; - letter-spacing: 0.05em; - margin-left: 16px; -} - -.btn-launch:hover { - background: #BACDB0; - color: #2E2C2F; - transform: translateY(-1px); +.btn-play:disabled { + opacity: 0.6; + cursor: not-allowed; + transform: none; } .launch-hint { diff --git a/src/components/DownloadSection.jsx b/src/components/DownloadSection.jsx index f287d38..0fbe6fe 100644 --- a/src/components/DownloadSection.jsx +++ b/src/components/DownloadSection.jsx @@ -7,6 +7,7 @@ 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(); @@ -16,19 +17,30 @@ export default function DownloadSection() { .catch(() => setReady(true)); }, []); - const handleDownload = (e) => { - if (!user) { - e.preventDefault(); - navigate('/login'); - } - }; - - const handleLaunch = () => { + const handlePlay = () => { if (!user) { navigate('/login'); 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?.url) { + // 런처 미설치 → 자동 다운로드 + const a = document.createElement('a'); + a.href = info.url; + a.download = ''; + a.click(); + } + }, 2000); }; if (!ready) return null; @@ -36,20 +48,17 @@ export default function DownloadSection() { return (
-

게임 런처 다운로드

+

A301

{info ? ( <>

- {info.fileName} · {info.fileSize} · {info.version} + {info.version} · {info.fileSize}

- - {user ? '다운로드' : '로그인 후 다운로드'} - -

- 게임 시작이 안 되나요? 먼저 다운로드 후 launcher.exe install을 실행해주세요. + 처음 설치하는 경우 자동으로 다운로드됩니다

) : (