Style improvements

This commit is contained in:
Eduard Urbach 2017-12-04 21:58:55 +01:00
parent 5357d669cf
commit 00996de045
4 changed files with 15 additions and 16 deletions

View File

@ -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

View File

@ -73,6 +73,9 @@
margin-bottom 0.5rem
min-width 200px
.video-container
box-shadow shadow-light
> 500px
.anime-soundtracks
horizontal-wrap

View File

@ -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

View File

@ -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