Added basic UI for anime display

This commit is contained in:
Eduard Urbach 2018-03-11 22:42:58 +01:00
parent e94f8800de
commit 8898413804
3 changed files with 42 additions and 5 deletions

View File

@ -1,6 +1,11 @@
component AudioPlayer component AudioPlayer
#audio-player #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="") a#audio-player-track-title.ajax(href="")
#audio-player-controls #audio-player-controls
button#audio-player-prev.audio-player-side-button.action(data-action="playPreviousTrack", data-trigger="click") button#audio-player-prev.audio-player-side-button.action(data-action="playPreviousTrack", data-trigger="click")
RawIcon("step-backward") RawIcon("step-backward")

View File

@ -1,20 +1,49 @@
#audio-player #audio-player
vertical vertical
default-transition default-transition
justify-content center
position relative position relative
margin 0.8rem 0 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 #audio-player-track-title
width 100%
color text-color color text-color
font-size 0.7rem font-size 0.7rem
line-height 1.7em line-height 1.7em
opacity 0.8 opacity 0.8
text-align center text-align center
padding 0.8rem 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% 0%
transform rotateX(0) transform rotateX(0)
90% 90%

View File

@ -9,7 +9,10 @@ import (
// Random returns a random soundtrack. // Random returns a random soundtrack.
func Random(ctx *aero.Context) string { 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)) index := rand.Intn(len(tracks))
track := tracks[index] track := tracks[index]
@ -19,7 +22,7 @@ func Random(ctx *aero.Context) string {
// Next returns the next soundtrack for the audio player. // Next returns the next soundtrack for the audio player.
func Next(ctx *aero.Context) string { func Next(ctx *aero.Context) string {
tracks := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool { tracks := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool {
return track.File != "" return !track.IsDraft && track.File != ""
}) })
index := rand.Intn(len(tracks)) index := rand.Intn(len(tracks))