|
@@ -76,10 +76,16 @@ export default defineComponent({
|
|
|
if (headTopData.rhythmModeDirection !== "vertical") {
|
|
|
const element = document.querySelector(".rhythmBox-scale-element") as HTMLElement | null
|
|
|
if (element) {
|
|
|
+ const playBtnEl = document.querySelector("#studnetT-7") as HTMLElement | null
|
|
|
const screenWidth = document.documentElement.clientWidth
|
|
|
const originalWidth = element.offsetWidth
|
|
|
- // 保留一位小数
|
|
|
- const scale = screenWidth < originalWidth ? Math.floor((screenWidth / originalWidth) * 10) / 10 : 1
|
|
|
+ // 比较差值,需要计算播放按钮的位置
|
|
|
+ let distanceWidth = screenWidth
|
|
|
+ if (playBtnEl) {
|
|
|
+ distanceWidth = screenWidth - (screenWidth - playBtnEl.getBoundingClientRect().left) * 2
|
|
|
+ }
|
|
|
+ // 保留2位小数
|
|
|
+ const scale = distanceWidth < originalWidth ? Math.floor((distanceWidth / originalWidth) * 100) / 100 : 1
|
|
|
element.style.transform = `translate(-50%, -50%) scale(${scale})`
|
|
|
}
|
|
|
}
|