mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
fix nav and folder banner text responsiveness
This commit is contained in:
@@ -24,7 +24,6 @@ body {
|
|||||||
|
|
||||||
#app {
|
#app {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ const tabs = useTabStore();
|
|||||||
|
|
||||||
.r-content {
|
.r-content {
|
||||||
grid-area: content;
|
grid-area: content;
|
||||||
// width: 29rem;
|
width: 29rem;
|
||||||
width: 100%;
|
// width: 100%;
|
||||||
|
|
||||||
// @include tablet-landscape {
|
// @include tablet-landscape {
|
||||||
// display: none;
|
// display: none;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
<ClearSvg />
|
<ClearSvg />
|
||||||
<span>Clear</span>
|
<span>Clear</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="shuffle-queue action">
|
<button class="shuffle-queue action" @click="queue.shuffleQueue">
|
||||||
<SaveAsPlaylistSvg />
|
<ShuffleSvg />
|
||||||
<span> Save as Playlist </span>
|
<span>Shuffle</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
import useQueueStore from "../../../stores/queue";
|
import useQueueStore from "../../../stores/queue";
|
||||||
|
|
||||||
import ClearSvg from "@/assets/icons/delete.svg";
|
import ClearSvg from "@/assets/icons/delete.svg";
|
||||||
import SaveAsPlaylistSvg from "@/assets/icons/sdcard.svg";
|
import ShuffleSvg from "@/assets/icons/shuffle.svg";
|
||||||
import MoreSvg from "@/assets/icons/more.svg";
|
import MoreSvg from "@/assets/icons/more.svg";
|
||||||
|
|
||||||
const queue = useQueueStore();
|
const queue = useQueueStore();
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import TracksGrid from "./TracksGrid.vue";
|
|||||||
.right-search {
|
.right-search {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: auto;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.heading {
|
.heading {
|
||||||
|
|||||||
@@ -15,16 +15,16 @@
|
|||||||
<div class="center rounded">
|
<div class="center rounded">
|
||||||
<Loader />
|
<Loader />
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<!-- <div class="right">
|
||||||
<Search />
|
<Search />
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import NavButtons from "./NavButtons.vue";
|
import NavButtons from "./NavButtons.vue";
|
||||||
import Loader from "../shared/Loader.vue";
|
import Loader from "../shared/Loader.vue";
|
||||||
import Search from "./Search.vue";
|
// import Search from "./Search.vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { Routes } from "@/composables/enums";
|
import { Routes } from "@/composables/enums";
|
||||||
@@ -80,16 +80,19 @@ watch(
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.topnav {
|
.topnav {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr min-content max-content;
|
grid-template-columns: 1fr min-content;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
gap: 1rem;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: max-content 1fr;
|
grid-template-columns: max-content 1fr;
|
||||||
width: min-content;
|
overflow: hidden;
|
||||||
overflow: scroll;
|
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ onUpdated(() => {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
#folder-nav-title {
|
#folder-nav-title {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
.folder {
|
.folder {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $small;
|
gap: $small;
|
||||||
@@ -64,9 +66,9 @@ onUpdated(() => {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding-right: $smaller;
|
padding-right: $smaller;
|
||||||
|
|
||||||
@include for-desktop-down {
|
// @include for-desktop-down {
|
||||||
max-width: 9rem;
|
// max-width: 9rem;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
|||||||
+32
-6
@@ -12,10 +12,7 @@ import {
|
|||||||
Track,
|
Track,
|
||||||
} from "../interfaces";
|
} from "../interfaces";
|
||||||
|
|
||||||
function writeQueue(
|
function writeQueue(from: From, tracks: Track[]) {
|
||||||
from: fromFolder | fromAlbum | fromPlaylist,
|
|
||||||
tracks: Track[]
|
|
||||||
) {
|
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"queue",
|
"queue",
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -46,6 +43,15 @@ const defaultTrack = <Track>{
|
|||||||
image: "meh",
|
image: "meh",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function shuffle(tracks: Track[]) {
|
||||||
|
const shuffled = tracks.slice();
|
||||||
|
for (let i = shuffled.length - 1; i > 0; i--) {
|
||||||
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
||||||
|
}
|
||||||
|
return shuffled;
|
||||||
|
}
|
||||||
|
|
||||||
type From = fromFolder | fromAlbum | fromPlaylist | fromSearch;
|
type From = fromFolder | fromAlbum | fromPlaylist | fromSearch;
|
||||||
|
|
||||||
export default defineStore("Queue", {
|
export default defineStore("Queue", {
|
||||||
@@ -76,7 +82,7 @@ export default defineStore("Queue", {
|
|||||||
const track = this.tracklist[index];
|
const track = this.tracklist[index];
|
||||||
this.currentid = track.trackid;
|
this.currentid = track.trackid;
|
||||||
const uri = state.settings.uri + "/file/" + track.trackid;
|
const uri = state.settings.uri + "/file/" + track.trackid;
|
||||||
const elem = document.getElementById("progress");
|
const elem = document.getElementById("progress") as HTMLElement;
|
||||||
this.updateCurrent(index);
|
this.updateCurrent(index);
|
||||||
|
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
@@ -173,7 +179,7 @@ export default defineStore("Queue", {
|
|||||||
this.currenttrack = track;
|
this.currenttrack = track;
|
||||||
this.current = index;
|
this.current = index;
|
||||||
this.currentid = track.trackid;
|
this.currentid = track.trackid;
|
||||||
this.duration.full = track.length;
|
this.duration.full = track.length || 0;
|
||||||
},
|
},
|
||||||
setNewQueue(tracklist: Track[]) {
|
setNewQueue(tracklist: Track[]) {
|
||||||
if (this.tracklist !== tracklist) {
|
if (this.tracklist !== tracklist) {
|
||||||
@@ -260,5 +266,25 @@ export default defineStore("Queue", {
|
|||||||
writeQueue(this.from, [defaultTrack] as Track[]);
|
writeQueue(this.from, [defaultTrack] as Track[]);
|
||||||
writeCurrent(0);
|
writeCurrent(0);
|
||||||
},
|
},
|
||||||
|
shuffleQueue() {
|
||||||
|
const Toast = useNotifStore();
|
||||||
|
if (this.tracklist.length < 2) {
|
||||||
|
Toast.showNotification("Queue is too short", NotifType.Info);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const shuffled = shuffle(this.tracklist);
|
||||||
|
this.tracklist = shuffled;
|
||||||
|
|
||||||
|
this.current = 0;
|
||||||
|
this.play(this.current);
|
||||||
|
|
||||||
|
this.currentid = shuffled[0].trackid;
|
||||||
|
this.next = 1;
|
||||||
|
this.prev = this.tracklist.length - 1;
|
||||||
|
|
||||||
|
writeQueue(this.from, shuffled);
|
||||||
|
writeCurrent(0);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -80,19 +80,27 @@ onBeforeRouteUpdate((to, from) => {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
// display: table-cell;
|
||||||
|
// vertical-align: bottom;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
bottom: 1rem;
|
bottom: 1rem;
|
||||||
|
// height: 100%;
|
||||||
left: 1rem;
|
left: 1rem;
|
||||||
|
// right: 1rem;
|
||||||
|
// width: min-content;
|
||||||
|
max-width: calc(100% - 2rem);
|
||||||
background-color: $black;
|
background-color: $black;
|
||||||
|
|
||||||
@include for-desktop-down {
|
@include for-desktop-down {
|
||||||
max-width: 31rem;
|
max-width: 31rem;
|
||||||
|
right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
margin: $small;
|
margin: $small;
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: max-content 1fr;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: $small;
|
gap: $small;
|
||||||
|
|||||||
Reference in New Issue
Block a user