prime8dev

prime8dev
git clone https://git.prime8.dev/prime8dev.git
Log | Files | Refs | README | LICENSE

commit b69a9dfce59d00f76d4a7002c69b9e50a0339aa9
parent eec79bff26625000344e2694d33de10044179361
Author: Damian Myrda <damian@prime8.dev>
Date:   Thu, 12 Nov 2026 00:28:12 +0000

about: portrait back to photo (hamster stays as favicon)

Diffstat:
Minternal/utils/logo.go | 6+++---
Ainternal/utils/uptime_test.go | 22++++++++++++++++++++++
Minternal/web/templates/partials/about.gohtml | 2+-
Dstatic/hamster.gif | 0
Dstatic/hamster.png | 0
5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/internal/utils/logo.go b/internal/utils/logo.go @@ -13,12 +13,12 @@ import ( var logoMu sync.Mutex -const logoPath = "static/hamster.png" +const logoPath = "static/me.jpg" // logoCrop frames the face: fractions of the source image (x0, y0, x1, y1). -var logoCrop = [4]float64{0.1, 0.25, 0.9, 1.0} +var logoCrop = [4]float64{0.12, 0.08, 0.88, 0.84} -// LogoASCII renders static/hamster.png for terminals. Colored output uses +// LogoASCII renders static/me.jpg for terminals. Colored output uses // half-block cells (upper half = foreground, lower half = background), so each // cell carries two truecolor pixels and the portrait reads as a photo. Plain // output falls back to ascii art. diff --git a/internal/utils/uptime_test.go b/internal/utils/uptime_test.go @@ -0,0 +1,22 @@ +package utils + +import ( + "testing" + "time" +) + +func TestUptimeUsesBirthZone(t *testing.T) { + la, err := time.LoadLocation("America/Chicago") + if err != nil { + t.Skip(err) + } + birth := time.Date(2008, time.April, 20, 0, 0, 0, 0, la) + // 22:30 CDT Oct 22 is already Oct 23 in UTC; must still read 185d. + now := time.Date(2026, time.October, 23, 3, 30, 0, 0, time.UTC) + if got := Uptime(birth, now); got != "18y 185d" { + t.Fatalf("got %q, want 18y 185d", got) + } + if got := Uptime(birth, time.Date(2026, time.April, 20, 6, 0, 0, 0, time.UTC)); got != "18y 0d" { + t.Fatalf("birthday: got %q", got) + } +} diff --git a/internal/web/templates/partials/about.gohtml b/internal/web/templates/partials/about.gohtml @@ -3,7 +3,7 @@ <div class="about-layout"> <div class="section"> <div class="fetch"> - <img class="fetch-logo" src="/static/hamster.gif" width="240" height="240" decoding="async" alt="{{.About.Name}} - {{.About.Profession}}" loading="eager"> + <img class="fetch-logo" src="/static/me-sm.jpg" width="480" height="480" decoding="async" alt="{{.About.Name}} - {{.About.Profession}}" loading="eager"> <div class="fetch-info"> <div class="fetch-title"><span class="shell-user">{{.About.Handle}}</span>@<span class="shell-host">prime8</span></div> <div class="fetch-rule" aria-hidden="true">----------------</div> diff --git a/static/hamster.gif b/static/hamster.gif Binary files differ. diff --git a/static/hamster.png b/static/hamster.png Binary files differ.