修改播放列表的css

pull/2369/head
QiuLiang-99 2025-05-02 02:12:14 +08:00
parent 44fe92df94
commit d300064c56
2 changed files with 12 additions and 46 deletions

View File

@ -5,15 +5,10 @@
<layout-toolbar id="toolbar" /> <layout-toolbar id="toolbar" />
<div class="middle"> <div class="middle">
<layout-view id="view" ref="viewRef" /> <layout-view id="view" ref="viewRef" />
<PlayListWindow <PlayListWindow id="playlist" v-if="isShowPlaylist" @close="closePlaylist" />
v-if="isShowPlaylist"
:style="playlistStyle"
@close="closePlaylist"
/>
</div> </div>
<layout-play-bar id="player" /> <layout-play-bar id="player" />
</div> </div>
<layout-icons /> <layout-icons />
<layout-change-log-modal /> <layout-change-log-modal />
<layout-update-modal /> <layout-update-modal />
@ -31,31 +26,15 @@ import PlayListWindow from '@renderer/components/common/PlayListWindow.vue'
import { isShowPlaylist } from '@renderer/store/player/state' import { isShowPlaylist } from '@renderer/store/player/state'
import { setShowPlaylist } from '@renderer/store/player/action' import { setShowPlaylist } from '@renderer/store/player/action'
const viewRef = ref(null)
const playlistStyle = computed(() => {
const el = viewRef.value?.$el || viewRef.value
if (!el) return {}
const rect = el.getBoundingClientRect()
return {
position: 'absolute',
left: `${rect.left}px`,
top: `${rect.top}px`,
height: `${rect.height}px`,
width: `${rect.width}px`,
zIndex: 1000,
}
})
const closePlaylist = () => { const closePlaylist = () => {
setShowPlaylist(false) setShowPlaylist(false)
} }
useApp() useApp()
onMounted(async () => { onMounted(() => {
document.getElementById('root').style.display = 'block' document.getElementById('root').style.display = 'block'
await nextTick() nextTick()
}) })
</script> </script>
@ -63,11 +42,13 @@ onMounted(async () => {
@import './assets/styles/index.less'; @import './assets/styles/index.less';
@import './assets/styles/layout.less'; @import './assets/styles/layout.less';
html, body { html, body {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
user-select: none; user-select: none;
} }
#root { #root {
height: 100%; height: 100%;
position: relative; position: relative;
@ -112,18 +93,15 @@ html, body {
flex: auto; flex: auto;
min-height: 0; min-height: 0;
} }
#playlist {
.playlist-window { position: absolute;
position: relative;
top: 0; top: 0;
left: 0; right: 0;
width: 100%; width: 320px;
height: 100%; height: 100%;
border-left: 1px solid var(--color-border);
background-color: var(--color-main-background);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
border-radius: @radius-border;
overflow: hidden;
z-index: 1000; z-index: 1000;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
} }
</style> </style>

View File

@ -32,18 +32,6 @@ const emitClose = () => {
</script> </script>
<style scoped> <style scoped>
.playlist-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
}
.playlist-window { .playlist-window {
background-color: #222; background-color: #222;