Improved search styles

This commit is contained in:
Eduard Urbach 2017-12-03 17:02:11 +01:00
parent bbb7e1b621
commit cd9dfd85e1
5 changed files with 38 additions and 22 deletions

View File

@ -1,4 +1,7 @@
component Character(character *arn.Character)
a.character.ajax(href="/character/" + character.ID)
img.character-image.lazy(data-src=character.Image, alt=character.Name, title=character.Name)
//- span.character-name= character.Name
component CharacterSmall(character *arn.Character)
a.character.ajax(href="/character/" + character.ID)
img.character-image.character-image-small.lazy(data-src=character.Image, alt=character.Name, title=character.Name)

View File

@ -15,9 +15,11 @@
// opacity 1
.character-image
border-radius 3px
border-radius 5%
box-shadow shadow-medium
object-fit cover
width 112px
height 112px
// .character-name
// font-size 0.75rem
@ -25,7 +27,6 @@
// opacity 0.5
// transition opacity transition-speed ease
.character-image
width 112px
height 112px
border-radius 10%
.character-image-small
width 56px
height 56px

View File

@ -13,7 +13,7 @@ const maxAnime = 25
const maxPosts = 2
const maxThreads = 2
const maxTracks = 4
const maxCharacters = 12
const maxCharacters = 22
// Get search page.
func Get(ctx *aero.Context) string {

View File

@ -26,7 +26,7 @@ component SearchResults(term string, users []*arn.User, animes []*arn.Anime, pos
else
each character in characters
.mountable(data-mountable-type="character")
Character(character)
CharacterSmall(character)
.widget
h3.widget-title
@ -36,21 +36,22 @@ component SearchResults(term string, users []*arn.User, animes []*arn.Anime, pos
if len(posts) == 0 && len(threads) == 0
p.no-search-results.mountable No posts found.
else
each thread in threads
.mountable(data-mountable-type="forum")
.forum-search-result
a.forum-search-result-title.ajax(href=thread.Link())= thread.Title
if thread.Author().HasNick()
.forum-search-result-author= thread.Author().Nick
.forum-search-result-sample= thread.Text
.forum-search-results
each thread in threads
.forum-search-result.mountable(data-mountable-type="forum")
.forum-search-result-header
a.forum-search-result-title.ajax(href=thread.Link())= thread.Title
if thread.Author().HasNick()
.forum-search-result-author= thread.Author().Nick
.forum-search-result-sample= thread.Text
each post in posts
.mountable(data-mountable-type="forum")
.forum-search-result
a.forum-search-result-title.ajax(href=post.Link(), data-mountable-type="forum")= post.Thread().Title
if post.Author().HasNick()
.forum-search-result-author= post.Author().Nick
.forum-search-result-sample= post.Text
each post in posts
.forum-search-result.mountable(data-mountable-type="forum")
.forum-search-result-header
a.forum-search-result-title.ajax(href=post.Link(), data-mountable-type="forum")= post.Thread().Title
if post.Author().HasNick()
.forum-search-result-author= post.Author().Nick
.forum-search-result-sample= post.Text
.widget
h3.widget-title

View File

@ -10,7 +10,18 @@
width 55px !important
height 78px !important
.forum-search-results
horizontal-wrap
justify-content space-around
.forum-search-result
vertical
flex 1
flex-basis 380px
padding 0.75rem
overflow hidden
.forum-search-result-header
horizontal
.forum-search-result-title