WIP Redesign

This commit is contained in:
2026-04-17 10:54:06 +02:00
parent ec94580ab5
commit 268ffcdd27
11 changed files with 174 additions and 505 deletions

View File

@@ -1,7 +1,9 @@
{{if .Photos}}
<div class="diary-photo-grid">
{{range .Photos}}
<a href="{{.URL}}" target="_blank"><img src="{{.URL}}" alt="{{.Name}}" loading="lazy"></a>
{{end}}
</div>
<section class="diary-section">
<div class="diary-photo-grid">
{{range .Photos}}
<a href="{{.URL}}" target="_blank"><img src="{{.URL}}" alt="{{.Name}}" loading="lazy"></a>
{{end}}
</div>
</section>
{{end}}

View File

@@ -1,9 +1,9 @@
{{range .Days}}
<div class="diary-section">
<h2>
{{if .URL}}<a href="{{.URL}}">{{.Heading}}</a>{{else}}{{.Heading}}{{end}}
{{if .EditURL}}<a href="{{.EditURL}}" class="btn btn-small">edit</a>{{end}}
</h2>
<section class="diary-section">
<header class="diary-section-header">
<h2>{{if .URL}}<a href="{{.URL}}">{{.Heading}}</a>{{else}}{{.Heading}}{{end}}</h2>
{{if .EditURL}}<a href="{{.EditURL}}" role="button" class="secondary outline section-edit">edit</a>{{end}}
</header>
{{if .Content}}<div class="content">{{.Content}}</div>{{end}}
{{if .Photos}}
<div class="diary-photo-grid">
@@ -12,5 +12,5 @@
{{end}}
</div>
{{end}}
</div>
</section>
{{end}}

View File

@@ -1,8 +1,8 @@
{{range .Months}}
<div class="diary-section">
<h2 class="diary-heading">
<a href="{{.URL}}">{{.Name}}</a>
{{if .PhotoCount}}<span class="diary-photo-count">({{.PhotoCount}} photos)</span>{{end}}
</h2>
</div>
<section class="diary-section">
<hgroup>
<h2><a href="{{.URL}}">{{.Name}}</a></h2>
{{if .PhotoCount}}<p>{{.PhotoCount}} photos</p>{{end}}
</hgroup>
</section>
{{end}}

View File

