diff --git a/pages/anime/anime.go b/pages/anime/anime.go index f694893c..db368846 100644 --- a/pages/anime/anime.go +++ b/pages/anime/anime.go @@ -11,7 +11,7 @@ import ( ) const maxEpisodes = 26 -const maxEpisodesLongSeries = 10 +const maxEpisodesLongSeries = 12 const maxDescriptionLength = 170 // Get anime page. @@ -25,15 +25,9 @@ func Get(ctx *aero.Context) string { } episodes := anime.Episodes().Items - // episodesReversed := false if len(episodes) > maxEpisodes { - // episodesReversed = true - episodes = episodes[len(episodes)-maxEpisodesLongSeries:] - - for i, j := 0, len(episodes)-1; i < j; i, j = i+1, j-1 { - episodes[i], episodes[j] = episodes[j], episodes[i] - } + episodes = anime.Episodes().LastReversed(maxEpisodesLongSeries) } // Friends watching @@ -64,11 +58,7 @@ func Get(ctx *aero.Context) string { relations := anime.Relations() if relations != nil { - items := relations.Items - - sort.Slice(items, func(i, j int) bool { - return items[i].Anime().StartDate < items[j].Anime().StartDate - }) + relations.SortByStartDate() } // Soundtracks diff --git a/pages/anime/anime.scarlet b/pages/anime/anime.scarlet index 158ed5ce..90734c75 100644 --- a/pages/anime/anime.scarlet +++ b/pages/anime/anime.scarlet @@ -73,6 +73,9 @@ margin-bottom 0.5rem min-width 200px + .video-container + box-shadow shadow-light + > 500px .anime-soundtracks horizontal-wrap diff --git a/pages/anime/episode.scarlet b/pages/anime/episode.scarlet index e1a46218..f3529eb7 100644 --- a/pages/anime/episode.scarlet +++ b/pages/anime/episode.scarlet @@ -4,17 +4,23 @@ > 700px .episodes horizontal-wrap - justify-content space-around + justify-content flex-start .episode vertical flex 0 - flex-basis 200px + flex-basis 190px margin 0.5rem padding 0.5rem overflow hidden + border ui-border border-radius ui-element-border-radius color text-color + box-shadow shadow-light + + [data-available="false"] + &.mounted + opacity 0.25 !important :hover color text-color diff --git a/pages/anime/episodes.pixy b/pages/anime/episodes.pixy index 09c9924c..52f3a0e3 100644 --- a/pages/anime/episodes.pixy +++ b/pages/anime/episodes.pixy @@ -4,7 +4,7 @@ component AnimeEpisodes(anime *arn.Anime, episodes []*arn.AnimeEpisode, user *ar h3.anime-section-name Episodes .episodes each episode in episodes - a.episode.ajax.mountable(href=anime.Link() + "/episode/" + strconv.Itoa(episode.Number), data-mountable-type="episode") + a.episode.ajax.mountable(href=anime.Link() + "/episode/" + strconv.Itoa(episode.Number), data-mountable-type="episode", data-available=episode.Available()) .episode-number if episode.Number != -1 span= episode.Number