From d843b0baf1c12ee5b66f00ae28957ab0dff72207 Mon Sep 17 00:00:00 2001 From: Adam French Date: Thu, 1 Oct 2026 15:04:04 +0100 Subject: [PATCH] Make the stamps wall bounce at every page size The wall was a wrapping flex row with a fixed 4-stamp min-width, so it only overflowed (and so only bounced) when its cell was narrower than that. At tablet widths the cell is wider, the wall fitted, and horizontal motion stopped. Lay it out as a fixed-track grid whose column and row counts come from the cell's own size via a ResizeObserver, always one to two stamps larger than the cell on both axes, cycling the stamps to fill every slot. Co-Authored-By: Claude Opus 5.5 --- vue/src/views/home/Stamps.vue | 101 ++++++++++++++++++++++++++-------- 1 file changed, 79 insertions(+), 22 deletions(-) diff --git a/vue/src/views/home/Stamps.vue b/vue/src/views/home/Stamps.vue index 0b7c24f..c252c79 100644 --- a/vue/src/views/home/Stamps.vue +++ b/vue/src/views/home/Stamps.vue @@ -5,10 +5,15 @@ * The order is shuffled on module load so the wall looks different each visit. * The rAF loop then drifts the scroll position diagonally and bounces off each * edge — it drives the DOM's scrollLeft/scrollTop directly rather than any - * reactive state, and reads scrollWidth/clientWidth each frame because images - * load in progressively and change the bounds. + * reactive state, and reads scrollWidth/clientWidth each frame because the + * wall is re-sized whenever the cell is. + * + * The wall is a fixed-track grid whose column and row counts are derived from + * the cell's own size (see fitWall), so it always overflows on both axes. A + * wrapping flex row only overflowed when the cell happened to be narrower than + * the wall, which left it motionless at tablet widths. */ -import { ref, onMounted, onUnmounted } from "vue"; +import { ref, computed, onMounted, onUnmounted } from "vue"; import Touchscreen from "@/components/util/Touchscreen.vue"; import Link from "@/components/text/Link.vue"; @@ -34,7 +39,56 @@ let srcs = [ // page load but stable while the widget is mounted. Mutates in place. shuffleArray(srcs); +// The two linked stamps stay first; the shuffled local ones follow. +const stamps = [ + { + src: "https://www.adam-french.co.uk/img/stamps/mine.gif", + alt: "adam-french.co.uk", + href: "https://www.adam-french.co.uk", + }, + { + src: "https://jacobbarron.xyz/Banneh.gif", + alt: "jacobbarron.xyz", + href: "https://jacobbarron.xyz", + }, + ...srcs.map((src) => ({ src, alt: src.split("/").pop().split(".")[0] })), +]; + +// Must match the grid track sizes in the