@@ -5,47 +5,67 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{.Title}}</title>
<link rel="icon" href="/_/favicon.ico" />
<link rel="stylesheet" href="/_/pico.min.css" />
<link rel="stylesheet" href="/_/style.css" />
<script src="/_/global-shortcuts.js"></script>
</head>
<body>
<header>
<nav class="breadcrumb">
<a href="/"><svg class="logo" viewBox="0 0 26.052269 26.052269" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linejoin="miter" transform="matrix(0.05463483,8.1519706e-6,-8.1519706e-6,0.05463483,-64.560546,-24.6949)"><rect x="1188.537" y="457.92056" width="461.87488" height="462.15189" stroke-width="20.2288"/><path d="m1348.9955 456.59572.046 309.36839" stroke-width="19.6849"/><path d="m1200.3996 765.80237 441.8362-.0659" stroke-width="19.6849"/><path d="m1648.2897 620.244-299.2012.0446" stroke-width="20.5676"/><path d="m1491.6148 909.24806-.021-136.93117" stroke-width="19.6849"/><rect x="1191.6504" y="461.66092" width="457.09634" height="457.09634" stroke-width="19.6761"/></g></svg></a>
{{range .Crumbs}}<span class="sep">/</span
><a href="{{.URL}}">{{.Name}}</a>{{end}}
</nav>
{{if .EditMode}}
<a class="btn" href="{{.PostURL}}">CANCEL</a>
<button class="btn" type="submit" form="edit-form" data-action="save" data-key="S" title="Save (S)">SAVE</button>
{{else if .CanEdit}}
<button class="btn" onclick="newPage()" title="New page (N)">NEW</button>
<a class="btn" href="?edit" title="Edit page (E)">EDIT</a>
{{end}}
<div class="container-fluid">
<nav>
<nav aria-label="breadcrumb">
<ul>
<li>
<a href="/"><svg style="height: 1rem; width: 1rem; vertical-align: center;" viewBox="0 0 26.052269 26.052269" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linejoin="miter" transform="matrix(0.05463483,8.1519706e-6,-8.1519706e-6,0.05463483,-64.560546,-24.6949)"><rect x="1188.537" y="457.92056" width="461.87488" height="462.15189" stroke-width="20.2288"/><path d="m1348.9955 456.59572.046 309.36839" stroke-width="19.6849"/><path d="m1200.3996 765.80237 441.8362-.0659" stroke-width="19.6849"/><path d="m1648.2897 620.244-299.2012.0446" stroke-width="20.5676"/><path d="m1491.6148 909.24806-.021-136.93117" stroke-width="19.6849"/><rect x="1191.6504" y="461.66092" width="457.09634" height="457.09634" stroke-width="19.6761"/></g></svg></a>
</li>
{{range .Crumbs}}
<li><a href="{{.URL}}">{{.Name}}</a></li>
{{end}}
</ul>
</nav>
<ul>
{{if .EditMode}}
<li><a href="{{.PostURL}}" class="secondary">Cancel</a></li>
<li><a href="#" onclick="document.getElementById('edit-form').submit()" data-action="save" data-key="S" title="Save (S)">Save</a></li>
{{else if .CanEdit}}
<li><a href="#" onclick="newPage()" class="secondary" title="New page (N)">New</a></li>
<li><a href="?edit" title="Edit page (E)">Edit</a></li>
{{end}}
</ul>
</nav>
</div>
</header>
<main>
<main class="container">
{{if .EditMode}}
<form id="edit-form" class="edit-form" method="POST" action="{{.PostURL}}">
{{if ge .SectionIndex 0}}<input type="hidden" name="section" value="{{.SectionIndex}}">{{end}}
<div class="editor-toolbar">
<button type="button" class="btn btn-tool" data-action="bold" data-key="B" title="Bold (B)">**</button>
<button type="button" class="btn btn-tool" data-action="italic" data-key="I" title="Italic (I)">*</button>
<span class="toolbar-sep"></span>
<button type="button" class="btn btn-tool" data-action="h1" data-key="1" title="Heading 1 (1)">#</button>
<button type="button" class="btn btn-tool" data-action="h2" data-key="2" title="Heading 2 (2)">##</button>
<button type="button" class="btn btn-tool" data-action="h3" data-key="3" title="Heading 3 (3)">###</button>
<span class="toolbar-sep"></span>
<button type="button" class="btn btn-tool" data-action="code" data-key="C" title="Inline code (C)">`</button>
<button type="button" class="btn btn-tool" data-action="codeblock" data-key="K" title="Code block (K)">```</button>
<span class="toolbar-sep"></span>
<button type="button" class="btn btn-tool" data-action="link" data-key="L" title="Link (L)">[]</button>
<button type="button" class="btn btn-tool" data-action="quote" data-key="Q" title="Blockquote (Q)">&gt;</button>
<button type="button" class="btn btn-tool" data-action="ul" data-key="U" title="Unordered list (U)">-</button>
<button type="button" class="btn btn-tool" data-action="ol" data-key="O" title="Ordered list (O)">1.</button>
<button type="button" class="btn btn-tool" data-action="hr" data-key="R" title="Horizontal rule (R)">---</button>
<span class="toolbar-sep"></span>
<button type="button" class="btn btn-tool toolbar-dropdown" data-action="tbldrop" title="Table (T)">T▾</button>
<button type="button" class="btn btn-tool toolbar-dropdown" data-action="datedrop" title="Insert date (D/W)">D▾</button>
<div role="group">
<button type="button" data-action="bold" data-key="B" title="Bold (B)">B</button>
<button type="button" data-action="italic" data-key="I" title="Italic (I)"><i>I</i></button>
</div>
<div role="group">
<button type="button" data-action="h1" data-key="1" title="Heading 1 (1)">H1</button>
<button type="button" data-action="h2" data-key="2" title="Heading 2 (2)">H2</button>
<button type="button" data-action="h3" data-key="3" title="Heading 3 (3)">H3</button>
</div>
<div role="group">
<button type="button" data-action="code" data-key="C" title="Inline code (C)">`</button>
<button type="button" data-action="codeblock" data-key="K" title="Code block (K)">```</button>
</div>
<div role="group">
<button type="button" data-action="link" data-key="L" title="Link (L)">[ ]</button>
<button type="button" data-action="quote" data-key="Q" title="Blockquote (Q)">&gt;</button>
<button type="button" data-action="ul" data-key="U" title="Unordered list (U)">&bull;</button>
<button type="button" data-action="ol" data-key="O" title="Ordered list (O)">1.</button>
<button type="button" data-action="hr" data-key="R" title="Horizontal rule (R)"></button>
</div>
<div role="group">
<button type="button" class="toolbar-dropdown" data-action="tbldrop" title="Table (T)">T&#9662;</button>
<button type="button" class="toolbar-dropdown" data-action="datedrop" title="Insert date (D/W)">D&#9662;</button>
</div>
</div>
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
</form>
@@ -55,7 +75,7 @@
<script src="/_/editor.js"></script>
{{else}}
{{if .Content}}
<div class="content">{{.Content}}</div>
<section class="content">{{.Content}}</section>
{{end}}
{{if .SpecialContent}}
<div class="diary">{{.SpecialContent}}</div>
@@ -67,19 +87,30 @@
<script src="/_/sections.js"></script>
{{end}}
{{if .Entries}}
<div class="listing">
<div class="listing-header">Contents</div>
{{range .Entries}}
<div class="listing-item">
<span class="icon">{{.Icon}}</span>
<a href="{{.URL}}">{{.Name}}</a>
<span class="meta">{{.Meta}}</span>
</div>
{{end}}
</div>
<section class="listing">
<header>Contents</header>
<table>
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Name</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{{range .Entries}}
<tr>
<td>{{.Icon}}</td>
<td><a href="{{.URL}}">{{.Name}}</a></td>
<td>{{.Meta}}</td>
</tr>
{{end}}
</tbody>
</table>
</section>
{{else if not .Content}}
{{if not .SpecialContent}}
<p class="empty">Empty folder — <a href="?edit">[CREATE]</a></p>
<p class="empty">Empty folder — <a href="?edit">create</a></p>
{{end}}
{{end}}
{{end}}

