Improved assets

This commit is contained in:
Eduard Urbach 2017-10-02 00:55:37 +02:00
parent 504993861b
commit b0c70fc735
7 changed files with 17 additions and 27 deletions

View File

@ -44,8 +44,7 @@ func init() {
// Brand icons // Brand icons
app.Get("/images/brand/:file", func(ctx *aero.Context) string { app.Get("/images/brand/:file", func(ctx *aero.Context) string {
file := strings.TrimSuffix(ctx.Get("file"), ".webp") return ctx.File("images/brand/" + ctx.Get("file"))
return ctx.TryWebP("images/brand/"+file, ".png")
}) })
// Cover image // Cover image

View File

@ -35,20 +35,20 @@
"background_color": "#ffffff", "background_color": "#ffffff",
"icons": [ "icons": [
{ {
"src": "images/brand/64", "src": "images/brand/64.png",
"sizes": "64x64" "sizes": "64x64"
}, },
{ {
"src": "images/brand/144", "src": "images/brand/144.png",
"sizes": "144x144", "sizes": "144x144",
"type": "image/png" "type": "image/png"
}, },
{ {
"src": "images/brand/300", "src": "images/brand/300.png",
"sizes": "300x300" "sizes": "300x300"
}, },
{ {
"src": "images/brand/600", "src": "images/brand/600.png",
"sizes": "600x600" "sizes": "600x600"
} }
] ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -3,7 +3,7 @@ component Sidebar(user *arn.User)
if user != nil if user != nil
Avatar(user) Avatar(user)
else else
img.user-image.lazy(data-src="/images/brand/64", alt="Anime Notifier") img.user-image.lazy(data-src="/images/brand/64.png", data-webp="true", alt="Anime Notifier")
if user != nil if user != nil
SidebarButton("Home", "/animelist/watching", "home") SidebarButton("Home", "/animelist/watching", "home")

View File

@ -1,21 +1,12 @@
component StatusTabs(urlPrefix string) component StatusTabs(urlPrefix string)
.tabs.status-tabs .tabs.status-tabs
a.tab.status-tab.action(href=urlPrefix + "/watching", data-action="diff", data-trigger="click") StatusTab("Watching", "play", urlPrefix + "/watching")
Icon("play") StatusTab("Completed", "check", urlPrefix + "/completed")
span.tab-text Watching StatusTab("Planned", "forward", urlPrefix + "/planned")
StatusTab("On Hold", "pause", urlPrefix + "/hold")
a.tab.status-tab.action(href=urlPrefix + "/completed", data-action="diff", data-trigger="click") StatusTab("Dropped", "stop", urlPrefix + "/dropped")
Icon("check")
span.tab-text Completed
a.tab.status-tab.action(href=urlPrefix + "/planned", data-action="diff", data-trigger="click") component StatusTab(label string, icon string, url string)
Icon("forward") a.tab.status-tab.action(href=url, data-action="diff", data-trigger="click", aria-label=label)
span.tab-text Planned Icon(icon)
span.tab-text= label
a.tab.status-tab.action(href=urlPrefix + "/hold", data-action="diff", data-trigger="click")
Icon("pause")
span.tab-text On Hold
a.tab.status-tab.action(href=urlPrefix + "/dropped", data-action="diff", data-trigger="click")
Icon("stop")
span.tab-text Dropped

View File

@ -16,7 +16,7 @@ func Get(ctx *aero.Context) string {
"og:description": description, "og:description": description,
"og:type": "website", "og:type": "website",
"og:url": "https://" + ctx.App.Config.Domain, "og:url": "https://" + ctx.App.Config.Domain,
"og:image": "https://" + ctx.App.Config.Domain + "/images/brand/600", "og:image": "https://" + ctx.App.Config.Domain + "/images/brand/600.png",
}, },
Meta: map[string]string{ Meta: map[string]string{
"description": description, "description": description,

View File

@ -19,7 +19,7 @@ func Test(ctx *aero.Context) string {
notification := &arn.Notification{ notification := &arn.Notification{
Title: "Anime Notifier", Title: "Anime Notifier",
Message: "Yay, it works!", Message: "Yay, it works!",
Icon: "https://" + ctx.App.Config.Domain + "/images/brand/300", Icon: "https://" + ctx.App.Config.Domain + "/images/brand/300.png",
} }
user.SendNotification(notification) user.SendNotification(notification)