style: migrate watch page to v4 syntax

This commit is contained in:
2026-06-07 17:45:56 +02:00
committed by Milas Holsting
parent b8a89b7d2d
commit 9e3185c04e

View File

@@ -20,14 +20,14 @@
</a>
<ui-dropdown class="relative block" data-align="right" data-width="min-w-[160px]">
<div data-trigger class="cursor-pointer">
<button type="button" class="!rounded-none inline-flex h-10 items-center justify-between gap-2 bg-background-button px-4 text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<button type="button" class="rounded-none! inline-flex h-10 items-center justify-between gap-2 bg-background-button px-4 text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<span id="watchlist-status-display-{{$anime.MalID}}">
{{if .WatchlistStatus}}{{if eq .WatchlistStatus "watching"}}Watching{{else if eq .WatchlistStatus "completed"}}Completed{{else if eq .WatchlistStatus "plan_to_watch"}}Plan to Watch{{else if eq .WatchlistStatus "dropped"}}Dropped{{end}}{{else}}Add to Watchlist{{end}}
</span>
<svg class="h-4 w-4 text-foreground-muted" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="m6 9 6 6 6-6" /></svg>
</button>
</div>
<div data-content class="hidden absolute z-50 min-w-40 bg-background-button shadow-[var(--shadow-card)] ring-1 ring-black/10 right-0 top-full mt-2">
<div data-content class="hidden absolute z-50 min-w-40 bg-background-button shadow-(--shadow-card) ring-1 ring-black/10 right-0 top-full mt-2">
<div class="flex flex-col py-1">
<button
data-unstyled-button
@@ -93,14 +93,14 @@
<div class="flex gap-2">
{{$prevEp := sub (int $currentEpID) 1}}
{{if ge $prevEp 1}}
<a href="/anime/{{$anime.MalID}}/watch?ep={{$prevEp}}" class="!rounded-none inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<a href="/anime/{{$anime.MalID}}/watch?ep={{$prevEp}}" class="rounded-none! inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /></svg>
Prev
</a>
{{end}}
{{$nextEp := add (int $currentEpID) 1}}
{{if le $nextEp $totalEpisodes}}
<a href="/anime/{{$anime.MalID}}/watch?ep={{$nextEp}}" class="!rounded-none inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<a href="/anime/{{$anime.MalID}}/watch?ep={{$nextEp}}" class="rounded-none! inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
Next
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" /></svg>
</a>
@@ -110,12 +110,12 @@
<div class="flex justify-end" data-segment-editor-root>
<ui-dropdown class="relative block" data-align="right" data-width="min-w-[220px]">
<div data-trigger>
<button type="button" class="!rounded-none inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<button type="button" class="rounded-none! inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><circle cx="12" cy="12" r="1.5"/><circle cx="5" cy="12" r="1.5"/><circle cx="19" cy="12" r="1.5"/></svg>
More
</button>
</div>
<div data-content class="hidden absolute z-50 right-0 bottom-full mb-2 min-w-[220px] bg-background-button shadow-[var(--shadow-card)] ring-1 ring-black/10">
<div data-content class="hidden absolute z-50 right-0 bottom-full mb-2 min-w-55 bg-background-button shadow-(--shadow-card) ring-1 ring-black/10">
<div class="flex flex-col py-1">
<button type="button" data-segment-editor-toggle class="flex w-full items-center px-4 py-2.5 text-left text-sm font-normal text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
Add missing segment
@@ -125,7 +125,7 @@
</ui-dropdown>
<div data-segment-editor class="hidden fixed inset-0 z-50 items-center justify-center bg-black/50 px-4" role="dialog" aria-modal="true" aria-labelledby="segment-editor-title" aria-describedby="segment-editor-description">
<div class="w-full max-w-[520px] max-h-[min(420px,60vh)] overflow-auto bg-background-button shadow-[var(--shadow-card)] ring-1 ring-black/10">
<div class="w-full max-w-130 max-h-[min(420px,60vh)] overflow-auto bg-background-button shadow-(--shadow-card) ring-1 ring-black/10">
<div class="flex items-center justify-between px-4 py-3">
<div class="flex flex-col">
<span id="segment-editor-title" class="text-sm font-normal text-foreground">Segment capture</span>
@@ -145,7 +145,7 @@
<svg class="h-4 w-4 text-foreground-muted" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="m6 9 6 6 6-6" /></svg>
</button>
</div>
<div data-content class="hidden absolute z-50 top-full mt-1 left-0 w-full bg-background-button shadow-[var(--shadow-card)] ring-1 ring-black/10">
<div data-content class="hidden absolute z-50 top-full mt-1 left-0 w-full bg-background-button shadow-(--shadow-card) ring-1 ring-black/10">
<div class="flex flex-col py-1">
<button type="button" data-segment-type-option data-value="ed" class="flex w-full items-center justify-between px-4 py-2.5 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
<span class="text-sm font-normal text-foreground">Ending (ED)</span>
@@ -159,8 +159,8 @@
</div>
<div class="grid grid-cols-2 gap-3">
<button type="button" data-segment-mark-start class="!rounded-none px-3 py-2 bg-background-button text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Mark start</button>
<button type="button" data-segment-mark-end class="!rounded-none px-3 py-2 bg-background-button text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Mark end</button>
<button type="button" data-segment-mark-start class="rounded-none! px-3 py-2 bg-background-button text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Mark start</button>
<button type="button" data-segment-mark-end class="rounded-none! px-3 py-2 bg-background-button text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Mark end</button>
</div>
<div class="grid grid-cols-2 gap-3">
@@ -176,7 +176,7 @@
<div class="flex items-center justify-between">
<button type="button" data-segment-reset class="text-sm font-normal text-foreground-muted transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Reset</button>
<button type="button" data-segment-save class="!rounded-none px-4 py-2 bg-accent text-sm font-normal text-black transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Save</button>
<button type="button" data-segment-save class="rounded-none! px-4 py-2 bg-accent text-sm font-normal text-black transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Save</button>
</div>
<div data-segment-error class="hidden text-sm text-red-400"></div>
@@ -203,7 +203,7 @@
<svg class="h-4 w-4 text-foreground-muted shrink-0 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" /></svg>
</button>
</div>
<div data-content class="hidden absolute z-50 top-full mt-1 left-0 w-full bg-background-button shadow-[var(--shadow-card)] ring-1 ring-black/10 max-h-64 overflow-y-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden lg:[-ms-overflow-style:auto] lg:[scrollbar-width:thin] lg:[scrollbar-color:var(--scrollbar-thumb)_var(--scrollbar-track)] lg:[&::-webkit-scrollbar]:block lg:[&::-webkit-scrollbar]:h-2 lg:[&::-webkit-scrollbar-track]:bg-[var(--scrollbar-track)] lg:[&::-webkit-scrollbar-track]:rounded-none lg:[&::-webkit-scrollbar-thumb]:bg-[var(--scrollbar-thumb)] lg:[&::-webkit-scrollbar-thumb]:rounded-none lg:[&::-webkit-scrollbar-thumb:hover]:bg-[var(--scrollbar-thumb-hover)]">
<div data-content class="hidden absolute z-50 top-full mt-1 left-0 w-full bg-background-button shadow-(--shadow-card) ring-1 ring-black/10 max-h-64 overflow-y-auto [-ms-overflow-style:none] scrollbar-none [&::-webkit-scrollbar]:hidden lg:[-ms-overflow-style:auto] lg:scrollbar-thin lg:[scrollbar-color:var(--scrollbar-thumb)_var(--scrollbar-track)] lg:[&::-webkit-scrollbar]:block lg:[&::-webkit-scrollbar]:h-2 lg:[&::-webkit-scrollbar-track]:bg-(--scrollbar-track) lg:[&::-webkit-scrollbar-track]:rounded-none lg:[&::-webkit-scrollbar-thumb]:bg-(--scrollbar-thumb) lg:[&::-webkit-scrollbar-thumb]:rounded-none lg:[&::-webkit-scrollbar-thumb:hover]:bg-(--scrollbar-thumb-hover)">
<div class="flex flex-col py-1">
{{range .Seasons}}
<a href="/anime/{{.MalID}}/watch" class="px-4 py-2 text-left text-sm {{if .IsCurrent}}text-accent bg-accent/10{{else}}text-foreground-muted hover:bg-surface-hover{{end}} transition-colors">
@@ -239,7 +239,7 @@
<svg class="h-4 w-4 text-foreground-muted shrink-0 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" /></svg>
</button>
</div>
<div data-content class="hidden absolute z-50 top-full mt-1 left-0 min-w-50 bg-background-button shadow-[var(--shadow-card)] ring-1 ring-black/10">
<div data-content class="hidden absolute z-50 top-full mt-1 left-0 min-w-50 bg-background-button shadow-(--shadow-card) ring-1 ring-black/10">
<div class="flex flex-col py-1">
{{$ranges := ceilDiv $totalEpisodes 100}}
{{range $i := seq $ranges}}
@@ -271,7 +271,7 @@
{{end}}
</div>
{{else}}
<div class="flex min-h-0 flex-1 flex-col gap-1 pb-4 mt-2 overflow-y-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" data-episode-list style="overscroll-behavior-y: contain">
<div class="flex min-h-0 flex-1 flex-col gap-1 pb-4 mt-2 overflow-y-auto [-ms-overflow-style:none] scrollbar-none [&::-webkit-scrollbar]:hidden" data-episode-list style="overscroll-behavior-y: contain">
{{range $episodes}}
{{$isCurrent := eq (printf "%v" .Number) $currentEpID}}
{{$isFiller := .Filler}}