diff --git a/src/App.vue b/src/App.vue
index 75fa8211..df985f91 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -2,6 +2,7 @@
+
Single
Album
-
@@ -141,6 +141,7 @@ useVisibility(albumheaderthing, handleVisibilityState);
.title {
font-size: 2.5rem;
font-weight: 600;
+ width: fit-content;
}
.artist {
diff --git a/src/components/FolderView/SongList.vue b/src/components/FolderView/SongList.vue
index 25ddfa43..e4c6fd14 100644
--- a/src/components/FolderView/SongList.vue
+++ b/src/components/FolderView/SongList.vue
@@ -1,6 +1,6 @@
+
@@ -40,6 +37,7 @@
import { ref } from "vue";
-import { createPopper } from "@popperjs/core";
import OptionSvg from "@/assets/icons/more.svg";
@@ -99,38 +96,6 @@ function emitUpdate(track: Track) {
function showMenu(e: Event) {
showContext(e, props.track, options_button_clicked);
}
-
-let isHovering = false;
-
-function showToolTip() {
- isHovering = true;
-
- setTimeout(() => {
- if (isHovering) {
- const ttip = tooltip.value as HTMLElement;
- const atitle = artisttitle.value as HTMLElement;
-
- ttip.style.display = "unset";
-
- createPopper(atitle, ttip, {
- placement: "top",
- modifiers: [
- {
- name: "offset",
- options: {
- offset: [10, 10],
- },
- },
- ],
- });
- }
- }, 500);
-}
-
-function hideToolTip() {
- (tooltip.value as HTMLElement).style.display = "none";
- isHovering = false;
-}
diff --git a/src/directives/vTooltip.ts b/src/directives/vTooltip.ts
new file mode 100644
index 00000000..d0f7310e
--- /dev/null
+++ b/src/directives/vTooltip.ts
@@ -0,0 +1,42 @@
+import { Directive } from "vue";
+import { createPopper } from "@popperjs/core";
+
+export default {
+ mounted(el, binding) {
+ let isHovered = false;
+ const tooltip = document.getElementById("tooltip") as HTMLElement;
+
+ el.addEventListener("mouseenter", () => {
+ isHovered = true;
+
+ setTimeout(() => {
+ tooltip.innerText = binding.value;
+
+ if (isHovered) {
+ tooltip.style.display = "unset";
+
+ createPopper(el, tooltip, {
+ placement: "top",
+ modifiers: [
+ {
+ name: "offset",
+ options: {
+ offset: [0, 10],
+ },
+ },
+ ],
+ });
+ }
+ }, 1000);
+ });
+
+ el.addEventListener("mouseleave", () => {
+ isHovered = false;
+ tooltip.style.display = "none";
+ });
+ },
+ beforeUnmount(el: HTMLElement) {
+ el.removeEventListener("mouseenter", () => {});
+ el.removeEventListener("mouseleave", () => {});
+ },
+} as Directive;
diff --git a/src/main.ts b/src/main.ts
index 301570e2..dd6f0e2b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -3,6 +3,7 @@ import "./assets/scss/index.scss";
import { createPinia } from "pinia";
import { createApp } from "vue";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
+import vTooltip from "./directives/vTooltip";
import App from "./App.vue";
import router from "./router";
@@ -13,5 +14,6 @@ pinia.use(piniaPluginPersistedstate);
app.use(pinia);
app.use(router);
+app.directive("tooltip", vTooltip);
app.mount("#app");
diff --git a/src/views/PlaylistList.vue b/src/views/PlaylistList.vue
index 239d8244..e156fe66 100644
--- a/src/views/PlaylistList.vue
+++ b/src/views/PlaylistList.vue
@@ -1,7 +1,6 @@
-
import PlaylistCard from "@/components/PlaylistsList/PlaylistCard.vue";
-// import NewPlaylistCard from "@/components/PlaylistsList/NewPlaylistCard.vue";
import usePStore from "@/stores/pages/playlists";
const pStore = usePStore();
@@ -27,14 +25,6 @@ const pStore = usePStore();
.grid {
grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
gap: 1rem;
-
- // @include for-desktop-down {
- // grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
-
- // .name {
- // font-size: 0.9rem;
- // }
- // }
}
}
diff --git a/src/views/Search.vue b/src/views/Search.vue
index 6f312e3e..482b5c4b 100644
--- a/src/views/Search.vue
+++ b/src/views/Search.vue
@@ -13,12 +13,17 @@ import Main from "@/components/RightSideBar/Search/Main.vue";