Cleanup
This commit is contained in:
28
pages/soundtracks/soundtracks.go
Normal file
28
pages/soundtracks/soundtracks.go
Normal file
@ -0,0 +1,28 @@
|
||||
package soundtracks
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
const maxTracks = 9
|
||||
|
||||
// Get renders the music page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
tracks, err := arn.AllSoundTracks()
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching soundtracks", err)
|
||||
}
|
||||
|
||||
arn.SortSoundTracksLatestFirst(tracks)
|
||||
|
||||
if len(tracks) > maxTracks {
|
||||
tracks = tracks[:maxTracks]
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Music(tracks))
|
||||
}
|
11
pages/soundtracks/soundtracks.pixy
Normal file
11
pages/soundtracks/soundtracks.pixy
Normal file
@ -0,0 +1,11 @@
|
||||
component Music(tracks []*arn.SoundTrack)
|
||||
h1 Soundtracks
|
||||
|
||||
.music-buttons
|
||||
a.button.ajax(href="/new/soundtrack")
|
||||
Icon("plus")
|
||||
span Add soundtrack
|
||||
|
||||
.sound-tracks
|
||||
each track in tracks
|
||||
SoundTrack(track)
|
42
pages/soundtracks/soundtracks.scarlet
Normal file
42
pages/soundtracks/soundtracks.scarlet
Normal file
@ -0,0 +1,42 @@
|
||||
.sound-tracks
|
||||
horizontal-wrap
|
||||
justify-content space-around
|
||||
|
||||
.sound-track
|
||||
vertical
|
||||
flex 1
|
||||
flex-basis 500px
|
||||
padding 1rem
|
||||
|
||||
|
||||
.sound-track-content
|
||||
horizontal
|
||||
|
||||
iframe
|
||||
width 100%
|
||||
|
||||
box-shadow shadow-light
|
||||
|
||||
.sound-track-footer
|
||||
text-align right
|
||||
margin-bottom 1rem
|
||||
font-size 0.9em
|
||||
|
||||
span
|
||||
opacity 0.65
|
||||
|
||||
.sound-track-anime-link
|
||||
display none
|
||||
|
||||
> 800px
|
||||
.sound-track-anime-link
|
||||
display block
|
||||
|
||||
.sound-track-anime-image
|
||||
max-width 142px
|
||||
|
||||
> 600px
|
||||
.music-buttons
|
||||
position absolute
|
||||
top content-padding
|
||||
right content-padding
|
Reference in New Issue
Block a user