diff --git a/src/components/nav/NavBar.vue b/src/components/nav/NavBar.vue index 794de756..162a25ba 100644 --- a/src/components/nav/NavBar.vue +++ b/src/components/nav/NavBar.vue @@ -6,6 +6,7 @@
+
@@ -32,6 +33,7 @@ import createSubPaths from "@/composables/createSubPaths"; import { subPath } from "@/interfaces"; import Folder from "./Titles/Folder.vue"; import Playlists from "./Titles/Playlists.vue"; +import Album from "./Titles/Album.vue"; const route = useRoute(); @@ -44,7 +46,10 @@ function useSubRoutes() { switch (newRoute) { case Routes.folder: let oldpath = ""; - [oldpath, subPaths.value] = createSubPaths(route.params.path, oldpath); + [oldpath, subPaths.value] = createSubPaths( + route.params.path, + oldpath + ); watch( () => route.params.path, @@ -87,6 +92,8 @@ onMounted(() => { .title { font-size: 1.5rem; font-weight: bold; + margin-top: $smaller; + display: flex; } } } diff --git a/src/components/nav/Titles/Album.vue b/src/components/nav/Titles/Album.vue new file mode 100644 index 00000000..e4903ee6 --- /dev/null +++ b/src/components/nav/Titles/Album.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/components/nav/Titles/Folder.vue b/src/components/nav/Titles/Folder.vue index 4f7fbaa8..ba4b16e2 100644 --- a/src/components/nav/Titles/Folder.vue +++ b/src/components/nav/Titles/Folder.vue @@ -1,20 +1,6 @@ diff --git a/src/composables/perks.ts b/src/composables/perks.ts index 21ac71f9..abd8c26a 100644 --- a/src/composables/perks.ts +++ b/src/composables/perks.ts @@ -12,16 +12,19 @@ const putCommas = (artists: string[]) => { return result; }; -function focusCurrent() { - const elem = document.getElementsByClassName("currentInQueue")[0]; +function focusElem(className: string, delay?: number) { + const dom = document.getElementsByClassName(className)[0]; + if (!delay) delay = 300; - if (elem) { - elem.scrollIntoView({ - behavior: "smooth", - block: "center", - inline: "center", - }); - } + setTimeout(() => { + if (dom) { + dom.scrollIntoView({ + behavior: "smooth", + block: "center", + inline: "center", + }); + } + }, delay); } function getElem(id: string, type: string) { @@ -75,4 +78,4 @@ function formatSeconds(seconds: number, long?: boolean) { } } -export { putCommas, focusCurrent, formatSeconds, getElem }; +export { putCommas, focusElem, formatSeconds, getElem }; diff --git a/src/stores/tabs.ts b/src/stores/tabs.ts index f76b90b0..68a097b2 100644 --- a/src/stores/tabs.ts +++ b/src/stores/tabs.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import { focusCurrent } from "../composables/perks"; +import { focusElem } from "../composables/perks"; const tablist = { home: "home", @@ -16,7 +16,7 @@ export default defineStore("tabs", { changeTab(tab: string) { if (tab === this.tabs.queue) { setTimeout(() => { - focusCurrent(); + focusElem("currentInQueue"); }, 500); } this.current = tab; diff --git a/src/transitions.ts b/src/transitions.ts index 4e393909..c90ede30 100644 --- a/src/transitions.ts +++ b/src/transitions.ts @@ -4,7 +4,7 @@ export default { initial: { opacity: 0, x: 0, - y: 20 + y: 20, }, enter: { opacity: 1, @@ -21,7 +21,7 @@ export default { opacity: 0, x: -20, }, - enter: { + visible: { opacity: 1, x: 0, transition: { @@ -55,16 +55,5 @@ export default { }, }, }, - scale: { - initial: { - scale: 0.8, - }, - enter: { - scale: 1, - transition: { - duration: 200, - }, - }, - }, }, };