style: 样式调整

This commit is contained in:
539943419 committed 2024-09-27 15:51:52 +08:00
1 parent 55381df4f6
commit dafe494ce9
3 files changed
+59 -38

No files matched your search

@@ -101,13 +101,5 @@ onUnmounted(() => {
position: fixed; position: fixed;
bottom: 10px; bottom: 10px;
width: -webkit-fill-available; width: -webkit-fill-available;
.aplayer-list {
max-height: 444px !important;
ol {
max-height: inherit !important;
}
}
} }
</style> </style>
@@ -1,36 +1,46 @@
<template> <template>
<ol :style="{ maxHeight: ap.options.listMaxHeight }" :key="refreshKey" > <ol :style="{ maxHeight: ap.options.listMaxHeight }" :key="refreshKey">
<VueDraggable v-model="ap.list.audios" @start="onDragStart" @end="onDragEnd" item-key="id" handle=".aplayer-list-control-btn-reorder"> <VueDraggable v-model="ap.list.audios" @start="onDragStart" @end="onDragEnd" item-key="id"
<!-- <template #item="{ element, index }"> --> handle=".aplayer-list-control-btn-reorder" ghostClass="iSDragging">
<li v-for="(element, index) in ap.list.audios" :class="activeAudioIndex == index ? 'aplayer-list-light' : ''" <li v-for="(element, index) in ap.list.audios"
class="aplayer-list-new" @click="switchAudio(index)" :key="element.id"> :class="activeAudioIndex == index ? 'aplayer-list-light' : ''" class="aplayer-list-new"
<span class="aplayer-list-cur" :style="{ backgroundColor: apTheme }"></span> :key="element.id">
<span class="aplayer-list-index">{{ index + 1 }}</span> <span class="aplayer-list-cur" :style="{ backgroundColor: apTheme }"></span>
<span class="aplayer-list-title">{{ element.name }}</span> <span class="aplayer-list-index">{{ index + 1 }}</span>
<span class="aplayer-list-author" v-show="element.artist">{{ element.artist }}</span> <span class="aplayer-list-title">{{ element.name }}</span>
<div class="aplayer-list-control"> <div class="aplayer-list-control">
<div class="aplayer-list-control-btn" @click.stop="listAudioUp(index)" v-if="false"> <div class="aplayer-list-control-btn aplayer-list-control-btn-hover aplayer-list-control-btn-play"
<ChevronUpOutline class="aplayer-list-control-btn-svg" /> @click.stop="switchAudio(index)" v-if="activeAudioIndex !== index">
</div> <PlayOutline class="aplayer-list-control-btn-svg" />
<div class="aplayer-list-control-btn" @click.stop="listAudioDown(index)" v-if="false">
<ChevronDownOutline class="aplayer-list-control-btn-svg" />
</div>
<div class="aplayer-list-control-btn" @click.stop="listAudioRemove(index)">
<CloseOutline class="aplayer-list-control-btn-svg" />
</div>
<div class="aplayer-list-control-btn aplayer-list-control-btn-reorder">
<ReorderFourOutline class="aplayer-list-control-btn-svg" />
</div>
</div> </div>
</li> <div class="aplayer-list-control-btn aplayer-list-control-btn-hover"
<!-- </template> --> @click.stop="switchAudio(index)" v-if="false">
<HeartOutline class="aplayer-list-control-btn-svg" />
</div>
<div class="aplayer-list-control-btn" @click.stop="listAudioUp(index)" v-if="false">
<ChevronUpOutline class="aplayer-list-control-btn-svg" />
</div>
<div class="aplayer-list-control-btn" @click.stop="listAudioDown(index)" v-if="false">
<ChevronDownOutline class="aplayer-list-control-btn-svg" />
</div>
<div class="aplayer-list-control-btn aplayer-list-control-btn-hover"
@click.stop="listAudioRemove(index)">
<CloseOutline class="aplayer-list-control-btn-svg" />
</div>
<div class="aplayer-list-control-btn aplayer-list-control-btn-reorder">
<ReorderFourOutline class="aplayer-list-control-btn-svg" />
</div>
</div>
<span class="aplayer-list-author" v-show="element.artist !== 'Audio artist1'">{{ element.artist
}}</span>
</li>
</VueDraggable> </VueDraggable>
</ol> </ol>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, ref } from 'vue'; import { computed, onMounted, ref } from 'vue';
import { ChevronUpOutline, ChevronDownOutline, CloseOutline, ReorderFourOutline } from '@vicons/ionicons5'; import { ChevronUpOutline, ChevronDownOutline, CloseOutline, ReorderFourOutline, PlayOutline, HeartOutline } from '@vicons/ionicons5';
import { VueDraggable } from 'vue-draggable-plus' import { VueDraggable } from 'vue-draggable-plus'
import apType, { audioType } from '../types/ap'; import apType, { audioType } from '../types/ap';
@@ -65,8 +75,8 @@ const switchAudio = (index: number) => {
props.ap.list.switch(index) props.ap.list.switch(index)
} }
const listRefreshIndex = (curr: audioType) => { const listRefreshIndex = (curr: audioType) => {
for(let index in props.ap.list.audios){ for (let index in props.ap.list.audios) {
if(props.ap.list.audios[index] === curr) { if (props.ap.list.audios[index] === curr) {
props.ap.list.index = parseInt(index) props.ap.list.index = parseInt(index)
return return
} }
@@ -107,7 +117,7 @@ const listAudioDown = (index: number) => {
const listAudioRemove = (index: number) => { const listAudioRemove = (index: number) => {
props.ap.list.remove(index) props.ap.list.remove(index)
} }
const {onDragStart, onDragEnd} = (() => { const { onDragStart, onDragEnd } = (() => {
let curr: audioType let curr: audioType
return { return {
onDragStart: () => { onDragStart: () => {
@@ -131,10 +141,19 @@ onMounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.aplayer-list-new { .aplayer-list-new {
height: fit-content !important; height: fit-content !important;
cursor: default !important;
.aplayer-list-cur { .aplayer-list-cur {
height: calc( 100% - 8px ) !important; height: calc(100% - 8px) !important;
}
.aplayer-list-index {
display: inline-block;
width: 20px;
margin-right: 4px !important;
} }
} }
.aplayer-list-control { .aplayer-list-control {
float: right; float: right;
height: 32px; height: 32px;
@@ -147,12 +166,17 @@ onMounted(() => {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
cursor: pointer;
&-svg { &-svg {
width: 20px; width: 20px;
aspect-ratio: 1; aspect-ratio: 1;
transition: all .1s ease; transition: all .1s ease;
}
}
&-btn-hover {
.aplayer-list-control-btn-svg {
&:hover { &:hover {
width: 24px; width: 24px;
} }
@@ -166,4 +190,9 @@ onMounted(() => {
.aplayer .aplayer-list-new svg path { .aplayer .aplayer-list-new svg path {
fill: #ffffff00; fill: #ffffff00;
} }
.iSDragging {
opacity: 0.5;
background: #60e8a2 !important;
}
</style> </style>
+1 -1
View File
@@ -1,6 +1,6 @@
export type audioType = { export type audioType = {
url: string url: string
artist: string artist?: string
cover?: string cover?: string
name: string name: string
theme?: string theme?: string