refactor: use tailwind theme utilities

This commit is contained in:
2026-06-20 19:39:34 +02:00
committed by Milas Holsting
parent 2dca69c9f4
commit 2593a45cc3
10 changed files with 21 additions and 22 deletions

View File

@@ -7,7 +7,7 @@
<div class="flex w-full flex-col gap-10 lg:pr-80">
<div class="flex flex-col gap-8 md:flex-row lg:gap-12">
<div class="flex w-64 shrink-0 flex-col items-center gap-6 md:w-80 md:items-start lg:w-96">
<div class="aspect-2/3 w-full overflow-hidden bg-background-surface shadow-(--shadow-card) ring-1 ring-black/10">
<div class="aspect-2/3 w-full overflow-hidden bg-background-surface shadow-card ring-1 ring-black/10">
{{$imageUrl := posterURL $anime.Images.Webp.LargeImageURL $anime.Images.Jpg.LargeImageURL 400 600}}
<img src="{{$imageUrl}}" alt="{{$anime.Title}}" class="h-full w-full object-cover" />
</div>
@@ -59,7 +59,7 @@
<div class="grow lg:max-w-4xl">
{{template "anime_synopsis" dict "Anime" $anime}}
</div>
<aside class="fixed right-0 top-0 hidden h-screen w-80 shrink-0 flex-col overflow-y-auto border-l border-(--border-light) bg-background-sidebar p-8 lg:flex">
<aside class="fixed right-0 top-0 hidden h-screen w-80 shrink-0 flex-col overflow-y-auto border-l border-border-light bg-background-sidebar p-8 lg:flex">
<div class="flex flex-col gap-8">
<section>
<h3 class="mb-6 text-base font-normal text-foreground">Information</h3>

View File

@@ -28,7 +28,7 @@
</style>
<script type="module" src="{{assetURL "/dist/static/app.js"}}" defer></script>
<template id="toast-template">
<div class="toast pointer-events-auto w-88 max-w-[calc(100vw-2rem)] bg-background shadow-(--shadow-card) ring-1 ring-black/5 flex items-start gap-3 px-4 py-3 transform transition-all duration-300 translate-y-2 opacity-0 data-[variant=destructive]:bg-red-950/92 data-[variant=destructive]:ring-red-500/35">
<div class="toast pointer-events-auto w-88 max-w-[calc(100vw-2rem)] bg-background shadow-card ring-1 ring-black/5 flex items-start gap-3 px-4 py-3 transform transition-all duration-300 translate-y-2 opacity-0 data-[variant=destructive]:bg-red-950/92 data-[variant=destructive]:ring-red-500/35">
<div class="min-w-0 flex-1">
<div class="toast-message text-sm font-medium text-foreground leading-snug data-[variant=destructive]:text-red-100"></div>
</div>

View File

@@ -25,7 +25,7 @@
{{define "anime_themes_dialog"}}
<div class="fixed inset-0 z-50 hidden items-start justify-center bg-black/50 px-4 pt-[12vh]" data-themes-dialog aria-hidden="true">
<div class="w-full max-w-2xl overflow-hidden bg-background-button shadow-(--shadow-card)" role="dialog" aria-modal="true" aria-label="Theme Songs">
<div class="w-full max-w-2xl overflow-hidden bg-background-button shadow-card" role="dialog" aria-modal="true" aria-label="Theme Songs">
<div class="flex items-center justify-between px-6 py-4">
<h2 class="text-base font-normal text-foreground">Theme Songs</h2>
<button type="button" data-themes-close class="px-2 py-1 text-xs text-foreground-muted transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Close</button>

View File

