ui: modernize styling, cleaner layout, non-4chan vibe

This commit is contained in:
2026-04-06 18:18:22 +02:00
parent a7133ba121
commit f77649cc29
3 changed files with 231 additions and 169 deletions

View File

@@ -12,31 +12,30 @@ templ Layout(title string) {
</head> </head>
<body> <body>
<header> <header>
<div style="display: flex; justify-content: space-between; align-items: center;"> <div class="header-top">
<h1>/malago/</h1> <h1>/malago</h1>
<form action="/" method="GET" style="display: flex; align-items: center; gap: 8px;"> <div class="nav">
<input type="text" name="q" class="search-input" placeholder="search anime..." style="padding: 6px 12px; font-size: 14px; width: 250px; background: var(--surface); color: var(--text);" /> <a href="/">home</a>
<button type="submit" class="search-button" style="padding: 6px 12px; font-size: 14px;">go</button> <a href="/catalog">catalog</a>
<a href="/watchlist">watchlist</a>
</div>
<form action="/" method="GET" style="display: flex; align-items: center; gap: 0;">
<input type="text" name="q" class="search-input" placeholder="search anime..." />
<button type="submit" class="search-button">go</button>
</form> </form>
</div> </div>
<div class="nav">
[ <a href="/">home</a> ]
[ <a href="/catalog">catalog</a> ]
[ <a href="/watchlist">watchlist</a> ]
</div>
<hr/>
</header> </header>
<main> <main>
{ children... } { children... }
</main> </main>
<div id="toast-container" style="position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px;"></div> <div id="toast-container" style="position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px;"></div>
<script> <script>
document.body.addEventListener('toast', function(evt) { document.body.addEventListener('toast', function(evt) {
const container = document.getElementById('toast-container'); const container = document.getElementById('toast-container');
const toast = document.createElement('div'); const toast = document.createElement('div');
toast.style.cssText = 'background: var(--surface, #333); color: var(--text, #fff); border: 1px solid var(--border, #555); padding: 8px 16px; font-size: 12px; font-weight: bold; opacity: 0; transition: opacity 0.3s;'; toast.style.cssText = 'background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 12px 16px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.5);';
toast.textContent = '> ' + evt.detail.value; toast.textContent = evt.detail.value;
container.appendChild(toast); container.appendChild(toast);
// fade in // fade in

View File

@@ -42,7 +42,7 @@ func Layout(title string) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div style=\"display: flex; justify-content: space-between; align-items: center;\"><h1>/malago/</h1><form action=\"/\" method=\"GET\" style=\"display: flex; align-items: center; gap: 8px;\"><input type=\"text\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" style=\"padding: 6px 12px; font-size: 14px; width: 250px; background: var(--surface); color: var(--text);\"> <button type=\"submit\" class=\"search-button\" style=\"padding: 6px 12px; font-size: 14px;\">go</button></form></div><div class=\"nav\">[ <a href=\"/\">home</a> ] [ <a href=\"/catalog\">catalog</a> ] [ <a href=\"/watchlist\">watchlist</a> ]</div><hr></header><main>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</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\"><h1>/malago</h1><div class=\"nav\"><a href=\"/\">home</a> <a href=\"/catalog\">catalog</a> <a href=\"/watchlist\">watchlist</a></div><form action=\"/\" method=\"GET\" style=\"display: flex; align-items: center; gap: 0;\"><input type=\"text\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\"> <button type=\"submit\" class=\"search-button\">go</button></form></div></header><main>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -50,7 +50,7 @@ func Layout(title string) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</main><div id=\"toast-container\" style=\"position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px;\"></div><script>\n\t\t\t\tdocument.body.addEventListener('toast', function(evt) {\n\t\t\t\t\tconst container = document.getElementById('toast-container');\n\t\t\t\t\tconst toast = document.createElement('div');\n\t\t\t\t\ttoast.style.cssText = 'background: var(--surface, #333); color: var(--text, #fff); border: 1px solid var(--border, #555); padding: 8px 16px; font-size: 12px; font-weight: bold; opacity: 0; transition: opacity 0.3s;';\n\t\t\t\t\ttoast.textContent = '> ' + evt.detail.value;\n\t\t\t\t\tcontainer.appendChild(toast);\n\t\t\t\t\t\n\t\t\t\t\t// fade in\n\t\t\t\t\trequestAnimationFrame(() => { toast.style.opacity = '1'; });\n\t\t\t\t\t\n\t\t\t\t\t// remove after 3s\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\ttoast.style.opacity = '0';\n\t\t\t\t\t\tsetTimeout(() => { toast.remove(); }, 300);\n\t\t\t\t\t}, 3000);\n\t\t\t\t});\n\t\t\t</script></body></html>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</main><div id=\"toast-container\" style=\"position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px;\"></div><script>\n\t\t\t\tdocument.body.addEventListener('toast', function(evt) {\n\t\t\t\t\tconst container = document.getElementById('toast-container');\n\t\t\t\t\tconst toast = document.createElement('div');\n\t\t\t\t\ttoast.style.cssText = 'background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 12px 16px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.5);';\n\t\t\t\t\ttoast.textContent = evt.detail.value;\n\t\t\t\t\tcontainer.appendChild(toast);\n\t\t\t\t\t\n\t\t\t\t\t// fade in\n\t\t\t\t\trequestAnimationFrame(() => { toast.style.opacity = '1'; });\n\t\t\t\t\t\n\t\t\t\t\t// remove after 3s\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\ttoast.style.opacity = '0';\n\t\t\t\t\t\tsetTimeout(() => { toast.remove(); }, 300);\n\t\t\t\t\t}, 3000);\n\t\t\t\t});\n\t\t\t</script></body></html>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }

View File

@@ -1,155 +1,200 @@
:root { :root {
/* Dark Monochromatic Palette (4chan catalog style but dark) */ /* Minimalist, Clean Dark Palette */
--bg: #111111; /* very dark grey / almost black */ --bg: #0a0a0a; /* deep black background */
--surface: #1a1a1a; /* slightly lighter dark for inputs/boxes */ --surface: #141414; /* dark grey surface */
--border: #333333; /* dark grey border */ --surface-hover: #1f1f1f; /* slightly lighter surface for hover */
--text: #e0e0e0; /* light grey text */ --border: #262626; /* subtle border */
--text-muted: #888888; /* medium grey for meta/loading */ --text: #f0f0f0; /* crisp white text */
--link: #cccccc; /* light grey links */ --text-muted: #a3a3a3; /* readable grey for secondary text */
--accent: #e5e5e5; /* near-white for accents */
--link: #a3a3a3; /* muted links */
--link-hover: #ffffff; /* pure white on hover */ --link-hover: #ffffff; /* pure white on hover */
--greentext: #98fb98; /* pale green for success/quotes */ --greentext: #4ade80; /* modern green */
} }
body { body {
background-color: var(--bg); background-color: var(--bg);
color: var(--text); color: var(--text);
font-family: arial, helvetica, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
font-size: 15px; font-size: 14px;
line-height: 1.5;
margin: 0; margin: 0;
padding: 16px; padding: 0;
min-height: 100vh; min-height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} }
header { header {
text-align: center; padding: 24px 32px;
margin-bottom: 24px; border-bottom: 1px solid var(--border);
background: var(--bg);
position: sticky;
top: 0;
z-index: 100;
display: flex;
flex-direction: column;
gap: 16px;
}
.header-top {
display: flex;
justify-content: space-between;
align-items: center;
} }
h1 { h1 {
font-size: 24px; font-size: 20px;
font-weight: bold; font-weight: 600;
margin: 0 0 8px 0; letter-spacing: -0.02em;
margin: 0;
color: var(--text); color: var(--text);
} }
.nav { .nav {
font-size: 14px; font-size: 13px;
font-weight: bold; font-weight: 500;
display: flex;
gap: 24px;
padding-left: 0;
} }
a { a {
color: var(--link); color: var(--link);
text-decoration: none; text-decoration: none;
transition: color 0.15s ease;
} }
a:hover { a:hover {
color: var(--link-hover); color: var(--link-hover);
text-decoration: underline; }
.nav a {
text-transform: lowercase;
letter-spacing: 0.05em;
} }
hr { hr {
border: 0; display: none;
border-bottom: 1px solid var(--border); }
margin: 16px 0;
main {
padding: 32px;
max-width: 1400px;
margin: 0 auto;
} }
/* Search Area */ /* Search Area */
.search-box {
text-align: center;
margin-bottom: 24px;
}
.search-form {
display: inline-flex;
gap: 4px;
}
.search-input { .search-input {
border: 1px solid var(--border); border: 1px solid var(--border);
background: var(--surface); background: var(--surface);
padding: 6px; padding: 8px 12px;
color: var(--text); color: var(--text);
font-size: 15px; font-size: 13px;
width: 250px; width: 280px;
transition: all 0.2s ease;
border-radius: 0; /* Strict no rounded corners */
} }
.search-input:focus { .search-input:focus {
outline: none; outline: none;
border-color: var(--text-muted); border-color: var(--text-muted);
background: var(--bg);
}
.search-input::placeholder {
color: #525252;
} }
.search-button { .search-button {
background-color: var(--surface); background-color: var(--text);
border: 1px solid var(--border); border: 1px solid var(--text);
color: var(--text); color: var(--bg);
padding: 6px 16px; padding: 8px 16px;
cursor: pointer; cursor: pointer;
font-size: 15px; font-size: 13px;
font-weight: 600;
transition: all 0.15s ease;
border-radius: 0;
} }
.search-button:hover { .search-button:hover {
background-color: var(--border); background-color: var(--link-hover);
border-color: var(--link-hover);
} }
.status-text { .status-text {
color: var(--text-muted); color: var(--text-muted);
font-weight: bold; font-weight: 500;
font-size: 12px; font-size: 13px;
text-align: center; margin-bottom: 24px;
margin-bottom: 16px; text-transform: lowercase;
text-align: left;
} }
/* 4chan Catalog Grid */ /* Grid Layout */
.catalog-grid { .catalog-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 24px; gap: 32px 24px;
padding: 0 16px;
justify-items: center;
} }
.catalog-item { .catalog-item {
text-align: center; display: flex;
width: 180px; flex-direction: column;
gap: 12px;
text-align: left;
width: 100%;
} }
.catalog-thumb { .image-container, .catalog-thumb {
max-width: 180px; width: 100%;
max-height: 240px; aspect-ratio: 2/3;
object-fit: cover;
background: var(--surface);
border: 1px solid var(--border); border: 1px solid var(--border);
transition: opacity 0.1s; transition: transform 0.3s ease, opacity 0.3s ease;
display: block;
} }
.catalog-thumb:hover { .image-container:hover, .catalog-thumb:hover {
opacity: 0.8; transform: scale(1.02);
opacity: 0.9;
} }
.no-image { .no-image {
width: 180px; width: 100%;
height: 240px; aspect-ratio: 2/3;
background-color: var(--surface);
border: 1px solid var(--border);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: var(--text-muted); color: #525252;
font-size: 13px; font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.1em;
background: var(--surface);
border: 1px solid var(--border);
} }
.catalog-title { .catalog-title {
font-weight: bold; font-weight: 500;
font-size: 13px; font-size: 14px;
margin-top: 6px; margin: 0;
word-wrap: break-word;
line-height: 1.4; line-height: 1.4;
color: var(--text); color: var(--text);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
} }
footer { footer {
text-align: center; text-align: center;
font-size: 13px; font-size: 12px;
color: var(--text-muted); color: var(--text-muted);
margin-top: 48px; margin-top: 64px;
padding: 32px;
border-top: 1px solid var(--border);
} }
/* HTMX states */ /* HTMX states */
@@ -159,162 +204,180 @@ footer {
/* Anime Details Page */ /* Anime Details Page */
.details-container { .details-container {
padding: 16px; display: grid;
grid-template-columns: 300px 1fr;
gap: 48px;
align-items: start;
} }
.details-header { .details-header {
border-bottom: 1px solid var(--border); grid-column: 1 / -1;
padding-bottom: 16px; margin-bottom: 16px;
margin-bottom: 24px; border: none;
} }
.details-header h2 { .details-header h2 {
font-size: 28px; font-size: 32px;
font-weight: 600;
letter-spacing: -0.02em;
margin: 0 0 8px 0; margin: 0 0 8px 0;
color: var(--text);
} }
.details-subtitle { .details-subtitle {
font-size: 16px; font-size: 15px;
color: var(--text-muted); color: var(--text-muted);
} }
.details-body {
display: flex;
gap: 32px;
align-items: flex-start;
}
.details-sidebar { .details-sidebar {
width: 250px; display: flex;
flex-shrink: 0; flex-direction: column;
gap: 24px;
width: 100%;
} }
.details-image { .details-image {
width: 100%; width: 100%;
height: auto; height: auto;
border: 1px solid var(--border); border: 1px solid var(--border);
margin-bottom: 16px; display: block;
} }
.stats-table { .stats-table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: 14px; font-size: 13px;
background-color: var(--surface);
border: 1px solid var(--border); border: 1px solid var(--border);
} }
.stats-table td { .stats-table td {
border: 1px solid var(--border); border-bottom: 1px solid var(--border);
padding: 6px 8px; padding: 10px 12px;
text-align: left; border-right: none;
vertical-align: top; border-left: none;
}
.stats-table tr:last-child td {
border-bottom: none;
} }
.stats-table .stat-label { .stats-table .stat-label {
font-weight: bold;
color: var(--text-muted); color: var(--text-muted);
background-color: var(--bg); width: 100px;
width: 80px; font-weight: 500;
background: transparent;
} }
.stat-sub { .stat-sub {
color: var(--text-muted); color: #525252;
font-size: 12px; font-size: 12px;
display: block;
margin-top: 2px;
} }
.details-main { .details-main {
flex: 1; display: flex;
flex-direction: column;
gap: 32px;
} }
.details-main h3 { .details-main h3 {
font-size: 20px; font-size: 14px;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--text-muted);
margin: 0 0 16px 0; margin: 0 0 16px 0;
color: var(--text); font-weight: 600;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
padding-bottom: 4px; padding-bottom: 8px;
display: inline-block; display: block;
} }
.details-synopsis { .details-synopsis {
font-size: 17px; font-size: 15px;
line-height: 1.7; line-height: 1.8;
color: var(--text);
white-space: pre-wrap; white-space: pre-wrap;
} }
.relations-container {
margin-top: 32px;
}
.relations-list {
margin-top: 32px;
padding-top: 16px;
}
.relations-list ul { .relations-list ul {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
display: flex;
flex-direction: column;
gap: 12px;
} }
.relations-list li { .relations-list li {
margin-bottom: 8px; font-size: 14px;
font-size: 15px; display: flex;
gap: 8px;
align-items: baseline;
}
.relations-list strong {
color: var(--text-muted);
font-weight: 500;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
min-width: 80px;
}
/* Forms & Selects */
select, input[type="text"], input[type="password"], input[type="email"] {
background: var(--surface);
border: 1px solid var(--border);
color: var(--text);
padding: 8px 12px;
font-size: 13px;
font-family: inherit;
border-radius: 0;
transition: all 0.2s ease;
}
select:focus, input:focus {
outline: none;
border-color: var(--text-muted);
background: var(--bg);
}
button {
border-radius: 0;
} }
/* Responsive adjustments */ /* Responsive adjustments */
@media (max-width: 600px) { @media (max-width: 768px) {
body { header {
padding: 8px; padding: 16px;
} }
.catalog-grid { .header-top {
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 8px;
padding: 0 4px;
}
.catalog-item, .catalog-thumb, .no-image {
width: 120px;
}
.catalog-thumb, .no-image {
max-height: 170px;
}
.search-form {
flex-direction: column; flex-direction: column;
align-items: flex-start;
gap: 16px;
}
form[action="/"] {
width: 100%; width: 100%;
} }
.search-input { .search-input {
width: 100%; width: 100%;
box-sizing: border-box; flex: 1;
} }
.search-button { main {
width: 100%; padding: 16px;
} }
.details-body { .details-container {
flex-direction: column; grid-template-columns: 1fr;
gap: 16px; gap: 32px;
} }
.details-sidebar { .catalog-grid {
width: 100%; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
margin: 0 auto; gap: 24px 16px;
}
.details-main {
width: 100%;
}
.nav {
font-size: 14px;
gap: 8px;
display: flex;
justify-content: center;
} }
} }