From a3b7e4b3deca82094e512193152f782d7fc401e3 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 4 Mar 2018 16:53:42 +0100 Subject: [PATCH] Added new support page --- layout/sidebar/sidebar.pixy | 2 +- pages/index.go | 2 ++ pages/shop/shop.pixy | 1 + pages/support/support.go | 20 +++++++++++++++++++ pages/support/support.pixy | 32 +++++++++++++++++++++++++++++++ pages/support/support.scarlet | 36 +++++++++++++++++++++++++++++++++++ styles/include/config.scarlet | 4 ++++ tests.go | 1 + 8 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 pages/support/support.go create mode 100644 pages/support/support.pixy create mode 100644 pages/support/support.scarlet diff --git a/layout/sidebar/sidebar.pixy b/layout/sidebar/sidebar.pixy index 1631be54..d6b3ac14 100644 --- a/layout/sidebar/sidebar.pixy +++ b/layout/sidebar/sidebar.pixy @@ -31,7 +31,7 @@ component Sidebar(user *arn.User) SidebarButton("Users", "/users", "globe") if user != nil - SidebarButton("Shop", "/shop", "shopping-cart") + SidebarButton("Support", "/support", "heart") if arn.IsDevelopment() SidebarButton("Groups", "/groups", "users") diff --git a/pages/index.go b/pages/index.go index 90b2c2b2..a019ca15 100644 --- a/pages/index.go +++ b/pages/index.go @@ -51,6 +51,7 @@ import ( "github.com/animenotifier/notify.moe/pages/soundtrack" "github.com/animenotifier/notify.moe/pages/soundtracks" "github.com/animenotifier/notify.moe/pages/statistics" + "github.com/animenotifier/notify.moe/pages/support" "github.com/animenotifier/notify.moe/pages/terms" "github.com/animenotifier/notify.moe/pages/threads" "github.com/animenotifier/notify.moe/pages/upload" @@ -180,6 +181,7 @@ func Configure(app *aero.Application) { l.Page("/search/*term", search.Get) // Shop + l.Page("/support", support.Get) l.Page("/shop", shop.Get) l.Page("/inventory", inventory.Get) l.Page("/charge", charge.Get) diff --git a/pages/shop/shop.pixy b/pages/shop/shop.pixy index d0e97467..bf018454 100644 --- a/pages/shop/shop.pixy +++ b/pages/shop/shop.pixy @@ -9,6 +9,7 @@ component Shop(user *arn.User, items []*arn.Item) component ShopTabs(user *arn.User) .tabs + Tab("Support", "heart", "/support") Tab("Shop", "shopping-cart", "/shop") Tab("Inventory", "briefcase", "/inventory") Tab("History", "history", "/shop/history") diff --git a/pages/support/support.go b/pages/support/support.go new file mode 100644 index 00000000..3eb1e643 --- /dev/null +++ b/pages/support/support.go @@ -0,0 +1,20 @@ +package support + +import ( + "net/http" + + "github.com/aerogo/aero" + "github.com/animenotifier/notify.moe/components" + "github.com/animenotifier/notify.moe/utils" +) + +// Get support page. +func Get(ctx *aero.Context) string { + user := utils.GetUser(ctx) + + if user == nil { + return ctx.Error(http.StatusUnauthorized, "Not logged in", nil) + } + + return ctx.HTML(components.Support(user)) +} diff --git a/pages/support/support.pixy b/pages/support/support.pixy new file mode 100644 index 00000000..ee4877a3 --- /dev/null +++ b/pages/support/support.pixy @@ -0,0 +1,32 @@ +component Support(user *arn.User) + ShopTabs(user) + + h1.mountable Want to support us? + + .feature-cards + .feature-card.mountable + .feature-card-icon + RawIcon("user") + + p.feature-card-text Anime Notifier is developed and maintained mostly by just one person in Japan. + + .feature-card.mountable + .feature-card-icon + RawIcon("comments") + + .feature-card-text + p The developer is always listening to user feedback. Your voice will definitely be heard! + + .feature-card.mountable + .feature-card-icon + RawIcon("thumbs-up") + + .feature-card-text + p We aim for the highest quality standards, which is why the site will always be ad-free. + + .feature-card.mountable + .feature-card-icon + RawIcon("star") + + .feature-card-text + p You'll receive PRO account status allowing you to unlock extra features! \ No newline at end of file diff --git a/pages/support/support.scarlet b/pages/support/support.scarlet new file mode 100644 index 00000000..71676cd1 --- /dev/null +++ b/pages/support/support.scarlet @@ -0,0 +1,36 @@ +.feature-cards + horizontal + justify-content space-around + max-width 1200px + margin 0 auto + margin-top content-padding + +.feature-card + vertical + flex-basis 250px + border-radius 5px + overflow hidden + background ui-background + box-shadow shadow-light + border 1px solid ui-border-color + default-transition + + :hover + box-shadow shadow-medium + +.feature-card-icon, +.feature-card-text + horizontal + justify-content center + align-items center + text-align center + padding 1rem + margin 0 + +.feature-card-icon + font-size 3rem + background feature-card-color + color feature-card-icon-color + +.feature-card-text + // \ No newline at end of file diff --git a/styles/include/config.scarlet b/styles/include/config.scarlet index e5074cd2..0ee584c7 100644 --- a/styles/include/config.scarlet +++ b/styles/include/config.scarlet @@ -71,6 +71,10 @@ anime-list-item-name-color = link-color // Tables table-width-normal = 900px +// Feature cards +feature-card-color = crimson +feature-card-icon-color = white + // Loading animation loading-anim-color = main-color diff --git a/tests.go b/tests.go index 27767288..bcdd408d 100644 --- a/tests.go +++ b/tests.go @@ -295,6 +295,7 @@ var routeTests = map[string][]string{ "/settings/pro": nil, "/shop": nil, "/shop/history": nil, + "/support": nil, "/charge": nil, "/inventory": nil, "/extension/embed": nil,