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);