feat: main menu component, roadmap update
This commit is contained in:
135
src/components/MainMenu.vue
Normal file
135
src/components/MainMenu.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from '@/composables/useI18n'
|
||||
import LangSwitch from '@/components/LangSwitch.vue'
|
||||
|
||||
defineProps<{
|
||||
showResume: boolean
|
||||
showChapters: boolean
|
||||
showAchievements: boolean
|
||||
showGallery: boolean
|
||||
isGameEnd: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
start: []
|
||||
resume: []
|
||||
chapters: []
|
||||
achievements: []
|
||||
gallery: []
|
||||
settings: []
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="main-menu-overlay">
|
||||
<div class="main-menu">
|
||||
<div class="menu-top-bar">
|
||||
<LangSwitch />
|
||||
</div>
|
||||
|
||||
<h1 v-if="isGameEnd" class="menu-title">{{ t('ui.gameEnd') }}</h1>
|
||||
|
||||
<div class="menu-row primary-row">
|
||||
<button class="menu-btn primary" @click="emit('start')">{{ t('ui.start') }}</button>
|
||||
<button v-if="showResume" class="menu-btn secondary" @click="emit('resume')">{{ t('ui.resume') }}</button>
|
||||
</div>
|
||||
|
||||
<div class="menu-row secondary-row">
|
||||
<button v-if="showChapters" class="menu-btn tertiary" @click="emit('chapters')">{{ t('ui.chapters') }}</button>
|
||||
<button v-if="showAchievements" class="menu-btn tertiary" @click="emit('achievements')">成就</button>
|
||||
<button v-if="showGallery" class="menu-btn tertiary" @click="emit('gallery')">画廊</button>
|
||||
<button class="menu-btn tertiary" @click="emit('settings')">设置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.main-menu-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.88);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.main-menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.menu-top-bar {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.menu-title {
|
||||
font-size: 36px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 6px;
|
||||
color: #ddd;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.menu-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.menu-btn {
|
||||
padding: 16px 40px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
letter-spacing: 2px;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.menu-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.menu-btn.primary {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
padding: 18px 56px;
|
||||
font-size: 22px;
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
.menu-btn.primary:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.menu-btn.secondary {
|
||||
background: rgba(100, 200, 255, 0.08);
|
||||
border-color: rgba(100, 200, 255, 0.3);
|
||||
color: #8cf;
|
||||
font-size: 16px;
|
||||
padding: 16px 36px;
|
||||
}
|
||||
|
||||
.menu-btn.secondary:hover {
|
||||
background: rgba(100, 200, 255, 0.15);
|
||||
}
|
||||
|
||||
.menu-btn.tertiary {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
color: #aaa;
|
||||
font-size: 14px;
|
||||
padding: 12px 28px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.menu-btn.tertiary:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: #ddd;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user