弓箭动画调整

This commit is contained in:
kron
2025-06-17 16:02:29 +08:00
parent a74fd1e744
commit 67825d2b24
7 changed files with 49 additions and 21 deletions

View File

@@ -40,7 +40,7 @@ const props = defineProps({
</view>
</view>
<view :style="{ width: '100%', marginBottom: '20px' }">
<BowTarget :scores="arrows" :showE="false" />
<BowTarget :scores="arrows" :showLatestArrow="false" />
</view>
<view class="desc">
<text>{{ arrows.length }}</text>

View File

@@ -34,14 +34,13 @@ const props = defineProps({
type: Array,
default: () => [],
},
showE: {
showLatestArrow: {
type: Boolean,
default: true,
},
});
const showRoundTips = ref(false);
const showLatestArrow = ref(false);
const prevLength = ref(0);
const timer = ref(null);
@@ -51,7 +50,6 @@ watch(
if (newVal.length - prevLength.value === 1) {
if (timer.value) clearTimeout(timer.value);
showRoundTips.value = true;
showLatestArrow.value = true;
timer.value = setTimeout(() => {
showRoundTips.value = false;
}, 1000);
@@ -86,11 +84,13 @@ function calcRealY(num) {
</view>
<view class="target">
<view
v-if="scores.length && showRoundTips && showE"
v-if="scores.length && showRoundTips && showLatestArrow"
class="e-value fade-in"
>经验 +1</view
>
<view v-if="scores.length && showRoundTips" class="round-tip fade-in"
<view
v-if="scores.length && showRoundTips && showLatestArrow"
class="round-tip fade-in"
>{{ scores[scores.length - 1].ring }}<text></text></view
>
<image
@@ -101,7 +101,11 @@ function calcRealY(num) {
? '../static/hit-icon-green.png'
: '../static/hit-icon.png'
"
:class="`hit ${index + 1 === scores.length ? 'pump-in' : ''}`"
:class="`hit ${
index + 1 === scores.length && !blueScores.length && showLatestArrow
? 'pump-in'
: ''
}`"
:style="{
left: calcRealX(bow.x),
top: calcRealY(bow.y),
@@ -111,7 +115,7 @@ function calcRealY(num) {
v-for="(bow, index) in blueScores"
:key="index"
src="../static/hit-icon-blue.png"
:class="`hit ${index + 1 === blueScores.length ? 'pump-in' : ''}`"
class="hit"
:style="{
left: calcRealX(bow.x),
top: calcRealY(bow.y),

View File

@@ -61,7 +61,7 @@ watch(
</view>
</view>
<view :style="{ width: '95%' }">
<BowTarget :scores="scores" />
<BowTarget :scores="scores" :showLatestArrow="false" />
</view>
<view class="score-text"
><text :style="{ color: '#fed847' }">12</text>支箭<text

View File

@@ -97,7 +97,11 @@ watch(
</view>
</view>
<view :style="{ width: '95%' }">
<BowTarget :scores="redScores" :blueScores="blueScores" :showE="false" />
<BowTarget
:scores="redScores"
:blueScores="blueScores"
:showLatestArrow="false"
/>
</view>
<view class="score-row" v-for="(player, index) in players" :key="index">
<Avatar