靶点优化
This commit is contained in:
@@ -102,11 +102,11 @@ watch(
|
|||||||
|
|
||||||
function calcRealX(num) {
|
function calcRealX(num) {
|
||||||
const len = 20.4 + num;
|
const len = 20.4 + num;
|
||||||
return `calc(${(len / 40.8) * 100}% - 8px)`;
|
return `calc(${(len / 40.8) * 100}% - 6px)`;
|
||||||
}
|
}
|
||||||
function calcRealY(num) {
|
function calcRealY(num) {
|
||||||
const len = num < 0 ? Math.abs(num) + 20.4 : 20.4 - num;
|
const len = num < 0 ? Math.abs(num) + 20.4 : 20.4 - num;
|
||||||
return `calc(${(len / 40.8) * 100}% - 8px)`;
|
return `calc(${(len / 40.8) * 100}% - 6px)`;
|
||||||
}
|
}
|
||||||
const simulShoot = async () => {
|
const simulShoot = async () => {
|
||||||
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
|
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
|
||||||
@@ -144,7 +144,27 @@ const simulShoot2 = async () => {
|
|||||||
>{{ blueScores[blueScores.length - 1].ring }}<text>环</text></view
|
>{{ blueScores[blueScores.length - 1].ring }}<text>环</text></view
|
||||||
>
|
>
|
||||||
<block v-for="(bow, index) in scores" :key="index">
|
<block v-for="(bow, index) in scores" :key="index">
|
||||||
<image
|
<view
|
||||||
|
v-if="bow.ring > 0"
|
||||||
|
:class="`hit ${
|
||||||
|
index === scores.length - 1 && !blueScores.length && showLatestArrow
|
||||||
|
? 'pump-in'
|
||||||
|
: ''
|
||||||
|
}`"
|
||||||
|
:style="{
|
||||||
|
left: calcRealX(bow.x),
|
||||||
|
top: calcRealY(bow.y),
|
||||||
|
backgroundColor:
|
||||||
|
index === scores.length - 1 &&
|
||||||
|
!blueScores.length &&
|
||||||
|
showLatestArrow &&
|
||||||
|
mode !== 'team'
|
||||||
|
? 'green'
|
||||||
|
: 'red',
|
||||||
|
}"
|
||||||
|
>{{ bow.ring }}</view
|
||||||
|
>
|
||||||
|
<!-- <image
|
||||||
v-if="bow.ring > 0"
|
v-if="bow.ring > 0"
|
||||||
:src="
|
:src="
|
||||||
index === scores.length - 1 &&
|
index === scores.length - 1 &&
|
||||||
@@ -163,10 +183,10 @@ const simulShoot2 = async () => {
|
|||||||
left: calcRealX(bow.x),
|
left: calcRealX(bow.x),
|
||||||
top: calcRealY(bow.y),
|
top: calcRealY(bow.y),
|
||||||
}"
|
}"
|
||||||
/>
|
/> -->
|
||||||
</block>
|
</block>
|
||||||
<block v-for="(bow, index) in blueScores" :key="index">
|
<block v-for="(bow, index) in blueScores" :key="index">
|
||||||
<image
|
<!-- <image
|
||||||
v-if="bow.ring > 0"
|
v-if="bow.ring > 0"
|
||||||
src="../static/hit-icon-blue.png"
|
src="../static/hit-icon-blue.png"
|
||||||
class="hit"
|
class="hit"
|
||||||
@@ -175,7 +195,21 @@ const simulShoot2 = async () => {
|
|||||||
left: calcRealX(bow.x),
|
left: calcRealX(bow.x),
|
||||||
top: calcRealY(bow.y),
|
top: calcRealY(bow.y),
|
||||||
}"
|
}"
|
||||||
/>
|
/> -->
|
||||||
|
<view
|
||||||
|
v-if="bow.ring > 0"
|
||||||
|
:class="`hit ${
|
||||||
|
index === scores.length - 1 && !blueScores.length && showLatestArrow
|
||||||
|
? 'pump-in'
|
||||||
|
: ''
|
||||||
|
}`"
|
||||||
|
:style="{
|
||||||
|
left: calcRealX(bow.x),
|
||||||
|
top: calcRealY(bow.y),
|
||||||
|
backgroundColor: 'blue',
|
||||||
|
}"
|
||||||
|
>{{ bow.ring }}</view
|
||||||
|
>
|
||||||
</block>
|
</block>
|
||||||
<image src="../static/bow-target.png" mode="widthFix" />
|
<image src="../static/bow-target.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
@@ -198,7 +232,7 @@ const simulShoot2 = async () => {
|
|||||||
}
|
}
|
||||||
.target {
|
.target {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
.e-value {
|
.e-value {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -229,9 +263,17 @@ const simulShoot2 = async () => {
|
|||||||
}
|
}
|
||||||
.hit {
|
.hit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 16px;
|
width: 12px;
|
||||||
height: 16px;
|
height: 12px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid #fff;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 8px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 12px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user