Add tuicss library

This commit is contained in:
2025-12-12 11:55:37 +01:00
parent e5bbdcab42
commit 4bbc7975b3
7 changed files with 293 additions and 431 deletions

View File

@@ -5,18 +5,18 @@
hx-get="/calendar/{{.PrevYear}}/{{.PrevMonth}}"
hx-target="#calendar-panel"
hx-swap="innerHTML"
class="nav-btn"
class="tui-button"
aria-label="Previous month">
‹
«
</button>
<h2>{{.MonthName}} {{.Year}}</h2>
<span class="calendar-title">{{.MonthName}} {{.Year}}</span>
<button
hx-get="/calendar/{{.NextYear}}/{{.NextMonth}}"
hx-target="#calendar-panel"
hx-swap="innerHTML"
class="nav-btn"
class="tui-button"
aria-label="Next month">
&#8250;
&raquo;
</button>
</div>
@@ -49,9 +49,9 @@
<span class="day-number">{{$day}}</span>
{{if $content.HasContent}}
<div class="day-indicators">
{{if $content.HasEvents}}<span class="indicator event-indicator" title="Events">📅</span>{{end}}
{{if $content.HasDiary}}<span class="indicator diary-indicator" title="Diary">📝</span>{{end}}
{{if $content.HasPhotos}}<span class="indicator photo-indicator" title="Photos">📷</span>{{end}}
{{if $content.HasEvents}}<span class="indicator" title="Events">E</span>{{end}}
{{if $content.HasDiary}}<span class="indicator" title="Diary">D</span>{{end}}
{{if $content.HasPhotos}}<span class="indicator" title="Photos">P</span>{{end}}
</div>
{{end}}
</div>
@@ -63,18 +63,26 @@
hx-get="/timeline/{{.Year}}/{{.Month | printf "%d"}}"
hx-target="#timeline-panel"
hx-swap="innerHTML"
class="btn btn-primary">
class="tui-button cyan-168 white-text">
View Timeline
</button>
</div>
</div>
<dialog id="day-modal" class="day-modal">
<div id="day-modal-content">
<!-- Day content loaded via HTMX -->
<dialog id="day-modal" class="tui-modal">
<div class="tui-window tui-no-shadow">
<fieldset class="tui-fieldset">
<legend class="center">Day Details</legend>
<button class="tui-fieldset-button" onclick="document.getElementById('day-modal').close()">
<span class="red-168-text">X</span>
</button>
<div id="day-modal-content">
<!-- Day content loaded via HTMX -->
</div>
<div class="modal-actions">
<button class="tui-button" onclick="document.getElementById('day-modal').close()">Close</button>
</div>
</fieldset>
</div>
<form method="dialog">
<button class="btn btn-secondary">Close</button>
</form>
</dialog>
{{end}}

View File

