Added spoilers to characters

This commit is contained in:
Eduard Urbach 2018-11-01 09:11:11 +09:00
parent 007e2e90ec
commit 2730306cef
4 changed files with 25 additions and 0 deletions

View File

@ -83,6 +83,15 @@ func parseCharacterDescription(input string) (output string, attributes []*arn.C
continue
}
paragraph = strings.TrimSpace(paragraph)
// Skip paragraph if it's too short.
if len(paragraph) < 30 {
if !strings.HasSuffix(paragraph, ".") || strings.HasSuffix(paragraph, "...") {
continue
}
}
finalParagraphs = append(finalParagraphs, paragraph)
// originalLine := line

View File

@ -37,6 +37,10 @@ component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime
.character-description.mountable(data-mountable-type="header")!= markdown.Render(character.Description)
.character-spoilers
each spoiler in character.Spoilers
.spoiler.character-spoiler.mountable(data-mountable-type="header")!= markdown.Render(spoiler.Text)
.character-main-column
if len(characterAnime) > 0
.character-section

View File

@ -52,6 +52,12 @@
.character-anime-item-image
anime-mini-item-image
.character-spoiler-warning
margin content-padding 0
.character-spoiler
margin typography-margin 0
.character-quotes
justify-content flex-start

6
styles/spoiler.scarlet Normal file
View File

@ -0,0 +1,6 @@
.spoiler
transition filter 500ms ease, transform transition-speed ease
filter blur(2px)
:hover
filter blur(0)