51 lines
1.4 KiB
Plaintext
51 lines
1.4 KiB
Plaintext
package templates
|
|
|
|
templ Layout(title string) {
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<title>{ title }</title>
|
|
<link rel="stylesheet" href="/static/css/style.css"/>
|
|
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="header-top">
|
|
<div class="header-left">
|
|
<a href="/" class="logo">/malago</a>
|
|
<div class="nav">
|
|
<a href="/">catalog</a>
|
|
<a href="/watchlist">watchlist</a>
|
|
</div>
|
|
</div>
|
|
<form action="/search" method="GET" class="header-search">
|
|
<input type="text" name="q" class="search-input" placeholder="search anime..." />
|
|
</form>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
{ children... }
|
|
</main>
|
|
<div id="toast-container"></div>
|
|
<script>
|
|
document.body.addEventListener('toast', function(evt) {
|
|
const container = document.getElementById('toast-container');
|
|
const toast = document.createElement('div');
|
|
toast.className = 'toast';
|
|
toast.textContent = evt.detail.value;
|
|
container.appendChild(toast);
|
|
|
|
requestAnimationFrame(() => { toast.style.opacity = '1'; });
|
|
|
|
setTimeout(() => {
|
|
toast.style.opacity = '0';
|
|
setTimeout(() => { toast.remove(); }, 300);
|
|
}, 3000);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
} |