修改播放栏UI
parent
b1ee4d10d7
commit
d1d9d65a06
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
// Height
|
// Height
|
||||||
@height-toolbar: 54px;
|
@height-toolbar: 54px;
|
||||||
@height-player: 68px;
|
@height-player: 66px;
|
||||||
|
|
||||||
|
|
||||||
// Shadow
|
// Shadow
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
@click.stop
|
@click.stop
|
||||||
@mouseenter="emit('mouseenter', $event)"
|
@mouseenter="emit('mouseenter', $event)"
|
||||||
@mouseleave="emit('mouseleave', $event)"
|
@mouseleave="emit('mouseleave', $event)"
|
||||||
|
@transitionend="emit('transitionend', $event)"
|
||||||
>
|
>
|
||||||
<div ref="dom_content" class="scroll" :class="$style.list">
|
<div ref="dom_content" class="scroll" :class="$style.list">
|
||||||
<slot />
|
<slot />
|
||||||
|
@ -39,6 +40,7 @@ interface Emitter {
|
||||||
(event: 'update:visible', visible: boolean): void
|
(event: 'update:visible', visible: boolean): void
|
||||||
(event: 'mouseenter', visible: MouseEvent): void
|
(event: 'mouseenter', visible: MouseEvent): void
|
||||||
(event: 'mouseleave', visible: MouseEvent): void
|
(event: 'mouseleave', visible: MouseEvent): void
|
||||||
|
(event: 'transitionend', visible: TransitionEvent): void
|
||||||
}
|
}
|
||||||
const emit = defineEmits<Emitter>()
|
const emit = defineEmits<Emitter>()
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,16 @@
|
||||||
</button>
|
</button>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div :class="$style.setting">
|
<div :class="$style.setting">
|
||||||
<span>{{ Math.trunc(volume * 100) }}%</span>
|
<div :class="$style.info">
|
||||||
|
<span>{{ Math.trunc(volume * 100) }}%</span>
|
||||||
|
<base-checkbox
|
||||||
|
id="player__volume_mute"
|
||||||
|
:model-value="isMute"
|
||||||
|
:label="$t('player__volume_mute_label')"
|
||||||
|
@update:model-value="saveVolumeIsMute($event)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<common-volume-bar />
|
<common-volume-bar />
|
||||||
<base-checkbox
|
|
||||||
id="player__volume_mute"
|
|
||||||
:model-value="isMute"
|
|
||||||
:label="$t('player__volume_mute_label')"
|
|
||||||
@update:model-value="saveVolumeIsMute($event)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</material-popup-btn>
|
</material-popup-btn>
|
||||||
|
@ -83,10 +85,17 @@ const icon = computed(() => {
|
||||||
.setting {
|
.setting {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
font-size: 14px;
|
|
||||||
padding: 2px 3px;
|
padding: 2px 3px;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
label span {
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 13px;
|
||||||
|
span {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<span>{{ nowPlayTimeStr }}</span>
|
<span>{{ nowPlayTimeStr }}</span>
|
||||||
<span style="margin: 0 1px;">/</span>
|
<span style="margin: 0 1px;">/</span>
|
||||||
<span>{{ maxPlayTimeStr }}</span>
|
<span>{{ maxPlayTimeStr }}</span>
|
||||||
<base-popup v-model:visible="visible" :btn-el="dom_btn" @mouseenter="handlMsEnter" @mouseleave="handlMsLeave">
|
<base-popup v-model:visible="visible" :btn-el="dom_btn" @mouseenter="handlMsEnter" @mouseleave="handlMsLeave" @transitionend="handleTranEnd">
|
||||||
<div :class="$style.progress">
|
<div :class="$style.progress">
|
||||||
<common-progress-bar :progress="progress" :handle-transition-end="handleTransitionEnd" :is-active-transition="isActiveTransition" />
|
<common-progress-bar v-if="visibleProgress" :progress="progress" :handle-transition-end="handleTransitionEnd" :is-active-transition="isActiveTransition" />
|
||||||
</div>
|
</div>
|
||||||
</base-popup>
|
</base-popup>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,14 +19,13 @@ import usePlayProgress from '@renderer/utils/compositions/usePlayProgress'
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
|
const visibleProgress = ref(false)
|
||||||
const dom_btn = ref<HTMLElement | null>(null)
|
const dom_btn = ref<HTMLElement | null>(null)
|
||||||
|
|
||||||
const handleShowPopup = (evt) => {
|
const handleShowPopup = (evt) => {
|
||||||
if (visible.value) evt.stopPropagation()
|
if (visible.value) evt.stopPropagation()
|
||||||
setTimeout(() => {
|
if (visible.value) handlMsLeave()
|
||||||
// if (!)
|
else handlMsEnter()
|
||||||
visible.value = !visible.value
|
|
||||||
}, 50)
|
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
nowPlayTimeStr,
|
nowPlayTimeStr,
|
||||||
|
@ -38,22 +37,31 @@ export default {
|
||||||
|
|
||||||
let timeout = null
|
let timeout = null
|
||||||
const handlMsEnter = () => {
|
const handlMsEnter = () => {
|
||||||
if (visible.value) {
|
if (timeout) {
|
||||||
if (timeout) {
|
clearTimeout(timeout)
|
||||||
clearTimeout(timeout)
|
timeout = null
|
||||||
timeout = null
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
visible.value = true
|
if (visible.value) return
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
visible.value = true
|
||||||
|
visibleProgress.value = true
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
const handlMsLeave = () => {
|
const handlMsLeave = () => {
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout)
|
||||||
|
timeout = null
|
||||||
|
}
|
||||||
if (!visible.value) return
|
if (!visible.value) return
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
timeout = null
|
timeout = null
|
||||||
visible.value = false
|
visible.value = false
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
const handleTranEnd = () => {
|
||||||
|
if (visible.value) return
|
||||||
|
visibleProgress.value = false
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
visible.value = true
|
visible.value = true
|
||||||
|
@ -64,6 +72,7 @@ export default {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
visible,
|
visible,
|
||||||
|
visibleProgress,
|
||||||
dom_btn,
|
dom_btn,
|
||||||
handleShowPopup,
|
handleShowPopup,
|
||||||
nowPlayTimeStr,
|
nowPlayTimeStr,
|
||||||
|
@ -73,6 +82,7 @@ export default {
|
||||||
handleTransitionEnd,
|
handleTransitionEnd,
|
||||||
handlMsLeave,
|
handlMsLeave,
|
||||||
handlMsEnter,
|
handlMsEnter,
|
||||||
|
handleTranEnd,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -86,8 +96,8 @@ export default {
|
||||||
flex: none;
|
flex: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
// display: inline-block;
|
// display: inline-block;
|
||||||
padding: 5px 0 5px 5px;
|
padding: 5px 0;
|
||||||
color: var(--color-font);
|
color: var(--color-300);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: opacity @transition-fast;
|
transition: opacity @transition-fast;
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.player">
|
<div :class="$style.player">
|
||||||
<div :class="$style.progress">
|
|
||||||
<common-progress-bar v-if="!isShowPlayerDetail" :class-name="$style.progressBar" :progress="progress" :handle-transition-end="handleTransitionEnd" :is-active-transition="isActiveTransition" />
|
|
||||||
</div>
|
|
||||||
<div :class="$style.picContent" :aria-label="$t('player__pic_tip')" @contextmenu="handleToMusicLocation" @click="showPlayerDetail">
|
<div :class="$style.picContent" :aria-label="$t('player__pic_tip')" @contextmenu="handleToMusicLocation" @click="showPlayerDetail">
|
||||||
<img v-if="musicInfo.pic" :src="musicInfo.pic" loading="lazy" decoding="async" @error="imgError">
|
<img v-if="musicInfo.pic" :src="musicInfo.pic" loading="lazy" decoding="async" @error="imgError">
|
||||||
<div v-else :class="$style.emptyPic">L<span>X</span></div>
|
<div v-else :class="$style.emptyPic">L<span>X</span></div>
|
||||||
|
@ -15,7 +12,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.timeContent">
|
<div :class="$style.timeContent">
|
||||||
<span>{{ nowPlayTimeStr }}</span>
|
<span>{{ nowPlayTimeStr }}</span>
|
||||||
<span style="margin: 0 1px;">/</span>
|
<div :class="$style.progress">
|
||||||
|
<common-progress-bar v-if="!isShowPlayerDetail" :class-name="$style.progressBar" :progress="progress" :handle-transition-end="handleTransitionEnd" :is-active-transition="isActiveTransition" />
|
||||||
|
</div>
|
||||||
|
<!-- <span style="margin: 0 1px;">/</span> -->
|
||||||
<span>{{ maxPlayTimeStr }}</span>
|
<span>{{ maxPlayTimeStr }}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- <play-progress /> -->
|
<!-- <play-progress /> -->
|
||||||
|
@ -149,13 +149,13 @@ export default {
|
||||||
.player {
|
.player {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: @height-player;
|
height: @height-player;
|
||||||
// border-top: 1px solid var(--color-primary-alpha-900);
|
border-top: 1px solid var(--color-primary-alpha-900);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
contain: strict;
|
contain: strict;
|
||||||
padding: 8px 6px 6px;
|
padding: 6px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
// box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
|
// box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
|
||||||
* {
|
* {
|
||||||
|
@ -169,22 +169,10 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: var(--color-main-background);
|
background-color: var(--color-main-background);
|
||||||
opacity: .8;
|
opacity: .9;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.progress {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
padding-bottom: 6px;
|
|
||||||
// height: 15px;
|
|
||||||
.progressBar {
|
|
||||||
height: 2px;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.picContent {
|
.picContent {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -240,7 +228,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.infoContent {
|
.infoContent {
|
||||||
padding-left: 10px;
|
padding: 0 10px;
|
||||||
flex: auto;
|
flex: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
|
@ -266,10 +254,37 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeContent {
|
.timeContent {
|
||||||
|
width: 30%;
|
||||||
|
// position: relative;
|
||||||
flex: none;
|
flex: none;
|
||||||
color: var(--color-font);
|
color: var(--color-300);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
padding-left: 10px;
|
// padding-left: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.progress {
|
||||||
|
// position: absolute;
|
||||||
|
// top: 0;
|
||||||
|
// left: 0;
|
||||||
|
// width: 100%;
|
||||||
|
flex: auto;
|
||||||
|
// width: 160px;
|
||||||
|
position: relative;
|
||||||
|
// padding-bottom: 6px;
|
||||||
|
margin: 0 8px;
|
||||||
|
padding: 8px 0;
|
||||||
|
// height: 15px;
|
||||||
|
// .progressBar {
|
||||||
|
// height: 4px;
|
||||||
|
// // border-radius: 0;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.playBtnContent {
|
.playBtnContent {
|
||||||
|
|
|
@ -54,7 +54,7 @@ export default {
|
||||||
},
|
},
|
||||||
maxHeight: {
|
maxHeight: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '80%',
|
default: '76%',
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
Loading…
Reference in New Issue