ui: fix premiered case and sidebar text
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
package jikan
|
package jikan
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
type SearchResult struct {
|
type SearchResult struct {
|
||||||
Animes []Anime
|
Animes []Anime
|
||||||
@@ -108,11 +111,29 @@ func (a Anime) ShortDuration() string {
|
|||||||
|
|
||||||
func (a Anime) Premiered() string {
|
func (a Anime) Premiered() string {
|
||||||
if a.Season != "" && a.Year > 0 {
|
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 ""
|
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 {
|
type AnimeResponse struct {
|
||||||
Data Anime `json:"data"`
|
Data Anime `json:"data"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ body {
|
|||||||
radial-gradient(1100px 500px at 8% -10%, #1a1b22 0%, transparent 55%),
|
radial-gradient(1100px 500px at 8% -10%, #1a1b22 0%, transparent 55%),
|
||||||
radial-gradient(900px 420px at 92% 0%, #171a1e 0%, transparent 60%);
|
radial-gradient(900px 420px at 92% 0%, #171a1e 0%, transparent 60%);
|
||||||
color: var(--text);
|
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);
|
font-size: var(--text-lg);
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -967,15 +967,15 @@ a.htmx-request {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-label {
|
.sidebar-label {
|
||||||
font-size: var(--text-sm);
|
font-size: var(--text-base);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
text-transform: uppercase;
|
text-transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.anime-side-section {
|
.anime-side-section {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--space-md);
|
gap: var(--space-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
.anime-side-section h3 {
|
.anime-side-section h3 {
|
||||||
@@ -994,13 +994,13 @@ a.htmx-request {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.side-details-more[open] {
|
.side-details-more[open] {
|
||||||
gap: var(--space-sm);
|
gap: var(--space-md);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-value {
|
.sidebar-value {
|
||||||
font-size: var(--text-base);
|
font-size: var(--text-md);
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
line-height: 1.4;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-row-wrap {
|
.sidebar-row-wrap {
|
||||||
@@ -1010,16 +1010,16 @@ a.htmx-request {
|
|||||||
.sidebar-tags {
|
.sidebar-tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: var(--space-xs);
|
gap: var(--space-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-tag {
|
.sidebar-tag {
|
||||||
padding: var(--space-xs) var(--space-sm);
|
padding: var(--space-xs) var(--space-md);
|
||||||
background: var(--surface-hover);
|
background: var(--surface-hover);
|
||||||
font-family: var(--font-mono);
|
font-family: inherit;
|
||||||
font-size: var(--text-xs);
|
font-size: var(--text-sm);
|
||||||
text-transform: uppercase;
|
text-transform: none;
|
||||||
letter-spacing: 0.05em;
|
letter-spacing: normal;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user