From 43f26346608ab13e7e7cd6a63288c7ce95775c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20T=C3=A4kker?= Date: Thu, 19 Feb 2026 14:18:31 +0100 Subject: [PATCH] Added shuffle and repeating --- app/components/Player/index.vue | 15 ++++++++++++--- app/plugins/player.ts | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/components/Player/index.vue b/app/components/Player/index.vue index 677c0e5..060b49c 100644 --- a/app/components/Player/index.vue +++ b/app/components/Player/index.vue @@ -17,7 +17,7 @@ onMounted(() => { }) const song = useSong() -const { isPlaying, play, pause, next, prev } = usePlayer() +const { isPlaying, play, pause, next, prev, shuffle, repeat } = usePlayer() @@ -113,6 +117,11 @@ const { isPlaying, play, pause, next, prev } = usePlayer() span { font-size: 24px; cursor: pointer; + transition: color 0.2s ease; + } + + .repeating { + color: $color-accent; } } diff --git a/app/plugins/player.ts b/app/plugins/player.ts index 299e011..2e2724e 100644 --- a/app/plugins/player.ts +++ b/app/plugins/player.ts @@ -146,6 +146,10 @@ export default defineNuxtPlugin((nuxtApp) => { sound.value = null } + const shuffle = () => { + queue.value.sort(() => Math.random() - 0.5) + } + // Info const getDuration = () => new Promise((resolve) => { @@ -174,6 +178,7 @@ export default defineNuxtPlugin((nuxtApp) => { prev, addToQueue, clear, + shuffle, getDuration, getSecondsPlayed, setSecondsPlayed,