View File

@@ -9,7 +9,7 @@
headings.forEach(function (h, i) {
var a = document.createElement('a');
a.href = '?edit&section=' + (i + 1);
a.className = 'btn btn-small section-edit';
a.className = 'secondary';
a.textContent = 'edit';
h.appendChild(a);
});

View File

@@ -1,432 +1 @@
/* === CRT Base === */
body {
background-color: black;
background-image: radial-gradient(rgba(0, 150, 0, 0.75), black 120%);
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
min-height: 100vh;
margin: 0;
overflow: auto;
padding: 0;
color: white;
font:
1rem Inconsolata,
monospace;
text-shadow: 0 0 5px #c8c8c8;
}
body::after {
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: #ffb300;
text-decoration: none;
}
a:hover {
color: #ffd54f;
}
/* === Header === */
header {
padding: 0.75rem 1rem;
border-bottom: 1px dashed #0a0;
display: flex;
align-items: center;
gap: 0.5rem;
flex-wrap: wrap;
}
.breadcrumb {
display: flex;
align-items: center;
gap: 0.25rem;
flex-wrap: wrap;
flex: 1;
}
.logo {
width: 1.1em;
height: 1.1em;
vertical-align: center;
}
.sep {
color: #060;
}
.btn {
background: none;
border: none;
color: #ffb300;
font: inherit;
cursor: pointer;
padding: 0;
text-decoration: none;
display: inline-block;
white-space: nowrap;
text-shadow: inherit;
}
.btn::before {
content: "[";
}
.btn::after {
content: "]";
}
.btn:hover {
color: #ffd54f;
}
/* === Button modifiers === */
.btn-small {
font-size: 0.65rem;
font-weight: normal;
vertical-align: middle;
}
/* === Main === */
main {
max-width: 860px;
margin: 0 auto;
padding: 1.5rem 1rem;
}
/* === Markdown content === */
.content {
margin-bottom: 2rem;
}
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
color: white;
margin: 1.25rem 0 0.5rem;
line-height: 1.3;
}
.content h1 {
font-size: 1.75rem;
border-bottom: 1px dashed #0a0;
padding-bottom: 0.25rem;
}
.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 {
border-left: 3px solid #0a0;
padding: 0.25rem 1rem;
color: #888;
margin: 0.75rem 0;
}
.content code {
font-family: Inconsolata, monospace;
font-size: 0.875em;
background: #001a00;
padding: 0.1em 0.35em;
}
.content pre {
background: #001a00;
border: 1px solid #0a0;
padding: 1rem;
overflow-x: auto;
margin: 0.75rem 0;
}
.content pre code {
background: none;
padding: 0;
}
.content table {
width: 100%;
border-collapse: collapse;
margin: 0.75rem 0;
font-size: 0.9rem;
}
.content th,
.content td {
border: 1px solid #0a0;
padding: 0.4rem 0.75rem;
text-align: left;
}
.content th {
background: #001a00;
color: white;
}
.content hr {
border: none;
border-top: 1px dashed #0a0;
margin: 1.5rem 0;
}
.content img {
max-width: 100%;
}
/* === File listing === */
.listing {
border: 1px solid #0a0;
}
.listing-header {
padding: 0.5rem 1rem;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: white;
border-bottom: 1px solid #0a0;
}
.listing-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.6rem 1rem;
border-top: 1px solid #060;
font-size: 0.95rem;
}
.listing-item:hover {
background: #001a00;
}
.listing-item .icon {
width: 1.25rem;
text-align: center;
flex-shrink: 0;
filter: drop-shadow(0 0 4px #c8c8c8);
}
.listing-item a {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: inherit;
text-shadow: inherit;
}
.listing-item .meta {
color: #888;
font-size: 0.8rem;
white-space: nowrap;
text-shadow: none;
}
/* === Editor toolbar === */
.editor-toolbar {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
border: 1px solid #0a0;
border-bottom: none;
padding: 0.4rem 0.6rem;
background: #001a00;
}
.btn-tool {
color: #0f0;
font-size: 0.85rem;
padding: 0 0.15rem;
text-shadow: 0 0 4px #0a0;
}
.btn-tool::before {
color: #060;
}
.btn-tool::after {
color: #060;
}
.btn-tool:hover {
color: #fff;
text-shadow: 0 0 6px #0f0;
}
.toolbar-sep {
width: 1px;
background: #060;
margin: 0 0.2rem;
align-self: stretch;
}
/* === Toolbar dropdowns === */
.toolbar-dropdown {
position: relative;
}
.toolbar-dropdown-menu {
position: absolute;
top: 100%;
left: 0;
display: none;
z-index: 100;
background: #001a00;
border: 1px solid #0a0;
min-width: 9rem;
}
.toolbar-dropdown-menu.is-open {
display: block;
}
.toolbar-dropdown-item {
display: block;
width: 100%;
text-align: left;
border: none;
border-radius: 0;
padding: 0.2rem 0.5rem;
}
/* === Edit form === */
.edit-form {
display: flex;
flex-direction: column;
}
textarea {
width: 100%;
min-height: 60vh;
background: #000;
border: 1px solid #0a0;
border-top: none;
color: #0f0;
caret-color: #0f0;
text-shadow: 0 0 4px #0a0;
font: inherit;
font-size: 0.9rem;
line-height: 1.6;
padding: 1rem;
resize: vertical;
outline: none;
box-sizing: border-box;
}
textarea:focus {
border-color: #0f0;
box-shadow: 0 0 5px #0a0;
}
/* === Diary views === */
.diary-section {
margin: 2rem 0;
padding-top: 1.5rem;
border-top: 1px dashed #0a0;
}
.diary-section:first-child {
border-top: none;
padding-top: 0;
margin-top: 0;
}
.diary-section h2 {
font-size: 1.2rem;
color: white;
margin-bottom: 0.75rem;
font-weight: normal;
}
.diary-photo-count {
color: #888;
font-size: 0.85rem;
}
.diary-photo-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 0.4rem;
margin-top: 0.75rem;
}
.diary-photo-grid a {
display: block;
line-height: 0;
}
.diary-photo-grid img {
width: 100%;
height: 140px;
object-fit: cover;
display: block;
}
.diary-section .content {
margin-bottom: 0.75rem;
}
/* === Section edit links === */
.section-edit {
margin-left: 0.75rem;
}
/* === Empty state === */
.empty {
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;
}
}
/* === Pico customizations === */