From 510633a83eae9b8974887879ceeabae55626064c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:51:29 +0000 Subject: [PATCH 1/5] Initial plan From a9b73a1f6054dce412cf772b009d9b4f764e97b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:00:25 +0000 Subject: [PATCH 2/5] Enable coin face image rotation from a folder of images - Create static/img/coin-faces/ folder for coin face images - Move me-photo.png/webp to coin-faces/ folder - Update nav.html to auto-discover images via Hugo readDir - Pass image list as data-coin-images JSON attribute - Update coin-flip.js to randomly rotate back face images - Each flip to the illustration triggers a new random photo swap Co-authored-by: brianruggieri <2104689+brianruggieri@users.noreply.github.com> --- layouts/partials/nav.html | 23 +++++++++-- static/img/{ => coin-faces}/me-photo.png | Bin static/img/{ => coin-faces}/me-photo.webp | Bin static/js/coin-flip.js | 47 ++++++++++++++++++++++ 4 files changed, 66 insertions(+), 4 deletions(-) rename static/img/{ => coin-faces}/me-photo.png (100%) rename static/img/{ => coin-faces}/me-photo.webp (100%) diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 88f0be0..d2e13f9 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,18 +1,33 @@ {{ $frontImg := .Site.Params.profileImage | relURL }} {{ $frontWebp := $frontImg | replaceRE `\.(png|jpg|jpeg)$` ".webp" }} +{{/* Discover coin-face images from the coin-faces folder */}} +{{ $coinFaces := slice }} +{{ range readDir "static/img/coin-faces" }} + {{ if not .IsDir }} + {{ $name := .Name }} + {{ if or (strings.HasSuffix $name ".png") (strings.HasSuffix $name ".jpg") (strings.HasSuffix $name ".jpeg") }} + {{ $coinFaces = $coinFaces | append (printf "/img/coin-faces/%s" $name) }} + {{ end }} + {{ end }} +{{ end }} +{{ $backImg := "" }} +{{ if gt (len $coinFaces) 0 }} + {{ $backImg = index $coinFaces 0 }} +{{ end }} +{{ $backWebp := $backImg | replaceRE `\.(png|jpg|jpeg)$` ".webp" }}