fix: 修复页面布局和交互问题

调整CSS样式改善元素对齐和文本换行
优化音频播放器进度条交互逻辑
移除未使用的代码和console.log
添加窗口大小变化的事件监听
修复标签云重新初始化问题
This commit is contained in:
DESKTOP-RQ919RC\Pc
2025-09-25 18:53:56 +08:00
parent d61f57ed71
commit e378e383f6
6 changed files with 43 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
const { createApp, ref, onMounted, nextTick, onUnmounted, computed } = Vue;
const search = createApp({
createApp({
setup() {
const musicData = ref([
["A组 世界在转动.MP3", "A组《来吧占领我的无私》.MP3"],
@@ -14,6 +14,11 @@ const search = createApp({
let isAnswer = ref(false);
onMounted(() => {
window.addEventListener("resize", () => {
// 重新计算 detailsHeight
const windowHeight = window.innerHeight;
detailsHeight.value = Math.max(windowHeight - 379 - 40, 350);
});
init();
// 获取可是窗口高度
@@ -74,8 +79,6 @@ const search = createApp({
let autoTimer = null;
const audioEnd = (item) => {
const nextItem = findNextItem(audiozSrc.value);
console.log("nextItem", nextItem);
if (nextItem) autoTimer = setTimeout(() => play(nextItem), 500);
audiozSrc.value = "";
};
@@ -144,18 +147,11 @@ const search = createApp({
let fluctuate = ref([]);
onMounted(() => {
// setInterval(() => {
// randomFluctuate();
// }, 150);
});
const randomFluctuate = () => {
fluctuate.value = []
fluctuate.value = [];
for (let i = 0; i < 30; i++) {
fluctuate.value.push(Math.floor(Math.random() * 10) + 1);
}
console.log("fluctuate", fluctuate.value);
};
return { fluctuate, isAnswer, detailsHeight, detailsRef, audioEnd, playSucceed, stop, audiozSrc, audioPlayer, backHome, select, loseState, winState, replyState, play, step, begin, musicData, nextStep };