commit 35906185fbbf1aed52bd5b3a35eee2655c6112a1
parent 16e3b7bd30a12f2a44bdd52db871fd0d6db63eec
Author: minerva-jupiter <ryouturn@gmail.com>
Date: Sat, 22 Mar 2025 20:47:12 +0900
deploy player
Diffstat:
2 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/src/components/PlayUI.vue b/src/components/PlayUI.vue
@@ -1,11 +1,11 @@
<template>
<div class="fixed-bottom">
<div class="d-flex justify-content-center">
- <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-stop-circle" viewBox="0 0 16 16">
+ <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-stop-circle" viewBox="0 0 16 16" @click.native="player.remove_queue()">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
<path d="M5 6.5A1.5 1.5 0 0 1 6.5 5h3A1.5 1.5 0 0 1 11 6.5v3A1.5 1.5 0 0 1 9.5 11h-3A1.5 1.5 0 0 1 5 9.5z"/>
</svg>
- <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-chevron-bar-right" viewBox="0 0 16 16">
+ <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-chevron-bar-right" viewBox="0 0 16 16" @click.native="player.next_song()">
<path fill-rule="evenodd" d="M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"/>
</svg>
</div>
@@ -13,4 +13,5 @@
</template>
<script setup lang="ts">
+import player from '../player';
</script>
\ No newline at end of file
diff --git a/src/player.ts b/src/player.ts
@@ -1,36 +1,35 @@
import { ref } from 'vue';
- export interface Queue {
- video_id: string;
- title: string;
- };
-
- let queue: Queue[] = [];
- const isPlaying = ref(false);
+export interface Queue {
+ video_id: string;
+ title: string;
+};
+
+let queue: Queue[] = [];
+const isPlaying = ref(false);
- function add_to_queue(list: Queue[]): void {
- console.log("add_to_queue was called");
- for (let i = 0; i < list.length; i++) {
- queue.push(list[i]);
- };
- console.log(queue);
- }
+function add_to_queue(list: Queue[]): void {
+ console.log("add_to_queue was called");
+ for (let i = 0; i < list.length; i++) {
+ queue.push(list[i]);
+ };
+}
- function remove_queue(): void {
- console.log("remove_queue was called");
- queue = [];
- }
+function remove_queue(): void {
+ console.log("remove_queue was called");
+ queue = [];
+}
- function next_song(): void {
- console.log("next_song was called");
- queue.shift();
- console.log(queue);
- }
+function next_song(): void {
+ console.log("next_song was called");
+ queue.shift();
+}
- function play(): void {
- console.log("play_pause was called");
- isPlaying.value = !isPlaying.value;
- }
+function toggle_play(): void {
+ console.log("play_pause was called");
+ isPlaying.value = !isPlaying.value;
+}
+
- export default {add_to_queue, remove_queue, next_song, play, isPlaying};-
\ No newline at end of file
+ export default {add_to_queue, remove_queue, next_song, toggle_play, isPlaying};+
\ No newline at end of file