音乐模块调整
This commit is contained in:
@@ -106,26 +106,26 @@ async function uploadToFeiniu() {
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="group grid h-11 items-center gap-3 rounded-md px-2 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/50"
|
||||
class="group grid h-11 items-center gap-3 rounded-md px-2 transition-colors"
|
||||
:class="[
|
||||
showAlbum
|
||||
? 'grid-cols-[28px_36px_minmax(0,1fr)_minmax(0,0.75fr)_74px_28px]'
|
||||
: 'grid-cols-[28px_36px_minmax(0,1fr)_74px_28px]',
|
||||
isCurrent ? 'bg-accent/60' : 'hover:bg-accent/40'
|
||||
]"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@dblclick="play"
|
||||
@keydown.enter.prevent="play"
|
||||
>
|
||||
<!-- 序号 / 播放态指示:悬停时原位切换,不占用固定的空白列 -->
|
||||
<div class="flex size-7 items-center justify-center text-[11.5px] tabular-nums text-muted-foreground">
|
||||
<!-- 序号 / 播放态指示 / 播放按钮。
|
||||
行本身不再是 role=button(内部还嵌着下拉菜单的按钮,嵌套交互元素对读屏是噪音);
|
||||
播放改由下面这个**常驻 DOM** 的按钮承担——原来它是 hover 才 display:none→block,
|
||||
而 display:none 的元素无法获得焦点,键盘用户根本按不到 -->
|
||||
<div class="relative flex size-7 items-center justify-center text-[11.5px] tabular-nums text-muted-foreground">
|
||||
<span v-if="isCurrent" class="music-eq" :class="{ 'is-paused': !store.playing }"><i /><i /><i /></span>
|
||||
<template v-else>
|
||||
<span class="group-hover:hidden">{{ index + 1 }}</span>
|
||||
<span class="transition-opacity group-hover:opacity-0">{{ index + 1 }}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="hidden text-foreground group-hover:block"
|
||||
class="absolute inset-0 flex items-center justify-center rounded text-foreground opacity-0 outline-none transition-opacity group-hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50"
|
||||
:aria-label="'播放 ' + item.title"
|
||||
@click.stop="play"
|
||||
>
|
||||
@@ -223,9 +223,11 @@ async function uploadToFeiniu() {
|
||||
>
|
||||
<Cloud class="size-4" /> 上传到飞牛曲库
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem disabled>
|
||||
<FolderOpen class="size-4" /> {{ item.dir || '未知目录' }}
|
||||
</DropdownMenuItem>
|
||||
<!-- 所在目录只是信息,不是动作:用 disabled 的菜单项展示会让人以为点了没反应 -->
|
||||
<div class="flex items-center gap-2 px-2 py-1.5 text-[11.5px] text-muted-foreground">
|
||||
<FolderOpen class="size-3.5 shrink-0" />
|
||||
<span class="truncate" :title="item.dir || ''">{{ item.dir || '未知目录' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="playlistId">
|
||||
|
||||
Reference in New Issue
Block a user