From 98e8b085cca3ae16333a35894179cf39f8f2e2fb Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 19 Oct 2024 14:24:00 -0500 Subject: [PATCH] feat: add controls to big player --- src/utils/utils.templ | 55 ++++++++++++- src/utils/utils_templ.go | 171 +++++++++++++++++++++++++++++---------- 2 files changed, 183 insertions(+), 43 deletions(-) diff --git a/src/utils/utils.templ b/src/utils/utils.templ index 8ecce08..3c37ac5 100644 --- a/src/utils/utils.templ +++ b/src/utils/utils.templ @@ -208,6 +208,11 @@ templ MusicPlayer() { this.play(this.idx + 1); } }, + previous() { + if (this.idx > 0) { + this.play(this.idx - 1); + } + }, preload() { console.log("preloading"); if (!(this.idx + 1 < this.queue.length)) { @@ -276,6 +281,32 @@ templ fullMusicPlayer() { x-text="queue[idx]?.artist ?? '-'" > +
+ +
+ @circleNotchIcon(48) + @playIcon(38) + @pauseIcon(38) +
+ +
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -129,7 +129,39 @@ func fullMusicPlayer() templ.Component { templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = circleNotchIcon(48).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = playIcon(38).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = pauseIcon(38).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("