fix: 替换音频可视化效果为静态图标
- Player.vue: 播放状态显示暂停图标而非可视化效果 - PlayQueueItem.vue: 当前播放项显示音波图标并带脉冲动画 - 创建新的 soundwave.vue 图标用于播放指示 - 避免在不支持的浏览器上显示空白或错误 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b0743178ed
commit
282af70b74
15
src/assets/icons/soundwave.vue
Normal file
15
src/assets/icons/soundwave.vue
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps<{
|
||||||
|
size: number
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" :class="`w-${size} h-${size}`">
|
||||||
|
<rect x="3" y="9" width="2" height="6" rx="1"></rect>
|
||||||
|
<rect x="7" y="5" width="2" height="14" rx="1"></rect>
|
||||||
|
<rect x="11" y="7" width="2" height="10" rx="1"></rect>
|
||||||
|
<rect x="15" y="4" width="2" height="16" rx="1"></rect>
|
||||||
|
<rect x="19" y="10" width="2" height="4" rx="1"></rect>
|
||||||
|
</svg>
|
||||||
|
</template>
|
|
@ -5,6 +5,7 @@ import { artistsOrganize } from '../utils'
|
||||||
import XIcon from '../assets/icons/x.vue'
|
import XIcon from '../assets/icons/x.vue'
|
||||||
import UpHyphenIcon from '../assets/icons/uphypen.vue'
|
import UpHyphenIcon from '../assets/icons/uphypen.vue'
|
||||||
import DownHyphenIcon from '../assets/icons/downhyphen.vue'
|
import DownHyphenIcon from '../assets/icons/downhyphen.vue'
|
||||||
|
import SoundwaveIcon from '../assets/icons/soundwave.vue'
|
||||||
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
@ -156,12 +157,7 @@ function removeItem() {
|
||||||
<img :src="queueItem.album?.coverUrl" />
|
<img :src="queueItem.album?.coverUrl" />
|
||||||
<div class="w-full h-full absolute top-0 left-0 bg-neutral-900/75 flex justify-center items-center"
|
<div class="w-full h-full absolute top-0 left-0 bg-neutral-900/75 flex justify-center items-center"
|
||||||
v-if="isCurrent">
|
v-if="isCurrent">
|
||||||
<div style="height: 1rem;" class="flex justify-center items-center gap-[.125rem]">
|
<SoundwaveIcon :size="6" class="text-white animate-pulse" />
|
||||||
<div class="bg-white w-[.125rem] rounded-full" v-for="(bar, index) in playQueueStore.visualizer"
|
|
||||||
:key="index" :style="{
|
|
||||||
height: `${Math.max(10, bar)}%`
|
|
||||||
}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col text-left flex-auto w-0">
|
<div class="flex flex-col text-left flex-auto w-0">
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { usePlayQueueStore } from '../stores/usePlayQueueStore'
|
||||||
|
|
||||||
import LoadingIndicator from '../assets/icons/loadingindicator.vue'
|
import LoadingIndicator from '../assets/icons/loadingindicator.vue'
|
||||||
import PlayIcon from '../assets/icons/play.vue'
|
import PlayIcon from '../assets/icons/play.vue'
|
||||||
|
import PauseIcon from '../assets/icons/pause.vue'
|
||||||
import { audioVisualizer, checkAndRefreshSongResource, supportsWebAudioVisualization } from '../utils'
|
import { audioVisualizer, checkAndRefreshSongResource, supportsWebAudioVisualization } from '../utils'
|
||||||
|
|
||||||
const playQueueStore = usePlayQueueStore()
|
const playQueueStore = usePlayQueueStore()
|
||||||
|
@ -518,12 +519,7 @@ setInterval(syncVolumeFromStorage, 100)
|
||||||
}">
|
}">
|
||||||
<div v-if="playQueueStore.isPlaying">
|
<div v-if="playQueueStore.isPlaying">
|
||||||
<LoadingIndicator v-if="playQueueStore.isBuffering === true" :size="4" />
|
<LoadingIndicator v-if="playQueueStore.isBuffering === true" :size="4" />
|
||||||
<div v-else class="h-4 flex justify-center items-center gap-[.125rem]">
|
<PauseIcon v-else :size="4" />
|
||||||
<div class="bg-white/75 w-[.125rem] rounded-full" v-for="(bar, index) in playQueueStore.visualizer"
|
|
||||||
:key="index" :style="{
|
|
||||||
height: `${Math.max(10, bar)}%`
|
|
||||||
}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<PlayIcon v-else :size="4" />
|
<PlayIcon v-else :size="4" />
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user