Apply CRT Styling

This commit is contained in:
2026-04-10 08:42:19 +02:00
parent 12063ba806
commit a09d45d728
2 changed files with 311 additions and 148 deletions

View File

@@ -1,182 +1,346 @@
:root { /* === CRT Base === */
--bg: #1e1e2e;
--surface: #313244;
--border: #45475a;
--text: #cdd6f4;
--muted: #6c7086;
--accent: #89b4fa;
--accent-dim: #1d2a3f;
--green: #a6e3a1;
--red: #f38ba8;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
--font-sans: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { body {
background: var(--bg); background-color: black;
color: var(--text); background-image: radial-gradient(rgba(0, 150, 0, 0.75), black 120%);
font-family: var(--font-sans); background-attachment: fixed;
font-size: 16px; background-size: cover;
line-height: 1.6; background-repeat: no-repeat;
min-height: 100vh; min-height: 100vh;
margin: 0;
overflow: auto;
padding: 0;
color: white;
font:
1rem Inconsolata,
monospace;
text-shadow: 0 0 5px #c8c8c8;
} }
a { color: var(--accent); text-decoration: none; } body::after {
a:hover { text-decoration: underline; } content: "";
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: repeating-linear-gradient(
0deg,
rgba(0, 0, 0, 0.15),
rgba(0, 0, 0, 0.15) 1px,
transparent 1px,
transparent 2px
);
pointer-events: none;
z-index: 9999;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
::selection {
background: #0080ff;
text-shadow: none;
}
/* === Links === */
a {
color: white;
text-decoration: none;
}
a:hover {
color: #0f0;
text-shadow: 0 0 8px #0f0;
}
/* === Header === */
header { header {
background: var(--surface);
border-bottom: 1px solid var(--border);
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
border-bottom: 1px dashed #0a0;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
flex-wrap: wrap; flex-wrap: wrap;
} }
header a { color: var(--text); font-weight: 600; } .breadcrumb {
header .sep { color: var(--muted); } display: flex;
align-items: center;
gap: 0.25rem;
flex-wrap: wrap;
flex: 1;
}
.breadcrumb { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; flex: 1; } .sep {
.breadcrumb a { color: var(--accent); } color: #060;
}
.edit-btn { .edit-btn {
background: var(--accent-dim); background: none;
border: 1px solid var(--accent); border: none;
color: var(--accent); color: white;
padding: 0.25rem 0.75rem; font: inherit;
border-radius: 4px;
font-size: 0.875rem;
cursor: pointer; cursor: pointer;
padding: 0;
text-decoration: none; text-decoration: none;
white-space: nowrap; white-space: nowrap;
} }
.edit-btn:hover { background: var(--accent); color: var(--bg); text-decoration: none; } .edit-btn::before {
content: "[";
}
.edit-btn::after {
content: "]";
}
.edit-btn:hover {
color: #0f0;
text-shadow: 0 0 8px #0f0;
}
main { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem; } /* === Main === */
main {
max-width: 860px;
margin: 0 auto;
padding: 1.5rem 1rem;
}
.content { margin-bottom: 2rem; } /* === Markdown content === */
.content {
margin-bottom: 2rem;
}
/* Markdown rendered content */ .content h1,
.content h1, .content h2, .content h3, .content h2,
.content h4, .content h5, .content h6 { .content h3,
.content h4,
.content h5,
.content h6 {
color: white;
margin: 1.25rem 0 0.5rem; margin: 1.25rem 0 0.5rem;
line-height: 1.3; line-height: 1.3;
} }
.content h1 { font-size: 1.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; } .content h1 {
.content h2 { font-size: 1.4rem; } font-size: 1.75rem;
.content h3 { font-size: 1.15rem; } border-bottom: 1px dashed #0a0;
.content p { margin: 0.75rem 0; } padding-bottom: 0.25rem;
.content ul, .content ol { margin: 0.75rem 0 0.75rem 1.5rem; } }
.content li { margin: 0.25rem 0; } .content h2 {
font-size: 1.4rem;
}
.content h3 {
font-size: 1.15rem;
}
.content p {
margin: 0.75rem 0;
}
.content ul,
.content ol {
margin: 0.75rem 0 0.75rem 1.5rem;
}
.content li {
margin: 0.25rem 0;
}
.content blockquote { .content blockquote {
border-left: 3px solid var(--accent); border-left: 3px solid #0a0;
padding: 0.25rem 1rem; padding: 0.25rem 1rem;
color: var(--muted); color: #888;
margin: 0.75rem 0; margin: 0.75rem 0;
} }
.content code { .content code {
font-family: var(--font-mono); font-family: Inconsolata, monospace;
font-size: 0.875em; font-size: 0.875em;
background: var(--surface); background: #001a00;
padding: 0.1em 0.35em; padding: 0.1em 0.35em;
border-radius: 3px;
} }
.content pre { .content pre {
background: var(--surface); background: #001a00;
border: 1px solid var(--border); border: 1px solid #0a0;
border-radius: 6px;
padding: 1rem; padding: 1rem;
overflow-x: auto; overflow-x: auto;
margin: 0.75rem 0; margin: 0.75rem 0;
} }
.content pre code { background: none; padding: 0; } .content pre code {
background: none;
padding: 0;
}
.content table { .content table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
margin: 0.75rem 0; margin: 0.75rem 0;
font-size: 0.9rem; font-size: 0.9rem;
} }
.content th, .content td { .content th,
border: 1px solid var(--border); .content td {
border: 1px solid #0a0;
padding: 0.4rem 0.75rem; padding: 0.4rem 0.75rem;
text-align: left; text-align: left;
} }
.content th { background: var(--surface); } .content th {
.content hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; } background: #001a00;
.content img { max-width: 100%; border-radius: 4px; } color: white;
}
.content hr {
border: none;
border-top: 1px dashed #0a0;
margin: 1.5rem 0;
}
.content img {
max-width: 100%;
}
/* File/folder listing */ /* === File listing === */
.listing { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; } .listing {
border: 1px solid #0a0;
}
.listing-header { .listing-header {
background: var(--surface);
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
font-size: 0.8rem; font-size: 0.8rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.05em; letter-spacing: 0.05em;
color: var(--muted); color: white;
border-bottom: 1px solid #0a0;
} }
.listing-item { .listing-item {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.75rem; gap: 0.75rem;
padding: 0.6rem 1rem; padding: 0.6rem 1rem;
border-top: 1px solid var(--border); border-top: 1px solid #060;
font-size: 0.95rem; font-size: 0.95rem;
} }
.listing-item:hover { background: var(--surface); } .listing-item:hover {
.listing-item .icon { font-size: 1rem; width: 1.25rem; text-align: center; flex-shrink: 0; } background: #001a00;
.listing-item a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.listing-item .meta { color: var(--muted); font-size: 0.8rem; white-space: nowrap; } .listing-item .icon {
width: 1.25rem;
text-align: center;
flex-shrink: 0;
text-shadow: none;
}
.listing-item a {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: white;
}
.listing-item .meta {
color: #888;
font-size: 0.8rem;
white-space: nowrap;
text-shadow: none;
}
/* Edit form */ /* === Edit form === */
.edit-form { display: flex; flex-direction: column; gap: 1rem; } .edit-form {
.edit-form textarea { display: flex;
flex-direction: column;
gap: 1rem;
}
textarea {
width: 100%; width: 100%;
min-height: 60vh; min-height: 60vh;
background: var(--surface); background: #000;
border: 1px solid var(--border); border: 1px solid #0a0;
border-radius: 6px; color: white;
color: var(--text); font: inherit;
font-family: var(--font-mono);
font-size: 0.9rem; font-size: 0.9rem;
line-height: 1.6; line-height: 1.6;
padding: 1rem; padding: 1rem;
resize: vertical; resize: vertical;
outline: none; outline: none;
box-sizing: border-box;
} }
.edit-form textarea:focus { border-color: var(--accent); } textarea:focus {
.form-actions { display: flex; gap: 0.75rem; } border-color: #0f0;
box-shadow: 0 0 5px #0a0;
}
.form-actions {
display: flex;
gap: 0.75rem;
}
.btn-save { .btn-save {
background: var(--accent); background: none;
color: var(--bg);
border: none; border: none;
padding: 0.6rem 1.5rem; color: white;
border-radius: 4px; font: inherit;
font-size: 1rem;
font-weight: 600;
cursor: pointer; cursor: pointer;
padding: 0;
} }
.btn-save:hover { opacity: 0.9; } .btn-save::before {
content: "[";
}
.btn-save::after {
content: "]";
}
.btn-save:hover {
color: #0f0;
text-shadow: 0 0 8px #0f0;
}
.btn-cancel { .btn-cancel {
background: transparent; background: none;
border: 1px solid var(--border); border: none;
color: var(--muted); color: #888;
padding: 0.6rem 1.25rem; font: inherit;
border-radius: 4px;
font-size: 1rem;
cursor: pointer; cursor: pointer;
padding: 0;
text-decoration: none; text-decoration: none;
display: inline-block; display: inline-block;
} }
.btn-cancel:hover { border-color: var(--text); color: var(--text); text-decoration: none; } .btn-cancel::before {
content: "[";
.empty { color: var(--muted); font-style: italic; padding: 1rem; text-align: center; } }
.btn-cancel::after {
@media (max-width: 600px) { content: "]";
header { padding: 0.5rem 0.75rem; } }
main { padding: 1rem 0.75rem; } .btn-cancel:hover {
.edit-form textarea { min-height: 50vh; } color: white;
text-shadow: none;
}
/* === Empty state === */
.empty {
color: #666;
font-style: italic;
padding: 1rem;
text-align: center;
}
/* === hr === */
hr {
border: none;
border-top: 1px dashed #0a0;
margin: 1rem 0;
}
/* === Scrollbars === */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: #111;
}
::-webkit-scrollbar-thumb {
background: #0a0;
}
::-webkit-scrollbar-thumb:hover {
background: #0f0;
}
/* === Responsive === */
@media (max-width: 600px) {
header {
padding: 0.5rem 0.75rem;
}
main {
padding: 1rem 0.75rem;
}
textarea {
min-height: 50vh;
}
} }

View File

@@ -44,7 +44,7 @@ var tmpl = template.Must(template.New("").Parse(`<!DOCTYPE html>
<a href="/">~</a> <a href="/">~</a>
{{range .Crumbs}}<span class="sep">/</span><a href="{{.URL}}">{{.Name}}</a>{{end}} {{range .Crumbs}}<span class="sep">/</span><a href="{{.URL}}">{{.Name}}</a>{{end}}
</nav> </nav>
{{if .CanEdit}}<a class="edit-btn" href="?edit">Edit</a>{{end}} {{if .CanEdit}}<a class="edit-btn" href="?edit">EDIT</a>{{end}}
</header> </header>
<main> <main>
{{if .EditMode}} {{if .EditMode}}
@@ -306,4 +306,3 @@ func pageTitle(urlPath string) string {
parts := strings.Split(strings.Trim(urlPath, "/"), "/") parts := strings.Split(strings.Trim(urlPath, "/"), "/")
return parts[len(parts)-1] return parts[len(parts)-1]
} }