fix album and artist card search results responsiveness

This commit is contained in:
geoffrey45
2022-08-16 09:25:40 +03:00
parent e1c9cfa99b
commit 703b3cf240
10 changed files with 56 additions and 84 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ body {
color: #fff; color: #fff;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-family: "SF Compact Display" !important; font-family: "SFCompactDisplay" !important;
font-size: 1rem; font-size: 1rem;
image-rendering: -webkit-optimize-contrast; image-rendering: -webkit-optimize-contrast;
width: calc(100vw - 1rem); width: calc(100vw - 1rem);
+1 -1
View File
@@ -9,6 +9,6 @@
@font-face { @font-face {
font-family: "SF Compact Display"; font-family: "SFCompactDisplay";
src: url("../sf-compact.woff") format("woff"); src: url("../sf-compact.woff") format("woff");
} }
-3
View File
@@ -6,9 +6,6 @@
<div class="disc-number" v-if="$route.name === Routes.folder"> <div class="disc-number" v-if="$route.name === Routes.folder">
In this folder In this folder
</div> </div>
<div class="disc-number" v-if="$route.name === Routes.playlist">
&nbsp;
</div>
</div> </div>
<div class="songlist"> <div class="songlist">
<SongItem <SongItem
@@ -1,6 +1,9 @@
<template> <template>
<div class="artists-results" v-if="search.artists.value.length"> <div class="artists-results">
<div class="search-results-grid"> <div class="search-results-grid" v-if="album_grid == true">
<AlbumCard v-for="a in search.albums.value" :key="a.albumid" :album="a" />
</div>
<div class="search-results-grid" v-else>
<ArtistCard <ArtistCard
v-for="artist in search.artists.value" v-for="artist in search.artists.value"
:key="artist.image" :key="artist.image"
@@ -14,10 +17,17 @@
<script setup lang="ts"> <script setup lang="ts">
import useSearchStore from "../../../stores/search"; import useSearchStore from "../../../stores/search";
import AlbumCard from "@/components/shared/AlbumCard.vue";
import ArtistCard from "../../shared/ArtistCard.vue"; import ArtistCard from "../../shared/ArtistCard.vue";
import LoadMore from "./LoadMore.vue"; import LoadMore from "./LoadMore.vue";
const search = useSearchStore(); const search = useSearchStore();
defineProps<{
album_grid?: boolean;
}>();
function loadMore() { function loadMore() {
search.updateLoadCounter("artists"); search.updateLoadCounter("artists");
search.loadArtists(search.loadCounter.artists); search.loadArtists(search.loadCounter.artists);
@@ -25,18 +35,14 @@ function loadMore() {
</script> </script>
<style lang="scss"> <style lang="scss">
.right-search .artists-results { .artists-results {
display: grid; display: grid;
margin: 0 1rem; margin: 0 1rem;
}
.xartist { .search-results-grid {
background-color: $gray; display: grid;
grid-template-columns: repeat(3, 1fr);
.artist-image { gap: 0.75rem;
width: 7rem;
height: 7rem;
object-fit: cover;
}
}
} }
</style> </style>
+2 -7
View File
@@ -5,7 +5,7 @@
<TracksGrid /> <TracksGrid />
</Tab> </Tab>
<Tab name="albums"> <Tab name="albums">
<AlbumGrid /> <ArtistGrid :album_grid="true" />
</Tab> </Tab>
<Tab name="artists"> <Tab name="artists">
<ArtistGrid /> <ArtistGrid />
@@ -15,7 +15,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import AlbumGrid from "./AlbumGrid.vue";
import ArtistGrid from "./ArtistGrid.vue"; 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";
@@ -36,11 +35,7 @@ import TracksGrid from "./TracksGrid.vue";
font-size: 2rem; font-size: 2rem;
color: $white; color: $white;
} }
.search-results-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.75rem;
}
.input { .input {
display: flex; display: flex;
+15 -50
View File
@@ -6,17 +6,11 @@
}" }"
class="result-item" class="result-item"
> >
<div class="img"> <img class="rounded" :src="imguri + album.image" alt="" />
<div <div>
class="album-art image" <h4 class="title ellip">{{ album.title }}</h4>
:style="{ <div class="artist ellip">{{ album.artist }}</div>
backgroundImage: `url(&quot;${imguri + album.image}&quot;)`,
}"
></div>
<div class="play shadow-lg image"></div>
</div> </div>
<div class="title ellip">{{ album.title }}</div>
<div class="artistsx ellipsis">{{ album.artist }}</div>
</router-link> </router-link>
</template> </template>
@@ -32,60 +26,31 @@ defineProps<{
<style lang="scss"> <style lang="scss">
.result-item { .result-item {
display: flex; display: grid;
flex-direction: column; gap: $small;
align-items: center;
padding: $small; padding: $small;
border-radius: 0.75rem;
text-align: left !important;
background-color: $gray4; background-color: $gray4;
color: #ffffffde !important;
transition: all 0.5s ease; transition: all 0.5s ease;
min-width: 8.5rem; border-radius: .7rem;
.img { img {
position: relative; width: 100%;
height: auto;
&:hover {
.play {
visibility: visible;
}
} }
.play { h4 {
width: 3rem; margin: 0;
height: 3rem;
background-color: $gray;
border-radius: 1rem;
position: absolute;
left: 2rem;
bottom: 2.5rem;
background-image: url("../../assets/icons/play.svg");
background-size: 2rem;
background-position: 60% 50%;
visibility: hidden;
}
.album-art {
height: 7.5rem;
width: 7.5rem;
border-radius: 0.5rem;
margin-bottom: 0.5rem;
}
} }
.title { .title {
width: 7rem; margin-bottom: $smaller;
margin-bottom: 0.25rem;
font-size: 0.9rem; font-size: 0.9rem;
font-weight: bold;
} }
.artistsx { .artist {
width: 7rem;
font-size: 0.8rem; font-size: 0.8rem;
text-align: left; text-align: left;
color: #ffffffbd; opacity: .75;
} }
} }
</style> </style>
+12 -6
View File
@@ -3,7 +3,6 @@
<img <img
class="artist-image shadow-sm" class="artist-image shadow-sm"
:src="imguri + artist.image" :src="imguri + artist.image"
alt=""
loading="lazy" loading="lazy"
/> />
<div> <div>
@@ -30,13 +29,10 @@ defineProps<{
overflow: hidden; overflow: hidden;
position: relative; position: relative;
min-width: 8.5em;
height: 11em;
border-radius: 0.75rem; border-radius: 0.75rem;
display: flex; display: grid;
flex-direction: column;
align-items: center;
justify-content: center; justify-content: center;
padding: 1rem $small;
cursor: pointer; cursor: pointer;
.artist-image { .artist-image {
@@ -66,5 +62,15 @@ defineProps<{
._is_on_sidebar { ._is_on_sidebar {
background-color: $gray4 !important; background-color: $gray4 !important;
.artist-image {
width: 7rem;
height: 7rem;
@include for-desktop-down {
width: 6rem;
height: 6rem;
}
}
} }
</style> </style>
+4
View File
@@ -113,6 +113,10 @@ function toggleBottom() {
.ap-page-content { .ap-page-content {
padding-bottom: 16rem; padding-bottom: 16rem;
@include for-desktop-down {
min-height: calc(100vh - 38.75rem);
}
} }
} }
+1 -2
View File
@@ -33,7 +33,7 @@ import { isSameRoute } from "@/composables/perks";
const loader = useLoaderStore(); const loader = useLoaderStore();
const FStore = useFStore(); const FStore = useFStore();
const scrollable = ref(null); const scrollable = ref<any>(null);
function getFolderName(route: RouteLocationNormalized) { function getFolderName(route: RouteLocationNormalized) {
const path = route.params.path as string; const path = route.params.path as string;
@@ -47,7 +47,6 @@ onBeforeRouteUpdate((to, from) => {
FStore.fetchAll(to.params.path as string) FStore.fetchAll(to.params.path as string)
.then(() => { .then(() => {
console.log("fetched");
scrollable.value.scrollTop = 0; scrollable.value.scrollTop = 0;
}) })
.then(() => { .then(() => {
+1 -1
View File
@@ -35,7 +35,7 @@ onMounted(() => {
playlist.fetchArtists(route.params.pid as string); playlist.fetchArtists(route.params.pid as string);
}); });
onUnmounted(() => playlist.reset()); onUnmounted(() => playlist.resetArtists());
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>