@@ -53,7 +53,7 @@
<svg class="h-4 w-4 opacity-50" 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="hidden absolute z-50 w-72 overflow-hidden bg-background-button rounded-none shadow-(--shadow-card) left-0 top-full mt-2">
<div data-content class="hidden absolute z-50 w-72 overflow-hidden bg-background-button rounded-none shadow-card left-0 top-full mt-2">
<div class="p-2">
<input id="studio-search" type="text" placeholder="Search studios..." class=" w-full bg-background-sidebar px-3 py-2 text-sm text-foreground placeholder-foreground-muted outline-none focus:ring-1 focus:ring-accent"
hx-get="/api/jikan/producers"
@@ -97,7 +97,7 @@
<svg class="h-4 w-4 opacity-50" 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="hidden absolute z-50 w-48 max-h-80 overflow-y-auto bg-background-button shadow-(--shadow-card) left-0 top-full mt-2 scrollbar-hidden">
<div data-content class="hidden absolute z-50 w-48 max-h-80 overflow-y-auto bg-background-button shadow-card left-0 top-full mt-2 scrollbar-hidden">
<form action="/browse" method="GET" hx-get="/browse" hx-trigger="change" hx-target="#browse-content" hx-select="#browse-content" hx-swap="outerHTML" class="flex flex-col">
<input type="hidden" name="q" value="{{.Query}}">
{{if .Studio}}<input type="hidden" name="studio" value="{{.Studio}}">{{end}}
@@ -127,7 +127,7 @@
<svg class="h-4 w-4 opacity-50" 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="hidden absolute z-50 w-40 bg-background-button rounded-none shadow-(--shadow-card) left-0 top-full mt-2 ">
<div data-content class="hidden absolute z-50 w-40 bg-background-button rounded-none shadow-card left-0 top-full mt-2 ">
<div class="flex flex-col">
{{range $statusOptions}}
<a href='{{browseURL $ (dict "status" .Value)}}' class="flex w-full items-center px-5 py-2.5 transition-colors focus:outline-none hover:bg-surface-hover text-sm text-foreground">{{.Label}}</a>
@@ -143,7 +143,7 @@
<svg class="h-4 w-4 opacity-50" 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="hidden absolute z-50 w-40 bg-background-button rounded-none shadow-(--shadow-card) left-0 top-full mt-2 ">
<div data-content class="hidden absolute z-50 w-40 bg-background-button rounded-none shadow-card left-0 top-full mt-2 ">
<div class="flex flex-col">
{{range $typeOptions}}
<a href='{{browseURL $ (dict "type" .Value)}}' class="flex w-full items-center px-5 py-2.5 transition-colors focus:outline-none hover:bg-surface-hover text-sm text-foreground">{{.Label}}</a>
@@ -160,7 +160,7 @@
<svg class="h-4 w-4 opacity-50" 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="hidden absolute z-50 w-48 bg-background-button rounded-none shadow-(--shadow-card) left-0 top-full mt-2 ">
<div data-content class="hidden absolute z-50 w-48 bg-background-button rounded-none shadow-card left-0 top-full mt-2 ">
<div class="flex flex-col">
{{range $sortOptions}}
<a href='{{browseURL $ (dict "order_by" .Value)}}' class="flex w-full items-center px-5 py-2.5 transition-colors focus:outline-none hover:bg-surface-hover text-sm text-foreground">{{.Label}}</a>

View File

@@ -56,7 +56,7 @@
<svg class="size-6 transition-transform duration-300" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
</button>
</div>
<div data-content class="hidden absolute z-50 w-64 bg-background-button rounded-none shadow-(--shadow-card) ring-1 ring-black/10 right-0 bottom-full mb-2">
<div data-content class="hidden absolute z-50 w-64 bg-background-button rounded-none shadow-card ring-1 ring-black/10 right-0 bottom-full mb-2">
<div class="flex flex-col">
<div class="flex items-center justify-between px-5 py-2.5">
<span class="text-[15px] font-normal text-foreground">Autoplay</span>

View File

