feat: add light mode support across all templates
This commit is contained in:
@@ -1,35 +1,34 @@
|
||||
{{define "header"}}
|
||||
<header class="bg-background-header flex flex-col border-b border-white/5 relative z-50">
|
||||
<header class="bg-background-header flex flex-col border-b border-border relative z-50">
|
||||
<div class="flex h-16 items-center justify-between px-4 md:px-6">
|
||||
<div class="flex items-center gap-4 lg:w-72">
|
||||
<button onclick="toggleMobileMenu()" class="block text-neutral-400 transition-colors hover:text-white focus:outline-none md:hidden">
|
||||
<div class="flex items-center gap-4">
|
||||
<button onclick="toggleMobileMenu()" class="block text-neutral-400 transition-colors hover:text-foreground focus:outline-none md:hidden">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>
|
||||
</button>
|
||||
<button onclick="toggleSidebar()" class="hidden text-neutral-400 transition-colors hover:text-white focus:outline-none lg:block">
|
||||
<button onclick="toggleSidebar()" class="hidden text-neutral-400 transition-colors hover:text-foreground focus:outline-none lg:block">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="12" y2="12"/><line x1="3" x2="21" y1="6" y2="6"/><line x1="3" x2="21" y1="18" y2="18"/></svg>
|
||||
</button>
|
||||
<a href="/" class="group flex items-center gap-2.5 focus:outline-none">
|
||||
<img src="/static/readme-logo-light.svg" alt="MAL" class="h-8 w-8 transition-transform group-hover:scale-110" />
|
||||
<span class="text-xl font-bold tracking-tight text-white hidden sm:block">MyAnime<span class="text-accent">List</span></span>
|
||||
<span class="text-xl font-bold tracking-tight text-foreground">MyAnime<span class="text-accent">List</span></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="hidden max-w-3xl flex-1 items-center justify-center px-4 md:flex">
|
||||
<div class="hidden max-w-2xl flex-1 items-center justify-center px-4 md:flex">
|
||||
<form action="/browse" method="GET" class="w-full max-w-lg">
|
||||
<div class="focus-within:border-accent bg-background-surface flex h-10 w-full items-center overflow-hidden border border-transparent transition-colors">
|
||||
<div class="focus-within:border-accent bg-background-surface flex h-10 w-full items-center overflow-hidden border border-border transition-colors">
|
||||
<div class="pr-2 pl-4 text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
||||
</div>
|
||||
<input type="text" name="q" placeholder="Search..." class="h-full w-full bg-transparent px-1 text-sm text-white focus:outline-none" />
|
||||
<input type="text" name="q" placeholder="Search..." class="h-full w-full bg-transparent px-1 text-sm text-foreground focus:outline-none" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 lg:w-72 relative">
|
||||
<div class="flex items-center gap-2 relative justify-end">
|
||||
<button
|
||||
id="theme-toggle"
|
||||
class="rounded-full p-1.5 text-neutral-400 transition-colors hover:bg-white/5 hover:text-white focus:outline-none"
|
||||
aria-label="Toggle theme"
|
||||
class="rounded-full p-1.5 text-neutral-400 transition-colors hover:bg-surface-hover hover:text-foreground focus:outline-none"
|
||||
>
|
||||
<svg class="theme-icon-dark size-5" viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2">
|
||||
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
|
||||
@@ -41,7 +40,7 @@
|
||||
</button>
|
||||
<ui-dropdown class="relative block">
|
||||
<div data-trigger class="cursor-pointer">
|
||||
<button class="flex items-center gap-1 rounded-full p-1 transition-colors hover:bg-white/5 focus:outline-none">
|
||||
<button class="flex items-center gap-1 rounded-full p-1 transition-colors hover:bg-surface-hover focus:outline-none">
|
||||
{{if .User}}
|
||||
<div class="bg-accent flex h-8 w-8 items-center justify-center overflow-hidden rounded-full text-sm font-semibold text-white">
|
||||
{{slice .User.Username 0 1}}
|
||||
@@ -64,9 +63,9 @@
|
||||
</div>
|
||||
</a>
|
||||
{{else}}
|
||||
<a href="/login" class="flex w-full items-center px-5 py-3.5 transition-colors focus:outline-none hover:bg-white/10 focus:bg-white/10">
|
||||
<a href="/login" class="flex w-full items-center px-5 py-3.5 transition-colors focus:outline-none hover:bg-surface-hover focus:bg-surface-hover">
|
||||
<div class="flex w-full items-center justify-between text-left">
|
||||
<span class="font-medium text-[15px] text-white">Log in</span>
|
||||
<span class="font-medium text-[15px] text-foreground">Log in</span>
|
||||
</div>
|
||||
</a>
|
||||
{{end}}
|
||||
@@ -76,14 +75,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex border-t border-white/5 p-3 md:hidden">
|
||||
<div class="flex border-t border-border p-3 md:hidden">
|
||||
<form action="/browse" method="GET" class="w-full">
|
||||
<div class="focus-within:border-accent bg-background-surface flex h-10 w-full items-center overflow-hidden border border-transparent transition-colors">
|
||||
<div class="pr-2 pl-4 text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
||||
<div class="focus-within:border-accent bg-background-surface flex h-10 w-full items-center overflow-hidden border border-border transition-colors">
|
||||
<div class="pr-2 pl-4 text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
||||
</div>
|
||||
<input type="text" name="q" placeholder="Search..." class="h-full w-full bg-transparent px-1 text-sm text-foreground focus:outline-none" />
|
||||
</div>
|
||||
<input type="text" name="q" placeholder="Search..." class="h-full w-full bg-transparent px-1 text-sm text-white focus:outline-none" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user