53 lines
2.1 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 SoundTrackMini(track *arn.SoundTrack, user *arn.User)
2018-04-19 13:04:25 +00:00
.soundtrack.mountable(id=track.ID)
2018-04-23 08:30:25 +00:00
SoundTrackContent(track, user)
SoundTrackMiniFooter(track, user)
2018-04-19 13:04:25 +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
.soundtrack-play-area.action(data-action="toggleAudio", data-trigger="click", data-audio-src="https://notify.moe/audio/" + track.File, data-soundtrack-id=track.ID)
2018-04-08 20:50:23 +00:00
img.soundtrack-image.lazy(data-src="https://img.youtube.com/vi/" + track.MediaByService("Youtube")[0].ServiceID + "/0.jpg", alt=track.Title)
2018-03-11 19:22:33 +00:00
button.soundtrack-play-button
RawIcon("play")
.soundtrack-visualizer
.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)
2018-03-11 14:43:17 +00:00
.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
2018-04-19 09:22:17 +00:00
span.utc-date.no-tip(data-date=track.Created)
2017-11-09 19:39:49 +00:00
span by
a(href=track.Creator().Link())= track.Creator().Nick + " "
2017-10-12 15:52:46 +00:00
2018-04-23 08:30:25 +00:00
component SoundTrackMiniFooter(track *arn.SoundTrack, user *arn.User)
2018-04-19 13:04:25 +00:00
.soundtrack-footer
2018-04-23 08:30:25 +00:00
if track.Title.ByUser(user) == ""
2018-04-19 13:04:25 +00:00
a(href=track.Link() + "/edit") untitled
else
2018-04-23 08:30:25 +00:00
a(href=track.Link())= track.Title.ByUser(user)
2018-04-19 13:04:25 +00:00
2017-10-12 15:52:46 +00:00
component ExternalMedia(media *arn.ExternalMedia)
2018-07-02 06:15:54 +00:00
iframe.lazy(data-src=media.EmbedLink(), allowfullscreen)