mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
add songs and featured artists to album view
This commit is contained in:
@@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<div class="folder" id="p-table">
|
||||||
|
<div class="table rounded" ref="songtitle">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Track</th>
|
||||||
|
<th>Artist</th>
|
||||||
|
<th>Album</th>
|
||||||
|
<th v-if="songTitleWidth > minWidth">Duration</th>
|
||||||
|
</tr>
|
||||||
|
<tr v-for="song in songs" :key="song">
|
||||||
|
<td :style="{ width: songTitleWidth + 'px' }" class="flex">
|
||||||
|
<div class="album-art rounded image"></div>
|
||||||
|
<div>
|
||||||
|
<span class="ellipsis">{{ song.title }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td :style="{ width: songTitleWidth + 'px' }">
|
||||||
|
<span class="artist" v-for="artist in song.artists" :key="artist">{{
|
||||||
|
artist
|
||||||
|
}}</span>
|
||||||
|
</td>
|
||||||
|
<td :style="{ width: songTitleWidth + 'px' }">{{ song.album }}</td>
|
||||||
|
<td
|
||||||
|
:style="{ width: songTitleWidth + 'px' }"
|
||||||
|
v-if="songTitleWidth > minWidth"
|
||||||
|
>
|
||||||
|
{{ song.duration }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
import { onMounted, onUnmounted } from "@vue/runtime-core";
|
||||||
|
import Songs from "../../data/songs.js";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const songtitle = ref(null);
|
||||||
|
const songTitleWidth = ref(null);
|
||||||
|
|
||||||
|
const minWidth = ref(300);
|
||||||
|
|
||||||
|
const songs = Songs.songs;
|
||||||
|
|
||||||
|
const resizeSongTitleWidth = () => {
|
||||||
|
let a = songtitle.value.clientWidth;
|
||||||
|
|
||||||
|
songTitleWidth.value = a > minWidth.value * 4 ? a / 4 : a / 3;
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
resizeSongTitleWidth();
|
||||||
|
|
||||||
|
window.addEventListener("resize", () => {
|
||||||
|
resizeSongTitleWidth();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener("resize", () => {
|
||||||
|
resizeSongTitleWidth();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return { songtitle, songTitleWidth, songs, minWidth };
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
#p-table {
|
||||||
|
height: calc(100% - 0rem) !important;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-bottom: 0rem;
|
||||||
|
|
||||||
|
table {
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
position: sticky;
|
||||||
|
background-color: rgb(58, 57, 57);
|
||||||
|
top: 0;
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="folder">
|
<div class="folder">
|
||||||
<div class="table rounded" ref="songtitle">
|
<div class="table rounded" ref="songtitle">
|
||||||
<table>
|
<table class="rounded">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Track</th>
|
<th>Track</th>
|
||||||
<th>Artist</th>
|
<th>Artist</th>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default {
|
|||||||
.f-artists {
|
.f-artists {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 12em;
|
height: 12em;
|
||||||
width: calc(100% - 1em);
|
width: calc(100%);
|
||||||
background-color: #1f1e1d;
|
background-color: #1f1e1d;
|
||||||
padding: $small;
|
padding: $small;
|
||||||
border-radius: $small;
|
border-radius: $small;
|
||||||
|
|||||||
+36
-5
@@ -1,17 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<div class="al-view">
|
||||||
|
<div class="header">
|
||||||
|
<Header />
|
||||||
|
</div>
|
||||||
|
<div class="separator" id="av-sep"></div>
|
||||||
|
<div>
|
||||||
|
<SongList />
|
||||||
|
</div>
|
||||||
|
<div class="separator" id="av-sep"></div>
|
||||||
|
<FeaturedArtists />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Header from "../components/AlbumView/Header.vue"
|
import Header from "../components/AlbumView/Header.vue";
|
||||||
|
import SongList from "../components/PlaylistView/SongList.vue";
|
||||||
|
import FeaturedArtists from "../components/PlaylistView/FeaturedArtists.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Header
|
Header,
|
||||||
|
SongList,
|
||||||
|
FeaturedArtists,
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
|
.al-view {
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#av-sep {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -48,9 +48,7 @@ export default {
|
|||||||
border-radius: $small;
|
border-radius: $small;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-bg .f-artists {
|
.p-bg .f-artists-p {
|
||||||
position: absolute;
|
margin-top: $small;
|
||||||
bottom: 0;
|
|
||||||
margin-top: 1em;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user