mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
try an experimental search page redesign
This commit is contained in:
committed by
Mungai Njoroge
parent
20151afcf5
commit
460695fd87
@@ -15,7 +15,7 @@
|
|||||||
grid-area: content;
|
grid-area: content;
|
||||||
margin-right: calc(0rem - ($medium + 2px));
|
margin-right: calc(0rem - ($medium + 2px));
|
||||||
padding-right: calc($medium);
|
padding-right: calc($medium);
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// show scrollbars on search page
|
// show scrollbars on search page
|
||||||
.search-view {
|
// .search-view {
|
||||||
margin-right: -1rem;
|
// margin-right: -1rem;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,4 +138,4 @@ button {
|
|||||||
#tooltip[data-popper-reference-hidden] {
|
#tooltip[data-popper-reference-hidden] {
|
||||||
visibility: hidden !important;
|
visibility: hidden !important;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
@@ -57,6 +57,7 @@ const menus = [
|
|||||||
{
|
{
|
||||||
name: "search",
|
name: "search",
|
||||||
route_name: Routes.search,
|
route_name: Routes.search,
|
||||||
|
params: { page: "top" },
|
||||||
icon: SearchSvg,
|
icon: SearchSvg,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,47 +3,28 @@
|
|||||||
<div id="ginner" tabindex="0" class="bg-primary">
|
<div id="ginner" tabindex="0" class="bg-primary">
|
||||||
<button
|
<button
|
||||||
:title="
|
:title="
|
||||||
tabs.current === tabs.tabs.search
|
tabs.current === tabs.tabs.search ? 'back to queue' : 'go to search'
|
||||||
? 'back to queue'
|
|
||||||
: 'go to search'
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<SearchSvg
|
<SearchSvg
|
||||||
v-if="tabs.current === tabs.tabs.queue"
|
v-if="on_nav || tabs.current === tabs.tabs.queue"
|
||||||
@click.prevent="tabs.switchToSearch"
|
@click.prevent="!on_nav && tabs.switchToSearch()"
|
||||||
/>
|
/>
|
||||||
<BackSvg
|
<BackSvg
|
||||||
v-if="tabs.current === tabs.tabs.search"
|
v-else-if="tabs.current === tabs.tabs.search"
|
||||||
@click.prevent="tabs.switchToQueue"
|
@click.prevent="tabs.switchToQueue"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
<input
|
<input
|
||||||
id="globalsearch"
|
id="globalsearch"
|
||||||
v-model.trim="search.query"
|
v-model.trim="search.query"
|
||||||
placeholder="Type to search"
|
placeholder="Search your library"
|
||||||
type="search"
|
type="text"
|
||||||
|
autocomplete="off"
|
||||||
@blur.prevent="removeFocusedClass"
|
@blur.prevent="removeFocusedClass"
|
||||||
@focus.prevent="addFocusedClass"
|
@focus.prevent="addFocusedClass"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="buttons rounded-sm bg-primary">
|
|
||||||
<button
|
|
||||||
@click="tabs.switchToQueue"
|
|
||||||
v-if="tabs.current !== tabs.tabs.queue"
|
|
||||||
name="switch to queue tab"
|
|
||||||
>
|
|
||||||
<QueueSvg />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="tabs.switchToSearch"
|
|
||||||
v-if="tabs.current !== tabs.tabs.search"
|
|
||||||
name="switch to search tab"
|
|
||||||
|
|
||||||
>
|
|
||||||
<SearchSvg />
|
|
||||||
</button>
|
|
||||||
</div> -->
|
|
||||||
<!-- <button>Global Search this that</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -54,6 +35,10 @@ import SearchSvg from "@/assets/icons/search.svg";
|
|||||||
import useSearchStore from "@/stores/search";
|
import useSearchStore from "@/stores/search";
|
||||||
import useTabStore from "@/stores/tabs";
|
import useTabStore from "@/stores/tabs";
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
on_nav?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
const search = useSearchStore();
|
const search = useSearchStore();
|
||||||
const tabs = useTabStore();
|
const tabs = useTabStore();
|
||||||
let classList: DOMTokenList | undefined;
|
let classList: DOMTokenList | undefined;
|
||||||
@@ -82,7 +67,6 @@ function removeFocusedClass() {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: $small;
|
gap: $small;
|
||||||
padding: 0 $small;
|
|
||||||
border-radius: 3rem;
|
border-radius: 3rem;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
@@ -91,7 +75,6 @@ function removeFocusedClass() {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 3rem;
|
border-radius: 3rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: -$smaller;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="nav-search-input">
|
<div class="nav-search-input">
|
||||||
<SearchInput />
|
<SearchInput :on_nav="true" />
|
||||||
<div id="nav-tab-headers"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -11,28 +10,12 @@ import SearchInput from "@/components/RightSideBar/SearchInput.vue";
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.nav-search-input {
|
.nav-search-input {
|
||||||
display: flex;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-evenly;
|
||||||
height: 2rem;
|
|
||||||
|
|
||||||
#gsearch-input {
|
& > div {
|
||||||
display: unset;
|
width: 70%;
|
||||||
|
margin: 0 auto;
|
||||||
#ginner {
|
|
||||||
max-width: 30rem;
|
|
||||||
margin: 0 auto;
|
|
||||||
border-radius: $small;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabheaders {
|
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ const routes = [
|
|||||||
component: () => import("@/views/SettingsView.vue"),
|
component: () => import("@/views/SettingsView.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/search",
|
path: "/search/:page",
|
||||||
name: "SearchView",
|
name: "SearchView",
|
||||||
component: () => import("@/views/Search.vue"),
|
component: () => import("@/views/search/main.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/queue",
|
path: "/queue",
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-albums-view"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.search-albums-view {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-artists-view"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.search-artists-view {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-folders-view"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.search-folders-view {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-view">
|
||||||
|
<div class="tabs">
|
||||||
|
<button v-for="page in pages">{{ page }}</button>
|
||||||
|
</div>
|
||||||
|
<div class="noscroll">
|
||||||
|
<component :is="getComponent()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
import TracksPage from "./tracks.vue";
|
||||||
|
import AlbumPage from "./albums.vue";
|
||||||
|
import ArtistPage from "./artists.vue";
|
||||||
|
|
||||||
|
enum pages {
|
||||||
|
tracks = "tracks",
|
||||||
|
albums = "albums",
|
||||||
|
artists = "artists",
|
||||||
|
}
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const page = route.params.page as string;
|
||||||
|
|
||||||
|
function getComponent() {
|
||||||
|
switch (page) {
|
||||||
|
case pages.tracks:
|
||||||
|
return TracksPage;
|
||||||
|
case pages.albums:
|
||||||
|
return AlbumPage;
|
||||||
|
|
||||||
|
case pages.artists:
|
||||||
|
return ArtistPage;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return TracksPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.search-view {
|
||||||
|
height: calc(100% - 1rem);
|
||||||
|
width: calc(100% - $small);
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: max-content 1fr;
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
width: fit-content;
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
// margin: 0 auto;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
background-color: $gray4;
|
||||||
|
padding: $small 1rem;
|
||||||
|
border-radius: $small;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-tracks-view">
|
||||||
|
<div class="noscroll">
|
||||||
|
<Layout :no_header="true" :tracks="search.tracks.value" />
|
||||||
|
</div>
|
||||||
|
<button @click.prevent="search.loadTracks">Load More</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import Layout from "@/layouts/HeaderAndVList.vue";
|
||||||
|
import useSearchStore from "@/stores/search";
|
||||||
|
|
||||||
|
const search = useSearchStore();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.search-tracks-view {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: 1fr max-content;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: fit-content;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user