@@ -1,8 +1,8 @@
{{define "day.html"}}
<div class="day-detail">
<header class="day-header">
<h2>{{.Date.Format "Monday, January 2, 2006"}}</h2>
</header>
<div class="day-header white-255-text">
{{.Date.Format "Monday, January 2, 2006"}}
</div>
<div id="day-detail-content">
{{template "day_content.html" .}}
@@ -13,20 +13,20 @@
{{define "day_content.html"}}
<div class="day-content">
{{/* Events Section */}}
<section class="day-section events-section">
<h3>📅 Events</h3>
<fieldset class="tui-input-fieldset">
<legend class="cyan-255-text">Events</legend>
{{if .Content.Events}}
<ul class="event-list">
{{range .Content.Events}}
<li class="event-item">
<strong>{{.Title}}</strong>
<span class="white-255-text">{{.Title}}</span>
{{if not .AllDay}}
<span class="event-time">{{formatTime .Start}} - {{formatTime .End}}</span>
<span class="green-255-text">{{formatTime .Start}} - {{formatTime .End}}</span>
{{else}}
<span class="event-time">All day</span>
<span class="green-255-text">All day</span>
{{end}}
{{if .Location}}
<span class="event-location">📍 {{.Location}}</span>
<span class="yellow-255-text">@ {{.Location}}</span>
{{end}}
{{if .Description}}
<p class="event-description">{{.Description}}</p>
@@ -37,16 +37,16 @@
{{else}}
<p class="empty-message">No events scheduled.</p>
{{end}}
</section>
</fieldset>
{{/* Diary Section */}}
<section class="day-section diary-section">
<h3>📝 Journal</h3>
<fieldset class="tui-input-fieldset">
<legend class="purple-255-text">Journal</legend>
{{if .Content.Diary}}
<div class="diary-display">
<p class="diary-text">{{.Content.Diary.Text}}</p>
<p class="diary-text white-255-text">{{.Content.Diary.Text}}</p>
<button
class="btn btn-small"
class="tui-button"
data-action="toggle-diary-edit">
Edit
</button>
@@ -56,18 +56,18 @@
hx-post="/diary/{{formatDate .Date}}"
hx-target="#day-detail-content"
hx-swap="innerHTML">
<textarea name="text" rows="5" placeholder="Write your thoughts...">{{.Content.Diary.Text}}</textarea>
<textarea name="text" class="tui-input full-width" rows="5" placeholder="Write your thoughts...">{{.Content.Diary.Text}}</textarea>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
<button type="submit" class="tui-button green-168 white-text">Save</button>
<button
type="button"
class="btn btn-secondary"
class="tui-button"
data-action="cancel-diary-edit">
Cancel
</button>
<button
type="button"
class="btn btn-danger"
class="tui-button red-168 white-text"
hx-delete="/diary/{{formatDate .Date}}"
hx-target="#day-detail-content"
hx-swap="innerHTML"
@@ -82,17 +82,17 @@
hx-post="/diary/{{formatDate .Date}}"
hx-target="#day-detail-content"
hx-swap="innerHTML">
<textarea name="text" rows="5" placeholder="Write your thoughts..."></textarea>
<textarea name="text" class="tui-input full-width" rows="5" placeholder="Write your thoughts..."></textarea>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
<button type="submit" class="tui-button green-168 white-text">Save</button>
</div>
</form>
{{end}}
</section>
</fieldset>
{{/* Photos Section */}}
<section class="day-section photos-section">
<h3>📷 Photos</h3>
<fieldset class="tui-input-fieldset">
<legend class="orange-255-text">Photos</legend>
{{if .Content.Photos}}
<div class="photo-gallery">
{{range .Content.Photos}}
@@ -100,13 +100,13 @@
<a href="{{.URLPath}}" target="_blank">
<img src="{{.URLPath}}" alt="{{.Description}}" loading="lazy">
</a>
<figcaption>{{.Description}}</figcaption>
{{if .Description}}<figcaption>{{.Description}}</figcaption>{{end}}
</figure>
{{end}}
</div>
{{else}}
<p class="empty-message">No photos for this day.</p>
{{end}}
</section>
</fieldset>
</div>
{{end}}

View File

@@ -1,26 +1,31 @@
{{define "diary_form.html"}}
<div class="diary-form">
<h3>Journal Entry - {{.Date.Format "January 2, 2006"}}</h3>
<form
hx-post="/diary/{{formatDate .Date}}"
hx-target="this"
hx-swap="outerHTML">
<textarea
name="text"
rows="8"
placeholder="Write your thoughts...">{{if .Entry}}{{.Entry.Text}}{{end}}</textarea>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
{{if .Entry}}
<button
type="button"
class="btn btn-danger"
hx-delete="/diary/{{formatDate .Date}}"
hx-confirm="Delete this diary entry?">
Delete
</button>
{{end}}
</div>
</form>
<div class="tui-window tui-no-shadow">
<fieldset class="tui-fieldset">
<legend class="center">Journal Entry - {{.Date.Format "January 2, 2006"}}</legend>
<form
hx-post="/diary/{{formatDate .Date}}"
hx-target="this"
hx-swap="outerHTML">
<textarea
name="text"
class="tui-input full-width"
rows="8"
placeholder="Write your thoughts...">{{if .Entry}}{{.Entry.Text}}{{end}}</textarea>
<div class="form-actions">
<button type="submit" class="tui-button green-168 white-text">Save</button>
{{if .Entry}}
<button
type="button"
class="tui-button red-168 white-text"
hx-delete="/diary/{{formatDate .Date}}"
hx-confirm="Delete this diary entry?">
Delete
</button>
{{end}}
</div>
</form>
</fieldset>
</div>
</div>
{{end}}

View File

