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() }}
Choose between discovering artworks or novels from users on Pixiv.
Filter by content rating to customize your discovery experience.
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 @@Choose the time frame or category for the rankings.
{{ url := "/ranking?content=" + Content +"&date=" + .Data.CurrentDate + "&page=1&mode=" }}Navigate through different dates or view the latest rankings.
{{ url := "/ranking?content=" + Content + "&mode=" + Mode + "&page=1" }} +