From c0736e1285bcec0d4b2b899451db19128acf0c84 Mon Sep 17 00:00:00 2001 From: kron Date: Thu, 21 Aug 2025 16:08:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=B6=E5=AD=90=E7=82=B9=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BowTarget.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue index a396e85..ea08984 100644 --- a/src/components/BowTarget.vue +++ b/src/components/BowTarget.vue @@ -98,13 +98,13 @@ watch( } ); -function calcRealX(num, offset = 12) { +function calcRealX(num) { const len = 20.4 + num; - return `calc(${(len / 40.8) * 100}% - ${offset / 2}px)`; + return `calc(${(len / 40.8) * 100 - 1.5}%)`; } -function calcRealY(num, offset = 12) { +function calcRealY(num) { const len = num < 0 ? Math.abs(num) + 20.4 : 20.4 - num; - return `calc(${(len / 40.8) * 100}% - ${offset / 2}px)`; + return `calc(${(len / 40.8) * 100 - 1.5}%)`; } const simulShoot = async () => { if (device.value.deviceId) await simulShootAPI(device.value.deviceId); @@ -246,17 +246,20 @@ onMounted(() => { } .hit { position: absolute; - width: 12px; - height: 12px; + width: 3%; + height: 3%; + min-width: 3%; + min-height: 3%; border-radius: 50%; border: 1px solid #fff; z-index: 1; color: #fff; - font-size: 8px; - text-align: center; - line-height: 10px; + font-size: 2.2vw; box-sizing: border-box; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); + display: flex; + justify-content: center; + align-items: center; } .hit > text { transform: scaleX(0.7);