From 213bb87bf9090a672b6dce224ab6f7489efb78f0 Mon Sep 17 00:00:00 2001 From: perennial Date: Wed, 2 Oct 2024 14:57:45 +1000 Subject: [PATCH] Improve UI/UX for discovery and ranking pages Update Switcher block with new styling and active state indicator. Enhance discovery page layout and integrate Switcher for filters. Refine ranking page with explanatory text and reorganised navigation. --- assets/views/blocks/switcher.jet.html | 10 +++++++--- assets/views/discovery.jet.html | 18 ++++++++++++------ assets/views/rank.jet.html | 13 +++++++++---- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/assets/views/blocks/switcher.jet.html b/assets/views/blocks/switcher.jet.html index 18d59b8..fca44ea 100644 --- a/assets/views/blocks/switcher.jet.html +++ b/assets/views/blocks/switcher.jet.html @@ -8,21 +8,25 @@ The template loops through the paths, creating a button for each one. Each button is styled using Bootstrap 5 classes, including: - - btn-outline-secondary for the button style (or btn-outline-danger for r18 paths) + - btn-secondary for the button style (or btn-danger for r18 paths) - rounded-pill for pill-shaped edges - fw-bold for bold text The template also handles the active state: - Adds 'active' class to the button if its path matches the activeState - Sets aria-pressed attribute for accessibility + - Adds an icon (bi-circle-fill) for the active state This switcher can be used for tabbed navigation or toggling between different views. *} {{- block Switcher(baseURL, paths, names, activeState) }} {{- range i, k := paths }} - - {{- names[i] }} + + {{- if activeState == k }} + + {{- end }} + {{ names[i] }} {{- end }} {{- end }} diff --git a/assets/views/discovery.jet.html b/assets/views/discovery.jet.html index 6591c2f..5d93d7d 100644 --- a/assets/views/discovery.jet.html +++ b/assets/views/discovery.jet.html @@ -1,14 +1,18 @@ {{- extends "layout/default" }} +{{- import "blocks/switcher" }} {{- block body() }}

Discover artworks

-

Type

+

Type

Choose between discovering artworks or novels from users on Pixiv.

@@ -16,12 +20,14 @@
-

Filter

+

Filter

Filter by content rating to customize your discovery experience.

- All - Safe - R-18 + {{- Mode := isset(Queries.mode) ? Queries.mode : "all" }} + {{- url := replaceQuery(.Queries, "mode", "") }} + {{- path := slice("all", "safe", "r18") }} + {{- name := slice("All", "Safe", "R-18")}} + {{- yield Switcher(baseURL=url, paths=path, names=name, activeState=Mode)}}
diff --git a/assets/views/rank.jet.html b/assets/views/rank.jet.html index 6207509..338ba26 100644 --- a/assets/views/rank.jet.html +++ b/assets/views/rank.jet.html @@ -8,6 +8,7 @@

Content

+

Select the type of content you want to see in the rankings.

{{- Mode := isset(Queries.mode) ? Queries.mode : "daily" }} {{- Content := isset(Queries.content) ? Queries.content : "all" }} {{- url := "" }} {{- if Mode == "original" || Mode == "male" || Mode == "female" || Mode == ""}} @@ -24,6 +25,7 @@

Modes

+

Choose the time frame or category for the rankings.

{{ url := "/ranking?content=" + Content +"&date=" + .Data.CurrentDate + "&page=1&mode=" }}
{{- path := slice("daily", "weekly") }} @@ -50,16 +52,19 @@

Date (current: {{ .Data.CurrentDate }})

+

Navigate through different dates or view the latest rankings.

{{ url := "/ranking?content=" + Content + "&mode=" + Mode + "&page=1" }} +
{{- if .Data.PrevDate != "false" }} - Yesterday + Previous day {{- end }} {{ if .Data.NextDate != "false" }} - Next day + Next day {{- end }} - Latest - Ranking calendar