From e804a45c3888f8b7ff8a09d812a73ed4de1270a9 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Fri, 10 Apr 2026 01:22:52 +0200 Subject: [PATCH] ui: fix premiered case and sidebar text --- internal/jikan/types.go | 25 +++++++++++++++++++++++-- static/css/style.css | 26 +++++++++++++------------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/internal/jikan/types.go b/internal/jikan/types.go index 0ed8134..418003f 100644 --- a/internal/jikan/types.go +++ b/internal/jikan/types.go @@ -1,6 +1,9 @@ package jikan -import "fmt" +import ( + "fmt" + "strings" +) type SearchResult struct { Animes []Anime @@ -108,11 +111,29 @@ func (a Anime) ShortDuration() string { func (a Anime) Premiered() string { if a.Season != "" && a.Year > 0 { - return fmt.Sprintf("%s %d", a.Season, a.Year) + return fmt.Sprintf("%s %d", seasonLabel(a.Season), a.Year) } return "" } +func seasonLabel(season string) string { + switch strings.ToLower(season) { + case "winter": + return "Winter" + case "spring": + return "Spring" + case "summer": + return "Summer" + case "fall", "autumn": + return "Fall" + default: + if season == "" { + return "" + } + return strings.ToUpper(season[:1]) + strings.ToLower(season[1:]) + } +} + type AnimeResponse struct { Data Anime `json:"data"` } diff --git a/static/css/style.css b/static/css/style.css index 18fd09e..3e07ea1 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -85,7 +85,7 @@ body { radial-gradient(1100px 500px at 8% -10%, #1a1b22 0%, transparent 55%), radial-gradient(900px 420px at 92% 0%, #171a1e 0%, transparent 60%); color: var(--text); - font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: var(--text-lg); line-height: 1.5; margin: 0; @@ -967,15 +967,15 @@ a.htmx-request { } .sidebar-label { - font-size: var(--text-sm); + font-size: var(--text-base); font-weight: 600; color: var(--text); - text-transform: uppercase; + text-transform: none; } .anime-side-section { display: grid; - gap: var(--space-md); + gap: var(--space-sm); } .anime-side-section h3 { @@ -994,13 +994,13 @@ a.htmx-request { } .side-details-more[open] { - gap: var(--space-sm); + gap: var(--space-md); } .sidebar-value { - font-size: var(--text-base); + font-size: var(--text-md); color: var(--text-muted); - line-height: 1.4; + line-height: 1.5; } .sidebar-row-wrap { @@ -1010,16 +1010,16 @@ a.htmx-request { .sidebar-tags { display: flex; flex-wrap: wrap; - gap: var(--space-xs); + gap: var(--space-sm); } .sidebar-tag { - padding: var(--space-xs) var(--space-sm); + padding: var(--space-xs) var(--space-md); background: var(--surface-hover); - font-family: var(--font-mono); - font-size: var(--text-xs); - text-transform: uppercase; - letter-spacing: 0.05em; + font-family: inherit; + font-size: var(--text-sm); + text-transform: none; + letter-spacing: normal; color: var(--text); }