@@ -5,18 +5,18 @@
hx-get="/timeline/{{.PrevYear}}/{{.PrevMonth}}"
hx-target="#timeline-panel"
hx-swap="innerHTML"
class="nav-btn"
class="tui-button"
aria-label="Previous month">
&#8249;
&laquo;
</button>
<h2>{{.MonthName}} {{.Year}}</h2>
<span class="timeline-title">{{.MonthName}} {{.Year}}</span>
<button
hx-get="/timeline/{{.NextYear}}/{{.NextMonth}}"
hx-target="#timeline-panel"
hx-swap="innerHTML"
class="nav-btn"
class="tui-button"
aria-label="Next month">
&#8250;
&raquo;
</button>
</div>
@@ -24,68 +24,64 @@
{{if .Days}}
{{range .Days}}
<article class="timeline-day">
<header class="timeline-day-header">
<time datetime="{{formatDate .Date}}">
{{.Date.Format "Monday, January 2"}}
</time>
</header>
<div class="timeline-entries">
{{/* Events */}}
{{range .Events}}
<div class="timeline-entry event-entry">
<div class="entry-icon">📅</div>
<div class="entry-content">
<h4>{{.Title}}</h4>
{{if not .AllDay}}
<span class="entry-time">{{formatTime .Start}} - {{formatTime .End}}</span>
{{else}}
<span class="entry-time">All day</span>
{{end}}
{{if .Location}}
<span class="entry-location">📍 {{.Location}}</span>
{{end}}
{{if .Description}}
<p class="entry-description">{{.Description}}</p>
{{end}}
</div>
</div>
{{end}}
{{/* Diary entry */}}
{{if .Diary}}
<div class="timeline-entry diary-entry">
<div class="entry-icon">📝</div>
<div class="entry-content">
<h4>Journal Entry</h4>
<p class="entry-description diary-text">{{.Diary.Text}}</p>
</div>
</div>
{{end}}
{{/* Photos */}}
{{if .Photos}}
<div class="timeline-entry photo-entry">
<div class="entry-icon">📷</div>
<div class="entry-content">
<h4>Photos</h4>
<div class="photo-grid">
{{range .Photos}}
<figure class="photo-item">
<img src="{{.URLPath}}" alt="{{.Description}}" loading="lazy">
<figcaption>{{.Description}}</figcaption>
</figure>
<div class="tui-window tui-no-shadow">
<fieldset class="tui-fieldset tui-border-single">
<legend>{{.Date.Format "Monday, January 2"}}</legend>
<div class="timeline-entries">
{{/* Events */}}
{{range .Events}}
<div class="timeline-entry">
<span class="entry-type cyan-255-text">[EVENT]</span>
<span class="entry-title white-255-text">{{.Title}}</span>
{{if not .AllDay}}
<span class="entry-time green-255-text">{{formatTime .Start}} - {{formatTime .End}}</span>
{{else}}
<span class="entry-time green-255-text">All day</span>
{{end}}
{{if .Location}}
<span class="entry-location yellow-255-text">@ {{.Location}}</span>
{{end}}
{{if .Description}}
<p class="entry-description">{{.Description}}</p>
{{end}}
</div>
{{end}}
{{/* Diary entry */}}
{{if .Diary}}
<div class="timeline-entry">
<span class="entry-type purple-255-text">[DIARY]</span>
<span class="entry-title white-255-text">Journal Entry</span>
<p class="entry-description diary-text">{{.Diary.Text}}</p>
</div>
{{end}}
{{/* Photos */}}
{{if .Photos}}
<div class="timeline-entry">
<span class="entry-type orange-255-text">[PHOTOS]</span>
<span class="entry-title white-255-text">{{len .Photos}} photo(s)</span>
<div class="photo-grid">
{{range .Photos}}
<figure class="photo-item">
<a href="{{.URLPath}}" target="_blank">
<img src="{{.URLPath}}" alt="{{.Description}}" loading="lazy">
</a>
{{if .Description}}<figcaption>{{.Description}}</figcaption>{{end}}
</figure>
{{end}}
</div>
</div>
{{end}}
</div>
</div>
{{end}}
</fieldset>
</div>
</article>
{{end}}
{{else}}
<div class="timeline-empty">
<p>No entries for this month.</p>
<p class="white-255-text">No entries for this month.</p>
</div>
{{end}}
</div>