-
@@ -39,7 +39,7 @@ export default {
window.app_event.setVolume(volumeEvent.msDownVolume = val)
- if (isMute.value) window.app_event.setVolumeIsMute(false)
+ // if (isMute.value) window.app_event.setVolumeIsMute(false)
}
const handleVolumeMsUp = () => {
volumeEvent.isMsDown = false
@@ -76,8 +76,9 @@ export default {
.volume-content {
flex: none;
position: relative;
- width: 80px;
- margin-right: 10px;
+ width: 100px;
+ padding: 5px 0;
+ // margin-right: 10px;
display: flex;
align-items: center;
opacity: .5;
@@ -90,20 +91,20 @@ export default {
.volume {
// cursor: pointer;
width: 100%;
- height: 0.25em;
- border-radius: 10px;
+ height: 5px;
+ // border-radius: 10px;
// overflow: hidden;
transition: @transition-normal;
transition-property: background-color, opacity;
- background-color: var(--color-button-background);
+ background-color: var(--color-primary-alpha-700);
// background-color: #f5f5f5;
position: relative;
- border-radius: @radius-progress-border;
+ // border-radius: @radius-progress-border;
}
-.muted {
- opacity: .5;
-}
+// .muted {
+// opacity: .5;
+// }
.volume-bar {
position: absolute;
@@ -115,9 +116,9 @@ export default {
transition-timing-function: ease;
width: 100%;
height: 100%;
- border-radius: @radius-progress-border;
+ // border-radius: @radius-progress-border;
transition-duration: 0.2s;
- background-color: var(--color-button-background);
+ background-color: var(--color-button-font);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}
diff --git a/src/renderer/components/common/VolumeBtn.vue b/src/renderer/components/common/VolumeBtn.vue
new file mode 100644
index 00000000..b39e0116
--- /dev/null
+++ b/src/renderer/components/common/VolumeBtn.vue
@@ -0,0 +1,94 @@
+
+
+
+
+
+ {{ Math.trunc(volume * 100) }}%
+
+
+
+
+
+
+
+
+
+
diff --git a/src/renderer/components/layout/Icons.vue b/src/renderer/components/layout/Icons.vue
index 93c958cf..4a32a5ba 100644
--- a/src/renderer/components/layout/Icons.vue
+++ b/src/renderer/components/layout/Icons.vue
@@ -170,13 +170,12 @@
-
-
-
+
+
-
-
+
+
diff --git a/src/renderer/components/layout/PlayBar/ControlBtns.vue b/src/renderer/components/layout/PlayBar/ControlBtns.vue
index b3e284d4..4601342f 100644
--- a/src/renderer/components/layout/PlayBar/ControlBtns.vue
+++ b/src/renderer/components/layout/PlayBar/ControlBtns.vue
@@ -1,43 +1,27 @@
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/src/renderer/components/layout/PlayBar/index.vue b/src/renderer/components/layout/PlayBar/index.vue
index b12360ce..cf9d649a 100644
--- a/src/renderer/components/layout/PlayBar/index.vue
+++ b/src/renderer/components/layout/PlayBar/index.vue
@@ -1,26 +1,25 @@
-
+
+
+
+
![]()
-
+
LX
-
-
-
-
-
-
-
{{ statusText }}{{ nowPlayTimeStr }}/{{ maxPlayTimeStr }}
+
+
+ {{ title }}
+
{{ statusText }}
-
+
+ {{ nowPlayTimeStr }}
+ /
+ {{ maxPlayTimeStr }}
+
+
+
-
@@ -157,29 +144,51 @@ export default {
@import '@renderer/assets/styles/layout.less';
.player {
+ position: relative;
height: @height-player;
- background-color: var(--color-main-background);
- border-top: 1px solid var(--color-primary-alpha-900);
+ // border-top: 1px solid var(--color-primary-alpha-900);
box-sizing: border-box;
display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
contain: strict;
- padding: 5px 0;
+ padding: 11px 6px 6px;
z-index: 2;
// box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
* {
box-sizing: border-box;
}
+
+ &:before {
+ .mixin-after;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: var(--color-main-background);
+ opacity: .8;
+ z-index: -1;
+ }
}
-.left {
- width: @height-player - 2;
+.progress {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ padding-bottom: 5px;
+ // height: 15px;
+}
+
+.picContent {
height: 100%;
+ aspect-ratio: 1 / 1;
+
// color: var(--color-primary);
// transition: @transition-normal;
// transition-property: color;
flex: none;
- padding: 2PX;
opacity: 1;
- // transition: @transition-normal;
+ transition: opacity @transition-fast;
// transition-property: opacity;
display: flex;
justify-content: center;
@@ -190,9 +199,9 @@ export default {
opacity: .8;
}
- svg {
- fill: currentColor;
- }
+ // svg {
+ // fill: currentColor;
+ // }
img {
box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
max-width: 100%;
@@ -203,58 +212,77 @@ export default {
border-radius: @radius-border;
// border: 2px solid @color-theme_2-background_1;
}
+
+ .emptyPic {
+ background-color: var(--color-primary-light-900-alpha-200);
+ border-radius: @radius-border;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--color-primary-light-400-alpha-200);
+ user-select: none;
+ font-size: 20px;
+ font-family: Consolas, "Courier New", monospace;
+
+ span {
+ padding-left: 3px;
+ }
+ }
}
-.middle {
+
+.infoContent {
+ padding-left: 10px;
flex: auto;
- height: 100%;
- padding: 2px 10px 2px 8px;
display: flex;
flex-flow: column nowrap;
+ justify-content: center;
+ align-items: flex-start;
+ font-size: 14px;
+ color: var(--color-font);
+ min-width: 0;
}
-.right {
+
+.title {
+ max-width: 100%;
+ font-size: 13px;
+ color: var(--color-font-label);
+ .mixin-ellipsis-1;
+}
+.status {
+ padding-top: 5px;
+ height: 23px;
+ .mixin-ellipsis-1;
+ line-height: 1.5;
+ max-width: 100%;
+}
+
+.timeContent {
+ flex: none;
+ color: var(--color-font);
+ font-size: 13px;
+ padding-left: 10px;
+}
+
+.playBtnContent {
height: 100%;
flex: none;
display: flex;
flex-flow: row nowrap;
align-items: center;
- padding-left: 15px;
- padding-right: 20px;
-}
-.column1 {
- flex: auto;
- position: relative;
- font-size: 16px;
- .container {
- position: absolute;
- left: 0;
- width: 100%;
- height: 100%;
- display: flex;
- flex-flow: row nowrap;
- justify-content: space-between;
- }
-}
-
-.title {
- flex: 0 1 auto;
- min-width: 0;
- padding-right: 5px;
- font-size: 14px;
- line-height: 18px;
- .mixin-ellipsis-1;
+ padding-left: 10px;
+ padding-right: 15px;
+ gap: 18px;
}
.play-btn {
- + .play-btn {
- margin-left: 15px;
- }
flex: none;
- height: 46%;
+ height: 52%;
// margin-top: -2px;
- // transition: @transition-normal;
- // transition-property: color;
+ transition: @transition-fast;
+ transition-property: color, opacity;
color: var(--color-button-font);
- transition: opacity 0.2s ease;
opacity: 1;
cursor: pointer;
@@ -270,54 +298,4 @@ export default {
}
}
-.column2 {
- flex: none;
- padding: 3px 0;
- height: 10px;
- position: relative;
-}
-
-
-.column3 {
- transition: @transition-normal;
- transition-property: color;
- color: var(--color-font);
- flex: none;
- font-size: 12px;
- display: flex;
- padding-top: 2px;
- // justify-content: space-between;
- height: 22px;
- align-items: center;
-}
-
-.status-text {
- font-size: 0.98em;
- transition: @transition-normal;
- transition-property: color;
- color: var(--color-font-label);
- .mixin-ellipsis-1;
- // padding: 0 5px;
- padding-right: 5px;
- flex: 1 1 0;
- // text-align: center;
- line-height: 1.2;
- width: 0;
-}
-
-#icon-pic {
- // color: var(--color-primary);
- .c1 {
- transition: @transition-normal;
- transition-property: fill;
- // fill: @color-player-pic-c1;
- }
- .c2 {
- transition: @transition-normal;
- transition-property: fill;
- // fill: @color-player-pic-c2;
- }
-}
-
-
diff --git a/src/renderer/components/layout/PlayDetail/PlayBar.vue b/src/renderer/components/layout/PlayDetail/PlayBar.vue
index cc2d9df2..b44c742e 100644
--- a/src/renderer/components/layout/PlayDetail/PlayBar.vue
+++ b/src/renderer/components/layout/PlayDetail/PlayBar.vue
@@ -12,7 +12,7 @@
/>
-
{{ status }}{{ nowPlayTimeStr }}/{{ maxPlayTimeStr }}
+
{{ status }}{{ nowPlayTimeStr }}/{{ maxPlayTimeStr }}
diff --git a/src/renderer/components/layout/PlayDetail/components/ControlBtns.vue b/src/renderer/components/layout/PlayDetail/components/ControlBtns.vue
index a3a3e5fe..b464c9c3 100644
--- a/src/renderer/components/layout/PlayDetail/components/ControlBtns.vue
+++ b/src/renderer/components/layout/PlayDetail/components/ControlBtns.vue
@@ -1,32 +1,22 @@
div(:class="$style.footerLeftControlBtns")
- common-volume-bar
- div(:class="[$style.footerLeftControlBtn, $style.lrcBtn]" @click="toggleDesktopLyric" @contextmenu="toggleLockDesktopLyric" :aria-label="toggleDesktopLyricBtnTitle")
+ button(:class="[$style.footerLeftControlBtn, $style.lrcBtn]" @click="toggleDesktopLyric" @contextmenu="toggleLockDesktopLyric" :aria-label="toggleDesktopLyricBtnTitle")
svg(v-show="appSetting['desktopLyric.enable']" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='125%' viewBox='0 0 512 512' space='preserve')
use(xlink:href='#icon-desktop-lyric-on')
svg(v-show="!appSetting['desktopLyric.enable']" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='125%' viewBox='0 0 512 512' space='preserve')
use(xlink:href='#icon-desktop-lyric-off')
- div(:class="[$style.footerLeftControlBtn, { [$style.active]: appSetting['player.audioVisualization'] }]" @click="toggleAudioVisualization" :aria-label="$t('audio_visualization')")
+ button(:class="[$style.footerLeftControlBtn, { [$style.active]: appSetting['player.audioVisualization'] }]" @click="toggleAudioVisualization" :aria-label="$t('audio_visualization')")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='95%' viewBox='0 0 24 24' space='preserve')
use(xlink:href='#icon-audio-wave')
- div(:class="[$style.footerLeftControlBtn, { [$style.active]: isShowLrcSelectContent }]" @click="toggleVisibleLrc" :aria-label="$t('lyric__select')")
+ button(:class="[$style.footerLeftControlBtn, { [$style.active]: isShowLrcSelectContent }]" @click="toggleVisibleLrc" :aria-label="$t('lyric__select')")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='95%' viewBox='0 0 24 24' space='preserve')
use(xlink:href='#icon-text')
- div(:class="[$style.footerLeftControlBtn, {[$style.active]: isShowPlayComment}]" @click="toggleVisibleComment" :aria-label="$t('comment__show')")
+ button(:class="[$style.footerLeftControlBtn, {[$style.active]: isShowPlayComment}]" @click="toggleVisibleComment" :aria-label="$t('comment__show')")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='95%' viewBox='0 0 24 24' space='preserve')
use(xlink:href='#icon-comment')
- div(:class="$style.footerLeftControlBtn" @click="toggleNextPlayMode" :aria-label="nextTogglePlayName")
- svg(v-show="appSetting['player.togglePlayMethod'] == 'listLoop'" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 24 24' space='preserve')
- use(xlink:href='#icon-list-loop')
- svg(v-show="appSetting['player.togglePlayMethod'] == 'random'" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 24 24' space='preserve')
- use(xlink:href='#icon-list-random')
- svg(v-show="appSetting['player.togglePlayMethod'] == 'list'" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='120%' viewBox='0 0 24 24' space='preserve')
- use(xlink:href='#icon-list-order')
- svg(v-show="appSetting['player.togglePlayMethod'] == 'singleLoop'" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='110%' viewBox='0 0 24 24' space='preserve')
- use(xlink:href='#icon-single-loop')
- svg(v-show="!appSetting['player.togglePlayMethod']" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='120%' viewBox='0 0 24 24' space='preserve')
- use(xlink:href='#icon-single')
- div(:class="$style.footerLeftControlBtn" @click="isShowAddMusicTo = true" :aria-label="$t('player__add_music_to')")
+ common-volume-btn
+ common-toggle-play-mode-btn
+ button(:class="$style.footerLeftControlBtn" @click="isShowAddMusicTo = true" :aria-label="$t('player__add_music_to')")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512' space='preserve')
use(xlink:href='#icon-add-2')
common-list-add-modal(v-model:show="isShowAddMusicTo" :musicInfo="playMusicInfo.musicInfo")
@@ -117,29 +107,34 @@ export default {
@import '@renderer/assets/styles/layout.less';
.footerLeftControlBtns {
- color: var(--color-font);
display: flex;
flex-flow: row nowrap;
justify-content: flex-end;
+ align-items: center;
+ gap: 6px;
+
+ button {
+ width: 20px;
+ color: var(--color-font);
+ }
.footerLeftControlBtn {
- width: 18px;
- height: 18px;
+ // width: 18px;
+ // height: 18px;
opacity: .5;
cursor: pointer;
transition: opacity @transition-normal;
display: flex;
align-items: center;
justify-content: center;
+ background-color: transparent;
+ border: none;
+ padding: 0;
&:hover {
opacity: .9;
}
- +.footerLeftControlBtn {
- margin-left: 6px;
- }
-
&.active {
color: var(--color-primary);
opacity: .8;
diff --git a/src/renderer/components/material/PopupBtn.vue b/src/renderer/components/material/PopupBtn.vue
new file mode 100644
index 00000000..4f0c8cb3
--- /dev/null
+++ b/src/renderer/components/material/PopupBtn.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/renderer/core/globalData.ts b/src/renderer/core/globalData.ts
index 5b1a8f50..c5e2d8bd 100644
--- a/src/renderer/core/globalData.ts
+++ b/src/renderer/core/globalData.ts
@@ -25,6 +25,7 @@ window.lx = {
restorePlayInfo: null,
worker: createWorkers(),
isDev: process.env.NODE_ENV == 'production',
+ rootOffset: window.dt ? 0 : 8,
}
window.lxData = {}
diff --git a/src/renderer/store/index.ts b/src/renderer/store/index.ts
index 1694f7b2..05818d9b 100644
--- a/src/renderer/store/index.ts
+++ b/src/renderer/store/index.ts
@@ -1,4 +1,4 @@
-import { ref, reactive, shallowRef, markRaw, computed } from '@common/utils/vueTools'
+import { ref, reactive, shallowRef, markRaw, computed, watch } from '@common/utils/vueTools'
import { windowSizeList as configWindowSizeList } from '@common/config'
import { appSetting } from './setting'
import pkg from '../../../package.json'
@@ -117,6 +117,9 @@ export const userApi = reactive<{
})
export const isFullscreen = ref(false)
+watch(isFullscreen, isFullscreen => {
+ window.lx.rootOffset = window.dt || isFullscreen ? 0 : 8
+}, { immediate: true })
export const themeShouldUseDarkColors = ref(window.shouldUseDarkColors)
diff --git a/src/renderer/types/app.d.ts b/src/renderer/types/app.d.ts
index 99692943..2df8b609 100644
--- a/src/renderer/types/app.d.ts
+++ b/src/renderer/types/app.d.ts
@@ -26,6 +26,7 @@ interface Lx {
songlistKey: string | null
songlistPosition?: number
}
+ rootOffset: number
}
declare global {
diff --git a/src/renderer/utils/compositions/useMenuLocation.js b/src/renderer/utils/compositions/useMenuLocation.js
index fe534667..26fb4720 100644
--- a/src/renderer/utils/compositions/useMenuLocation.js
+++ b/src/renderer/utils/compositions/useMenuLocation.js
@@ -1,7 +1,5 @@
import { onMounted, onBeforeUnmount, watch, reactive, ref } from '@common/utils/vueTools'
-import { isFullscreen } from '@renderer/store'
-let rootOffset = window.dt ? 0 : 8
export default ({ visible, location, onHide }) => {
const transition1 = 'transform, opacity'
@@ -61,13 +59,9 @@ export default ({ visible, location, onHide }) => {
visible ? handleShow() : handleHide()
}, { immediate: true })
- watch(isFullscreen, isFullscreen => {
- rootOffset = window.dt || isFullscreen ? 0 : 8
- }, { immediate: true })
-
watch(location, location => {
- menuStyles.left = location.x - rootOffset + 2 + 'px'
- menuStyles.top = location.y - rootOffset + 'px'
+ menuStyles.left = location.x - window.lx.rootOffset + 2 + 'px'
+ menuStyles.top = location.y - window.lx.rootOffset + 'px'
// nextTick(() => {
if (show) {
if (menuStyles.transitionProperty != transition2) menuStyles.transitionProperty = transition2
diff --git a/src/renderer/utils/compositions/useNextTogglePlay.ts b/src/renderer/utils/compositions/useNextTogglePlay.ts
index a1730be3..37047eae 100644
--- a/src/renderer/utils/compositions/useNextTogglePlay.ts
+++ b/src/renderer/utils/compositions/useNextTogglePlay.ts
@@ -4,13 +4,13 @@ import {
} from '@common/utils/vueTools'
import { useI18n } from '@renderer/plugins/i18n'
-const playNextModes = [
- 'listLoop',
- 'random',
- 'list',
- 'singleLoop',
- 'none',
-] as const
+// const playNextModes = [
+// 'listLoop',
+// 'random',
+// 'list',
+// 'singleLoop',
+// 'none',
+// ] as const
export default () => {
const t = useI18n()
@@ -24,10 +24,11 @@ export default () => {
}
})
- const toggleNextPlayMode = () => {
- let index = playNextModes.indexOf(appSetting['player.togglePlayMethod'])
- if (++index >= playNextModes.length) index = 0
- setTogglePlayMode(playNextModes[index] ?? playNextModes[0])
+ const toggleNextPlayMode = (mode: LX.AppSetting['player.togglePlayMethod']) => {
+ if (mode == appSetting['player.togglePlayMethod']) return
+ // let index = playNextModes.indexOf(appSetting['player.togglePlayMethod'])
+ // if (++index >= playNextModes.length) index = 0
+ setTogglePlayMode(mode)
}
return {