Files
shoot-miniprograms/src/components/BattleHeader.vue

100 lines
1.9 KiB
Vue
Raw Normal View History

2025-05-16 15:56:54 +08:00
<script setup>
2025-06-05 21:32:51 +08:00
import Avatar from "@/components/Avatar.vue";
2025-05-16 15:56:54 +08:00
defineProps({
isMelee: {
type: Boolean,
default: false,
},
2025-06-05 21:32:51 +08:00
blueTeam: {
type: Array,
default: () => [],
},
redTeam: {
type: Array,
default: () => [],
},
2025-05-16 15:56:54 +08:00
});
</script>
<template>
<view class="container">
<image
:src="`../static/battle-header${isMelee ? '-melee' : ''}.png`"
mode="widthFix"
/>
<view v-if="isMelee" class="players-melee">
<view></view>
</view>
<view v-if="!isMelee" class="players">
<view>
2025-06-08 20:59:41 +08:00
<block v-if="blueTeam[0]">
<Avatar :src="blueTeam[0].avatar" frame />
<text>{{ blueTeam[0].name }}</text>
<image
v-if="blueTeam[0].winner"
src="../static/winner-badge.png"
mode="widthFix"
/>
</block>
2025-05-16 15:56:54 +08:00
</view>
<view>
2025-06-08 20:59:41 +08:00
<block v-if="redTeam[0]">
<Avatar v-if="redTeam[0]" :src="redTeam[0].avatar" frame />
<text>{{ redTeam[0].name }}</text>
<image
v-if="redTeam[0].winner"
src="../static/winner-badge.png"
mode="widthFix"
/>
</block>
2025-05-16 15:56:54 +08:00
</view>
</view>
</view>
</template>
<style scoped>
.container {
width: 100%;
position: relative;
margin-bottom: 10px;
}
.container > image:first-child {
position: absolute;
width: 100%;
2025-06-08 12:52:49 +08:00
top: -5px;
z-index: 1;
2025-05-16 15:56:54 +08:00
}
.players {
display: flex;
}
.players > view {
width: 50%;
height: 80px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff9;
font-size: 14px;
2025-06-08 12:52:49 +08:00
margin-top: 20px;
padding-top: 5px;
2025-06-05 21:32:51 +08:00
overflow: hidden;
2025-06-08 12:52:49 +08:00
position: relative;
2025-05-16 15:56:54 +08:00
}
.players > view:first-child {
background-color: #364469;
}
.players > view:last-child {
background-color: #692735;
}
2025-06-08 12:52:49 +08:00
.players > view > text {
margin-top: 5px;
}
.players > view > image:last-child {
position: absolute;
width: 60px;
right: 0;
bottom: 0;
}
2025-05-16 15:56:54 +08:00
</style>