更新播放栏UI

This commit is contained in:
Folltoshe 2022-11-06 19:53:19 +08:00
parent d1d9d65a06
commit 6fd513ee79
2 changed files with 126 additions and 81 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "lx-music-desktop", "name": "lx-music-desktop",
"version": "2.0.0-beta.6", "version": "2.0.0-beta.7",
"description": "一个免费的音乐查找助手", "description": "一个免费的音乐查找助手",
"main": "./dist/main.js", "main": "./dist/main.js",
"productName": "lx-music-desktop", "productName": "lx-music-desktop",

View File

@ -5,22 +5,15 @@
<div v-else :class="$style.emptyPic">L<span>X</span></div> <div v-else :class="$style.emptyPic">L<span>X</span></div>
</div> </div>
<div :class="$style.infoContent"> <div :class="$style.infoContent">
<div :class="$style.title" :aria-label="title + $t('copy_tip')" @click="handleCopy(title)"> <div :class="$style.title" :aria-label=" title + $t('copy_tip')" @click="handleCopy(title)">
{{ title }} {{ title }}
</div> </div>
<div :class="$style.status">{{ statusText }}</div> <div :class="$style.status">{{ statusText }}</div>
</div> </div>
<div :class="$style.timeContent"> <div :class="$style.rightContent">
<span>{{ nowPlayTimeStr }}</span> <div :class="$style.rightBtn">
<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>
</div>
<!-- <play-progress /> -->
<control-btns />
<div :class="$style.playBtnContent"> <div :class="$style.playBtnContent">
<control-btns />
<div :class="$style.playBtn" :aria-label="$t('player__prev')" style="transform: rotate(180deg);" @click="playPrev()"> <div :class="$style.playBtn" :aria-label="$t('player__prev')" style="transform: rotate(180deg);" @click="playPrev()">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" height="100%" viewBox="0 0 220.847 220.847" space="preserve"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" height="100%" viewBox="0 0 220.847 220.847" space="preserve">
<use xlink:href="#icon-nextMusic" /> <use xlink:href="#icon-nextMusic" />
@ -41,6 +34,19 @@
</div> </div>
</div> </div>
</div> </div>
<div :class="$style.rightProgress">
<div :class="$style.timeContent">
<span>{{ nowPlayTimeStr }}</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>{{ maxPlayTimeStr }}</span>
</div>
</div>
</div>
<!-- <play-progress /> -->
</div>
</template> </template>
<script> <script>
@ -115,6 +121,18 @@ export default {
: '^-^' : '^-^'
}) })
const titleName = computed(() => {
return musicInfo.name
? musicInfo.name
: '^-^'
})
const titleSinger = computed(() => {
return musicInfo.singer
? musicInfo.singer
: '^-^'
})
// onBeforeUnmount(() => { // onBeforeUnmount(() => {
// window.eventHub.emit(eventPlayerNames.setTogglePlay) // window.eventHub.emit(eventPlayerNames.setTogglePlay)
// }) // })
@ -130,6 +148,8 @@ export default {
imgError, imgError,
statusText, statusText,
title, title,
titleName,
titleSinger,
showPlayerDetail, showPlayerDetail,
isPlay, isPlay,
togglePlay, togglePlay,
@ -177,7 +197,6 @@ export default {
.picContent { .picContent {
height: 100%; height: 100%;
aspect-ratio: 1 / 1; aspect-ratio: 1 / 1;
// color: var(--color-primary); // color: var(--color-primary);
// transition: @transition-normal; // transition: @transition-normal;
// transition-property: color; // transition-property: color;
@ -189,11 +208,9 @@ export default {
justify-content: center; justify-content: center;
// align-items: center; // align-items: center;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
opacity: .8; opacity: .8;
} }
// svg { // svg {
// fill: currentColor; // fill: currentColor;
// } // }
@ -227,59 +244,24 @@ export default {
} }
} }
.infoContent {
padding: 0 10px;
flex: auto;
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: flex-start;
font-size: 14px;
color: var(--color-font);
min-width: 0;
line-height: 1.5;
}
.title {
max-width: 100%;
font-size: 12px;
color: var(--color-font-label);
.mixin-ellipsis-1;
}
.status {
padding-top: 2px;
height: 23px;
.mixin-ellipsis-1;
max-width: 100%;
}
.timeContent { .timeContent {
width: 30%; width: 100%;
// position: relative; // position: relative;
flex: none; flex: none;
color: var(--color-300); color: var(--color-300);
font-size: 13px; font-size: 13px;
// padding-left: 10px; padding-top: 8px;
padding-right: 10px;
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
align-items: center; align-items: center;
} }
.progress { .progress {
// position: absolute; // position: absolute;
// top: 0;
// left: 0;
// width: 100%;
flex: auto; flex: auto;
// width: 160px;
position: relative; position: relative;
// padding-bottom: 6px;
margin: 0 8px; margin: 0 8px;
padding: 8px 0; padding: 8px 0;
// height: 15px;
// .progressBar {
// height: 4px;
// // border-radius: 0;
// }
} }
.time { .time {
display: flex; display: flex;
@ -287,27 +269,78 @@ export default {
justify-content: space-between; justify-content: space-between;
} }
.playBtnContent { .infoContent {
height: 100%;
flex: none;
display: flex;
flex-flow: row nowrap;
align-items: center;
padding-left: 10px; padding-left: 10px;
padding-right: 15px; flex: auto;
gap: 18px; display: flex;
margin-right: auto;
flex-flow: column nowrap;
justify-content: center;
align-items: flex-start;
font-size: 12px;
color: var(--color-font);
min-width: 0;
line-height: 2.2;
max-width: 40%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.title {
.mixin-ellipsis-1;
color: var(--color-font);
font-size: 14px;
max-width: 100%;
}
.status {
.mixin-ellipsis-1;
color: var(--color-font-lable);
font-size: 12px;
max-width: 100%;
} }
.rightContent {
position: absolute;
height: 100%;
width: 50%;
right: 0;
margin-right: auto;
padding-right: 10px;
flex: auto;
display: flex;
justify-content: center;
font-size: 13px;
color: var(--color-font);
}
.rightBtn {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
padding-top: 8px;
padding-right: 20px;
width: 100%;
height: 50%;
}
.playBtnContent {
position: absolute;
justify-content: center;
align-items: center;
display: flex;
height: 100%;
width: 100%;
gap: 28px;
}
.play-btn { .play-btn {
position: relative;
flex: none; flex: none;
height: 52%; height: 90%;
// margin-top: -2px;
transition: @transition-fast; transition: @transition-fast;
transition-property: color, opacity; transition-property: color, opacity;
color: var(--color-button-font); color: var(--color-button-font);
opacity: 1; opacity: 1;
cursor: pointer; cursor: pointer;
svg { svg {
fill: currentColor; fill: currentColor;
filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2)); filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));
@ -320,4 +353,16 @@ export default {
} }
} }
.rightProgress {
position: absolute;
right: 0;
display: inline-block;
justify-content: center;
width: 100%;
height: 50%;
top: 50%;
bottom: 0;
margin-left: auto;
}
</style> </style>