Branchwell

Lumen & Gesso / website / app / data / transformPairs.ts

1// Before/after commission pairs for the "camera roll → wall" showcase.
2//
3// Each pair is a single composition: the customer's raw phone snap sits
4// as a tilted polaroid leaning against the corner of the finished framed
5// portrait. ALL_PAIRS is the full data set; HOME_PAIRS is the featured
6// trio on the home page and GALLERY_PAIRS is everything else — the
7// gallery never repeats a home feature. Both derive from ALL_PAIRS.
8
9import type { PortraitPromptId } from './styleCatalog';
10import type { FrameId, MatteId } from './frames';
11import type { ProductId } from '../lib/pricing';
12
13export type TransformPair = {
14 n: string;
15 before: { src: string; alt: string; ratio: string };
16 after: { src: string; alt: string };
17 name: string;
18 medium: string;
19 blurb: string;
20 // The product family pictured (matted vs canvas — visually distinct
21 // from the photo, since canvas has no mat border). Drives the
22 // gallery's "From $X" price via startingSalePrice() in pricing.ts.
23 productId: ProductId;
24 // sizeId is RETAINED for legacy reasons but the gallery no longer
25 // displays it or forwards it to the builder — the AI-generated
26 // lifestyle photos don't faithfully depict a specific frame size, so
27 // claiming one would be misleading. Customer picks size in the
28 // builder. Safe to delete once no other consumer relies on it.
29 sizeId: string;
30 // Catalog style this commission used — when set, the pair's "Start a
31 // portrait" CTA opens the builder with that style preselected.
32 styleId?: PortraitPromptId;
33 // Frame + matte the lifestyle shot is composed with. Passed to the
34 // builder via the "Make one like this" CTA so the customer lands on
35 // the same finish they just saw.
36 frameId?: FrameId;
37 matteId?: MatteId;
38 // Per-pair polaroid placement so the pairs don't all read identically.
39 tilt: number;
40 tapeRotate: number;
41 corner: 'br' | 'tr' | 'bl';
42};
43
44/** The full set — every commission, shown on the /gallery page. */
45export const ALL_PAIRS: TransformPair[] = [
46 {
47 n: '01',
48 before: {
49 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-daisy.jpg/public',
50 alt: 'Phone snapshot of a long-haired cream dog with two blue bows, resting on a leather couch.',
51 ratio: '3 / 4',
52 },
53 after: {
54 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/yorkie-impasto.jpg/public',
55 alt: 'Heavy impasto portrait of a long-haired cream dog with two blue-grey bows, soft-white canvas float frame on a weathered wood plank wall.',
56 },
57 name: 'Cimba',
58 medium: 'Impasto · ivory frame',
59 blurb: "Bon Bon's Boshay Pabu Cimba, bred by Bonnie Murphy, Lhasa Love.",
60 productId: 'matted',
61 sizeId: '16x20',
62 styleId: 'mixedmedia',
63 frameId: 'white',
64 matteId: 'offwhite',
65 tilt: -5.2,
66 tapeRotate: 1.8,
67 corner: 'br',
68 },
69 {
70 n: '02',
71 before: {
72 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-gg.jpg/public',
73 alt: 'Phone snapshot of a fluffy tan-and-white Lhasa Apso with a single top-knot in soft window light.',
74 ratio: '3 / 4',
75 },
76 after: {
77 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-gg-landscape.jpg/public',
78 alt: 'Landscape-style oil portrait of a fluffy tan Lhasa Apso in a Romantic lakeside autumn scene, soft-white canvas float frame above a wood credenza.',
79 },
80 name: 'GG',
81 medium: 'Landscape style · ivory frame',
82 blurb: "Bon Bon's Boshay Pabu Sunrise Xhmeroni, bred by Bonnie Murphy, Lhasa Love.",
83 productId: 'matted',
84 sizeId: '16x20',
85 styleId: 'landscape-oil',
86 frameId: 'white',
87 matteId: 'offwhite',
88 tilt: 4.4,
89 tapeRotate: -2.1,
90 corner: 'tr',
91 },
92 {
93 n: '03',
94 before: {
95 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-pepper.jpg/public',
96 alt: 'Phone snapshot of a black-and-white long-haired dog on a sunlit windowsill.',
97 ratio: '4 / 3',
98 },
99 after: {
100 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-pepper-popart.jpg/public',
101 alt: 'Pop-art portrait of a black-and-white long-haired dog, ivory frame on a weathered wood wall.',
102 },
103 name: 'Moki',
104 medium: 'Pop art · ivory frame',
105 blurb: 'Bon Bon’s Moki Boy Wonder, bred by Bonnie Murphy, Lhasa Love.',
106 productId: 'matted',
107 sizeId: '16x20',
108 styleId: 'popart',
109 frameId: 'white',
110 matteId: 'snowwhite',
111 tilt: -4.5,
112 tapeRotate: 2.2,
113 corner: 'bl',
114 },
115 {
116 n: '04',
117 before: {
118 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-goldenretriever.jpg/public',
119 alt: 'Phone snapshot of a happy golden retriever sitting on a living-room rug surrounded by toys.',
120 ratio: '3 / 4',
121 },
122 after: {
123 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-cooper-vector-v4.jpg/public',
124 alt: 'Vector-outline portrait of a golden retriever, ivory frame on weathered wood.',
125 },
126 name: 'Cooper',
127 medium: 'Vector outline · ivory frame',
128 blurb: 'Golden retriever, toys underfoot. Caught mid-grin. Joy with absolutely no notes.',
129 productId: 'matted',
130 sizeId: '16x20',
131 styleId: 'vector',
132 frameId: 'white',
133 matteId: 'snowwhite',
134 tilt: 5.0,
135 tapeRotate: -2.4,
136 corner: 'bl',
137 },
138 {
139 n: '06',
140 before: {
141 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-koda.jpg/public',
142 alt: 'Phone snapshot of a blue merle Australian Shepherd sitting on a hardwood living-room floor in window light.',
143 ratio: '3 / 4',
144 },
145 after: {
146 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-koda-named-v4.jpg/public',
147 alt: 'Named-portrait painting of a blue merle Australian Shepherd, “Koda” lettered above on a soft white ground.',
148 },
149 name: 'Koda',
150 medium: 'Named portrait · walnut frame',
151 blurb: 'Blue merle Aussie, ears at attention. Caught mid-thought. Equal parts mischief and devotion.',
152 productId: 'matted',
153 sizeId: '16x20',
154 styleId: 'named',
155 frameId: 'walnut',
156 matteId: 'snowwhite',
157 tilt: 4.6,
158 tapeRotate: -2.0,
159 corner: 'tr',
160 },
161 {
162 n: '07',
163 before: {
164 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-maple.jpg/public',
165 alt: 'Phone snapshot of a Cavalier King Charles Spaniel in soft window light.',
166 ratio: '3 / 4',
167 },
168 after: {
169 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-maple-watercolor-v2.jpg/public',
170 alt: 'Watercolor portrait of a Cavalier King Charles Spaniel, soft pigment washes on clean white, ivory frame.',
171 },
172 name: 'Maple',
173 medium: 'Watercolor · ivory frame',
174 blurb: 'Cavalier in afternoon window light. Caught mid-tilt. Velvet ears, deeply unimpressed.',
175 productId: 'matted',
176 sizeId: '16x20',
177 styleId: 'watercolor',
178 frameId: 'white',
179 matteId: 'snowwhite',
180 tilt: -4.8,
181 tapeRotate: 1.9,
182 corner: 'br',
183 },
184 {
185 n: '08',
186 before: {
187 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-juno.jpg/public',
188 alt: 'Phone snapshot of an Italian Greyhound curled on a green velvet sofa.',
189 ratio: '3 / 4',
190 },
191 after: {
192 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-juno-lineart-v3.jpg/public',
193 alt: 'Refined ink line-drawing portrait of an Italian Greyhound, "Juno" lettered above on clean white, ivory frame in a modern minimalist home office.',
194 },
195 name: 'Juno',
196 medium: 'Line drawing · ivory frame',
197 blurb: 'Italian Greyhound, ears at ease. Caught mid-tilt. Refined ink, no second-guesses.',
198 productId: 'matted',
199 sizeId: '16x20',
200 styleId: 'lineart',
201 frameId: 'white',
202 matteId: 'snowwhite',
203 tilt: 4.0,
204 tapeRotate: -1.6,
205 corner: 'tr',
206 },
207 {
208 n: '11',
209 before: {
210 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-sakura.jpg/public',
211 alt: 'Phone snapshot of a Shiba Inu standing on a sunny garden path.',
212 ratio: '3 / 4',
213 },
214 after: {
215 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-sakura-ukiyoe.jpg/public',
216 alt: 'Ukiyo-e woodblock portrait of a Shiba Inu with sumi-black outlines and Edo-period colour, ivory frame.',
217 },
218 name: 'Sakura',
219 medium: 'Ukiyo-e · ivory frame',
220 blurb: 'Shiba Inu in spring air. Caught mid-glance. A small fox with a long memory.',
221 productId: 'matted',
222 sizeId: '16x20',
223 styleId: 'ukiyoe',
224 frameId: 'white',
225 matteId: 'offwhite',
226 tilt: -4.6,
227 tapeRotate: 1.7,
228 corner: 'tr',
229 },
230 // ─── Neo-Expressionist ──────────────────────────────────────────────
231 {
232 n: '32',
233 before: {
234 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-rex.jpg/public',
235 alt: 'Phone snapshot of a fawn French bulldog standing alert on a tile floor.',
236 ratio: '3 / 4',
237 },
238 after: {
239 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-rex-neoexpressionist-v2.jpg/public',
240 alt: 'Neo-expressionist standing portrait of a French bulldog, matte black frame on a moody downtown loft wall with polished concrete floors and a low leather sofa.',
241 },
242 name: 'Rex',
243 medium: 'Neo-Expressionist · matte black frame',
244 blurb: 'French bulldog, king of the alley. Caught mid-stand. Gold crown, no apology.',
245 productId: 'matted',
246 sizeId: '16x20',
247 styleId: 'neoexpressionist',
248 frameId: 'black',
249 matteId: 'black',
250 tilt: 4.2,
251 tapeRotate: -2.1,
252 corner: 'br',
253 },
254 {
255 n: '12',
256 before: {
257 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-tenzin.jpg/public',
258 alt: 'Phone snapshot of a Tibetan Mastiff resting on a rug in soft daylight.',
259 ratio: '3 / 4',
260 },
261 after: {
262 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-tenzin-thangka-v3.jpg/public',
263 alt: 'Thangka-style portrait of a Tibetan Mastiff, mineral pigments and gold-leaf halo, gilt frame.',
264 },
265 name: 'Tenzin',
266 medium: 'Thangka · warm gold frame',
267 blurb: 'Tibetan Mastiff under a gold-leaf halo. Caught mid-sit. Sacred, with snacks at stake.',
268 productId: 'canvas',
269 sizeId: '16x20',
270 styleId: 'thangka',
271 frameId: 'gold',
272 matteId: 'offwhite',
273 tilt: 4.2,
274 tapeRotate: -1.9,
275 corner: 'bl',
276 },
277 {
278 n: '13',
279 before: {
280 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-sable.jpg/public',
281 alt: 'Phone snapshot of a whippet curled on a linen sofa.',
282 ratio: '3 / 4',
283 },
284 after: {
285 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-sable-charcoal-v2.jpg/public',
286 alt: 'Charcoal drawing of a whippet on cotton paper, name hand-lettered above, ivory frame.',
287 },
288 name: 'Sable',
289 medium: 'Charcoal · ivory frame',
290 blurb: 'Whippet curled like a comma. Caught mid-dream. Vine charcoal, no eraser used.',
291 productId: 'matted',
292 sizeId: '16x20',
293 styleId: 'charcoal',
294 frameId: 'white',
295 matteId: 'snowwhite',
296 tilt: -4.4,
297 tapeRotate: 2.1,
298 corner: 'br',
299 },
300 {
301 n: '16',
302 before: {
303 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-clover.jpg/public',
304 alt: 'Phone snapshot of a Holland Lop rabbit sitting on a hardwood floor.',
305 ratio: '3 / 4',
306 },
307 after: {
308 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-clover-charcoal-v3.jpg/public',
309 alt: 'Charcoal portrait of a Holland Lop rabbit, white frame in a bright nursery corner.',
310 },
311 name: 'Clover',
312 medium: 'Charcoal · white frame',
313 blurb: 'Holland Lop, ears down. Caught mid-nibble. Charcoal, soft as the fur.',
314 productId: 'matted',
315 sizeId: '12x16',
316 styleId: 'charcoal',
317 frameId: 'white',
318 matteId: 'snowwhite',
319 tilt: 4.6,
320 tapeRotate: -1.9,
321 corner: 'br',
322 },
323 {
324 n: '17',
325 before: {
326 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-wren.jpg/public',
327 alt: 'Phone snapshot of a Northern Cardinal perched on a leafy branch.',
328 ratio: '3 / 4',
329 },
330 after: {
331 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-wren-ukiyoe.jpg/public',
332 alt: 'Ukiyo-e woodblock portrait of a cardinal, walnut frame in a book-lined library nook.',
333 },
334 name: 'Wren',
335 medium: 'Ukiyo-e · walnut frame',
336 blurb: 'Cardinal on a branch. Caught mid-glance. Edo lines, modern bird.',
337 productId: 'matted',
338 sizeId: '12x16',
339 styleId: 'ukiyoe',
340 frameId: 'walnut',
341 matteId: 'offwhite',
342 tilt: -4.0,
343 tapeRotate: 1.8,
344 corner: 'tr',
345 },
346 {
347 n: '18',
348 before: {
349 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-hamlet.jpg/public',
350 alt: 'Phone snapshot of a spotted Juliana mini pig standing on a grassy lawn.',
351 ratio: '3 / 4',
352 },
353 after: {
354 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-hamlet-popart.jpg/public',
355 alt: 'Pop-art portrait of a Juliana mini pig, matte black frame in a bright cheerful kitchen.',
356 },
357 name: 'Hamlet',
358 medium: 'Pop art · matte black frame',
359 blurb: 'Mini pig, spots and all. Caught mid-snort. Bold colour, no apology.',
360 productId: 'matted',
361 sizeId: '16x20',
362 styleId: 'popart',
363 frameId: 'black',
364 matteId: 'snowwhite',
365 tilt: 5.0,
366 tapeRotate: -2.2,
367 corner: 'bl',
368 },
369 {
370 n: '20',
371 before: {
372 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-quill.jpg/public',
373 alt: 'Phone snapshot of a small pet hedgehog held gently in cupped hands.',
374 ratio: '3 / 4',
375 },
376 after: {
377 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-quill-mixedmedia.jpg/public',
378 alt: 'Mixed-media impasto portrait of a hedgehog, walnut frame in a cozy attic studio.',
379 },
380 name: 'Quill',
381 medium: 'Mixed-media · walnut frame',
382 blurb: 'Hedgehog in cupped hands. Caught mid-squeak. Impasto for the texture of him.',
383 productId: 'matted',
384 sizeId: '12x16',
385 styleId: 'mixedmedia',
386 frameId: 'walnut',
387 matteId: 'offwhite',
388 tilt: 4.3,
389 tapeRotate: -1.5,
390 corner: 'tr',
391 },
392 {
393 n: '22',
394 before: {
395 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-major.jpg/public',
396 alt: 'Phone snapshot of an Arabian horse standing alert in a sunlit barn aisle.',
397 ratio: '3 / 4',
398 },
399 after: {
400 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-major-lineart.jpg/public',
401 alt: 'Continuous-line drawing of an Arabian horse, matte black frame in a modern minimalist office.',
402 },
403 name: 'Major',
404 medium: 'Line drawing · black frame',
405 blurb: 'Arabian in barn light. Caught mid-breath. One line, no fuss, all horse.',
406 productId: 'matted',
407 sizeId: '16x20',
408 styleId: 'lineart',
409 frameId: 'black',
410 matteId: 'snowwhite',
411 tilt: 4.0,
412 tapeRotate: -1.7,
413 corner: 'tr',
414 },
415 {
416 n: '23',
417 before: {
418 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-marlow.jpg/public',
419 alt: 'Phone snapshot of a vibrant red-and-blue Betta fish in a glass aquarium.',
420 ratio: '3 / 4',
421 },
422 after: {
423 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-marlow-cubist.jpg/public',
424 alt: 'Cubist portrait of a Betta fish in fractured planes of colour, natural oak frame in an eclectic mid-century study.',
425 },
426 name: 'Marlow',
427 medium: 'Cubist · oak frame',
428 blurb: 'Betta in full sail. Caught mid-drift. Fractured into something better.',
429 productId: 'matted',
430 sizeId: '12x16',
431 styleId: 'cubist',
432 frameId: 'oak',
433 matteId: 'snowwhite',
434 tilt: -4.4,
435 tapeRotate: 2.0,
436 corner: 'br',
437 },
438 // ─── Risograph ──────────────────────────────────────────────────────
439 {
440 n: '26',
441 before: {
442 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-murph.jpg/public',
443 alt: 'Phone snapshot of a Pembroke Welsh Corgi sitting in soft window light.',
444 ratio: '3 / 4',
445 },
446 after: {
447 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-murph-risograph-v3.jpg/public',
448 alt: 'Risograph portrait of a Pembroke Welsh Corgi in a honey oak frame, leaning on a print-shop studio wall with a desk lamp and stacked art prints.',
449 },
450 name: 'Murph',
451 medium: 'Risograph · honey oak frame',
452 blurb: 'Pembroke Welsh Corgi, ears at full mast. Caught mid-grin. Two inks, pulled bright.',
453 productId: 'matted',
454 sizeId: '16x20',
455 styleId: 'risograph',
456 frameId: 'oak',
457 matteId: 'snowwhite',
458 tilt: 4.4,
459 tapeRotate: -2.0,
460 corner: 'br',
461 },
462 {
463 n: '28',
464 before: {
465 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-chip.jpg/public',
466 alt: 'Phone snapshot of a sky-blue budgerigar perched on a wooden dowel.',
467 ratio: '3 / 4',
468 },
469 after: {
470 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-chip-risograph-v3.jpg/public',
471 alt: 'Risograph portrait of a budgerigar in a soft white frame, hung in a small-press design studio with neutral plaster walls and a vintage Anglepoise lamp.',
472 },
473 name: 'Chip',
474 medium: 'Risograph · ivory frame',
475 blurb: 'Budgerigar on a perch. Caught mid-tilt. Sky-blue, screen-printed, sound on.',
476 productId: 'matted',
477 sizeId: '12x16',
478 styleId: 'risograph',
479 frameId: 'white',
480 matteId: 'snowwhite',
481 tilt: 4.0,
482 tapeRotate: -1.7,
483 corner: 'bl',
484 },
485 // ─── At Home (retro disco kitchen) ──────────────────────────────────
486 {
487 n: '30',
488 before: {
489 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-marmalade.jpg/public',
490 alt: 'Phone snapshot of an orange tabby cat resting in soft daylight.',
491 ratio: '3 / 4',
492 },
493 after: {
494 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-marmalade-athome-v4.jpg/public',
495 alt: 'Retro-modern photograph of an orange tabby in a richly-styled mid-century-modern kitchen-living room, honey oak frame hung above a walnut credenza beside a mustard velvet lounge chair.',
496 },
497 name: 'Marmalade',
498 medium: 'Retro Home · honey oak frame',
499 blurb: 'Orange tabby in a sunlit mid-century kitchen. Caught mid-sit. Mint tiles, all heart.',
500 productId: 'matted',
501 sizeId: '16x20',
502 styleId: 'athome',
503 frameId: 'oak',
504 matteId: 'offwhite',
505 tilt: 4.6,
506 tapeRotate: -1.9,
507 corner: 'tr',
508 },
509 {
510 n: '05',
511 before: {
512 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-bowie.jpg/public',
513 alt: 'Phone snapshot of a fawn French bulldog sitting on a living-room couch.',
514 ratio: '3 / 4',
515 },
516 after: {
517 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-bowie-popart-v2.jpg/public',
518 alt: 'Pop-art portrait of a French bulldog, ivory frame on a weathered wood wall.',
519 },
520 name: 'Bowie',
521 medium: 'Pop art · ivory frame',
522 blurb: 'French bulldog, ears up. Caught mid-ponder. Mostly ears, entirely certain.',
523 productId: 'matted',
524 sizeId: '16x20',
525 styleId: 'popart',
526 frameId: 'white',
527 matteId: 'snowwhite',
528 tilt: -4.2,
529 tapeRotate: 2.0,
530 corner: 'br',
531 },
532 // ─── Pop art (cat) — home-feature trio ──────────────────────────────
533 {
534 n: '33',
535 before: {
536 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/before-ziggy.jpg/public',
537 alt: 'Phone snapshot of a ginger orange tabby cat sitting in soft window light.',
538 ratio: '3 / 4',
539 },
540 after: {
541 src: 'https://imagedelivery.net/UI7TTlrLGypjCwT_wfSMNA/portraits/lifestyle-ziggy-popart.jpg/public',
542 alt: 'Pop-art portrait of a ginger tabby cat in bold saturated colour, soft-white frame in a bright breakfast nook.',
543 },
544 name: 'Ziggy',
545 medium: 'Pop art · ivory frame',
546 blurb: 'Ginger tabby, cranked to full saturation. Caught mid-blink. A small sun with strong opinions.',
547 productId: 'matted',
548 sizeId: '16x20',
549 styleId: 'popart',
550 frameId: 'white',
551 matteId: 'snowwhite',
552 tilt: -4.5,
553 tapeRotate: 2.2,
554 corner: 'bl',
555 },
556];
557
558// ── Rotating home vs gallery split ──────────────────────────────────
559// Both views derive from ALL_PAIRS so there's a single source of truth.
560// Rather than a fixed home trio, WHICH pairs land on the home page (and
561// in what order the gallery shows the rest) rotates on a daily cycle so
562// the site never feels static. Both lists come out of one seeded shuffle
563// in rotatedPairs(seed), so the gallery can never repeat whatever the
564// home page is currently featuring — the home trio is simply removed
565// from the gallery remainder for that same seed.
566
567// Number of commissions featured on the home page.
568const HOME_COUNT = 3;
569
570// Retired — never shown on the home page or in the gallery.
571const GALLERY_RETIRED_NAMES: readonly string[] = ['Cooper'];
572
573// Every commission still in circulation (retired pieces removed). This
574// is the pool the rotation draws from.
575const ACTIVE_PAIRS: TransformPair[] = ALL_PAIRS.filter(
576 (p) => !GALLERY_RETIRED_NAMES.includes(p.name),
577);
578
579// mulberry32 — a tiny deterministic PRNG. A given seed always yields the
580// same sequence, so both pages compute an identical shuffle (and thus an
581// identical home/gallery split) without sharing state across renders.
582function mulberry32(seed: number): () => number {
583 let a = seed >>> 0;
584 return () => {
585 a |= 0;
586 a = (a + 0x6d2b79f5) | 0;
587 let t = Math.imul(a ^ (a >>> 15), 1 | a);
588 t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
589 return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
590 };
591}
592
593// Deterministic Fisher–Yates shuffle seeded by `seed`.
594function seededShuffle<T>(items: readonly T[], seed: number): T[] {
595 const rng = mulberry32(seed);
596 const out = items.slice();
597 for (let i = out.length - 1; i > 0; i--) {
598 const j = Math.floor(rng() * (i + 1));
599 [out[i], out[j]] = [out[j], out[i]];
600 }
601 return out;
602}
603
604// The style a pair reads as, for "no repeats" purposes. Falls back to the
605// pair's (unique) name when it has no catalog style, so a style-less pair
606// never counts as a duplicate of anything.
607function styleKey(p: TransformPair): string {
608 return p.styleId ?? p.name;
609}
610
611// Pick the HOME_COUNT featured pairs from a shuffled pool, taking only
612// DISTINCT styles so the trio is never two of the same style (no two
613// pop-art frames side by side). With 20+ active pairs across many styles
614// there are always enough; the trailing fill is a safety net for a
615// hypothetical tiny catalog and would still avoid a repeat unless there
616// genuinely aren't HOME_COUNT distinct styles to choose from.
617function pickHomeTrio(shuffled: TransformPair[]): TransformPair[] {
618 const picked: TransformPair[] = [];
619 const usedStyles = new Set<string>();
620 for (const p of shuffled) {
621 if (picked.length >= HOME_COUNT) break;
622 if (usedStyles.has(styleKey(p))) continue;
623 usedStyles.add(styleKey(p));
624 picked.push(p);
625 }
626 // Safety net only: if the catalog were ever too small to yield
627 // HOME_COUNT distinct styles, fill the rest (still preferring unused
628 // styles first so a repeat is the genuine last resort).
629 if (picked.length < HOME_COUNT) {
630 for (const p of shuffled) {
631 if (picked.length >= HOME_COUNT) break;
632 if (!picked.includes(p)) picked.push(p);
633 }
634 }
635 return picked;
636}
637
638// Reorder an already-shuffled list so no two ADJACENT pairs share a style
639// (e.g. two charcoals never sit next to each other in the gallery). Greedy
640// "most-frequent remaining style first, never equal to the previous one" —
641// the classic no-two-adjacent reorder, which always succeeds when feasible
642// (i.e. when no single style is more than half the list, which holds here).
643// Ties are broken by the incoming shuffle order, so the result still varies
644// with the daily seed. If a style is ever unavoidably over-represented, the
645// only forced adjacencies happen at the very end.
646function spaceOutStyles(shuffled: TransformPair[]): TransformPair[] {
647 const remaining = shuffled.slice();
648 const result: TransformPair[] = [];
649 let prevStyle: string | null = null;
650
651 while (remaining.length > 0) {
652 const counts = new Map<string, number>();
653 for (const p of remaining) {
654 counts.set(styleKey(p), (counts.get(styleKey(p)) ?? 0) + 1);
655 }
656 // Among pairs whose style differs from the previous one, take the pair
657 // belonging to the most-common remaining style (earliest in shuffle
658 // order on a tie). Picking the scarcest-to-place style first is what
659 // prevents painting ourselves into a forced adjacency later.
660 let bestIdx = -1;
661 let bestCount = -1;
662 for (let i = 0; i < remaining.length; i++) {
663 const style = styleKey(remaining[i]);
664 if (style === prevStyle) continue;
665 const count = counts.get(style)!;
666 if (count > bestCount) {
667 bestCount = count;
668 bestIdx = i;
669 }
670 }
671 // Only the previous style remains — forced to repeat it (rare/last item).
672 if (bestIdx === -1) bestIdx = 0;
673
674 const [chosen] = remaining.splice(bestIdx, 1);
675 result.push(chosen);
676 prevStyle = styleKey(chosen);
677 }
678 return result;
679}
680
681export type RotatedPairs = { home: TransformPair[]; gallery: TransformPair[] };
682
683/**
684 * Split every active commission into a home trio + the gallery remainder
685 * for a given integer seed. Deterministic: the same seed always produces
686 * the same split, so the gallery never shows a pair the home page is
687 * currently featuring. Each list is renumbered 01, 02, 03… for its own
688 * "№" labels.
689 */
690export function rotatedPairs(seed: number): RotatedPairs {
691 const shuffled = seededShuffle(ACTIVE_PAIRS, seed);
692 const home = pickHomeTrio(shuffled);
693 const homeNames = new Set(home.map((p) => p.name));
694 // Gallery = the shuffle remainder, then de-clustered so two same-style
695 // pairs never land next to each other.
696 const gallery = spaceOutStyles(shuffled.filter((p) => !homeNames.has(p.name)));
697 const number = (p: TransformPair, i: number): TransformPair => ({
698 ...p,
699 n: String(i + 1).padStart(2, '0'),
700 });
701 return { home: home.map(number), gallery: gallery.map(number) };
702}
703
704// Seconds per rotation step. Also the ISR `revalidate` window set on the
705// home and gallery pages — keep them in sync (currently one day). NOTE:
706// Next requires `revalidate` to be a literal, so the pages hard-code
707// 86400; if you change this, change those too.
708export const ROTATION_PERIOD_SECONDS = 86400;
709
710/** The current rotation seed, advancing once per ROTATION_PERIOD_SECONDS. */
711export function currentRotationSeed(): number {
712 return Math.floor(Date.now() / 1000 / ROTATION_PERIOD_SECONDS);
713}