mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
use songitem component on search page track items
This commit is contained in:
@@ -40,8 +40,11 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rounded shadow-lg bigimg">
|
<div
|
||||||
<img :src="imguri.thumb + album.image" />
|
class="rounded shadow-lg image bigimg"
|
||||||
|
:style="{ backgroundImage: `url(${imguri.thumb + album.image})` }"
|
||||||
|
>
|
||||||
|
<!-- <img :src="imguri.thumb + album.image" /> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -92,7 +95,7 @@ useVisibility(albumheaderthing, handleVisibilityState);
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.a-header {
|
.a-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr auto;
|
grid-template-columns: 1fr max-content;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
@@ -102,13 +105,15 @@ useVisibility(albumheaderthing, handleVisibilityState);
|
|||||||
|
|
||||||
.bigimg {
|
.bigimg {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
word-break: break-all;
|
width: 16rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
height: 100%;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
|
object-position: bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="right-search">
|
<div class="right-search">
|
||||||
<TabsWrapper>
|
<TabsWrapper>
|
||||||
<Tab name="tracks">
|
<Tab name="tracks">
|
||||||
<TracksGrid />
|
<TracksGrid :isOnSearchPage="isOnSearchPage" />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab name="albums">
|
<Tab name="albums">
|
||||||
<ArtistGrid :album_grid="true" />
|
<ArtistGrid :album_grid="true" />
|
||||||
@@ -19,6 +19,10 @@ import ArtistGrid from "./ArtistGrid.vue";
|
|||||||
import Tab from "./Tab.vue";
|
import Tab from "./Tab.vue";
|
||||||
import TabsWrapper from "./TabsWrapper.vue";
|
import TabsWrapper from "./TabsWrapper.vue";
|
||||||
import TracksGrid from "./TracksGrid.vue";
|
import TracksGrid from "./TracksGrid.vue";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
isOnSearchPage?: boolean;
|
||||||
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -36,7 +40,6 @@ import TracksGrid from "./TracksGrid.vue";
|
|||||||
color: $white;
|
color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,16 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="tracks-results">
|
<div id="tracks-results">
|
||||||
<TransitionGroup name="list" v-if="search.tracks.value.length">
|
<div v-if="search.tracks.value.length">
|
||||||
|
<div v-if="use_song_item">
|
||||||
|
<SongItem
|
||||||
|
v-for="track in search.tracks.value"
|
||||||
|
:key="track.trackid"
|
||||||
|
:isCurrent="queue.currentid == track.trackid"
|
||||||
|
:isHighlighted="false"
|
||||||
|
:isPlaying="queue.playing"
|
||||||
|
:track="track"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
<TrackItem
|
<TrackItem
|
||||||
v-for="(track, index) in search.tracks.value"
|
v-for="(track, index) in search.tracks.value"
|
||||||
:key="track?.trackid"
|
:key="track.trackid"
|
||||||
:track="track"
|
:track="track"
|
||||||
:isPlaying="queue.playing"
|
:isPlaying="queue.playing"
|
||||||
:isCurrent="queue.currentid == track.trackid"
|
:isCurrent="queue.currentid == track.trackid"
|
||||||
:isSearchTrack="true"
|
:isSearchTrack="true"
|
||||||
@PlayThis="updateQueue(index)"
|
@PlayThis="updateQueue(index)"
|
||||||
/>
|
/>
|
||||||
</TransitionGroup>
|
</div>
|
||||||
|
</div>
|
||||||
<div v-else class="t-center"><h5>🤷</h5></div>
|
<div v-else class="t-center"><h5>🤷</h5></div>
|
||||||
<LoadMore v-if="search.tracks.more" :loader="search.loadTracks" />
|
<LoadMore v-if="search.tracks.more" :loader="search.loadTracks" />
|
||||||
</div>
|
</div>
|
||||||
@@ -18,7 +30,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import LoadMore from "./LoadMore.vue";
|
import LoadMore from "./LoadMore.vue";
|
||||||
import TrackItem from "../../shared/TrackItem.vue";
|
import TrackItem from "@/components/shared/TrackItem.vue";
|
||||||
|
import SongItem from "@/components/shared/SongItem.vue";
|
||||||
import useQStore from "../../../stores/queue";
|
import useQStore from "../../../stores/queue";
|
||||||
import useSearchStore from "../../../stores/search";
|
import useSearchStore from "../../../stores/search";
|
||||||
|
|
||||||
@@ -29,22 +42,21 @@ function updateQueue(index: number) {
|
|||||||
queue.playFromSearch(search.query, search.tracks.value);
|
queue.playFromSearch(search.query, search.tracks.value);
|
||||||
queue.play(index);
|
queue.play(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
isOnSearchPage?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
let use_song_item: boolean = false;
|
||||||
|
|
||||||
|
if (props.isOnSearchPage) {
|
||||||
|
use_song_item = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.right-search #tracks-results {
|
.right-search #tracks-results {
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.list-enter-active,
|
|
||||||
.list-leave-active {
|
|
||||||
transition: all 0.5s ease;
|
|
||||||
transition-delay: 0.5s;
|
|
||||||
}
|
|
||||||
.list-enter-from,
|
|
||||||
.list-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(2rem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default defineStore("search", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadTracks() {
|
function loadTracks() {
|
||||||
loadCounter.tracks += 6;
|
loadCounter.tracks += 12;
|
||||||
|
|
||||||
loadMoreTracks(loadCounter.tracks)
|
loadMoreTracks(loadCounter.tracks)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -100,7 +100,7 @@ export default defineStore("search", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadAlbums() {
|
function loadAlbums() {
|
||||||
loadCounter.albums += 6;
|
loadCounter.albums += 12;
|
||||||
|
|
||||||
loadMoreAlbums(loadCounter.albums)
|
loadMoreAlbums(loadCounter.albums)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -115,7 +115,7 @@ export default defineStore("search", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadArtists() {
|
function loadArtists() {
|
||||||
loadCounter.artists += 6;
|
loadCounter.artists += 12;
|
||||||
|
|
||||||
loadMoreArtists(loadCounter.artists)
|
loadMoreArtists(loadCounter.artists)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -186,8 +186,6 @@ export default defineStore("search", () => {
|
|||||||
currentTab.value = tab;
|
currentTab.value = tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {}, 3000);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tracks,
|
tracks,
|
||||||
albums,
|
albums,
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-view">
|
<div class="search-view">
|
||||||
<div class="scrollable">
|
<div class="scrollable">
|
||||||
<Main />
|
<Main :isOnSearchPage="true" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SearchInput from "@/components/RightSideBar/SearchInput.vue";
|
|
||||||
import Main from "@/components/RightSideBar/Search/Main.vue";
|
import Main from "@/components/RightSideBar/Search/Main.vue";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user