mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
smoothen button icon interactions
This commit is contained in:
@@ -69,6 +69,16 @@ button {
|
|||||||
background: linear-gradient(70deg, $gray3, $gray2);
|
background: linear-gradient(70deg, $gray3, $gray2);
|
||||||
padding: 0 $small;
|
padding: 0 $small;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
svg {
|
||||||
|
transform: scale(0.75);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-image: linear-gradient(70deg, $darkestblue, $darkblue);
|
background-image: linear-gradient(70deg, $darkestblue, $darkblue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,19 +18,27 @@ import ArrowSvg from "../../assets/icons/right-arrow.svg";
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding-right: 1.25rem;
|
padding-right: 1rem;
|
||||||
border-right: 1px solid $gray3;
|
border-right: 1px solid $gray3;
|
||||||
width: max-content;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
width: 2.25rem;
|
width: 2.25rem;
|
||||||
background-color: $gray3;
|
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
border-radius: 0.65rem;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
transform: scale(1.25);
|
||||||
|
transition: all .2s;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.back {
|
.back {
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="nav-queue-title">
|
<div class="nav-queue-title">
|
||||||
<div class="first noscroll">
|
<div class="first noscroll">
|
||||||
<router-link :to="(getSourceUrlParams())">
|
<router-link :to="(location as RouteLocationRaw)">
|
||||||
<button>Go to source</button>
|
<button>Go to source</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="playing-from">
|
<div class="playing-from">
|
||||||
<div class="border rounded-sm pad-sm">
|
<div class="border rounded-sm pad-sm">
|
||||||
<b class="ellip">{{ getSourceName() }}</b>
|
<source-icon />
|
||||||
|
<b class="ellip">{{ name }}</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,67 +19,74 @@
|
|||||||
import QueueActions from "@/components/RightSideBar/Queue/QueueActions.vue";
|
import QueueActions from "@/components/RightSideBar/Queue/QueueActions.vue";
|
||||||
import { FromOptions, Routes } from "@/composables/enums";
|
import { FromOptions, Routes } from "@/composables/enums";
|
||||||
import useQueueStore from "@/stores/queue";
|
import useQueueStore from "@/stores/queue";
|
||||||
import { RouteLocationRaw, RouteRecordRaw } from "vue-router";
|
|
||||||
|
import FolderSvg from "@/assets/icons/folder.svg";
|
||||||
|
import SearchSvg from "@/assets/icons/search.svg";
|
||||||
|
import AlbumSvg from "@/assets/icons/album.svg";
|
||||||
|
import PlaylistSvg from "@/assets/icons/playlist.svg";
|
||||||
|
|
||||||
|
import { RouteLocationRaw } from "vue-router";
|
||||||
|
|
||||||
const queue = useQueueStore();
|
const queue = useQueueStore();
|
||||||
|
|
||||||
const { from: source } = queue;
|
const { from: source } = queue;
|
||||||
|
|
||||||
function getSourceName(): RouteLocationRaw {
|
function getSource() {
|
||||||
switch (source.type) {
|
|
||||||
case FromOptions.album:
|
|
||||||
return source.name;
|
|
||||||
|
|
||||||
case FromOptions.folder:
|
|
||||||
return source.name;
|
|
||||||
|
|
||||||
case FromOptions.playlist:
|
|
||||||
return source.name;
|
|
||||||
|
|
||||||
case FromOptions.search:
|
|
||||||
return `Search for: "${source.query}"`;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return "Ghost source";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSourceUrlParams() {
|
|
||||||
switch (source.type) {
|
switch (source.type) {
|
||||||
case FromOptions.album:
|
case FromOptions.album:
|
||||||
return {
|
return {
|
||||||
|
name: source.name,
|
||||||
|
icon: AlbumSvg,
|
||||||
|
location: {
|
||||||
name: Routes.album,
|
name: Routes.album,
|
||||||
params: {
|
params: {
|
||||||
hash: source.hash,
|
hash: source.hash,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case FromOptions.folder:
|
case FromOptions.folder:
|
||||||
return {
|
return {
|
||||||
|
name: source.name,
|
||||||
|
icon: FolderSvg,
|
||||||
|
location: {
|
||||||
name: Routes.folder,
|
name: Routes.folder,
|
||||||
params: {
|
params: {
|
||||||
path: source.path,
|
path: source.path,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case FromOptions.playlist:
|
case FromOptions.playlist:
|
||||||
return {
|
return {
|
||||||
|
name: source.name,
|
||||||
|
icon: PlaylistSvg,
|
||||||
|
location: {
|
||||||
name: Routes.playlist,
|
name: Routes.playlist,
|
||||||
params: {
|
params: {
|
||||||
pid: source.playlistid,
|
pid: source.playlistid,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case FromOptions.search:
|
case FromOptions.search:
|
||||||
return {
|
return {
|
||||||
|
name: `Search for: "${source.query}"`,
|
||||||
|
icon: SearchSvg,
|
||||||
|
location: {
|
||||||
name: Routes.search,
|
name: Routes.search,
|
||||||
params: {
|
params: {
|
||||||
query: source.query,
|
query: source.query,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "/";
|
return { name: "Ghost source" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { name, icon: SourceIcon, location } = getSource();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -99,6 +107,17 @@ function getSourceUrlParams() {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: $small;
|
gap: $small;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
|
|
||||||
|
.border {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: max-content 1fr;
|
||||||
|
align-items: center;
|
||||||
|
padding: $smaller $small;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
transform: scale(0.9);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
class="play-btn rounded-md"
|
class="play-btn"
|
||||||
@click="usePlayFrom(source, useQStore, store)"
|
@click="usePlayFrom(source, useQStore, store)"
|
||||||
>
|
>
|
||||||
<PlaySvg />
|
<PlaySvg />
|
||||||
@@ -26,5 +26,6 @@ defineProps<{
|
|||||||
.play-btn {
|
.play-btn {
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
border-radius: 0.65rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user