CSP update
This commit is contained in:
parent
50db360272
commit
b4e9b6a15e
@ -1,20 +0,0 @@
|
||||
component GenreOverview
|
||||
// TODO: Add this to the stylus file later
|
||||
style!= "h2{ text-align: center; } .light-button{ display: inline-block; }"
|
||||
section
|
||||
header
|
||||
h2 Genres
|
||||
|
||||
div
|
||||
each genre in Genres
|
||||
a.light-button.ajax(href="/genres/" + arn.FixGenre(genre))
|
||||
Icon(GenreIcons[genre])
|
||||
span= genre
|
||||
|
||||
component AnimeInGenre(genre string, animeList []*arn.Anime)
|
||||
style!= "h2 { text-align: center; } .genre-anime-list{ display: flex; flex-flow: row wrap; float: none !important; justify-content: center; } .genre-anime-image{ width: 16vw; height: 9vw; min-width: 90px; min-height: 127px; max-width: 200px; max-height: 282px; object-fit: cover; } .genre-anime-link{ margin: 0.5em; flex-grow: 0; flex-shrink: 0; }"
|
||||
h2= "#" + genre
|
||||
.genre-anime-list
|
||||
each anime in animeList
|
||||
a.genre-anime-link.ajax(href="/anime/" + s(anime.ID))
|
||||
img.anime-image.genre-anime-image(src=anime.Image, alt=anime.Title.Romaji, title=anime.Title.Romaji + " (" + s(anime.Watching) + ")")
|
22
components/genres/AnimeInGenre.styl
Normal file
22
components/genres/AnimeInGenre.styl
Normal file
@ -0,0 +1,22 @@
|
||||
h2
|
||||
text-align center
|
||||
|
||||
.genre-anime-list
|
||||
display flex
|
||||
flex-flow row wrap
|
||||
float none !important
|
||||
justify-content center
|
||||
|
||||
.genre-anime-image
|
||||
width 16vw
|
||||
height 9vw
|
||||
min-width 90px
|
||||
min-height 127px
|
||||
max-width 200px
|
||||
max-height 282px
|
||||
object-fit cover
|
||||
|
||||
.genre-anime-link
|
||||
margin 0.5em
|
||||
flex-grow 0
|
||||
flex-shrink 0
|
5
components/genres/GenreOverview.styl
Normal file
5
components/genres/GenreOverview.styl
Normal file
@ -0,0 +1,5 @@
|
||||
h2
|
||||
text-align center
|
||||
|
||||
.light-button
|
||||
display inline-block
|
15
components/genres/genres.pixy
Normal file
15
components/genres/genres.pixy
Normal file
@ -0,0 +1,15 @@
|
||||
component GenreOverview
|
||||
h2 Genres
|
||||
|
||||
div
|
||||
each genre in Genres
|
||||
a.light-button.ajax(href="/genres/" + arn.FixGenre(genre))
|
||||
Icon(GenreIcons[genre])
|
||||
span= genre
|
||||
|
||||
component AnimeInGenre(genre string, animeList []*arn.Anime)
|
||||
h2= "#" + genre
|
||||
.genre-anime-list
|
||||
each anime in animeList
|
||||
a.genre-anime-link.ajax(href="/anime/" + s(anime.ID))
|
||||
img.anime-image.genre-anime-image(src=anime.Image, alt=anime.Title.Romaji, title=anime.Title.Romaji + " (" + s(anime.Watching) + ")")
|
@ -1,9 +1,8 @@
|
||||
component Layout(content string, css string)
|
||||
component Layout(content string)
|
||||
html
|
||||
head
|
||||
title ARN 4.0 - Beta
|
||||
meta(name="viewport", content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes")
|
||||
style!= css
|
||||
body
|
||||
#container
|
||||
Header
|
||||
|
4
main.go
4
main.go
@ -20,12 +20,14 @@ func main() {
|
||||
animeCSSBytes, _ := ioutil.ReadFile("anime.css")
|
||||
css += string(animeCSSBytes)
|
||||
|
||||
app.SetStyle(css)
|
||||
|
||||
scripts, _ := ioutil.ReadFile("scripts.js")
|
||||
js := string(scripts)
|
||||
|
||||
// Define layout
|
||||
app.Layout = func(ctx *aero.Context, content string) string {
|
||||
return Render.Layout(content, css)
|
||||
return Render.Layout(content)
|
||||
}
|
||||
|
||||
app.Register("/", func(ctx *aero.Context) string {
|
||||
|
Loading…
Reference in New Issue
Block a user