2022-04-15 14:24:30 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
ref="wrapper"
|
2022-05-09 14:27:17 +00:00
|
|
|
:class="type"
|
|
|
|
class="song-list-wrap main-scroll-wrap"
|
|
|
|
data-testid="song-list"
|
2022-04-15 14:24:30 +00:00
|
|
|
tabindex="0"
|
|
|
|
@keydown.delete.prevent.stop="handleDelete"
|
|
|
|
@keydown.enter.prevent.stop="handleEnter"
|
|
|
|
@keydown.a.prevent="handleA"
|
|
|
|
>
|
2022-06-10 10:47:46 +00:00
|
|
|
<div :class="config.sortable ? 'sortable' : 'unsortable'" class="song-list-header">
|
2022-05-09 14:27:17 +00:00
|
|
|
<span
|
2022-06-10 10:47:46 +00:00
|
|
|
v-if="config.columns.includes('track')"
|
2022-05-09 14:27:17 +00:00
|
|
|
class="track-number"
|
|
|
|
data-testid="header-track-number"
|
2022-06-10 10:47:46 +00:00
|
|
|
@click="sort('track')"
|
2022-05-09 14:27:17 +00:00
|
|
|
>
|
2022-04-24 18:44:48 +00:00
|
|
|
#
|
2022-07-05 15:09:20 +00:00
|
|
|
<i v-show="sortField === 'track' && sortOrder === 'asc'" class="fa fa-angle-down"></i>
|
|
|
|
<i v-show="sortField === 'track' && sortOrder === 'desc'" class="fa fa-angle-up"></i>
|
2022-04-24 18:44:48 +00:00
|
|
|
</span>
|
2022-05-09 14:27:17 +00:00
|
|
|
<span
|
2022-06-10 10:47:46 +00:00
|
|
|
v-if="config.columns.includes('title')"
|
2022-05-09 14:27:17 +00:00
|
|
|
class="title"
|
|
|
|
data-testid="header-title"
|
2022-06-10 10:47:46 +00:00
|
|
|
@click="sort('title')"
|
2022-05-09 14:27:17 +00:00
|
|
|
>
|
2022-04-24 18:44:48 +00:00
|
|
|
Title
|
2022-07-05 15:09:20 +00:00
|
|
|
<i v-show="sortField === 'title' && sortOrder === 'asc'" class="fa fa-angle-down"></i>
|
|
|
|
<i v-show="sortField === 'title' && sortOrder === 'desc'" class="fa fa-angle-up"></i>
|
2022-04-24 18:44:48 +00:00
|
|
|
</span>
|
2022-04-15 17:00:08 +00:00
|
|
|
<span
|
2022-06-10 10:47:46 +00:00
|
|
|
v-if="config.columns.includes('artist')"
|
2022-05-09 14:27:17 +00:00
|
|
|
class="artist"
|
|
|
|
data-testid="header-artist"
|
2022-06-10 10:47:46 +00:00
|
|
|
@click="sort('artist_name')"
|
2022-04-15 17:00:08 +00:00
|
|
|
>
|
2022-04-24 18:44:48 +00:00
|
|
|
Artist
|
2022-07-05 15:09:20 +00:00
|
|
|
<i v-show="sortField === 'artist_name' && sortOrder === 'asc'" class="fa fa-angle-down"></i>
|
|
|
|
<i v-show="sortField === 'artist_name' && sortOrder === 'desc'" class="fa fa-angle-up"></i>
|
2022-04-24 18:44:48 +00:00
|
|
|
</span>
|
2022-04-15 17:00:08 +00:00
|
|
|
<span
|
2022-06-10 10:47:46 +00:00
|
|
|
v-if="config.columns.includes('album')"
|
2022-05-09 14:27:17 +00:00
|
|
|
class="album"
|
|
|
|
data-testid="header-album"
|
2022-06-10 10:47:46 +00:00
|
|
|
@click="sort('album_name')"
|
2022-04-15 17:00:08 +00:00
|
|
|
>
|
2022-04-24 18:44:48 +00:00
|
|
|
Album
|
2022-07-05 15:09:20 +00:00
|
|
|
<i v-show="sortField === 'album_name' && sortOrder === 'asc'" class="fa fa-angle-down"></i>
|
|
|
|
<i v-show="sortField === 'album_name' && sortOrder === 'desc'" class="fa fa-angle-up"></i>
|
2022-04-24 18:44:48 +00:00
|
|
|
</span>
|
2022-05-09 14:27:17 +00:00
|
|
|
<span
|
2022-06-10 10:47:46 +00:00
|
|
|
v-if="config.columns.includes('length')"
|
2022-05-09 14:27:17 +00:00
|
|
|
class="time"
|
|
|
|
data-testid="header-length"
|
2022-06-10 10:47:46 +00:00
|
|
|
@click="sort('length')"
|
2022-05-09 14:27:17 +00:00
|
|
|
>
|
2022-07-05 15:09:20 +00:00
|
|
|
<i v-show="sortField === 'length' && sortOrder === 'asc'" class="fa fa-angle-down"></i>
|
|
|
|
<i v-show="sortField === 'length' && sortOrder === 'desc'" class="fa fa-angle-up"></i>
|
2022-04-24 18:44:48 +00:00
|
|
|
<i class="duration-header fa fa-clock-o"></i>
|
|
|
|
</span>
|
2022-04-15 17:00:08 +00:00
|
|
|
<span class="favorite"></span>
|
|
|
|
<span class="play"></span>
|
|
|
|
</div>
|
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
<VirtualScroller v-slot="{ item }" :item-height="35" :items="songRows" @scrolled-to-end="$emit('scrolled-to-end')">
|
2022-04-29 08:40:34 +00:00
|
|
|
<SongListItem
|
|
|
|
:key="item.song.id"
|
2022-06-10 10:47:46 +00:00
|
|
|
:columns="config.columns"
|
2022-04-29 08:40:34 +00:00
|
|
|
:item="item"
|
|
|
|
draggable="true"
|
|
|
|
@click="rowClicked(item, $event)"
|
|
|
|
@dragleave="removeDroppableState"
|
|
|
|
@dragstart="rowDragStart(item, $event)"
|
|
|
|
@dragenter.prevent="allowDrop"
|
|
|
|
@dragover.prevent
|
|
|
|
@drop.stop.prevent="handleDrop(item, $event)"
|
2022-04-30 11:55:54 +00:00
|
|
|
@contextmenu.prevent="openContextMenu(item, $event)"
|
2022-04-29 08:40:34 +00:00
|
|
|
/>
|
2022-04-27 20:52:37 +00:00
|
|
|
</VirtualScroller>
|
2022-04-15 14:24:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import isMobile from 'ismobilejs'
|
2022-06-10 10:47:46 +00:00
|
|
|
import { findIndex } from 'lodash'
|
2022-07-04 14:18:41 +00:00
|
|
|
import { computed, defineAsyncComponent, inject, onMounted, ref, watch } from 'vue'
|
2022-06-10 10:47:46 +00:00
|
|
|
import { $, eventBus, startDragging } from '@/utils'
|
2022-07-05 15:09:20 +00:00
|
|
|
import {
|
|
|
|
SelectedSongsKey,
|
|
|
|
SongListConfigKey,
|
|
|
|
SongListSortFieldKey,
|
|
|
|
SongListSortOrderKey,
|
|
|
|
SongListTypeKey,
|
|
|
|
SongsKey
|
|
|
|
} from '@/symbols'
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-27 20:52:37 +00:00
|
|
|
const VirtualScroller = defineAsyncComponent(() => import('@/components/ui/VirtualScroller.vue'))
|
2022-04-24 18:44:48 +00:00
|
|
|
const SongListItem = defineAsyncComponent(() => import('@/components/song/SongListItem.vue'))
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const emit = defineEmits(['press:enter', 'press:delete', 'reorder', 'sort', 'scrolled-to-end'])
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const items = inject(SongsKey, ref([]))
|
|
|
|
const type = inject(SongListTypeKey, 'all-songs')
|
2022-07-04 14:18:41 +00:00
|
|
|
const selectedSongs = inject(SelectedSongsKey, ref([]))
|
2022-07-05 15:09:20 +00:00
|
|
|
const sortField = inject(SongListSortFieldKey, ref('title'))
|
|
|
|
const sortOrder = inject(SongListSortOrderKey, ref('asc'))
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const lastSelectedRow = ref<SongRow>()
|
2022-05-09 14:27:17 +00:00
|
|
|
const sortFields = ref<SongListSortField[]>([])
|
2022-04-29 08:40:34 +00:00
|
|
|
const songRows = ref<SongRow[]>([])
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const allowReordering = type === 'queue'
|
2022-07-04 14:18:41 +00:00
|
|
|
|
|
|
|
watch(songRows, () => {
|
|
|
|
selectedSongs.value = songRows.value.filter(row => row.selected).map(row => row.song)
|
|
|
|
}, { deep: true })
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const config = computed((): SongListConfig => {
|
2022-04-15 17:00:08 +00:00
|
|
|
return Object.assign({
|
|
|
|
sortable: true,
|
|
|
|
columns: ['track', 'title', 'artist', 'album', 'length']
|
2022-06-10 10:47:46 +00:00
|
|
|
}, inject(SongListConfigKey, {}))
|
2022-04-15 17:00:08 +00:00
|
|
|
})
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
/**
|
|
|
|
* Since song objects themselves are shared by all song lists, we can't use them directly to
|
|
|
|
* determine their selection status (selected/unselected). Therefore, for each song list, we
|
2022-04-29 08:40:34 +00:00
|
|
|
* maintain an array of "song rows," each containing the song itself and the "selected" flag.
|
2022-04-15 17:00:08 +00:00
|
|
|
*/
|
2022-04-29 08:40:34 +00:00
|
|
|
const generateSongRows = () => {
|
2022-04-15 17:00:08 +00:00
|
|
|
// Since this method re-generates the song wrappers, we need to keep track of the
|
|
|
|
// selected songs manually.
|
|
|
|
const selectedSongIds = selectedSongs.value.map(song => song.id)
|
|
|
|
|
|
|
|
return items.value.map(song => ({
|
|
|
|
song,
|
|
|
|
selected: selectedSongIds.includes(song.id)
|
|
|
|
}))
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const sort = (field: SongListSortField) => {
|
2022-04-15 17:00:08 +00:00
|
|
|
// there are certain circumstances where sorting is simply disallowed, e.g. in Queue
|
2022-06-10 10:47:46 +00:00
|
|
|
if (!config.value.sortable) {
|
2022-04-15 17:00:08 +00:00
|
|
|
return
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-07-05 15:09:20 +00:00
|
|
|
sortField.value = field
|
2022-06-10 10:47:46 +00:00
|
|
|
sortOrder.value = sortOrder.value === 'asc' ? 'desc' : 'asc'
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
emit('sort', field, sortOrder.value)
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const render = () => {
|
2022-06-10 10:47:46 +00:00
|
|
|
config.value.sortable || (sortFields.value = [])
|
|
|
|
songRows.value = generateSongRows()
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-28 16:04:52 +00:00
|
|
|
watch(items, () => render(), { deep: true })
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-21 18:12:11 +00:00
|
|
|
const handleDelete = () => {
|
|
|
|
emit('press:delete')
|
2022-04-15 17:00:08 +00:00
|
|
|
clearSelection()
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-21 18:12:11 +00:00
|
|
|
const handleEnter = (event: KeyboardEvent) => {
|
|
|
|
emit('press:enter', event)
|
|
|
|
clearSelection()
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
/**
|
|
|
|
* Select all (filtered) rows in the current list.
|
|
|
|
*/
|
2022-04-29 08:40:34 +00:00
|
|
|
const selectAllRows = () => songRows.value.forEach(row => (row.selected = true))
|
|
|
|
const clearSelection = () => songRows.value.forEach(row => (row.selected = false))
|
2022-04-15 17:00:08 +00:00
|
|
|
const handleA = (event: KeyboardEvent) => (event.ctrlKey || event.metaKey) && selectAllRows()
|
2022-04-29 08:40:34 +00:00
|
|
|
const getAllSongsWithSort = () => songRows.value.map(row => row.song)
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-29 08:40:34 +00:00
|
|
|
const rowClicked = (row: SongRow, event: MouseEvent) => {
|
2022-04-15 17:00:08 +00:00
|
|
|
// If we're on a touch device, or if Ctrl/Cmd key is pressed, just toggle selection.
|
|
|
|
if (isMobile.any) {
|
2022-04-29 08:40:34 +00:00
|
|
|
toggleRow(row)
|
2022-04-15 17:00:08 +00:00
|
|
|
return
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
if (event.ctrlKey || event.metaKey) {
|
2022-04-29 08:40:34 +00:00
|
|
|
toggleRow(row)
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
if (event.button === 0) {
|
|
|
|
if (!(event.ctrlKey || event.metaKey || event.shiftKey)) {
|
|
|
|
clearSelection()
|
2022-04-29 08:40:34 +00:00
|
|
|
toggleRow(row)
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
if (event.shiftKey && lastSelectedRow.value) {
|
2022-04-29 08:40:34 +00:00
|
|
|
selectRowsBetween(lastSelectedRow.value, row)
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-29 08:40:34 +00:00
|
|
|
const toggleRow = (row: SongRow) => {
|
|
|
|
row.selected = !row.selected
|
|
|
|
lastSelectedRow.value = row
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-29 08:40:34 +00:00
|
|
|
const selectRowsBetween = (first: SongRow, second: SongRow) => {
|
2022-04-29 09:52:55 +00:00
|
|
|
const firstIndex = Math.max(0, findIndex(songRows.value, row => row.song.id === first.song.id))
|
|
|
|
const secondIndex = Math.max(0, findIndex(songRows.value, row => row.song.id === second.song.id))
|
|
|
|
const indexes = [firstIndex, secondIndex]
|
2022-04-15 17:00:08 +00:00
|
|
|
indexes.sort((a, b) => a - b)
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
for (let i = indexes[0]; i <= indexes[1]; ++i) {
|
2022-04-29 08:40:34 +00:00
|
|
|
songRows.value[i].selected = true
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
/**
|
|
|
|
* Enable dragging songs by capturing the dragstart event on a table row.
|
|
|
|
* Even though the event is triggered on one row only, we'll collect other
|
|
|
|
* selected rows, if any, as well.
|
|
|
|
*/
|
2022-04-29 08:40:34 +00:00
|
|
|
const rowDragStart = (row: SongRow, event: DragEvent) => {
|
2022-04-15 17:00:08 +00:00
|
|
|
// If the user is dragging an unselected row, clear the current selection.
|
2022-04-29 08:40:34 +00:00
|
|
|
if (!row.selected) {
|
2022-04-15 17:00:08 +00:00
|
|
|
clearSelection()
|
2022-04-29 08:40:34 +00:00
|
|
|
row.selected = true
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
startDragging(event, selectedSongs.value, 'Song')
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
/**
|
|
|
|
* Add a "droppable" class and set the drop effect when other songs are dragged over a row.
|
|
|
|
*/
|
|
|
|
const allowDrop = (event: DragEvent) => {
|
2022-06-10 10:47:46 +00:00
|
|
|
if (!allowReordering) return
|
2022-04-15 17:00:08 +00:00
|
|
|
|
|
|
|
$.addClass((event.target as Element).parentElement, 'droppable')
|
|
|
|
event.dataTransfer!.dropEffect = 'move'
|
|
|
|
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2022-04-29 08:40:34 +00:00
|
|
|
const handleDrop = (item: SongRow, event: DragEvent) => {
|
2022-04-15 17:00:08 +00:00
|
|
|
if (
|
2022-06-10 10:47:46 +00:00
|
|
|
!allowReordering ||
|
2022-04-15 17:00:08 +00:00
|
|
|
!event.dataTransfer!.getData('application/x-koel.text+plain') ||
|
|
|
|
!selectedSongs.value.length
|
|
|
|
) {
|
|
|
|
return removeDroppableState(event)
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
2022-04-15 17:00:08 +00:00
|
|
|
|
2022-04-29 08:40:34 +00:00
|
|
|
emit('reorder', item.song)
|
2022-04-15 17:00:08 +00:00
|
|
|
return removeDroppableState(event)
|
|
|
|
}
|
|
|
|
|
|
|
|
const removeDroppableState = (event: DragEvent) => {
|
|
|
|
$.removeClass((event.target as Element).parentElement, 'droppable')
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2022-04-29 08:40:34 +00:00
|
|
|
const openContextMenu = async (row: SongRow, event: MouseEvent) => {
|
2022-04-15 17:00:08 +00:00
|
|
|
// If the user is right-clicking an unselected row,
|
|
|
|
// clear the current selection and select it instead.
|
2022-04-29 08:40:34 +00:00
|
|
|
if (!row.selected) {
|
2022-04-15 17:00:08 +00:00
|
|
|
clearSelection()
|
2022-04-29 08:40:34 +00:00
|
|
|
toggleRow(row)
|
2022-04-15 17:00:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
eventBus.emit('SONG_CONTEXT_MENU_REQUESTED', event, selectedSongs.value)
|
|
|
|
}
|
|
|
|
|
|
|
|
defineExpose({
|
2022-04-19 20:53:36 +00:00
|
|
|
getAllSongsWithSort,
|
|
|
|
sort
|
2022-04-15 14:24:30 +00:00
|
|
|
})
|
2022-04-28 14:46:38 +00:00
|
|
|
|
|
|
|
onMounted(() => render())
|
2022-04-15 14:24:30 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.song-list-wrap {
|
|
|
|
position: relative;
|
2022-04-24 18:44:48 +00:00
|
|
|
padding: 0 !important;
|
2022-04-27 20:52:37 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2022-04-15 14:24:30 +00:00
|
|
|
|
|
|
|
.song-list-header {
|
|
|
|
background: var(--color-bg-secondary);
|
|
|
|
z-index: 1;
|
2022-04-15 17:00:08 +00:00
|
|
|
display: flex;
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
div.droppable {
|
2022-04-15 14:24:30 +00:00
|
|
|
border-bottom-width: 3px;
|
|
|
|
border-bottom-color: var(--color-green);
|
|
|
|
}
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
.song-list-header span, .song-item span {
|
2022-04-15 14:24:30 +00:00
|
|
|
text-align: left;
|
|
|
|
padding: 8px;
|
|
|
|
vertical-align: middle;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
&.time {
|
2022-04-15 17:00:08 +00:00
|
|
|
flex-basis: 96px;
|
2022-04-15 14:24:30 +00:00
|
|
|
padding-right: 24px;
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.track-number {
|
2022-04-15 17:00:08 +00:00
|
|
|
flex-basis: 66px;
|
2022-04-15 14:24:30 +00:00
|
|
|
padding-left: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.artist {
|
2022-04-15 17:00:08 +00:00
|
|
|
flex-basis: 23%;
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.album {
|
2022-04-15 17:00:08 +00:00
|
|
|
flex-basis: 27%;
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.favorite {
|
2022-04-15 17:00:08 +00:00
|
|
|
flex-basis: 36px;
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.play {
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
@media (hover: none) {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 8px;
|
|
|
|
right: 4px;
|
|
|
|
}
|
|
|
|
}
|
2022-04-15 17:00:08 +00:00
|
|
|
|
|
|
|
&.title {
|
|
|
|
flex: 1;
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
.song-list-header {
|
2022-04-15 14:24:30 +00:00
|
|
|
color: var(--color-text-secondary);
|
|
|
|
letter-spacing: 1px;
|
|
|
|
text-transform: uppercase;
|
|
|
|
cursor: pointer;
|
|
|
|
|
2022-04-24 18:44:48 +00:00
|
|
|
i:not(.duration-header) {
|
2022-04-15 14:24:30 +00:00
|
|
|
color: var(--color-highlight);
|
|
|
|
font-size: 1.2rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
.unsortable span {
|
2022-04-15 14:24:30 +00:00
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
|
|
|
|
.scroller {
|
|
|
|
overflow: auto;
|
|
|
|
position: absolute;
|
|
|
|
top: 35px;
|
|
|
|
left: 0;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
overflow-y: scroll;
|
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
|
|
|
|
.item-container {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
min-height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media only screen and (max-width: 768px) {
|
2022-04-15 17:00:08 +00:00
|
|
|
.song-list-header {
|
2022-04-15 14:24:30 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.scroller {
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
.item-container {
|
|
|
|
left: 12px;
|
|
|
|
right: 12px;
|
|
|
|
width: calc(100vw - 24px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
.song-item {
|
2022-04-15 14:24:30 +00:00
|
|
|
padding: 8px 32px 8px 4px;
|
|
|
|
position: relative;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
.song-item span {
|
2022-04-15 14:24:30 +00:00
|
|
|
display: none;
|
|
|
|
padding: 0;
|
|
|
|
vertical-align: bottom;
|
|
|
|
color: var(--color-text-primary);
|
|
|
|
|
|
|
|
&.artist, &.title {
|
|
|
|
display: inline;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.artist {
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
font-size: 0.9rem;
|
|
|
|
padding: 0 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|