40 lines
1.6 KiB
Plaintext
Raw Normal View History

2018-04-23 08:30:25 +00:00
component SoundTrack(track *arn.SoundTrack, user *arn.User)
2018-03-11 14:43:17 +00:00
.soundtrack.mountable(id=track.ID)
2018-04-23 08:30:25 +00:00
SoundTrackContent(track, user)
SoundTrackFooter(track, user)
2017-10-12 15:52:46 +00:00
2018-04-23 08:30:25 +00:00
component SoundTrackContent(track *arn.SoundTrack, user *arn.User)
2018-03-11 14:43:17 +00:00
.soundtrack-content
2017-10-12 15:52:46 +00:00
if track.MainAnime() != nil
2018-04-23 08:30:25 +00:00
a.soundtrack-anime-link(href="/anime/" + track.MainAnime().ID, title=track.MainAnime().Title.ByUser(user))
2018-04-18 13:07:46 +00:00
img.soundtrack-anime-image.lazy(data-src=track.MainAnime().ImageLink("medium"), data-webp="true", data-color=track.MainAnime().AverageColor(), alt=track.MainAnime().Title.Canonical)
2017-11-09 17:31:32 +00:00
2018-03-11 19:22:33 +00:00
SoundTrackMedia(track)
component SoundTrackMedia(track *arn.SoundTrack)
if track.File != "" && track.HasMediaByService("Youtube")
2018-03-11 19:22:33 +00:00
.soundtrack-media
2018-12-07 00:54:17 +00:00
.media-play-area.action(data-action="toggleAudio", data-trigger="click", data-audio-src="https://notify.moe/audio/" + track.File, data-media-id=track.ID)
img.media-image.lazy(data-src="https://img.youtube.com/vi/" + track.MediaByService("Youtube")[0].ServiceID + "/0.jpg", alt=track.Title)
2019-04-30 14:59:53 +00:00
button.media-play-button(aria-label="Play soundtrack")
2018-03-11 19:22:33 +00:00
RawIcon("play")
2018-12-07 00:54:17 +00:00
.media-visualizer
2018-03-11 19:22:33 +00:00
.visualizer-box.visualizer-box-1
.visualizer-box.visualizer-box-2
.visualizer-box.visualizer-box-3
else if len(track.Media) > 0
2018-03-11 19:22:33 +00:00
ExternalMedia(track.Media[0])
2017-10-12 15:52:46 +00:00
2018-04-23 08:30:25 +00:00
component SoundTrackFooter(track *arn.SoundTrack, user *arn.User)
2019-09-01 07:39:17 +00:00
footer.soundtrack-footer
2018-04-23 08:30:25 +00:00
if track.Title.ByUser(user) == ""
a(href=track.Link() + "/edit") untitled
2017-10-12 15:52:46 +00:00
else
2018-04-23 08:30:25 +00:00
a(href=track.Link())= track.Title.ByUser(user)
2017-11-09 19:39:49 +00:00
span posted
2021-11-23 12:57:43 +00:00
time.utc-date.no-tip(datetime=track.Created)
2017-11-09 19:39:49 +00:00
span by
a(href=track.Creator().Link())= track.Creator().Nick + " "