For the lulz

This commit is contained in:
Eduard Urbach 2017-07-04 10:26:18 +02:00
parent 1f9503f3e7
commit 7d9106f6ea
3 changed files with 25 additions and 1 deletions

View File

@ -2,6 +2,10 @@ component FrontPage
.frontpage .frontpage
h2 notify.moe h2 notify.moe
video.bg-video(autoplay="true", loop="true")
source(src="//s1.webmshare.com/ZrK1J.webm")
img.action.screenshot(src="/images/elements/extension-screenshot.png", alt="Screenshot of the browser extension", title="Click to install the Chrome Extension", data-action="installExtension", data-trigger="click") img.action.screenshot(src="/images/elements/extension-screenshot.png", alt="Screenshot of the browser extension", title="Click to install the Chrome Extension", data-action="installExtension", data-trigger="click")
Login Login

View File

@ -7,11 +7,23 @@
font-weight normal font-weight normal
letter-spacing 3px letter-spacing 3px
text-transform uppercase text-transform uppercase
color white
.footer .footer
text-align center text-align center
margin-top content-padding margin-top content-padding
.bg-video
position absolute
top 50%
left 50%
transform translateX(-50%) translateY(-50%)
min-width 100%
min-height 100%
width auto
height auto
z-index -100
.screenshot .screenshot
max-width 100% max-width 100%
border-radius 3px border-radius 3px

View File

@ -35,6 +35,13 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusBadRequest, "Couldn't load your anime list from AniList", err) return ctx.Error(http.StatusBadRequest, "Couldn't load your anime list from AniList", err)
} }
matches := findAllMatches(allAnime, animeList)
return ctx.HTML(components.ImportAnilist(user, matches))
}
// findAllMatches returns all matches for the anime inside an anilist anime list.
func findAllMatches(allAnime []*arn.Anime, animeList *arn.AniListAnimeList) []*arn.AniListMatch {
matches := []*arn.AniListMatch{} matches := []*arn.AniListMatch{}
matches = importList(matches, allAnime, animeList.Lists.Watching) matches = importList(matches, allAnime, animeList.Lists.Watching)
@ -47,9 +54,10 @@ func Get(ctx *aero.Context) string {
matches = importList(matches, allAnime, list) matches = importList(matches, allAnime, list)
} }
return ctx.HTML(components.ImportAnilist(user, matches)) return matches
} }
// importList imports a single list inside an anilist anime list collection.
func importList(matches []*arn.AniListMatch, allAnime []*arn.Anime, animeListItems []*arn.AniListAnimeListItem) []*arn.AniListMatch { func importList(matches []*arn.AniListMatch, allAnime []*arn.Anime, animeListItems []*arn.AniListAnimeListItem) []*arn.AniListMatch {
for _, item := range animeListItems { for _, item := range animeListItems {
matches = append(matches, &arn.AniListMatch{ matches = append(matches, &arn.AniListMatch{