@@ -22,7 +8,11 @@
class="path"
v-for="path in subPaths"
:key="path.path"
- :class="{ current: path.active }"
+ :class="{ inthisfolder: path.active }"
+ v-motion-slide-from-left-100
+ @click="
+ $router.push({ name: 'FolderView', params: { path: path.path } })
+ "
>
{{ path.name }}
@@ -33,11 +23,17 @@
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,
- },
- },
- },
},
};