diff --git a/pages/music/music.go b/pages/music/music.go index 64bdbb4f..061a1d5a 100644 --- a/pages/music/music.go +++ b/pages/music/music.go @@ -1,8 +1,12 @@ package music -import "github.com/aerogo/aero" -import "github.com/animenotifier/notify.moe/components" -import "github.com/animenotifier/arn" +import ( + "sort" + + "github.com/aerogo/aero" + "github.com/animenotifier/arn" + "github.com/animenotifier/notify.moe/components" +) // Get renders the music page. func Get(ctx *aero.Context) string { @@ -19,6 +23,8 @@ func Get(ctx *aero.Context) string { Tags: []string{ "anime:7622", }, + Created: arn.DateTimeUTC(), + CreatedBy: "4J6qpK1ve", }) tracks = append(tracks, &arn.SoundTrack{ @@ -32,6 +38,12 @@ func Get(ctx *aero.Context) string { Tags: []string{ "anime:11469", }, + Created: arn.DateTimeUTC(), + CreatedBy: "4J6qpK1ve", + }) + + sort.Slice(tracks, func(i, j int) bool { + return tracks[i].Created > tracks[j].Created }) return ctx.HTML(components.Music(tracks)) diff --git a/pages/music/music.pixy b/pages/music/music.pixy index 0276ddd6..0d291360 100644 --- a/pages/music/music.pixy +++ b/pages/music/music.pixy @@ -4,8 +4,10 @@ component Music(tracks []*arn.SoundTrack) .sound-tracks each track in tracks .sound-track - each anime in track.Anime() - a.sound-track-anime-link.ajax(href="/anime/" + anime.ID) - img.sound-track-anime-image(src=anime.Image.Small, alt=anime.Title.Canonical, title=anime.Title.Canonical) + a.sound-track-anime-link.ajax(href="/anime/" + track.MainAnime().ID) + img.sound-track-anime-image(src=track.MainAnime().Image.Small, alt=track.MainAnime().Title.Canonical, title=track.MainAnime().Title.Canonical) iframe(src="https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/" + track.Media[0].ServiceID + "?auto_play=false&hide_related=true&show_comments=true&show_user=true&show_reposts=false&visual=true") + .sound-track-footer + span posted by + a.ajax(href=track.CreatedByUser().Link())= track.CreatedByUser().Nick \ No newline at end of file diff --git a/pages/music/music.scarlet b/pages/music/music.scarlet index e3b59811..f648ed36 100644 --- a/pages/music/music.scarlet +++ b/pages/music/music.scarlet @@ -3,11 +3,18 @@ .sound-track horizontal - margin-bottom 1rem iframe width 100% +.sound-track-footer + text-align right + margin-bottom content-padding + font-size 0.9em + + span + opacity 0.65 + .sound-track-anime-link //