refactor: migrate templates to tailwind utilities
This commit is contained in:
@@ -10,7 +10,6 @@ templ Layout(title string, showHeader bool) {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>{ title }</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg"/>
|
||||
<link rel="stylesheet" href="/static/css/style.css"/>
|
||||
<link rel="stylesheet" href="/static/css/tailwind.css"/>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
|
||||
<script src="/static/js/discover.js" defer></script>
|
||||
@@ -18,32 +17,35 @@ templ Layout(title string, showHeader bool) {
|
||||
<script src="/static/js/timezone.js" defer></script>
|
||||
<script src="/static/js/auth.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<body class="min-h-screen bg-[var(--bg)] text-[var(--text)] font-[var(--font)] text-[14px] leading-[1.45]">
|
||||
if showHeader {
|
||||
<header>
|
||||
<div class="header-top">
|
||||
<div class="header-left">
|
||||
<a href="/" class="logo" aria-label="mal logo">
|
||||
@icons.LogoIcon("logo-svg")
|
||||
<header class="sticky top-0 z-[100] bg-[var(--header)]">
|
||||
<div class="mx-auto flex w-full max-w-[1580px] items-center gap-4 px-4 py-3 max-[860px]:flex-wrap max-[860px]:gap-3">
|
||||
<div class="flex min-w-0 items-center gap-5 max-[860px]:w-full max-[860px]:flex-wrap max-[860px]:gap-3" data-search-root>
|
||||
<a href="/" class="inline-flex items-center text-[var(--accent)]" aria-label="mal logo">
|
||||
@icons.LogoIcon("h-7 w-7")
|
||||
</a>
|
||||
<div class="nav">
|
||||
<a href="/">Catalog</a>
|
||||
<a href="/discover">Discover</a>
|
||||
<a href="/notifications">Notifications</a>
|
||||
<a href="/watchlist">Watchlist</a>
|
||||
<a href="/account">Account</a>
|
||||
<div class="flex flex-wrap gap-3 text-[0.85rem] max-[860px]:w-full max-[860px]:gap-2">
|
||||
<a class="text-[var(--text-muted)] no-underline hover:text-[var(--text)] hover:no-underline" href="/">Catalog</a>
|
||||
<a class="text-[var(--text-muted)] no-underline hover:text-[var(--text)] hover:no-underline" href="/discover">Discover</a>
|
||||
<a class="text-[var(--text-muted)] no-underline hover:text-[var(--text)] hover:no-underline" href="/notifications">Notifications</a>
|
||||
<a class="text-[var(--text-muted)] no-underline hover:text-[var(--text)] hover:no-underline" href="/watchlist">Watchlist</a>
|
||||
<a class="text-[var(--text-muted)] no-underline hover:text-[var(--text)] hover:no-underline" href="/account">Account</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-search-wrapper">
|
||||
<form action="/search" method="GET" class="header-search" id="search-form">
|
||||
<input type="text" id="search-input" name="q" class="search-input" placeholder="Search anime..." autocomplete="off"/>
|
||||
<div id="search-dropdown" class="search-dropdown"></div>
|
||||
<div class="relative ml-auto min-w-[240px] w-[min(420px,45vw)] max-[860px]:ml-0 max-[860px]:w-full" data-search-root>
|
||||
<form action="/search" method="GET" class="w-full" id="search-form">
|
||||
<input type="text" id="search-input" name="q" class="h-[34px] w-full border border-transparent bg-[var(--surface-search)] px-3 text-[var(--text)] transition-colors duration-120 placeholder:text-[var(--text-faint)] focus:border-[var(--surface-search-focus-border)] focus:outline-none" placeholder="Search anime..." autocomplete="off"/>
|
||||
<div id="search-dropdown" class="absolute inset-x-0 top-[calc(100%+2px)] z-[120] max-h-[min(70vh,560px)] overflow-y-auto bg-[var(--panel)]"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
}
|
||||
<main class={ "main-content", templ.KV("auth-main", !showHeader) }>
|
||||
<main class={
|
||||
"mx-auto w-full max-w-[1580px] px-4 pt-5 pb-8 max-[860px]:px-3 max-[860px]:pb-6",
|
||||
templ.KV("flex min-h-screen items-center justify-center px-4 py-0", !showHeader),
|
||||
}>
|
||||
{ children... }
|
||||
</main>
|
||||
<script src="/static/js/search.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user