feat: add simulcast page with season picker and navigation

This commit is contained in:
2026-06-30 19:29:18 +02:00
parent 4afa0b46f9
commit 86ba058825
7 changed files with 101 additions and 5 deletions

View File

@@ -104,6 +104,7 @@
</a>
<a href="/browse" class="hidden h-full items-center px-2 text-base transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground-muted sm:inline-flex sm:px-3 {{if eq $currentPath "/browse"}}text-foreground{{else}}text-foreground-muted{{end}}" aria-current="{{if eq $currentPath "/browse"}}page{{end}}">Browse</a>
<a href="/top-picks" class="hidden h-full items-center px-2 text-base transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground-muted sm:inline-flex sm:px-3 {{if eq $currentPath "/top-picks"}}text-foreground{{else}}text-foreground-muted{{end}}" aria-current="{{if eq $currentPath "/top-picks"}}page{{end}}">Top Picks</a>
<a href="/simulcast" class="hidden h-full items-center px-2 text-base transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground-muted sm:inline-flex sm:px-3 {{if eq $currentPath "/simulcast"}}text-foreground{{else}}text-foreground-muted{{end}}" aria-current="{{if eq $currentPath "/simulcast"}}page{{end}}">Simulcast</a>
</div>
<div class="hidden h-full items-center sm:flex">
@@ -126,6 +127,9 @@
<a href="/top-picks" class="flex items-center justify-between px-5 py-3 text-sm transition-colors hover:bg-surface-hover {{if eq $currentPath "/top-picks"}}text-foreground{{else}}text-foreground-muted hover:text-foreground{{end}}" aria-current="{{if eq $currentPath "/top-picks"}}page{{end}}">
<span>Top Picks</span>
</a>
<a href="/simulcast" class="flex items-center justify-between px-5 py-3 text-sm transition-colors hover:bg-surface-hover {{if eq $currentPath "/simulcast"}}text-foreground{{else}}text-foreground-muted hover:text-foreground{{end}}" aria-current="{{if eq $currentPath "/simulcast"}}page{{end}}">
<span>Simulcast</span>
</a>
<a href="/watchlist" class="flex items-center justify-between px-5 py-3 text-sm transition-colors hover:bg-surface-hover {{if eq $currentPath "/watchlist"}}text-foreground{{else}}text-foreground-muted hover:text-foreground{{end}}" aria-current="{{if eq $currentPath "/watchlist"}}page{{end}}">
<span>Watchlist</span>
</a>

View File

@@ -0,0 +1,58 @@
{{define "title"}}Simulcast{{end}}
{{define "content"}}
<div class="mx-auto flex w-full max-w-7xl flex-col gap-6 pb-12">
<div class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
<h1 class="text-2xl font-medium text-foreground">Simulcast Season</h1>
<ui-dropdown class="relative block" data-align="right" data-width="min-w-44">
<div data-trigger class="cursor-pointer">
<button type="button" class="flex h-10 min-w-44 items-center justify-between gap-3 bg-background-button px-4 text-sm text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<span>{{.SeasonLabel}} {{.Year}}</span>
<svg class="h-4 w-4 text-foreground-muted" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m6 9 6 6 6-6" /></svg>
</button>
</div>
<div data-content class="absolute right-0 top-full z-50 mt-2 hidden max-h-80 min-w-44 overflow-y-auto bg-background-button shadow-card scrollbar-hidden">
<div class="flex flex-col py-1">
{{range .SeasonOptions}}
<a href="/simulcast?season={{.Season}}&year={{.Year}}" class="flex w-full items-center px-5 py-2.5 text-sm transition-colors hover:bg-surface-hover {{if and (eq .Season $.Season) (eq .Year $.Year)}}text-accent{{else}}text-foreground-muted hover:text-foreground{{end}}">{{.Label}}</a>
{{end}}
</div>
</div>
</ui-dropdown>
</div>
{{if .Animes}}
<div class="grid grid-cols-2 gap-x-4 gap-y-7 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6">
{{range .Animes}}
{{template "anime_card" dict "Anime" . "WithActions" true "IsWatchlist" (index $.WatchlistMap .MalID)}}
{{end}}
</div>
{{else}}
<div class="border border-border-light px-6 py-16 text-center text-sm text-foreground-muted">No provider releases found for {{.SeasonLabel}} {{.Year}}.</div>
{{end}}
<div class="flex items-center justify-between border-t-2 border-border-light pt-4 text-xs font-medium uppercase tracking-wide text-foreground-muted">
{{if .Previous}}
<a href="/simulcast?season={{.Previous.Season}}&year={{.Previous.Year}}" class="inline-flex items-center gap-2 transition-colors hover:text-foreground">
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6" /></svg>
Previous season
</a>
{{else}}
<span class="inline-flex cursor-not-allowed items-center gap-2 opacity-35" aria-disabled="true">
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6" /></svg>
Previous season
</span>
{{end}}
{{if .Next}}
<a href="/simulcast?season={{.Next.Season}}&year={{.Next.Year}}" class="inline-flex items-center gap-2 transition-colors hover:text-foreground">
Next season
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6" /></svg>
</a>
{{else}}
<span class="inline-flex cursor-not-allowed items-center gap-2 opacity-35" aria-disabled="true">
Next season
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6" /></svg>
</span>
{{end}}
</div>
</div>
{{end}}