From 5084d3ac52782f6ce4800710e93a5ea9951a2d2d Mon Sep 17 00:00:00 2001 From: Araozu Date: Tue, 8 Oct 2024 19:09:52 -0500 Subject: [PATCH] feat: play/pause current song --- src/utils/utils.templ | 45 ++++++++++++++++++-- src/utils/utils_templ.go | 91 +++++++++++++++++++++++++++++++++------- 2 files changed, 116 insertions(+), 20 deletions(-) diff --git a/src/utils/utils.templ b/src/utils/utils.templ index 5f03388..fbcf816 100644 --- a/src/utils/utils.templ +++ b/src/utils/utils.templ @@ -30,7 +30,7 @@ templ MusicPlayer() {
@@ -39,8 +39,9 @@ templ MusicPlayer() {

-

-

-
+
@playIcon(26) + @pauseIcon(26)
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -113,14 +117,14 @@ func playIcon(size int) 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 + } + return templ_7745c5c3_Err + }) +} + func skipForwardIcon(size int) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -163,21 +222,21 @@ func skipForwardIcon(size int) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("