Browse Source

战斗界面保持和其他界面一样的风格

master
hanqin 2 weeks ago
parent
commit
8e251474af
  1. 97
      Build_God_Game/src/views/BattleView.vue

97
Build_God_Game/src/views/BattleView.vue

@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router'
import { useMonsterStore } from '@/stores/monster'
import { useCharacterStore } from '@/stores/character'
import { ElMessage } from 'element-plus'
import { ArrowLeft } from '@element-plus/icons-vue'
import Particles from '@/components/Particles/Particles.vue'
const route = useRoute()
const router = useRouter()
@ -185,10 +185,13 @@ onUnmounted(() => {
</script>
<template>
<div class="battle-container">
<div class="battle-header">
<el-button :icon="ArrowLeft" circle @click="goBack" />
<h2>战斗</h2>
<div class="battle-page">
<Particles :particle-count="50" :particle-colors="['#ffffff', '#aaaaaa']" class="particles-bg" />
<div class="page-container">
<div class="page-header">
<span class="back-btn" @click="goBack"> 返回</span>
<span class="title">战斗</span>
<span class="header-placeholder"></span>
</div>
<div v-if="!currentMonster || !currentCharacter" class="loading">
@ -278,39 +281,74 @@ onUnmounted(() => {
</div>
</template>
</div>
</div>
</template>
<style scoped lang="css">
.battle-container {
padding: 20px;
.battle-page {
min-height: 100vh;
background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
background: #000000;
padding: 20px;
position: relative;
}
.particles-bg {
position: fixed !important;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
}
.battle-header {
.page-container {
max-width: 480px;
margin: 0 auto;
position: relative;
z-index: 10;
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 16px;
margin-bottom: 24px;
padding: 16px 0;
margin-bottom: 20px;
}
.battle-header h2 {
color: #f8fafc;
margin: 0;
.back-btn {
color: #666666;
font-size: 0.9rem;
cursor: pointer;
padding: 8px;
}
.back-btn:hover {
color: #ffffff;
}
.title {
color: #ffffff;
font-size: 1.1rem;
font-weight: 500;
}
.header-placeholder {
width: 60px;
}
.loading {
color: #64748b;
text-align: center;
padding: 60px 20px;
color: #666666;
padding: 40px 20px;
}
.battle-area {
display: flex;
align-items: center;
justify-content: space-between;
padding: 40px 20px;
background: rgba(0, 0, 0, 0.2);
padding: 24px 12px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 16px;
margin-bottom: 20px;
}
@ -321,14 +359,14 @@ onUnmounted(() => {
}
.combatant-icon {
width: 100px;
height: 100px;
margin: 0 auto 16px;
width: 88px;
height: 88px;
margin: 0 auto 12px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.08);
border-radius: 16px;
background: rgba(255, 255, 255, 0.06);
border-radius: 14px;
}
.combatant-icon img {
@ -351,14 +389,16 @@ onUnmounted(() => {
}
.vs {
color: #f59e0b;
font-size: 32px;
color: #ff8844;
font-size: 1.4rem;
font-weight: 800;
padding: 0 24px;
padding: 0 8px;
flex-shrink: 0;
}
.battle-log {
background: rgba(0, 0, 0, 0.3);
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 12px;
padding: 16px;
max-height: 200px;
@ -395,7 +435,8 @@ onUnmounted(() => {
.battle-result {
text-align: center;
padding: 24px;
background: rgba(0, 0, 0, 0.3);
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 12px;
margin-bottom: 20px;
}

Loading…
Cancel
Save