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()
@@ -38,12 +38,16 @@ const { isPlaying, play, pause, next, prev } = 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,