@@ -4,7 +4,6 @@ import { useRouter } from 'vue-router'
44import { usePlayerStore } from ' ../stores/player'
55import { useProgressStore } from ' ../stores/progress'
66import { chapters } from ' ../content/chapters'
7- import { generatePassword } from ' ../utils/cipher'
87import { getEndingChapterId } from ' ../config/endings'
98import LogoThreeFx from ' ../components/LogoThreeFx.vue'
109
@@ -113,71 +112,6 @@ function onKeyDown(e: KeyboardEvent) {
113112onMounted (() => window .addEventListener (' keydown' , onKeyDown ))
114113onUnmounted (() => window .removeEventListener (' keydown' , onKeyDown ))
115114
116- // ====== 開發者模式 ======
117- const showDevPanel = ref (false )
118- const devClickCount = ref (0 )
119- let devClickTimer: ReturnType <typeof setTimeout > | null = null
120-
121- function onVersionClick() {
122- devClickCount .value ++
123- if (devClickTimer ) clearTimeout (devClickTimer )
124- devClickTimer = setTimeout (() => {
125- devClickCount .value = 0
126- }, 2000 )
127-
128- if (devClickCount .value >= 2 ) {
129- showDevPanel .value = true
130- devClickCount .value = 0
131- }
132- }
133-
134- function closeDevPanel() {
135- showDevPanel .value = false
136- }
137-
138- // 設定測試分數(Day 4-10 每天 10 題)
139- function setTestScores(percentage : number ) {
140- const correct = percentage === 100 ? 10 : percentage === 90 ? 9 : percentage === 80 ? 8 : 7
141- for (let day = 4 ; day <= 10 ; day ++ ) {
142- progress .saveQuizScore (day , correct , 10 )
143- }
144- // 同時設定為已通關狀態
145- progress .setCurrentChapter (11 )
146- }
147-
148- function setEndingTrue() {
149- setTestScores (100 )
150- }
151-
152- function setEndingNormal() {
153- setTestScores (90 )
154- }
155-
156- function setEndingBad() {
157- setTestScores (80 )
158- }
159-
160- function goToEnding() {
161- // 根據分數進入對應結局章節
162- const endingChapterId = getEndingChapterId (progress .endingType )
163- router .push ({ name: ' chapter' , params: { id: String (endingChapterId ) } })
164- }
165-
166- // Day 7 密碼(開發者用)
167- const day7Password = computed (() => {
168- if (! player .name ) return ' (請先設定玩家名稱)'
169- return generatePassword (player .name )
170- })
171-
172- const copySuccess = ref (false )
173- function copyPassword() {
174- navigator .clipboard .writeText (day7Password .value )
175- copySuccess .value = true
176- setTimeout (() => {
177- copySuccess .value = false
178- }, 2000 )
179- }
180-
181115// 成就系統
182116const showAchievementModal = ref (false )
183117
@@ -306,11 +240,8 @@ function closeAchievementModal() {
306240 </button >
307241 </nav >
308242
309- <!-- 版本資訊(連點 5 次開啟開發者模式) -->
310- <p
311- class =" mt-6 cursor-default select-none text-center text-xs text-white/30 md:mt-8 md:text-left"
312- @click =" onVersionClick"
313- >
243+ <!-- 版本資訊 -->
244+ <p class =" mt-6 cursor-default select-none text-center text-xs text-white/30 md:mt-8 md:text-left" >
314245 v1.0 · 2025 後端新手生存指南
315246 </p >
316247 </div >
@@ -398,99 +329,6 @@ function closeAchievementModal() {
398329 </div >
399330 </Transition >
400331
401- <!-- 開發者模式面板 -->
402- <Transition name =" fade" >
403- <div
404- v-if =" showDevPanel"
405- class =" fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm"
406- @click.self =" closeDevPanel"
407- >
408- <div class =" mx-4 w-full max-w-md rounded-2xl border border-purple-500/30 bg-slate-900/95 p-6 shadow-2xl" >
409- <div class =" mb-4 flex items-center justify-between" >
410- <h2 class =" flex items-center gap-2 text-lg font-bold text-purple-400" >
411- <span >🛠️</span >
412- <span >開發者模式</span >
413- </h2 >
414- <button
415- class =" rounded-full p-1 text-white/50 hover:bg-white/10 hover:text-white"
416- @click =" closeDevPanel"
417- >
418- <svg xmlns =" http://www.w3.org/2000/svg" class =" h-5 w-5" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" >
419- <line x1 =" 18" y1 =" 6" x2 =" 6" y2 =" 18" />
420- <line x1 =" 6" y1 =" 6" x2 =" 18" y2 =" 18" />
421- </svg >
422- </button >
423- </div >
424-
425- <!-- 目前狀態 -->
426- <div class =" mb-4 rounded-lg bg-slate-800/50 p-3 text-sm" >
427- <p class =" text-white/50" >目前結局分數:<span class =" font-mono text-white" >{{ progress.endingScore }}%</span ></p >
428- <p class =" text-white/50" >結局類型:<span class =" font-mono text-white" >{{ progress.endingType }}</span ></p >
429- <p class =" text-white/50" >Day 7 道具:<span :class =" progress.hasDay7Item ? 'text-emerald-400' : 'text-rose-400'" >{{ progress.hasDay7Item ? '✓ 已取得' : '✗ 未取得' }}</span ></p >
430- </div >
431-
432- <!-- Day 7 密碼 -->
433- <div class =" mb-4 rounded-lg border border-amber-500/30 bg-amber-900/20 p-3" >
434- <p class =" mb-2 text-sm text-amber-400" >🔑 Day 7 彩蛋密碼</p >
435- <div class =" flex items-center gap-2" >
436- <code class =" flex-1 rounded bg-slate-800 px-3 py-2 font-mono text-sm text-white" >{{ day7Password }}</code >
437- <button
438- class =" rounded-lg bg-amber-500/20 px-3 py-2 text-sm text-amber-400 transition-all hover:bg-amber-500/30"
439- @click =" copyPassword"
440- >
441- {{ copySuccess ? '✓ 已複製' : '複製' }}
442- </button >
443- </div >
444- </div >
445-
446- <p class =" mb-3 text-sm text-white/50" >快速設定結局分數(Day 4-10):</p >
447-
448- <div class =" space-y-2" >
449- <button
450- class =" w-full rounded-xl border border-emerald-500/30 bg-emerald-900/20 px-4 py-3 text-left transition-all hover:border-emerald-400/50 hover:bg-emerald-900/40"
451- @click =" setEndingTrue"
452- >
453- <span class =" flex items-center justify-between" >
454- <span class =" font-semibold text-emerald-400" >🌟 完美結局 + 🔮 彩蛋結局</span >
455- <span class =" text-xs text-white/40" >100%</span >
456- </span >
457- </button >
458-
459- <button
460- class =" w-full rounded-xl border border-sky-500/30 bg-sky-900/20 px-4 py-3 text-left transition-all hover:border-sky-400/50 hover:bg-sky-900/40"
461- @click =" setEndingNormal"
462- >
463- <span class =" flex items-center justify-between" >
464- <span class =" font-semibold text-sky-400" >🌑 普通結局「封印」</span >
465- <span class =" text-xs text-white/40" >90%</span >
466- </span >
467- </button >
468-
469- <button
470- class =" w-full rounded-xl border border-rose-500/30 bg-rose-900/20 px-4 py-3 text-left transition-all hover:border-rose-400/50 hover:bg-rose-900/40"
471- @click =" setEndingBad"
472- >
473- <span class =" flex items-center justify-between" >
474- <span class =" font-semibold text-rose-400" >💀 壞結局「過勞」</span >
475- <span class =" text-xs text-white/40" >80%</span >
476- </span >
477- </button >
478- </div >
479-
480- <!-- 進入結局按鈕 -->
481- <div class =" mt-3" >
482- <button
483- class =" w-full rounded-xl border border-purple-500/30 bg-purple-900/30 px-4 py-3 font-semibold text-purple-400 transition-all hover:border-purple-400/50 hover:bg-purple-900/50"
484- @click =" goToEnding"
485- >
486- ▶ 進入結局畫面
487- </button >
488- </div >
489-
490- <p class =" mt-4 text-center text-xs text-white/30" >點擊按鈕後會自動設定為已通關狀態</p >
491- </div >
492- </div >
493- </Transition >
494332 </Teleport >
495333
496334 <!-- 成就 Modal -->
0 commit comments