diff --git a/layout/sidebar/audioplayer.pixy b/layout/sidebar/audioplayer.pixy index c80e4916..6dcae542 100644 --- a/layout/sidebar/audioplayer.pixy +++ b/layout/sidebar/audioplayer.pixy @@ -1,6 +1,11 @@ component AudioPlayer #audio-player + #audio-player-anime-info + a#audio-player-anime-link.ajax(href="", title="") + img#audio-player-anime-image.hidden(data-src="", data-webp="true", alt="Anime cover") + a#audio-player-track-title.ajax(href="") + #audio-player-controls button#audio-player-prev.audio-player-side-button.action(data-action="playPreviousTrack", data-trigger="click") RawIcon("step-backward") diff --git a/layout/sidebar/audioplayer.scarlet b/layout/sidebar/audioplayer.scarlet index ccb25327..450464be 100644 --- a/layout/sidebar/audioplayer.scarlet +++ b/layout/sidebar/audioplayer.scarlet @@ -1,20 +1,49 @@ #audio-player vertical default-transition + justify-content center position relative margin 0.8rem 0 - min-height 90px + min-height 147px + +#audio-player-anime-info + display flex + justify-content center + align-items center + width 100% + +#audio-player-anime-image + opacity 0.15 !important + width 39px + height 39px + border-radius 3px + object-fit cover + default-transition + animation rotate-y-once 5s ease infinite alternate + + :hover + filter saturate(130%) + opacity 1.0 !important + +animation rotate-y-once + 0% + transform rotateY(0) + 90% + transform rotateY(0) + 100% + transform rotateY(90deg) #audio-player-track-title + width 100% color text-color font-size 0.7rem line-height 1.7em opacity 0.8 text-align center padding 0.8rem - animation title-flow 5s ease infinite alternate + animation rotate-x-once 5s ease infinite alternate -animation title-flow +animation rotate-x-once 0% transform rotateX(0) 90% diff --git a/pages/soundtrack/random.go b/pages/soundtrack/random.go index 79a82410..2578da76 100644 --- a/pages/soundtrack/random.go +++ b/pages/soundtrack/random.go @@ -9,7 +9,10 @@ import ( // Random returns a random soundtrack. func Random(ctx *aero.Context) string { - tracks := arn.AllSoundTracks() + tracks := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool { + return !track.IsDraft + }) + index := rand.Intn(len(tracks)) track := tracks[index] @@ -19,7 +22,7 @@ func Random(ctx *aero.Context) string { // Next returns the next soundtrack for the audio player. func Next(ctx *aero.Context) string { tracks := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool { - return track.File != "" + return !track.IsDraft && track.File != "" }) index := rand.Intn(len(tracks))