@@ -21,7 +21,7 @@
</button>
</div>
<div data-content class="hidden absolute z-50 min-w-40 bg-background-button rounded-none shadow-(--shadow-card) left-0 top-full mt-2">
<div data-content class="hidden absolute z-50 min-w-40 bg-background-button rounded-none shadow-card left-0 top-full mt-2">
<div class="flex flex-col">
<button
data-unstyled-button

View File

@@ -7,7 +7,7 @@
{{define "content"}}
<div class="flex min-h-[calc(100dvh-7.5rem)] flex-col bg-background" data-command-palette-page>
<div class="border-b border-(--border) bg-background shadow-[0_10px_28px_rgba(0,0,0,0.18)]" data-command-palette-root aria-label="Search anime">
<div class="border-b border-border bg-background shadow-[0_10px_28px_rgba(0,0,0,0.18)]" data-command-palette-root aria-label="Search anime">
<label for="command-palette-input" class="sr-only">Search anime</label>
<div class="mx-auto flex min-h-32 w-full max-w-4xl items-end gap-4 px-5 pb-6 pt-8 md:min-h-40 md:px-8 md:pb-7">
<div class="min-w-0 flex-1">

View File

@@ -50,7 +50,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 right-0 bottom-full mb-2 min-w-40 bg-background-button shadow-(--shadow-card) ring-1 ring-black/10">
<div data-content class="hidden absolute z-50 right-0 bottom-full mb-2 min-w-40 bg-background-button shadow-card ring-1 ring-black/10">
<div class="flex flex-col">
<button
data-unstyled-button
@@ -114,7 +114,7 @@
More
</button>
</div>
<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 data-content class="hidden absolute z-50 right-0 bottom-full mb-2 min-w-55 bg-background-button shadow-card ring-1 ring-black/10">
<div class="flex flex-col">
<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
@@ -124,7 +124,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">
<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="w-full max-w-130 max-h-[min(420px,60vh)] overflow-auto bg-background-button shadow-card ring-1 ring-black/10">
<div class="flex items-start justify-between px-4 py-3">
<span id="segment-editor-title" class="text-base font-medium tracking-[0.02em] text-foreground">Segment capture</span>
<button type="button" data-segment-editor-close class="inline-flex h-8 w-8 items-center justify-center text-foreground/60 transition-opacity hover:text-foreground/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent" aria-label="Close segment capture modal">
@@ -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-(--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-card ring-1 ring-black/10">
<div class="flex flex-col">
<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>
@@ -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-(--shadow-card) ring-1 ring-black/10 max-h-64 overflow-y-auto scrollbar-hidden 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 data-content class="hidden absolute z-50 top-full mt-1 left-0 w-full bg-background-button shadow-card ring-1 ring-black/10 max-h-64 overflow-y-auto scrollbar-hidden 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">
{{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-(--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-card ring-1 ring-black/10">
<div class="flex flex-col">
{{$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 scrollbar-hidden" data-episode-list style="overscroll-behavior-y: contain">
<div class="mt-2 flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overscroll-contain pb-4 scrollbar-hidden" data-episode-list>
{{range $episodes}}
{{$isCurrent := eq (printf "%v" .Number) $currentEpID}}
{{$isFiller := .Filler}}

View File

@@ -30,7 +30,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
</button>
</div>
<div data-content class="hidden absolute z-50 min-w-37.5 bg-background-button rounded-none shadow-(--shadow-card) ring-1 ring-black/10 right-0 top-full mt-2">
<div data-content class="hidden absolute z-50 min-w-37.5 bg-background-button rounded-none shadow-card ring-1 ring-black/10 right-0 top-full mt-2">
<div class="flex flex-col">
<button data-watchlist-sort="date" class="flex w-full items-center px-4 py-2 text-sm font-normal text-foreground transition-colors hover:bg-surface-hover focus-visible:ring-1 focus-visible:ring-accent">Date Added</button>
<button data-watchlist-sort="title" class="flex w-full items-center px-4 py-2 text-sm font-normal text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:ring-1 focus-visible:ring-accent">Title</button>