All projects
Component3d

Room

Visit live
0 views 0 copiesFree

Sign in to take this project

Sign in to copy the source, prompt and SKILL.md.

DetailsPublished
Version
v1.0
Motion
Micro interaction
Updated
Nov 25, 2026
room.html
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 <title>Zestwell — Citrus Season</title>
7
8 <!-- Google Fonts: Oswald, Newsreader & DM Mono -->
9 <link rel="preconnect" href="https://fonts.googleapis.com" />
10 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11 <link
12 href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400..500;1,6..72,400&family=Oswald:wght@500;600&display=swap"
13 rel="stylesheet"
14 />
15
16 <!-- Import Map for Three.js -->
17 <script type="importmap">
18 {
19 "imports": {
20 "three": "https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js"
21 }
22 }
23 </script>
24
25 <style>
26 :root {
27 --wall: #FFF9EC;
28 --floor: #F8E7D2;
29 --ink: #3A3550;
30 --ink-60: rgba(58, 53, 80, 0.6);
31 --ink-35: rgba(58, 53, 80, 0.35);
32 --ink-15: rgba(58, 53, 80, 0.15);
33 --lemon: #FBE46D;
34 --blush: #F7D2D1;
35 --chip-on: #FCEB93;
36 --drawer: #F9E3DF;
37 --page: #FFF9EF;
38
39 --font-display: 'Oswald', 'Arial Narrow', sans-serif;
40 --font-serif: 'Newsreader', Georgia, serif;
41 --font-mono: 'DM Mono', ui-monospace, monospace;
42
43 --u: min(calc(100vw / 1440), calc(100vh / 900));
44 --w: calc(100vw / 1440);
45 }
46
47 *, *::before, *::after {
48 box-sizing: border-box;
49 }
50
51 html, body {
52 height: 100%;
53 width: 100%;
54 margin: 0;
55 padding: 0;
56 overflow: hidden;
57 background: var(--wall);
58 color: var(--ink);
59 -webkit-font-smoothing: antialiased;
60 -moz-osx-font-smoothing: grayscale;
61 }
62
63 button {
64 background: none;
65 border: none;
66 padding: 0;
67 font: inherit;
68 color: inherit;
69 cursor: pointer;
70 }
71
72 a {
73 text-decoration: none;
74 color: inherit;
75 }
76
77 /* ================= 1. TOP NAVIGATION ================= */
78 header.nav {
79 position: fixed;
80 top: 0;
81 left: 0;
82 width: 100%;
83 height: calc(58 * var(--u));
84 padding: 0 calc(27 * var(--u));
85 display: flex;
86 align-items: center;
87 z-index: 30;
88 background: transparent;
89 border-bottom: 1px solid transparent;
90 transition: background 0.3s ease, border-color 0.3s ease;
91 }
92
93 header.nav.is-solid {
94 background: var(--page);
95 border-bottom-color: var(--ink-15);
96 }
97
98 .nav-logo {
99 font-family: var(--font-serif);
100 font-weight: 500;
101 font-size: calc(21 * var(--u));
102 letter-spacing: -0.01em;
103 margin-right: calc(36 * var(--u));
104 min-height: 24px;
105 display: inline-flex;
106 align-items: center;
107 }
108
109 .nav-links {
110 display: flex;
111 align-items: center;
112 gap: calc(22 * var(--u));
113 }
114
115 .nav-links button,
116 .nav-links a {
117 font-family: var(--font-serif);
118 font-size: max(11px, calc(13.5 * var(--u)));
119 opacity: 0.85;
120 min-height: 24px;
121 display: inline-flex;
122 align-items: center;
123 transition: opacity 0.2s ease;
124 }
125
126 .nav-links button:hover,
127 .nav-links a:hover {
128 opacity: 1;
129 }
130
131 .nav-right {
132 margin-left: auto;
133 display: flex;
134 align-items: center;
135 gap: calc(14 * var(--u));
136 }
137
138 .search-pill {
139 width: calc(159 * var(--u));
140 height: max(24px, calc(27 * var(--u)));
141 border: 1px solid var(--ink-35);
142 border-radius: 99px;
143 padding: 0 calc(6 * var(--u)) 0 calc(11 * var(--u));
144 display: flex;
145 align-items: center;
146 justify-content: space-between;
147 transition: border-color 0.2s;
148 }
149
150 .search-pill:hover {
151 border-color: var(--ink);
152 }
153
154 .search-placeholder {
155 font-family: var(--font-serif);
156 font-size: max(11px, calc(12 * var(--u)));
157 color: var(--ink-60);
158 }
159
160 .search-icons {
161 display: inline-flex;
162 align-items: center;
163 gap: calc(5 * var(--u));
164 }
165
166 .search-icons svg {
167 width: calc(12 * var(--u));
168 height: calc(12 * var(--u));
169 color: var(--ink-60);
170 }
171
172 .search-kbd {
173 font-family: var(--font-mono);
174 font-size: max(11px, calc(9 * var(--u)));
175 border: 1px solid var(--ink-15);
176 border-radius: 4px;
177 padding: 0 calc(4 * var(--u));
178 color: var(--ink-35);
179 line-height: 1.35;
180 }
181
182 .currency-pill {
183 height: max(24px, calc(27 * var(--u)));
184 padding: 0 calc(10 * var(--u));
185 border: 1px solid var(--ink-35);
186 border-radius: 99px;
187 font-family: var(--font-mono);
188 font-size: max(11px, calc(10.5 * var(--u)));
189 display: inline-flex;
190 align-items: center;
191 gap: 5px;
192 }
193
194 .nav-icon-btn {
195 width: max(24px, calc(26 * var(--u)));
196 height: max(24px, calc(26 * var(--u)));
197 display: grid;
198 place-items: center;
199 position: relative;
200 border-radius: 99px;
201 }
202
203 .nav-icon-btn svg {
204 width: calc(18 * var(--u));
205 height: calc(18 * var(--u));
206 stroke: currentColor;
207 stroke-width: 1.6;
208 fill: none;
209 }
210
211 .bag-badge {
212 position: absolute;
213 top: -2px;
214 right: -3px;
215 min-width: 16px;
216 height: 16px;
217 padding: 0 4px;
218 border-radius: 99px;
219 background: var(--ink);
220 color: var(--wall);
221 font-family: var(--font-mono);
222 font-size: 11px;
223 display: none;
224 place-items: center;
225 line-height: 1;
226 }
227
228 .bag-badge.has-items {
229 display: grid;
230 }
231
232 /* ================= 2. 3D GALLERY CANVAS ================= */
233 main#gallery {
234 position: fixed;
235 inset: 0;
236 touch-action: none;
237 cursor: grab;
238 z-index: 1;
239 }
240
241 main#gallery.is-dragging {
242 cursor: grabbing;
243 }
244
245 main#gallery.is-hovering {
246 cursor: pointer;
247 }
248
249 main#gallery canvas {
250 width: 100%;
251 height: 100%;
252 display: block;
253 transition: opacity 0.3s ease;
254 }
255
256 #veil {
257 position: fixed;
258 inset: 0;
259 background: var(--wall);
260 z-index: 25;
261 pointer-events: none;
262 opacity: 1;
263 }
264
265 /* ================= 3. GALLERY UI OVERLAY ================= */
266 .gui {
267 position: fixed;
268 inset: 0;
269 z-index: 20;
270 pointer-events: none;
271 transition: opacity 0.3s ease, visibility 0.3s ease;
272 }
273
274 .gui.is-hidden {
275 opacity: 0;
276 visibility: hidden;
277 }
278
279 .gui-arrows,
280 .gui-hint,
281 .gui-toggle,
282 .gui-caption {
283 pointer-events: auto;
284 }
285
286 .mask-line {
287 display: block;
288 overflow: hidden;
289 }
290
291 .mask-inner {
292 display: block;
293 }
294
295 .gui-arrows {
296 position: absolute;
297 left: calc(27 * var(--u));
298 top: calc(262 * var(--u));
299 display: flex;
300 flex-direction: column;
301 gap: calc(10 * var(--u));
302 }
303
304 .arrow-btn {
305 width: calc(50 * var(--u));
306 height: calc(50 * var(--u));
307 border-radius: 50%;
308 border: 1.5px solid var(--ink);
309 display: grid;
310 place-items: center;
311 color: var(--ink);
312 background: transparent;
313 transition: background 0.25s ease, color 0.25s ease;
314 }
315
316 .arrow-btn:hover {
317 background: var(--ink);
318 color: var(--wall);
319 }
320
321 .arrow-btn svg {
322 width: calc(20 * var(--u));
323 height: calc(20 * var(--u));
324 stroke: currentColor;
325 stroke-width: 1.5;
326 fill: none;
327 }
328
329 .gui-hint {
330 position: absolute;
331 right: calc(27 * var(--u));
332 bottom: calc(229 * var(--u));
333 text-align: right;
334 font-family: var(--font-mono);
335 font-size: max(11px, calc(10 * var(--u)));
336 letter-spacing: 0.12em;
337 line-height: 1.65;
338 text-transform: uppercase;
339 }
340
341 .gui-toggle {
342 position: absolute;
343 right: calc(29 * var(--u));
344 bottom: calc(174 * var(--u));
345 border: 1px solid var(--ink-35);
346 border-radius: 99px;
347 padding: calc(2 * var(--u));
348 display: flex;
349 gap: calc(2 * var(--u));
350 background: rgba(255, 249, 236, 0.72);
351 backdrop-filter: blur(4px);
352 }
353
354 .toggle-btn {
355 height: max(24px, calc(22 * var(--u)));
356 padding: 0 calc(14 * var(--u));
357 border-radius: 99px;
358 font-family: var(--font-mono);
359 font-size: max(11px, calc(9.5 * var(--u)));
360 letter-spacing: 0.12em;
361 text-transform: uppercase;
362 transition: background 0.2s ease, color 0.2s ease;
363 }
364
365 .toggle-btn.is-active {
366 background: var(--ink);
367 color: var(--wall);
368 }
369
370 .gui-caption {
371 position: absolute;
372 left: calc(25 * var(--u));
373 bottom: calc(30 * var(--u));
374 }
375
376 .caption-kicker {
377 font-family: var(--font-mono);
378 font-size: max(11px, calc(11.5 * var(--u)));
379 letter-spacing: 0.14em;
380 width: max-content;
381 margin: 0 0 calc(10 * var(--u)) calc(3 * var(--u));
382 text-transform: uppercase;
383 }
384
385 .caption-title {
386 font-family: var(--font-display);
387 font-weight: 600;
388 font-size: calc(170 * var(--u));
389 line-height: 0.82;
390 letter-spacing: 0.005em;
391 white-space: nowrap;
392 transform: scaleX(0.855);
393 transform-origin: bottom left;
394 margin: 0;
395 text-transform: uppercase;
396 }
397
398 .cta-enter {
399 position: absolute;
400 left: calc(946 * var(--u));
401 bottom: 0;
402 font-family: var(--font-mono);
403 font-size: max(11px, calc(11 * var(--u)));
404 letter-spacing: 0.12em;
405 border-bottom: 1px solid var(--ink);
406 padding-bottom: calc(2 * var(--u));
407 margin-bottom: calc(9 * var(--u));
408 white-space: nowrap;
409 min-height: 24px;
410 display: inline-flex;
411 align-items: flex-end;
412 text-transform: uppercase;
413 }
414
415 /* ================= 4. FLOATING "OPEN THE PRINT" PILL ================= */
416 #open-pill {
417 position: fixed;
418 top: 0;
419 left: 0;
420 z-index: 22;
421 pointer-events: none;
422 background: #1e1b2b;
423 color: #ffffff;
424 font-family: var(--font-mono);
425 font-size: max(11px, calc(10 * var(--u)));
426 letter-spacing: 0.14em;
427 padding: calc(7 * var(--u)) calc(13 * var(--u));
428 border-radius: 99px;
429 opacity: 0;
430 transform: translate(-50%, -50%);
431 transition: opacity 0.12s ease;
432 white-space: nowrap;
433 text-transform: uppercase;
434 }
435
436 #open-pill.is-visible {
437 opacity: 1;
438 }
439
440 /* ================= 5. PRINT PRODUCT PAGE ================= */
441 section#page {
442 position: fixed;
443 inset: 0;
444 z-index: 15;
445 background: var(--page);
446 overflow-y: auto;
447 overflow-x: hidden;
448 opacity: 0;
449 visibility: hidden;
450 pointer-events: none;
451 transition: opacity 0.3s ease, visibility 0.3s ease;
452 }
453
454 section#page.is-open {
455 opacity: 1;
456 visibility: visible;
457 pointer-events: auto;
458 }
459
460 .page-grid {
461 padding-top: calc(96 * var(--w));
462 display: grid;
463 grid-template-columns: calc(712 * var(--w)) calc(638 * var(--w));
464 align-items: start;
465 }
466
467 .page-left {
468 position: sticky;
469 top: calc(96 * var(--w));
470 padding-left: calc(184 * var(--w));
471 width: calc(544 * var(--w));
472 }
473
474 #page-art {
475 width: calc(360 * var(--w));
476 aspect-ratio: 3 / 4.08;
477 background-color: #f3ead8;
478 box-shadow:
479 0 0 0 calc(10 * var(--w)) #F6EAD8,
480 0 calc(2 * var(--w)) calc(10 * var(--w)) calc(10 * var(--w)) rgba(58, 53, 80, 0.06);
481 opacity: 0;
482 }
483
484 #page-art.is-ready {
485 opacity: 1;
486 }
487
488 .page-meta {
489 width: calc(360 * var(--w));
490 margin-top: calc(34 * var(--w));
491 display: flex;
492 align-items: center;
493 justify-content: space-between;
494 font-family: var(--font-mono);
495 font-size: max(11px, calc(11 * var(--w)));
496 opacity: 0;
497 transition: opacity 0.15s ease;
498 }
499
500 .meta-room {
501 display: inline-flex;
502 align-items: center;
503 gap: calc(7 * var(--w));
504 }
505
506 .page-meta svg {
507 width: calc(17 * var(--w));
508 height: calc(17 * var(--w));
509 stroke: currentColor;
510 stroke-width: 1.5;
511 fill: none;
512 }
513
514 .page-right {
515 opacity: 0;
516 transition: opacity 0.15s ease;
517 }
518
519 .page-meta.is-revealed,
520 .page-right.is-revealed,
521 .collection-band.is-revealed {
522 opacity: 1;
523 }
524
525 .p-title {
526 font-family: var(--font-display);
527 font-weight: 600;
528 font-size: calc(46 * var(--w));
529 text-transform: uppercase;
530 line-height: 1;
531 margin: 0;
532 }
533
534 .p-artist {
535 font-family: var(--font-serif);
536 font-style: italic;
537 font-size: max(11px, calc(19 * var(--w)));
538 margin: calc(6 * var(--w)) 0 calc(18 * var(--w));
539 }
540
541 .p-desc {
542 font-family: var(--font-serif);
543 font-size: max(11px, calc(14.5 * var(--w)));
544 line-height: 1.55;
545 color: var(--ink-60);
546 max-width: calc(560 * var(--w));
547 margin: 0 0 calc(20 * var(--w));
548 }
549
550 .p-price {
551 font-family: var(--font-mono);
552 font-size: max(11px, calc(15 * var(--w)));
553 }
554
555 .p-tax {
556 font-family: var(--font-mono);
557 font-size: max(11px, calc(10 * var(--w)));
558 color: var(--ink-60);
559 margin: calc(24 * var(--w)) 0 calc(24 * var(--w));
560 }
561
562 .opt-group {
563 margin-bottom: calc(21 * var(--w));
564 }
565
566 .opt-label {
567 font-family: var(--font-mono);
568 font-size: max(11px, calc(10 * var(--w)));
569 text-transform: uppercase;
570 letter-spacing: 0.1em;
571 margin-bottom: calc(8 * var(--w));
572 }
573
574 .opt-val {
575 color: var(--ink-60);
576 text-transform: none;
577 letter-spacing: 0;
578 }
579
580 .chip-row {
581 display: flex;
582 flex-wrap: wrap;
583 gap: calc(13 * var(--w));
584 }
585
586 .chip {
587 height: max(28px, calc(32 * var(--w)));
588 padding: 0 calc(14 * var(--w));
589 border: 1px solid var(--ink-35);
590 font-family: var(--font-mono);
591 font-size: max(11px, calc(10.5 * var(--w)));
592 display: inline-flex;
593 align-items: center;
594 justify-content: center;
595 transition: background 0.15s ease, border-color 0.15s ease;
596 }
597
598 .chip.is-on {
599 background: var(--chip-on);
600 border-color: var(--ink);
601 }
602
603 .frame-chip {
604 width: calc(121 * var(--w));
605 height: calc(126 * var(--w));
606 border: 1px solid var(--ink-15);
607 background: rgba(255, 255, 255, 0.35);
608 display: flex;
609 flex-direction: column;
610 align-items: center;
611 justify-content: center;
612 gap: calc(10 * var(--w));
613 padding: calc(8 * var(--w));
614 font-family: var(--font-mono);
615 font-size: max(11px, calc(10 * var(--w)));
616 transition: background 0.15s ease, border-color 0.15s ease;
617 }
618
619 .frame-chip.is-on {
620 background: var(--chip-on);
621 border-color: var(--ink);
622 }
623
624 .frame-thumb {
625 width: calc(38 * var(--w));
626 aspect-ratio: 3 / 4.08;
627 background-color: #eee2ce;
628 }
629
630 .frame-thumb.is-classic {
631 box-shadow: 0 0 0 calc(4 * var(--w)) #C99A63;
632 }
633
634 .frame-thumb.is-canvas {
635 box-shadow: 0 0 0 calc(5 * var(--w)) #1d1b24;
636 }
637
638 .buy-row {
639 margin-top: calc(42 * var(--w));
640 display: flex;
641 gap: calc(26 * var(--w));
642 }
643
644 .qty-stepper {
645 width: calc(100 * var(--w));
646 height: calc(50 * var(--w));
647 border: 1px solid var(--ink-35);
648 display: flex;
649 align-items: center;
650 justify-content: space-between;
651 padding: 0 calc(10 * var(--w));
652 font-family: var(--font-mono);
653 font-size: max(11px, calc(13 * var(--w)));
654 }
655
656 .qty-stepper button {
657 min-width: 24px;
658 min-height: 24px;
659 display: grid;
660 place-items: center;
661 }
662
663 .btn-add-bag {
664 flex: 1;
665 height: calc(50 * var(--w));
666 background: var(--ink);
667 color: #ffffff;
668 font-family: var(--font-display);
669 font-weight: 500;
670 font-size: max(11px, calc(16 * var(--w)));
671 letter-spacing: 0.12em;
672 text-transform: uppercase;
673 transition: background 0.2s ease;
674 }
675
676 .btn-add-bag:hover {
677 background: #2a2640;
678 }
679
680 .accordions {
681 margin-top: calc(36 * var(--w));
682 border-top: 1px solid var(--ink-35);
683 }
684
685 .acc-item {
686 border-bottom: 1px solid var(--ink-35);
687 }
688
689 .acc-trigger {
690 width: 100%;
691 height: max(32px, calc(40 * var(--w)));
692 display: flex;
693 align-items: center;
694 justify-content: space-between;
695 font-family: var(--font-serif);
696 font-size: max(11px, calc(15 * var(--w)));
697 text-align: left;
698 }
699
700 .acc-plus {
701 font-family: var(--font-mono);
702 font-size: max(13px, calc(16 * var(--w)));
703 transition: transform 0.3s ease;
704 display: inline-block;
705 }
706
707 .acc-item.is-open .acc-plus {
708 transform: rotate(45deg);
709 }
710
711 .acc-panel {
712 height: 0;
713 overflow: hidden;
714 transition: height 0.3s ease;
715 }
716
717 .acc-body {
718 padding-bottom: calc(16 * var(--w));
719 font-family: var(--font-serif);
720 font-size: max(11px, calc(13.5 * var(--w)));
721 line-height: 1.55;
722 color: var(--ink-60);
723 }
724
725 /* Collection Band */
726 .collection-band {
727 margin-top: calc(70 * var(--w));
728 background: #FBF3E4;
729 padding: calc(36 * var(--w)) 0 calc(80 * var(--w)) calc(48 * var(--w));
730 opacity: 0;
731 transition: opacity 0.15s ease;
732 }
733
734 .band-title {
735 font-family: var(--font-display);
736 font-weight: 600;
737 font-size: calc(38 * var(--w));
738 margin: 0 0 calc(28 * var(--w)) calc(-15 * var(--w));
739 text-transform: uppercase;
740 line-height: 1;
741 }
742
743 .band-cards {
744 display: flex;
745 gap: calc(87 * var(--w));
746 }
747
748 .print-card {
749 width: calc(168 * var(--w));
750 cursor: pointer;
751 }
752
753 .card-art {
754 width: 100%;
755 aspect-ratio: 3 / 4;
756 background-color: #f3ead8;
757 box-shadow: 0 0 0 calc(7 * var(--w)) #F6EAD8;
758 transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
759 }
760
761 .print-card:hover .card-art {
762 transform: translateY(calc(-4 * var(--w)));
763 }
764
765 .card-title {
766 font-family: var(--font-serif);
767 font-weight: 500;
768 font-size: max(11px, calc(14 * var(--w)));
769 margin-top: calc(14 * var(--w));
770 }
771
772 .card-artist {
773 font-family: var(--font-serif);
774 font-style: italic;
775 font-size: max(11px, calc(13.5 * var(--w)));
776 color: var(--ink-60);
777 margin-top: calc(2 * var(--w));
778 }
779
780 .card-price {
781 font-family: var(--font-mono);
782 font-size: max(11px, calc(11 * var(--w)));
783 margin-top: calc(4 * var(--w));
784 }
785
786 /* ================= 6. LIST VIEW ================= */
787 section#list {
788 position: fixed;
789 inset: 0;
790 z-index: 14;
791 background: var(--page);
792 overflow-y: auto;
793 padding: calc(110 * var(--w)) calc(48 * var(--w)) calc(80 * var(--w));
794 opacity: 0;
795 visibility: hidden;
796 pointer-events: none;
797 transition: opacity 0.3s ease, visibility 0.3s ease;
798 }
799
800 section#list.is-open {
801 opacity: 1;
802 visibility: visible;
803 pointer-events: auto;
804 }
805
806 .list-title {
807 font-family: var(--font-display);
808 font-weight: 600;
809 font-size: calc(38 * var(--w));
810 text-transform: uppercase;
811 margin: 0 0 calc(36 * var(--w));
812 line-height: 1;
813 }
814
815 .list-grid {
816 display: flex;
817 flex-wrap: wrap;
818 gap: calc(46 * var(--w)) calc(56 * var(--w));
819 }
820
821 /* ================= 7. BAG DRAWER ================= */
822 #drawer-backdrop {
823 position: fixed;
824 inset: 0;
825 z-index: 39;
826 background: rgba(58, 53, 80, 0.24);
827 opacity: 0;
828 pointer-events: none;
829 transition: opacity 0.3s ease;
830 }
831
832 #drawer-backdrop.is-open {
833 opacity: 1;
834 pointer-events: auto;
835 }
836
837 aside.drawer {
838 position: fixed;
839 top: 0;
840 right: 0;
841 bottom: 0;
842 width: calc(387 * var(--w));
843 z-index: 40;
844 background: var(--drawer);
845 padding: calc(28 * var(--w)) calc(28 * var(--w)) calc(28 * var(--w)) calc(32 * var(--w));
846 display: flex;
847 flex-direction: column;
848 transform: translateX(101%);
849 transition: transform 0.45s cubic-bezier(0.1, 0.85, 0.2, 1);
850 }
851
852 aside.drawer.is-open {
853 transform: translateX(0);
854 }
855
856 .drawer-head {
857 display: flex;
858 align-items: center;
859 justify-content: space-between;
860 margin-bottom: calc(24 * var(--w));
861 }
862
863 .drawer-title {
864 font-family: var(--font-display);
865 font-weight: 600;
866 font-size: calc(26 * var(--w));
867 margin: 0;
868 text-transform: uppercase;
869 line-height: 1;
870 }
871
872 .drawer-close {
873 min-width: 28px;
874 min-height: 28px;
875 font-size: 24px;
876 line-height: 1;
877 display: grid;
878 place-items: center;
879 }
880
881 .drawer-items {
882 flex: 1;
883 overflow-y: auto;
884 display: flex;
885 flex-direction: column;
886 gap: calc(20 * var(--w));
887 padding-right: 4px;
888 }
889
890 .drawer-empty {
891 font-family: var(--font-mono);
892 font-size: max(11px, calc(12 * var(--w)));
893 text-align: center;
894 margin-top: calc(120 * var(--w));
895 color: var(--ink-60);
896 letter-spacing: 0.08em;
897 }
898
899 .bag-row {
900 display: flex;
901 gap: calc(14 * var(--w));
902 align-items: flex-start;
903 transition: opacity 0.35s ease, transform 0.35s ease;
904 }
905
906 .bag-row.is-entering {
907 opacity: 0;
908 transform: translateY(calc(6 * var(--w)));
909 }
910
911 .bag-thumb {
912 width: calc(66 * var(--w));
913 aspect-ratio: 3 / 4;
914 flex-shrink: 0;
915 background-color: #f3ead8;
916 }
917
918 .bag-info {
919 flex: 1;
920 min-width: 0;
921 }
922
923 .bag-title {
924 font-family: var(--font-serif);
925 font-weight: 500;
926 font-size: max(11px, calc(14 * var(--w)));
927 }
928
929 .bag-artist {
930 font-family: var(--font-serif);
931 font-style: italic;
932 font-size: max(11px, calc(13 * var(--w)));
933 color: var(--ink-60);
934 }
935
936 .bag-meta {
937 font-family: var(--font-mono);
938 font-size: max(11px, calc(11 * var(--w)));
939 color: var(--ink-60);
940 margin-top: calc(4 * var(--w));
941 }
942
943 .bag-controls {
944 display: flex;
945 align-items: center;
946 justify-content: space-between;
947 margin-top: calc(10 * var(--w));
948 }
949
950 .mini-qty {
951 display: inline-flex;
952 align-items: center;
953 border: 1px solid var(--ink-35);
954 font-family: var(--font-mono);
955 font-size: max(11px, calc(11 * var(--w)));
956 }
957
958 .mini-qty button {
959 min-width: max(24px, calc(24 * var(--w)));
960 min-height: max(24px, calc(24 * var(--w)));
961 display: grid;
962 place-items: center;
963 }
964
965 .mini-qty span {
966 padding: 0 6px;
967 }
968
969 .btn-trash {
970 min-width: 24px;
971 min-height: 24px;
972 display: grid;
973 place-items: center;
974 color: var(--ink-60);
975 }
976
977 .btn-trash:hover {
978 color: var(--ink);
979 }
980
981 .drawer-footer {
982 border-top: 1px solid var(--ink-35);
983 padding-top: calc(18 * var(--w));
984 margin-top: calc(14 * var(--w));
985 }
986
987 .subtotal-row {
988 display: flex;
989 justify-content: space-between;
990 font-family: var(--font-mono);
991 font-size: max(11px, calc(13 * var(--w)));
992 margin-bottom: calc(16 * var(--w));
993 }
994
995 .btn-checkout {
996 width: 100%;
997 height: calc(50 * var(--w));
998 background: var(--ink);
999 color: #ffffff;
1000 font-family: var(--font-display);
1001 font-weight: 500;
1002 font-size: max(11px, calc(17 * var(--w)));
1003 letter-spacing: 0.1em;
1004 text-transform: uppercase;
1005 }
1006
1007 .btn-checkout:hover {
1008 background: #2a2640;
1009 }
1010
1011 /* Flyer Element */
1012 .flyer {
1013 position: fixed;
1014 top: 0;
1015 left: 0;
1016 z-index: 35;
1017 pointer-events: none;
1018 transform-origin: top left;
1019 box-shadow: 0 0 0 8px #F6EAD8;
1020 }
1021
1022 /* Subtle Toast Banner (for non-intrusive feedback without alert()) */
1023 #toast {
1024 position: fixed;
1025 bottom: 24px;
1026 left: 50%;
1027 transform: translate(-50%, 16px);
1028 background: var(--ink);
1029 color: var(--wall);
1030 font-family: var(--font-mono);
1031 font-size: 11px;
1032 letter-spacing: 0.1em;
1033 padding: 10px 18px;
1034 border-radius: 99px;
1035 z-index: 50;
1036 opacity: 0;
1037 pointer-events: none;
1038 transition: opacity 0.25s ease, transform 0.25s ease;
1039 }
1040
1041 #toast.is-shown {
1042 opacity: 1;
1043 transform: translate(-50%, 0);
1044 }
1045
1046 /* ================= DESKTOP-WIDTH PORTRAIT OVERRIDE ================= */
1047 @media (min-width: 820px) and (max-aspect-ratio: 1/1) {
1048 .caption-title {
1049 font-size: calc(150 * var(--u));
1050 }
1051 }
1052
1053 /* ================= 9. SMALL-SCREEN LAYOUT ================= */
1054 @media (max-width: 819px),
1055 (orientation: portrait) and (max-width: 1100px),
1056 (orientation: landscape) and (max-height: 500px) {
1057 :root {
1058 --u: 1px;
1059 --w: 1px;
1060 }
1061
1062 header.nav {
1063 height: 52px;
1064 padding: 0 16px;
1065 }
1066
1067 .nav-logo {
1068 font-size: 19px;
1069 margin-right: 0;
1070 }
1071
1072 .nav-links,
1073 .search-pill,
1074 .currency-pill,
1075 .nav-hide-sm {
1076 display: none !important;
1077 }
1078
1079 #btn-bag {
1080 width: 32px;
1081 height: 32px;
1082 }
1083
1084 #btn-bag svg {
1085 width: 20px;
1086 height: 20px;
1087 }
1088
1089 .gui-hint {
1090 top: 62px;
1091 bottom: auto;
1092 left: 16px;
1093 right: 16px;
1094 text-align: left;
1095 font-size: 11px;
1096 }
1097
1098 .gui-caption {
1099 left: 14px;
1100 bottom: 100px;
1101 }
1102
1103 .caption-kicker {
1104 font-size: 11px;
1105 }
1106
1107 .caption-title {
1108 font-size: min(23.5vw, 19vh);
1109 white-space: normal;
1110 line-height: 0.84;
1111 transform: none;
1112 max-width: 6ch;
1113 }
1114
1115 .cta-enter {
1116 position: static;
1117 display: inline-flex;
1118 margin-top: 12px;
1119 margin-bottom: 0;
1120 font-size: 11px;
1121 }
1122
1123 .gui-arrows {
1124 top: auto;
1125 left: 16px;
1126 bottom: 24px;
1127 flex-direction: row;
1128 gap: 10px;
1129 }
1130
1131 .arrow-btn {
1132 width: 44px;
1133 height: 44px;
1134 }
1135
1136 .arrow-btn svg {
1137 width: 18px;
1138 height: 18px;
1139 }
1140
1141 .gui-toggle {
1142 right: 16px;
1143 bottom: 30px;
1144 }
1145
1146 .toggle-btn {
1147 height: 26px;
1148 }
1149
1150 /* Print Page Small Screen */
1151 section#page {
1152 padding-top: 64px;
1153 }
1154
1155 .page-grid {
1156 padding-top: 0;
1157 grid-template-columns: 1fr;
1158 max-width: 680px;
1159 margin: 0 auto;
1160 padding-left: 20px;
1161 padding-right: 20px;
1162 }
1163
1164 .page-left {
1165 position: static;
1166 padding-left: 0;
1167 width: 100%;
1168 margin-bottom: 28px;
1169 }
1170
1171 #page-art {
1172 width: 100%;
1173 max-width: 420px;
1174 margin: 0 auto;
1175 box-shadow:
1176 0 0 0 8px #F6EAD8,
1177 0 2px 10px 10px rgba(58, 53, 80, 0.06);
1178 }
1179
1180 .page-meta {
1181 width: 100%;
1182 max-width: 420px;
1183 margin: 22px auto 0;
1184 }
1185
1186 .p-title {
1187 font-size: 36px;
1188 }
1189
1190 .p-artist {
1191 font-size: 18px;
1192 }
1193
1194 .p-desc {
1195 font-size: 14.5px;
1196 }
1197
1198 .chip-row {
1199 gap: 8px;
1200 }
1201
1202 .chip {
1203 height: 36px;
1204 font-size: 11px;
1205 padding: 0 12px;
1206 }
1207
1208 .frame-chip {
1209 width: min(calc((100vw - 60px) / 3), 190px);
1210 height: 118px;
1211 }
1212
1213 .buy-row {
1214 gap: 14px;
1215 }
1216
1217 .qty-stepper {
1218 width: 100px;
1219 height: 50px;
1220 }
1221
1222 .btn-add-bag {
1223 height: 50px;
1224 }
1225
1226 .acc-trigger {
1227 height: 46px;
1228 }
1229
1230 .collection-band {
1231 padding: 30px 0 60px max(20px, calc((100vw - 640px) / 2));
1232 }
1233
1234 .band-title {
1235 margin-left: 0;
1236 font-size: 32px;
1237 }
1238
1239 .band-cards {
1240 overflow-x: auto;
1241 scroll-snap-type: x mandatory;
1242 gap: 16px;
1243 padding-right: 20px;
1244 -webkit-overflow-scrolling: touch;
1245 }
1246
1247 .band-cards .print-card {
1248 flex: 0 0 150px;
1249 width: 150px;
1250 scroll-snap-align: start;
1251 }
1252
1253 /* List Small Screen */
1254 section#list {
1255 padding: 80px 20px 60px;
1256 }
1257
1258 .list-title {
1259 font-size: 32px;
1260 margin-bottom: 24px;
1261 }
1262
1263 .list-grid {
1264 display: grid;
1265 grid-template-columns: repeat(2, 1fr);
1266 gap: 28px 16px;
1267 }
1268
1269 .list-grid .print-card {
1270 width: 100%;
1271 }
1272
1273 /* Drawer Small Screen */
1274 aside.drawer {
1275 width: min(88vw, 380px);
1276 padding: 22px 20px;
1277 }
1278 }
1279
1280 /* Landscape Phone Override */
1281 @media (orientation: landscape) and (max-height: 500px) {
1282 .caption-title {
1283 font-size: min(13vw, 26vh);
1284 white-space: nowrap;
1285 max-width: none;
1286 }
1287
1288 .gui-caption {
1289 bottom: 18px;
1290 }
1291
1292 .cta-enter {
1293 margin-top: 8px;
1294 }
1295
1296 .gui-hint {
1297 display: none;
1298 }
1299
1300 .gui-arrows {
1301 left: auto;
1302 right: 16px;
1303 bottom: 18px;
1304 }
1305
1306 .gui-toggle {
1307 top: 60px;
1308 bottom: auto;
1309 right: 16px;
1310 }
1311 }
1312
1313 /* ================= 10. REDUCED MOTION ================= */
1314 @media (prefers-reduced-motion: reduce) {
1315 *, *::before, *::after {
1316 transition-duration: 0.01ms !important;
1317 animation-duration: 0.01ms !important;
1318 }
1319 }
1320 </style>
1321</head>
1322<body>
1323 <!-- 1. TOP NAVIGATION -->
1324 <header class="nav" id="main-nav">
1325 <button class="nav-logo" id="btn-logo" type="button">Zestwell</button>
1326
1327 <nav class="nav-links" aria-label="Primary">
1328 <button type="button" data-action="gallery">Index</button>
1329 <button type="button" data-action="list">Shop</button>
1330 <button type="button" data-action="info">Info</button>
1331 <button type="button" data-action="auctions">Auctions</button>
1332 <button type="button" data-action="help">Help</button>
1333 </nav>
1334
1335 <div class="nav-right">
1336 <button class="search-pill" id="btn-search" type="button" aria-label="Search prints">
1337 <span class="search-placeholder">Search…</span>
1338 <span class="search-icons">
1339 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
1340 <circle cx="11" cy="11" r="7"></circle>
1341 <line x1="16.5" y1="16.5" x2="21" y2="21"></line>
1342 </svg>
1343 <kbd class="search-kbd">⌘K</kbd>
1344 </span>
1345 </button>
1346
1347 <button class="currency-pill" type="button" id="btn-currency">
1348 <span>USD</span>
1349 <svg width="8" height="8" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5">
1350 <polyline points="2,3.5 5,6.5 8,3.5"></polyline>
1351 </svg>
1352 </button>
1353
1354 <button class="nav-icon-btn nav-hide-sm" type="button" aria-label="Account" data-toast="Collector account portal coming soon">
1355 <svg viewBox="0 0 24 24">
1356 <circle cx="12" cy="8" r="4"></circle>
1357 <path d="M4.5 20c1.6-3.8 4.4-5.5 7.5-5.5s5.9 1.7 7.5 5.5"></path>
1358 </svg>
1359 </button>
1360
1361 <button class="nav-icon-btn nav-hide-sm" type="button" aria-label="Saved prints" data-toast="Saved to your studio shortlist">
1362 <svg viewBox="0 0 24 24">
1363 <path d="M12 20.5s-7.5-4.7-9.2-9.2C1.5 8 3.6 4.8 7 4.8c2 0 3.7 1.1 5 2.7 1.3-1.6 3-2.7 5-2.7 3.4 0 5.5 3.2 4.2 6.5-1.7 4.5-9.2 9.2-9.2 9.2z"></path>
1364 </svg>
1365 </button>
1366
1367 <button class="nav-icon-btn" id="btn-bag" type="button" aria-label="Open shopping bag">
1368 <svg viewBox="0 0 24 24">
1369 <path d="M6 7h12l1 13H5L6 7z"></path>
1370 <path d="M9 7V5a3 3 0 0 1 6 0v2"></path>
1371 </svg>
1372 <span class="bag-badge" id="bag-badge">0</span>
1373 </button>
1374 </div>
1375 </header>
1376
1377 <!-- 2. 3D WEBGL GALLERY -->
1378 <main id="gallery">
1379 <div id="veil"></div>
1380 </main>
1381
1382 <!-- 3. GALLERY OVERLAY UI -->
1383 <div class="gui" id="gui">
1384 <div class="gui-arrows">
1385 <button class="arrow-btn" id="btn-prev" type="button" aria-label="Previous print">
1386 <svg viewBox="0 0 24 24">
1387 <line x1="19" y1="12" x2="5" y2="12"></line>
1388 <polyline points="11 6 5 12 11 18"></polyline>
1389 </svg>
1390 </button>
1391 <button class="arrow-btn" id="btn-next" type="button" aria-label="Next print">
1392 <svg viewBox="0 0 24 24">
1393 <line x1="5" y1="12" x2="19" y2="12"></line>
1394 <polyline points="13 6 19 12 13 18"></polyline>
1395 </svg>
1396 </button>
1397 </div>
1398
1399 <div class="gui-hint" id="gui-hint">
1400 <span class="mask-line"><span class="mask-inner" id="hint-1">Scroll or drag to walk round</span></span>
1401 <span class="mask-line"><span class="mask-inner" id="hint-2">Click a painting to look closer</span></span>
1402 </div>
1403
1404 <div class="gui-toggle" role="tablist" aria-label="View mode">
1405 <button class="toggle-btn is-active" id="tog-gallery" type="button">GALLERY</button>
1406 <button class="toggle-btn" id="tog-list" type="button">LIST</button>
1407 </div>
1408
1409 <div class="gui-caption">
1410 <p class="caption-kicker">
1411 <span class="mask-line"><span class="mask-inner">YOU ARE WALKING PAST</span></span>
1412 </p>
1413 <h1 class="caption-title">
1414 <span class="mask-line"><span class="mask-inner">CITRUS SEASON</span></span>
1415 </h1>
1416 <button class="cta-enter" id="btn-enter" type="button">
1417 <span class="mask-line"><span class="mask-inner">ENTER THE COLLECTION →</span></span>
1418 </button>
1419 </div>
1420 </div>
1421
1422 <!-- 4. HOVER PILL -->
1423 <div id="open-pill">OPEN THE PRINT</div>
1424
1425 <!-- 5. PRINT PRODUCT PAGE -->
1426 <section id="page" aria-hidden="true">
1427 <div class="page-grid">
1428 <div class="page-left">
1429 <div id="page-art"></div>
1430 <div class="page-meta" id="page-meta">
1431 <span>1/1</span>
1432 <button class="meta-room" type="button" id="btn-view-room">
1433 <svg viewBox="0 0 24 24">
1434 <polygon points="12 3 20 7.5 20 16.5 12 21 4 16.5 4 7.5 12 3"></polygon>
1435 <polyline points="4 7.5 12 12 20 7.5"></polyline>
1436 <line x1="12" y1="12" x2="12" y2="21"></line>
1437 </svg>
1438 <span>View in room</span>
1439 </button>
1440 <button type="button" aria-label="Bookmark print" data-toast="Bookmarked print">
1441 <svg viewBox="0 0 24 24">
1442 <path d="M6 4h12v17l-6-4-6 4V4z"></path>
1443 </svg>
1444 </button>
1445 </div>
1446 </div>
1447
1448 <div class="page-right" id="page-right">
1449 <h2 class="p-title" id="p-title">LEMONS ON GINGHAM</h2>
1450 <p class="p-artist" id="p-artist">Tova Lindqvist</p>
1451 <p class="p-desc" id="p-desc"></p>
1452 <div class="p-price" id="p-price">$ 60.00</div>
1453 <p class="p-tax">Prices include VAT. Shipping calculated at checkout.</p>
1454
1455 <!-- Option 1: Paper -->
1456 <div class="opt-group" data-opt="paper">
1457 <div class="opt-label">PAPER: <span class="opt-val" id="val-paper">Art Paper</span></div>
1458 <div class="chip-row">
1459 <button type="button" class="chip is-on" data-value="Art Paper">Art Paper</button>
1460 <button type="button" class="chip" data-value="Fine Art Paper">Fine Art Paper</button>
1461 <button type="button" class="chip" data-value="Recycled Paper">Recycled Paper</button>
1462 </div>
1463 </div>
1464
1465 <!-- Option 2: Size -->
1466 <div class="opt-group" data-opt="size">
1467 <div class="opt-label">SIZE: <span class="opt-val" id="val-size">11.7 × 16.5" (A3)</span></div>
1468 <div class="chip-row">
1469 <button type="button" class="chip is-on" data-value='11.7 × 16.5" (A3)'>11.7 × 16.5" (A3)</button>
1470 <button type="button" class="chip" data-value='16.5 × 23.4" (A2)'>16.5 × 23.4" (A2)</button>
1471 <button type="button" class="chip" data-value='23.4 × 33.1" (A1)'>23.4 × 33.1" (A1)</button>
1472 <button type="button" class="chip" data-value='33.1 × 46.8" (A0)'>33.1 × 46.8" (A0)</button>
1473 </div>
1474 </div>
1475
1476 <!-- Option 3: Signature -->
1477 <div class="opt-group" data-opt="signature">
1478 <div class="opt-label">SIGNATURE: <span class="opt-val" id="val-signature">Unsigned</span></div>
1479 <div class="chip-row">
1480 <button type="button" class="chip is-on" data-value="Unsigned">Unsigned</button>
1481 <button type="button" class="chip" data-value="Signed and Numbered">Signed and Numbered</button>
1482 </div>
1483 </div>
1484
1485 <!-- Option 4: Frame -->
1486 <div class="opt-group" data-opt="frame">
1487 <div class="opt-label">FRAME: <span class="opt-val" id="val-frame">Unframed</span></div>
1488 <div class="chip-row">
1489 <button type="button" class="frame-chip is-on" data-value="Unframed">
1490 <span class="frame-thumb" id="fthumb-0"></span>
1491 <span>Unframed</span>
1492 </button>
1493 <button type="button" class="frame-chip" data-value="Classic Frame">
1494 <span class="frame-thumb is-classic" id="fthumb-1"></span>
1495 <span>Classic Frame</span>
1496 </button>
1497 <button type="button" class="frame-chip" data-value="Framed Canvas">
1498 <span class="frame-thumb is-canvas" id="fthumb-2"></span>
1499 <span>Framed Canvas</span>
1500 </button>
1501 </div>
1502 </div>
1503
1504 <!-- Quantity + Add to Bag -->
1505 <div class="buy-row">
1506 <div class="qty-stepper">
1507 <button type="button" id="qty-minus" aria-label="Decrease quantity">−</button>
1508 <span id="qty-val">1</span>
1509 <button type="button" id="qty-plus" aria-label="Increase quantity">+</button>
1510 </div>
1511 <button type="button" class="btn-add-bag" id="btn-add-bag">ADD TO BAG</button>
1512 </div>
1513
1514 <!-- Accordions -->
1515 <div class="accordions">
1516 <div class="acc-item">
1517 <button type="button" class="acc-trigger">
1518 <span>Paper &amp; Sizes</span>
1519 <span class="acc-plus">+</span>
1520 </button>
1521 <div class="acc-panel">
1522 <div class="acc-body">
1523 Art Paper is a smooth 200 gsm matte stock. Fine Art Paper is a 310 gsm cotton rag with a soft texture. Recycled Paper is 100% post-consumer fibre.
1524 </div>
1525 </div>
1526 </div>
1527
1528 <div class="acc-item">
1529 <button type="button" class="acc-trigger">
1530 <span>Delivery Info</span>
1531 <span class="acc-plus">+</span>
1532 </button>
1533 <div class="acc-panel">
1534 <div class="acc-body">
1535 Prints are made to order and ship rolled in a tube within 3–5 working days. Framed pieces ship flat within 7–10 working days.
1536 </div>
1537 </div>
1538 </div>
1539
1540 <div class="acc-item">
1541 <button type="button" class="acc-trigger">
1542 <span>Returns Policy</span>
1543 <span class="acc-plus">+</span>
1544 </button>
1545 <div class="acc-panel">
1546 <div class="acc-body">
1547 Unframed prints can be returned within 30 days in their original tube. Signed editions are final sale.
1548 </div>
1549 </div>
1550 </div>
1551 </div>
1552 </div>
1553 </div>
1554
1555 <!-- Get The Collection Cross-Sell Band -->
1556 <div class="collection-band" id="collection-band">
1557 <h3 class="band-title">GET THE COLLECTION</h3>
1558 <div class="band-cards" id="band-cards"></div>
1559 </div>
1560 </section>
1561
1562 <!-- 6. LIST VIEW -->
1563 <section id="list" aria-hidden="true">
1564 <h2 class="list-title">CITRUS SEASON — ALL PRINTS</h2>
1565 <div class="list-grid" id="list-grid"></div>
1566 </section>
1567
1568 <!-- 7. BAG DRAWER -->
1569 <div id="drawer-backdrop"></div>
1570 <aside class="drawer" id="drawer" aria-label="Shopping bag">
1571 <div class="drawer-head">
1572 <h2 class="drawer-title">YOUR BAG</h2>
1573 <button type="button" class="drawer-close" id="btn-drawer-close" aria-label="Close bag">×</button>
1574 </div>
1575
1576 <div class="drawer-items" id="drawer-items"></div>
1577
1578 <div class="drawer-footer">
1579 <div class="subtotal-row">
1580 <span>Subtotal</span>
1581 <span id="bag-subtotal">$ 0.00</span>
1582 </div>
1583 <button type="button" class="btn-checkout" id="btn-checkout">CHECKOUT →</button>
1584 </div>
1585 </aside>
1586
1587 <div id="toast"></div>
1588
1589 <script type="module">
1590 import * as THREE from 'three';
1591
1592 /* =========================================================================
1593 1. CATALOG & SPRITE SHEET DATA
1594 ========================================================================= */
1595 const SHEET_URL =
1596 'https://images.higgs.ai/?default=1&output=webp&url=https%3A%2F%2Fd8j0ntlcm91z4.cloudfront.net%2Fuser_38xzZboKViGWJOttwIXH07lWA1P%2Fhf_20261120_071134_02d2d6ba-ed91-4c3f-87c4-1354b61b5882.png&w=1744&q=85';
1597
1598 const SHEET_W = 1744;
1599 const SHEET_H = 2336;
1600 const COLS = [
1601 [0, 575],
1602 [585, 1158],
1603 [1168, 1743],
1604 ];
1605 const ROWS = [
1606 [0, 769],
1607 [779, 1545],
1608 [1555, 2335],
1609 ];
1610
1611 const DESC_SUFFIX = ', painted in flat gouache tones. Printed on archival paper with a soft matte finish.';
1612
1613 const PRINTS = [
1614 { id: 0, title: 'Lemons on Gingham', artist: 'Tova Lindqvist', year: 2024, price: 60, desc: 'A sunny tabletop of lemons, a striped jug and blue gingham' + DESC_SUFFIX },
1615 { id: 1, title: 'Oranges & Stripe', artist: 'Elise Marten', year: 2024, price: 60, desc: 'A striped bowl heaped with oranges on a candy-stripe cloth' + DESC_SUFFIX },
1616 { id: 2, title: 'Pink Blooms', artist: 'Soren Vale', year: 2023, price: 55, desc: 'Pink garden flowers in a cobalt striped jug against warm yellow' + DESC_SUFFIX },
1617 { id: 3, title: 'Citrus Jug', artist: 'Nora Feldt', year: 2024, price: 60, desc: 'Leafy lemon branches in a striped jug on a sunlit table' + DESC_SUFFIX },
1618 { id: 4, title: 'Teacup & Lemon', artist: 'Ada Kerrow', year: 2023, price: 50, desc: 'A blue-patterned teacup with a slice of lemon, all morning light' + DESC_SUFFIX },
1619 { id: 5, title: 'Blood Orange Bowl', artist: 'Pim Halden', year: 2024, price: 60, desc: 'Halved blood oranges glowing in a white bowl on deep blue' + DESC_SUFFIX },
1620 { id: 6, title: 'Lemon Tree, Window', artist: 'Ines Morrow', year: 2022, price: 65, desc: 'A potted lemon tree by an open window on a gingham table' + DESC_SUFFIX },
1621 { id: 7, title: 'Grapefruit Halves', artist: 'Juno Basset', year: 2024, price: 55, desc: 'Pink grapefruit halves on a hand-painted checked plate' + DESC_SUFFIX },
1622 { id: 8, title: 'Daisies in Stripes', artist: 'Wren Calloway', year: 2023, price: 55, desc: 'White daisies in a tall striped pitcher against blush pink' + DESC_SUFFIX },
1623 ];
1624
1625 function getCropBox(i) {
1626 const col = i % 3;
1627 const row = Math.floor(i / 3);
1628 const [c0, c1] = COLS[col];
1629 const [r0, r1] = ROWS[row];
1630 return {
1631 x: c0 + 6,
1632 y: r0 + 6,
1633 w: c1 - c0 - 12,
1634 h: r1 - r0 - 12,
1635 };
1636 }
1637
1638 const CROPS = PRINTS.map((_, i) => getCropBox(i));
1639
1640 function applyDomCrop(el, printIndex) {
1641 if (!el) return;
1642 el.dataset.cropIdx = String(printIndex);
1643 const rect = el.getBoundingClientRect();
1644 const W = rect.width || el.offsetWidth || 168;
1645 const H = rect.height || el.offsetHeight || 224;
1646 const { x, y, w, h } = CROPS[printIndex];
1647 const sx = W / w;
1648 const sy = H / h;
1649 el.style.backgroundImage = `url("${SHEET_URL}")`;
1650 el.style.backgroundRepeat = 'no-repeat';
1651 el.style.backgroundSize = `${SHEET_W * sx}px ${SHEET_H * sy}px`;
1652 el.style.backgroundPosition = `${-x * sx}px ${-y * sy}px`;
1653 }
1654
1655 function refreshAllDomCrops() {
1656 document.querySelectorAll('[data-crop-idx]').forEach((el) => {
1657 const idx = Number(el.dataset.cropIdx);
1658 if (!Number.isNaN(idx)) applyDomCrop(el, idx);
1659 });
1660 }
1661
1662 /* =========================================================================
1663 2. MEDIA QUERIES & STATE
1664 ========================================================================= */
1665 const smallMQ = window.matchMedia(
1666 '(max-width: 819px), (orientation: portrait) and (max-width: 1100px), (orientation: landscape) and (max-height: 500px)'
1667 );
1668 const reducedMQ = window.matchMedia('(prefers-reduced-motion: reduce)');
1669
1670 const isSmall = () => smallMQ.matches;
1671 const isPortraitSmall = () => isSmall() && window.innerHeight > window.innerWidth;
1672 const isReduced = () => reducedMQ.matches;
1673
1674 const state = {
1675 view: 'gallery', // 'gallery' | 'page' | 'list'
1676 currentPrint: 0,
1677 lastViewedPrint: 0,
1678 options: {
1679 paper: 'Art Paper',
1680 size: '11.7 × 16.5" (A3)',
1681 signature: 'Unsigned',
1682 frame: 'Unframed',
1683 qty: 1,
1684 },
1685 bag: [],
1686 bagOpen: false,
1687 focusedMesh: null,
1688 hoveredMesh: null,
1689 pointerX: 0,
1690 pointerY: 0,
1691 };
1692
1693 /* =========================================================================
1694 3. THREE.JS CURVED GALLERY SCENE
1695 ========================================================================= */
1696 const galleryEl = document.getElementById('gallery');
1697 const renderer = new THREE.WebGLRenderer({ antialias: true });
1698 renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
1699 renderer.setSize(window.innerWidth, window.innerHeight);
1700 renderer.outputColorSpace = THREE.SRGBColorSpace;
1701 renderer.toneMapping = THREE.NoToneMapping;
1702 galleryEl.appendChild(renderer.domElement);
1703
1704 const scene = new THREE.Scene();
1705 scene.background = new THREE.Color('#FFF9EC');
1706 scene.fog = new THREE.Fog('#FFF9EC', 10, 46);
1707
1708 const camera = new THREE.PerspectiveCamera(
1709 window.innerWidth >= window.innerHeight ? 56 : 70,
1710 window.innerWidth / window.innerHeight,
1711 0.05,
1712 100
1713 );
1714
1715 // Reference lights (scene uses MeshBasicMaterial as specified)
1716 scene.add(new THREE.HemisphereLight(0xfffdf6, 0xe9cfa6, 1.55));
1717 scene.add(new THREE.AmbientLight(0xfff6e6, 0.55));
1718
1719 // Procedural Gradient Textures
1720 function makeVerticalGradient(stops) {
1721 const c = document.createElement('canvas');
1722 c.width = 4;
1723 c.height = 256;
1724 const ctx = c.getContext('2d');
1725 const g = ctx.createLinearGradient(0, 0, 0, 256);
1726 stops.forEach(([pos, col]) => g.addColorStop(pos, col));
1727 ctx.fillStyle = g;
1728 ctx.fillRect(0, 0, 4, 256);
1729 const tex = new THREE.CanvasTexture(c);
1730 tex.colorSpace = THREE.SRGBColorSpace;
1731 return tex;
1732 }
1733
1734 function makeFloorTexture() {
1735 const c = document.createElement('canvas');
1736 c.width = 1024;
1737 c.height = 1024;
1738 const ctx = c.getContext('2d');
1739 const rInPx = 512 * (12.2 / 18);
1740 const g = ctx.createRadialGradient(512, 512, rInPx, 512, 512, 512);
1741 g.addColorStop(0, '#EDD6B0');
1742 g.addColorStop(0.55, '#F3E1C3');
1743 g.addColorStop(1, '#EFDAB8');
1744 ctx.fillStyle = '#EDD6B0';
1745 ctx.fillRect(0, 0, 1024, 1024);
1746 ctx.fillStyle = g;
1747 ctx.beginPath();
1748 ctx.arc(512, 512, 512, 0, Math.PI * 2);
1749 ctx.fill();
1750 const tex = new THREE.CanvasTexture(c);
1751 tex.colorSpace = THREE.SRGBColorSpace;
1752 return tex;
1753 }
1754
1755 function makeRadialGlow(innerColor, outerColor, solidStop) {
1756 const c = document.createElement('canvas');
1757 c.width = 256;
1758 c.height = 256;
1759 const ctx = c.getContext('2d');
1760 const g = ctx.createRadialGradient(128, 128, 0, 128, 128, 128);
1761 g.addColorStop(0, innerColor);
1762 g.addColorStop(solidStop, innerColor);
1763 g.addColorStop(1, outerColor);
1764 ctx.fillStyle = g;
1765 ctx.fillRect(0, 0, 256, 256);
1766 const tex = new THREE.CanvasTexture(c);
1767 tex.colorSpace = THREE.SRGBColorSpace;
1768 return tex;
1769 }
1770
1771 const R_OUT = 18;
1772 const R_IN = 12.2;
1773 const WALL_H = 6.2;
1774
1775 // Outer Wall
1776 const outerWall = new THREE.Mesh(
1777 new THREE.CylinderGeometry(R_OUT, R_OUT, WALL_H, 160, 1, true),
1778 new THREE.MeshBasicMaterial({
1779 map: makeVerticalGradient([
1780 [0, '#F5EBD8'],
1781 [0.2, '#FBF3E3'],
1782 [0.6, '#FBF3E3'],
1783 [0.86, '#F8EDD9'],
1784 [1, '#EFDFC4'],
1785 ]),
1786 side: THREE.BackSide,
1787 })
1788 );
1789 outerWall.position.y = WALL_H / 2;
1790 scene.add(outerWall);
1791
1792 // Inner Pillar
1793 const innerPillar = new THREE.Mesh(
1794 new THREE.CylinderGeometry(R_IN, R_IN, WALL_H, 120, 1, true),
1795 new THREE.MeshBasicMaterial({
1796 map: makeVerticalGradient([
1797 [0, '#F7EEDD'],
1798 [0.3, '#FFFAF0'],
1799 [0.8, '#FDF5E6'],
1800 [1, '#F1E1C6'],
1801 ]),
1802 side: THREE.FrontSide,
1803 })
1804 );
1805 innerPillar.position.y = WALL_H / 2;
1806 scene.add(innerPillar);
1807
1808 // Floor
1809 const floor = new THREE.Mesh(
1810 new THREE.CircleGeometry(R_OUT, 160),
1811 new THREE.MeshBasicMaterial({ map: makeFloorTexture() })
1812 );
1813 floor.rotation.x = -Math.PI / 2;
1814 scene.add(floor);
1815
1816 // Ceiling
1817 const ceiling = new THREE.Mesh(
1818 new THREE.CircleGeometry(R_OUT, 160),
1819 new THREE.MeshBasicMaterial({ color: '#FAF1E0', side: THREE.BackSide })
1820 );
1821 ceiling.rotation.x = -Math.PI / 2;
1822 ceiling.position.y = WALL_H;
1823 scene.add(ceiling);
1824
1825 // Shared Halo, Shadow & Frame Geometries
1826 const PW = 1.36;
1827 const PH = PW * (763 / 567);
1828 const PY = 1.95;
1829
1830 const haloMat = new THREE.MeshBasicMaterial({
1831 map: makeRadialGlow('rgba(255,255,255,0.95)', 'rgba(255,255,255,0)', 0.35),
1832 transparent: true,
1833 depthWrite: false,
1834 fog: true,
1835 });
1836 const shadowMat = new THREE.MeshBasicMaterial({
1837 map: makeRadialGlow('rgba(120,90,50,0.28)', 'rgba(120,90,50,0)', 0.25),
1838 transparent: true,
1839 depthWrite: false,
1840 fog: true,
1841 });
1842 const frameMat = new THREE.MeshBasicMaterial({ color: '#D3AA72' });
1843
1844 const haloGeo = new THREE.PlaneGeometry(2.1 * PW, 1.75 * PH);
1845 const shadowGeo = new THREE.PlaneGeometry(1.25 * PW, 1.18 * PH);
1846 const frameGeo = new THREE.BoxGeometry(PW + 0.07, PH + 0.07, 0.06);
1847 const artGeo = new THREE.PlaneGeometry(PW, PH);
1848 const labelGeo = new THREE.PlaneGeometry(0.92, 0.92 * (260 / 640));
1849
1850 // Create 9 placeholder print materials (populated once sheet loads)
1851 const printMats = PRINTS.map(() => new THREE.MeshBasicMaterial({ color: '#f4ead8' }));
1852 const labelCanvases = [];
1853 const labelTextures = [];
1854
1855 function drawLabelCanvas(canvas, print) {
1856 const ctx = canvas.getContext('2d');
1857 ctx.clearRect(0, 0, 640, 260);
1858 ctx.fillStyle = '#3A3550';
1859 ctx.textBaseline = 'alphabetic';
1860
1861 ctx.font = '500 58px "Newsreader", Georgia, serif';
1862 ctx.fillText(print.artist, 30, 82);
1863
1864 ctx.font = 'italic 400 54px "Newsreader", Georgia, serif';
1865 ctx.fillText(print.title, 30, 150);
1866
1867 ctx.fillStyle = 'rgba(58, 53, 80, 0.7)';
1868 ctx.font = '400 30px "DM Mono", monospace';
1869 ctx.fillText(`${print.year} · PRINT`, 30, 215);
1870 }
1871
1872 PRINTS.forEach((p) => {
1873 const c = document.createElement('canvas');
1874 c.width = 640;
1875 c.height = 260;
1876 drawLabelCanvas(c, p);
1877 const tex = new THREE.CanvasTexture(c);
1878 tex.colorSpace = THREE.SRGBColorSpace;
1879 labelCanvases.push(c);
1880 labelTextures.push(tex);
1881 });
1882
1883 const labelMats = labelTextures.map(
1884 (tex) =>
1885 new THREE.MeshBasicMaterial({
1886 map: tex,
1887 transparent: true,
1888 depthWrite: false,
1889 fog: true,
1890 })
1891 );
1892
1893 const interactivePrintMeshes = [];
1894 const outerPrintEntries = [];
1895
1896 function createPrintGroup(printIdx, theta, wallType) {
1897 const group = new THREE.Group();
1898
1899 const halo = new THREE.Mesh(haloGeo, haloMat);
1900 halo.position.set(0, PY + 0.05, 0.005);
1901 group.add(halo);
1902
1903 const shadow = new THREE.Mesh(shadowGeo, shadowMat);
1904 shadow.position.set(0.05, PY - 0.06, 0.01);
1905 group.add(shadow);
1906
1907 const frame = new THREE.Mesh(frameGeo, frameMat);
1908 frame.position.set(0, PY, 0.045);
1909 group.add(frame);
1910
1911 const artMesh = new THREE.Mesh(artGeo, printMats[printIdx]);
1912 artMesh.position.set(0, PY, 0.077);
1913 artMesh.userData = { printIdx, theta, wall: wallType };
1914 group.add(artMesh);
1915 interactivePrintMeshes.push(artMesh);
1916
1917 const labelMesh = new THREE.Mesh(labelGeo, labelMats[printIdx]);
1918 labelMesh.position.set(-PW / 2 + 0.46, PY - PH / 2 - 0.42, 0.02);
1919 group.add(labelMesh);
1920
1921 if (wallType === 'outer') {
1922 group.position.set(17.98 * Math.cos(theta), 0, 17.98 * Math.sin(theta));
1923 group.lookAt(0, 0, 0);
1924 outerPrintEntries.push({ printIdx, theta, mesh: artMesh });
1925 } else {
1926 group.position.set(12.22 * Math.cos(theta), 0, 12.22 * Math.sin(theta));
1927 group.lookAt(24.44 * Math.cos(theta), 0, 24.44 * Math.sin(theta));
1928 }
1929
1930 scene.add(group);
1931 return artMesh;
1932 }
1933
1934 // 36 Outer Wall Prints
1935 for (let s = 0; s < 36; s++) {
1936 const theta = (s * 2 * Math.PI) / 36;
1937 createPrintGroup(s % 9, theta, 'outer');
1938 }
1939
1940 // 24 Inner Pillar Prints
1941 for (let k = 0; k < 24; k++) {
1942 const theta = ((k + 0.5) * 2 * Math.PI) / 24;
1943 createPrintGroup((k + 4) % 9, theta, 'inner');
1944 }
1945
1946 /* =========================================================================
1947 4. CAMERA POSE & GLIDE SYSTEM
1948 ========================================================================= */
1949 const getWalkOffsetD = () =>
1950 isPortraitSmall() ? 0.14 + 0.9 * ((2 * Math.PI) / 36) : 0.14;
1951
1952 function getWalkPoseParams() {
1953 if (isPortraitSmall()) {
1954 return { r: 15.4, yaw: -0.42, y: 1.9, pitch: -0.1 };
1955 }
1956 return { r: 15.6, yaw: -0.3, y: 1.92, pitch: -0.12 };
1957 }
1958
1959 function getFocusPoseParams(wall) {
1960 if (isPortraitSmall()) {
1961 return wall === 'outer'
1962 ? { r: 18 - 5.2, yaw: Math.PI / 2, y: PY - 1.05, pitch: 0 }
1963 : { r: 12.2 + 5.2, yaw: -Math.PI / 2, y: PY - 1.05, pitch: 0 };
1964 }
1965 return wall === 'outer'
1966 ? { r: 18 - 4.26, yaw: Math.PI / 2, y: PY - 0.52, pitch: 0 }
1967 : { r: 12.2 + 4.26, yaw: -Math.PI / 2, y: PY - 0.52, pitch: 0 };
1968 }
1969
1970 const walkInit = getWalkPoseParams();
1971 const camState = {
1972 th: getWalkOffsetD(),
1973 targetTh: getWalkOffsetD(),
1974 r: walkInit.r,
1975 yaw: walkInit.yaw,
1976 y: walkInit.y,
1977 pitch: walkInit.pitch,
1978 };
1979
1980 let glide = null; // { active, elapsed, duration, from, to, onDone }
1981 let introCam = null; // { active, elapsed, duration, fromTh, toTh, fromR, toR }
1982
1983 function applyCameraPose() {
1984 const { th, r, yaw, y, pitch } = camState;
1985 const px = r * Math.cos(th);
1986 const pz = r * Math.sin(th);
1987 camera.position.set(px, y, pz);
1988
1989 const tx = Math.sin(th);
1990 const tz = -Math.cos(th);
1991 const nx = Math.cos(th);
1992 const nz = Math.sin(th);
1993
1994 const dx = Math.cos(yaw) * tx + Math.sin(yaw) * nx;
1995 const dz = Math.cos(yaw) * tz + Math.sin(yaw) * nz;
1996 camera.lookAt(px + dx, y + pitch, pz + dz);
1997 }
1998
1999 function shortestAngleNear(targetAngle, referenceAngle) {
2000 return referenceAngle + Math.atan2(Math.sin(targetAngle - referenceAngle), Math.cos(targetAngle - referenceAngle));
2001 }
2002
2003 const hint1El = document.getElementById('hint-1');
2004 const hint2El = document.getElementById('hint-2');
2005
2006 function setHintMode(focused) {
2007 if (focused) {
2008 hint1El.textContent = 'Click the painting to open it';
2009 hint2El.textContent = 'Esc or click away to step back';
2010 } else {
2011 hint1El.textContent = 'Scroll or drag to walk round';
2012 hint2El.textContent = 'Click a painting to look closer';
2013 }
2014 }
2015
2016 function startFocusGlide(mesh) {
2017 const { theta, wall, printIdx } = mesh.userData;
2018 state.focusedMesh = mesh;
2019 state.lastViewedPrint = printIdx;
2020 setHintMode(true);
2021
2022 const goalTh = shortestAngleNear(theta, camState.th);
2023 const targetPose = getFocusPoseParams(wall);
2024 const dur = isReduced() ? 0 : 0.95;
2025
2026 if (dur === 0) {
2027 camState.th = camState.targetTh = goalTh;
2028 Object.assign(camState, targetPose);
2029 glide = null;
2030 return;
2031 }
2032
2033 glide = {
2034 elapsed: 0,
2035 duration: dur,
2036 from: {
2037 th: camState.th,
2038 r: camState.r,
2039 yaw: camState.yaw,
2040 y: camState.y,
2041 pitch: camState.pitch,
2042 },
2043 to: {
2044 th: goalTh,
2045 ...targetPose,
2046 },
2047 };
2048 }
2049
2050 function stepBackToWalk() {
2051 if (!state.focusedMesh) return;
2052 state.focusedMesh = null;
2053 setHintMode(false);
2054 hideOpenPill();
2055
2056 const D = getWalkOffsetD();
2057 const goalTh = camState.th + D;
2058 const walkPose = getWalkPoseParams();
2059 const dur = isReduced() ? 0 : 0.95;
2060
2061 camState.targetTh = goalTh;
2062 if (dur === 0) {
2063 camState.th = goalTh;
2064 Object.assign(camState, walkPose);
2065 glide = null;
2066 return;
2067 }
2068
2069 glide = {
2070 elapsed: 0,
2071 duration: dur,
2072 from: {
2073 th: camState.th,
2074 r: camState.r,
2075 yaw: camState.yaw,
2076 y: camState.y,
2077 pitch: camState.pitch,
2078 },
2079 to: {
2080 th: goalTh,
2081 ...walkPose,
2082 },
2083 };
2084 }
2085
2086 /* =========================================================================
2087 5. RAYCASTING & PROJECTED SCREEN RECTANGLE
2088 ========================================================================= */
2089 const raycaster = new THREE.Raycaster();
2090 const pointerNDC = new THREE.Vector2();
2091 const openPillEl = document.getElementById('open-pill');
2092
2093 function getMeshScreenRect(mesh) {
2094 mesh.updateWorldMatrix(true, false);
2095 const hw = PW / 2;
2096 const hh = PH / 2;
2097 const localCorners = [
2098 new THREE.Vector3(-hw, -hh, 0),
2099 new THREE.Vector3(hw, -hh, 0),
2100 new THREE.Vector3(hw, hh, 0),
2101 new THREE.Vector3(-hw, hh, 0),
2102 ];
2103 let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
2104 const vw = window.innerWidth;
2105 const vh = window.innerHeight;
2106
2107 for (const c of localCorners) {
2108 c.applyMatrix4(mesh.matrixWorld);
2109 c.project(camera);
2110 const sx = (c.x * 0.5 + 0.5) * vw;
2111 const sy = (-c.y * 0.5 + 0.5) * vh;
2112 if (sx < minX) minX = sx;
2113 if (sx > maxX) maxX = sx;
2114 if (sy < minY) minY = sy;
2115 if (sy > maxY) maxY = sy;
2116 }
2117 return {
2118 left: minX,
2119 top: minY,
2120 width: Math.max(10, maxX - minX),
2121 height: Math.max(10, maxY - minY),
2122 };
2123 }
2124
2125 function hideOpenPill() {
2126 openPillEl.classList.remove('is-visible');
2127 }
2128
2129 function updateOpenPill() {
2130 if (state.view !== 'gallery' || !state.focusedMesh) {
2131 hideOpenPill();
2132 return;
2133 }
2134 if (isSmall()) {
2135 const rect = getMeshScreenRect(state.focusedMesh);
2136 openPillEl.style.left = `${rect.left + rect.width * 0.5}px`;
2137 openPillEl.style.top = `${rect.top + rect.height * 0.55}px`;
2138 openPillEl.classList.add('is-visible');
2139 } else if (state.hoveredMesh === state.focusedMesh) {
2140 openPillEl.style.left = `${state.pointerX}px`;
2141 openPillEl.style.top = `${state.pointerY}px`;
2142 openPillEl.classList.add('is-visible');
2143 } else {
2144 hideOpenPill();
2145 }
2146 }
2147
2148 function pickPrintAt(clientX, clientY) {
2149 pointerNDC.x = (clientX / window.innerWidth) * 2 - 1;
2150 pointerNDC.y = -(clientY / window.innerHeight) * 2 + 1;
2151 raycaster.setFromCamera(pointerNDC, camera);
2152 const hits = raycaster.intersectObjects(interactivePrintMeshes, false);
2153 return hits.length > 0 ? hits[0].object : null;
2154 }
2155
2156 /* =========================================================================
2157 6. NAVIGATION & INPUT LISTENERS (WHEEL, DRAG, KEYS, ARROWS)
2158 ========================================================================= */
2159 galleryEl.addEventListener(
2160 'wheel',
2161 (e) => {
2162 if (state.view !== 'gallery') return;
2163 e.preventDefault();
2164 if (state.focusedMesh) {
2165 stepBackToWalk();
2166 }
2167 const dy = e.deltaMode === 1 ? e.deltaY * 33 : e.deltaY;
2168 camState.targetTh -= dy * 0.0016;
2169 },
2170 { passive: false }
2171 );
2172
2173 let pointerDown = false;
2174 let dragged = false;
2175 let downX = 0;
2176 let downY = 0;
2177 let downTargetTh = 0;
2178
2179 galleryEl.addEventListener('pointerdown', (e) => {
2180 if (state.view !== 'gallery') return;
2181 pointerDown = true;
2182 dragged = false;
2183 downX = e.clientX;
2184 downY = e.clientY;
2185 downTargetTh = camState.targetTh;
2186 });
2187
2188 window.addEventListener('pointermove', (e) => {
2189 state.pointerX = e.clientX;
2190 state.pointerY = e.clientY;
2191
2192 if (pointerDown && state.view === 'gallery') {
2193 const dx = e.clientX - downX;
2194 const dy = e.clientY - downY;
2195 if (!dragged && Math.hypot(dx, dy) > 6) {
2196 dragged = true;
2197 galleryEl.classList.add('is-dragging');
2198 if (state.focusedMesh) {
2199 stepBackToWalk();
2200 downTargetTh = camState.targetTh;
2201 }
2202 }
2203 if (dragged) {
2204 const delta = Math.abs(dx) > Math.abs(dy) ? dx : dy;
2205 const sens = isSmall() ? 0.0042 : 0.0022;
2206 camState.targetTh = downTargetTh + delta * sens;
2207 }
2208 } else if (state.view === 'gallery' && !isSmall()) {
2209 const hit = pickPrintAt(e.clientX, e.clientY);
2210 state.hoveredMesh = hit;
2211 galleryEl.classList.toggle('is-hovering', Boolean(hit));
2212 updateOpenPill();
2213 }
2214 });
2215
2216 window.addEventListener('pointerup', (e) => {
2217 if (!pointerDown) return;
2218 pointerDown = false;
2219 galleryEl.classList.remove('is-dragging');
2220
2221 if (!dragged && state.view === 'gallery') {
2222 const hit = pickPrintAt(e.clientX, e.clientY);
2223 if (hit) {
2224 if (state.focusedMesh === hit) {
2225 const srcRect = getMeshScreenRect(hit);
2226 openPrintPage(hit.userData.printIdx, srcRect);
2227 } else {
2228 startFocusGlide(hit);
2229 }
2230 } else if (state.focusedMesh) {
2231 stepBackToWalk();
2232 }
2233 }
2234 });
2235
2236 function stepSlot(dir) {
2237 if (state.view !== 'gallery') return;
2238 if (state.focusedMesh) {
2239 stepBackToWalk();
2240 }
2241 const STEP = (2 * Math.PI) / 36;
2242 const D = getWalkOffsetD();
2243 camState.targetTh = (Math.round((camState.targetTh - D) / STEP) - dir) * STEP + D;
2244 }
2245
2246 document.getElementById('btn-prev').addEventListener('click', () => stepSlot(-1));
2247 document.getElementById('btn-next').addEventListener('click', () => stepSlot(1));
2248
2249 window.addEventListener('keydown', (e) => {
2250 if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
2251 e.preventDefault();
2252 openListView();
2253 return;
2254 }
2255
2256 if (e.key === 'Escape') {
2257 if (state.bagOpen) {
2258 closeBagDrawer();
2259 return;
2260 }
2261 if (state.view === 'page' || state.view === 'list') {
2262 returnToGallery();
2263 return;
2264 }
2265 if (state.focusedMesh) {
2266 stepBackToWalk();
2267 }
2268 return;
2269 }
2270
2271 if (state.view === 'gallery' && !state.bagOpen) {
2272 if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
2273 e.preventDefault();
2274 stepSlot(1);
2275 } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
2276 e.preventDefault();
2277 stepSlot(-1);
2278 }
2279 }
2280 });
2281
2282 /* =========================================================================
2283 7. PRODUCT PAGE, FLIP FLYER, LIST VIEW & BAG DRAWER
2284 ========================================================================= */
2285 const navEl = document.getElementById('main-nav');
2286 const guiEl = document.getElementById('gui');
2287 const pageEl = document.getElementById('page');
2288 const listEl = document.getElementById('list');
2289 const pageArtEl = document.getElementById('page-art');
2290 const pageMetaEl = document.getElementById('page-meta');
2291 const pageRightEl = document.getElementById('page-right');
2292 const bandEl = document.getElementById('collection-band');
2293
2294 let revealTimer = null;
2295
2296 function syncUIStates() {
2297 const overlayOpen = state.view === 'page' || state.view === 'list';
2298 navEl.classList.toggle('is-solid', overlayOpen);
2299 guiEl.classList.toggle('is-hidden', overlayOpen);
2300 document.getElementById('tog-gallery').classList.toggle('is-active', state.view === 'gallery');
2301 document.getElementById('tog-list').classList.toggle('is-active', state.view === 'list');
2302 if (overlayOpen) hideOpenPill();
2303 }
2304
2305 function createCardElement(printIdx) {
2306 const p = PRINTS[printIdx];
2307 const card = document.createElement('article');
2308 card.className = 'print-card';
2309 card.innerHTML = `
2310 <div class="card-art"></div>
2311 <div class="card-title">${p.title}</div>
2312 <div class="card-artist">${p.artist}</div>
2313 <div class="card-price">$ ${p.price.toFixed(2)}</div>
2314 `;
2315 const art = card.querySelector('.card-art');
2316 requestAnimationFrame(() => applyDomCrop(art, printIdx));
2317 card.addEventListener('click', () => {
2318 const srcRect = art.getBoundingClientRect();
2319 openPrintPage(printIdx, srcRect);
2320 });
2321 return card;
2322 }
2323
2324 function renderListGrid() {
2325 const grid = document.getElementById('list-grid');
2326 grid.innerHTML = '';
2327 PRINTS.forEach((_, idx) => grid.appendChild(createCardElement(idx)));
2328 }
2329
2330 function renderCollectionBand(currentIdx) {
2331 const container = document.getElementById('band-cards');
2332 container.innerHTML = '';
2333 for (let offset = 0; offset < 4; offset++) {
2334 const idx = (currentIdx + offset) % 9;
2335 container.appendChild(createCardElement(idx));
2336 }
2337 }
2338
2339 function resetProductOptions() {
2340 state.options = {
2341 paper: 'Art Paper',
2342 size: '11.7 × 16.5" (A3)',
2343 signature: 'Unsigned',
2344 frame: 'Unframed',
2345 qty: 1,
2346 };
2347 document.getElementById('qty-val').textContent = '1';
2348 document.querySelectorAll('.opt-group').forEach((grp) => {
2349 const key = grp.dataset.opt;
2350 const val = state.options[key];
2351 grp.querySelector('.opt-val').textContent = val;
2352 grp.querySelectorAll('button').forEach((btn) => {
2353 btn.classList.toggle('is-on', btn.dataset.value === val);
2354 });
2355 });
2356 }
2357
2358 function openPrintPage(printIdx, srcRect) {
2359 clearTimeout(revealTimer);
2360 state.currentPrint = printIdx;
2361 state.lastViewedPrint = printIdx;
2362 state.view = 'page';
2363
2364 const p = PRINTS[printIdx];
2365 document.getElementById('p-title').textContent = p.title;
2366 document.getElementById('p-artist').textContent = p.artist;
2367 document.getElementById('p-desc').textContent = p.desc;
2368 document.getElementById('p-price').textContent = `$ ${p.price.toFixed(2)}`;
2369 resetProductOptions();
2370 renderCollectionBand(printIdx);
2371
2372 // Hide elements prior to FLIP & 1000ms staggered reveal
2373 pageArtEl.classList.remove('is-ready');
2374 pageMetaEl.classList.remove('is-revealed');
2375 pageRightEl.classList.remove('is-revealed');
2376 bandEl.classList.remove('is-revealed');
2377
2378 listEl.classList.remove('is-open');
2379 listEl.setAttribute('aria-hidden', 'true');
2380 pageEl.classList.add('is-open');
2381 pageEl.setAttribute('aria-hidden', 'false');
2382 pageEl.scrollTo({ top: 0, behavior: isReduced() ? 'auto' : 'smooth' });
2383 syncUIStates();
2384
2385 requestAnimationFrame(() => {
2386 applyDomCrop(pageArtEl, printIdx);
2387 [0, 1, 2].forEach((n) => applyDomCrop(document.getElementById(`fthumb-${n}`), printIdx));
2388
2389 const dstRect = pageArtEl.getBoundingClientRect();
2390 const flyDur = isReduced() ? 0 : 300;
2391
2392 if (srcRect && flyDur > 0 && dstRect.width > 0) {
2393 const flyer = document.createElement('div');
2394 flyer.className = 'flyer';
2395 flyer.style.width = `${dstRect.width}px`;
2396 flyer.style.height = `${dstRect.height}px`;
2397 document.body.appendChild(flyer);
2398 applyDomCrop(flyer, printIdx);
2399
2400 const dx = srcRect.left - dstRect.left;
2401 const dy = srcRect.top - dstRect.top;
2402 const sx = srcRect.width / dstRect.width;
2403 const sy = srcRect.height / dstRect.height;
2404
2405 const anim = flyer.animate(
2406 [
2407 { transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` },
2408 { transform: 'translate(0px, 0px) scale(1, 1)' },
2409 ],
2410 {
2411 duration: flyDur,
2412 easing: 'cubic-bezier(0.25, 0.75, 0.25, 1)',
2413 fill: 'forwards',
2414 }
2415 );
2416
2417 anim.onfinish = () => {
2418 pageArtEl.classList.add('is-ready');
2419 flyer.remove();
2420 };
2421 } else {
2422 pageArtEl.classList.add('is-ready');
2423 }
2424 });
2425
2426 const detailDelay = isReduced() ? 0 : 1000;
2427 revealTimer = setTimeout(() => {
2428 pageMetaEl.classList.add('is-revealed');
2429 pageRightEl.classList.add('is-revealed');
2430 bandEl.classList.add('is-revealed');
2431 }, detailDelay);
2432 }
2433
2434 function openListView() {
2435 clearTimeout(revealTimer);
2436 state.view = 'list';
2437 pageEl.classList.remove('is-open');
2438 pageEl.setAttribute('aria-hidden', 'true');
2439 listEl.classList.add('is-open');
2440 listEl.setAttribute('aria-hidden', 'false');
2441 listEl.scrollTop = 0;
2442 syncUIStates();
2443 requestAnimationFrame(refreshAllDomCrops);
2444 }
2445
2446 function returnToGallery() {
2447 clearTimeout(revealTimer);
2448 state.view = 'gallery';
2449 pageEl.classList.remove('is-open');
2450 pageEl.setAttribute('aria-hidden', 'true');
2451 listEl.classList.remove('is-open');
2452 listEl.setAttribute('aria-hidden', 'true');
2453 syncUIStates();
2454
2455 // Find nearest outer-wall copy of lastViewedPrint and glide to focus on it
2456 const candidates = outerPrintEntries.filter((e) => e.printIdx === state.lastViewedPrint);
2457 if (candidates.length > 0) {
2458 let best = candidates[0];
2459 let bestDist = Infinity;
2460 for (const c of candidates) {
2461 const nearTh = shortestAngleNear(c.theta, camState.th);
2462 const dist = Math.abs(nearTh - camState.th);
2463 if (dist < bestDist) {
2464 bestDist = dist;
2465 best = c;
2466 }
2467 }
2468 startFocusGlide(best.mesh);
2469 }
2470 }
2471
2472 // Option Chips
2473 document.querySelectorAll('.opt-group').forEach((grp) => {
2474 const key = grp.dataset.opt;
2475 const valEl = grp.querySelector('.opt-val');
2476 grp.querySelectorAll('button').forEach((btn) => {
2477 btn.addEventListener('click', () => {
2478 const val = btn.dataset.value;
2479 state.options[key] = val;
2480 valEl.textContent = val;
2481 grp.querySelectorAll('button').forEach((b) => b.classList.toggle('is-on', b === btn));
2482 });
2483 });
2484 });
2485
2486 // Quantity Stepper (1..9)
2487 document.getElementById('qty-minus').addEventListener('click', () => {
2488 if (state.options.qty > 1) {
2489 state.options.qty -= 1;
2490 document.getElementById('qty-val').textContent = String(state.options.qty);
2491 }
2492 });
2493 document.getElementById('qty-plus').addEventListener('click', () => {
2494 if (state.options.qty < 9) {
2495 state.options.qty += 1;
2496 document.getElementById('qty-val').textContent = String(state.options.qty);
2497 }
2498 });
2499
2500 // Accordions
2501 document.querySelectorAll('.acc-item').forEach((item) => {
2502 const trigger = item.querySelector('.acc-trigger');
2503 const panel = item.querySelector('.acc-panel');
2504 trigger.addEventListener('click', () => {
2505 const willOpen = !item.classList.contains('is-open');
2506 item.classList.toggle('is-open', willOpen);
2507 panel.style.height = willOpen ? `${panel.scrollHeight}px` : '0px';
2508 });
2509 });
2510
2511 // Shopping Bag Drawer Logic
2512 const drawerEl = document.getElementById('drawer');
2513 const backdropEl = document.getElementById('drawer-backdrop');
2514 const drawerItemsEl = document.getElementById('drawer-items');
2515 const badgeEl = document.getElementById('bag-badge');
2516 const subtotalEl = document.getElementById('bag-subtotal');
2517
2518 function openBagDrawer() {
2519 state.bagOpen = true;
2520 drawerEl.classList.add('is-open');
2521 backdropEl.classList.add('is-open');
2522 }
2523
2524 function closeBagDrawer() {
2525 state.bagOpen = false;
2526 drawerEl.classList.remove('is-open');
2527 backdropEl.classList.remove('is-open');
2528 }
2529
2530 function renderBag(animateKey = null) {
2531 const totalQty = state.bag.reduce((sum, item) => sum + item.qty, 0);
2532 const subtotal = state.bag.reduce((sum, item) => sum + PRINTS[item.printIdx].price * item.qty, 0);
2533
2534 badgeEl.textContent = String(totalQty);
2535 badgeEl.classList.toggle('has-items', totalQty > 0);
2536 subtotalEl.textContent = `$ ${subtotal.toFixed(2)}`;
2537
2538 drawerItemsEl.innerHTML = '';
2539 if (state.bag.length === 0) {
2540 drawerItemsEl.innerHTML = '<div class="drawer-empty">YOUR BAG IS EMPTY</div>';
2541 return;
2542 }
2543
2544 state.bag.forEach((item, idx) => {
2545 const p = PRINTS[item.printIdx];
2546 const row = document.createElement('div');
2547 row.className = 'bag-row';
2548 if (animateKey && item.key === animateKey && !isReduced()) {
2549 row.classList.add('is-entering');
2550 }
2551 row.innerHTML = `
2552 <div class="bag-thumb"></div>
2553 <div class="bag-info">
2554 <div class="bag-title">${p.title}</div>
2555 <div class="bag-artist">${p.artist}</div>
2556 <div class="bag-meta">${item.size} · ${item.frame}</div>
2557 <div class="bag-meta">$ ${(p.price * item.qty).toFixed(2)}</div>
2558 <div class="bag-controls">
2559 <div class="mini-qty">
2560 <button type="button" data-q="-1" aria-label="Decrease">−</button>
2561 <span>${item.qty}</span>
2562 <button type="button" data-q="1" aria-label="Increase">+</button>
2563 </div>
2564 <button type="button" class="btn-trash" aria-label="Remove item">
2565 <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6">
2566 <polyline points="3 6 5 6 21 6"></polyline>
2567 <path d="M19 6l-1 14H6L5 6"></path>
2568 <path d="M10 11v6"></path>
2569 <path d="M14 11v6"></path>
2570 </svg>
2571 </button>
2572 </div>
2573 </div>
2574 `;
2575 const thumb = row.querySelector('.bag-thumb');
2576 requestAnimationFrame(() => applyDomCrop(thumb, item.printIdx));
2577
2578 row.querySelector('[data-q="-1"]').addEventListener('click', () => {
2579 if (item.qty > 1) {
2580 item.qty -= 1;
2581 } else {
2582 state.bag.splice(idx, 1);
2583 }
2584 renderBag();
2585 });
2586 row.querySelector('[data-q="1"]').addEventListener('click', () => {
2587 if (item.qty < 9) {
2588 item.qty += 1;
2589 renderBag();
2590 }
2591 });
2592 row.querySelector('.btn-trash').addEventListener('click', () => {
2593 state.bag.splice(idx, 1);
2594 renderBag();
2595 });
2596
2597 drawerItemsEl.appendChild(row);
2598
2599 if (row.classList.contains('is-entering')) {
2600 setTimeout(() => {
2601 row.classList.remove('is-entering');
2602 }, 750);
2603 }
2604 });
2605 }
2606
2607 document.getElementById('btn-add-bag').addEventListener('click', () => {
2608 const { paper, size, signature, frame, qty } = state.options;
2609 const key = `${state.currentPrint}|${paper}|${size}|${signature}|${frame}`;
2610 const existing = state.bag.find((i) => i.key === key);
2611 if (existing) {
2612 existing.qty = Math.min(9, existing.qty + qty);
2613 } else {
2614 state.bag.push({
2615 key,
2616 printIdx: state.currentPrint,
2617 paper,
2618 size,
2619 signature,
2620 frame,
2621 qty,
2622 });
2623 }
2624 openBagDrawer();
2625 renderBag(key);
2626 });
2627
2628 // Global Button Bindings
2629 document.getElementById('btn-logo').addEventListener('click', returnToGallery);
2630 document.getElementById('tog-gallery').addEventListener('click', returnToGallery);
2631 document.getElementById('tog-list').addEventListener('click', openListView);
2632 document.getElementById('btn-enter').addEventListener('click', openListView);
2633 document.getElementById('btn-search').addEventListener('click', openListView);
2634 document.getElementById('btn-view-room').addEventListener('click', returnToGallery);
2635 document.getElementById('btn-bag').addEventListener('click', openBagDrawer);
2636 document.getElementById('btn-drawer-close').addEventListener('click', closeBagDrawer);
2637 backdropEl.addEventListener('click', closeBagDrawer);
2638
2639 document.querySelectorAll('.nav-links button').forEach((btn) => {
2640 btn.addEventListener('click', () => {
2641 const act = btn.dataset.action;
2642 if (act === 'gallery') returnToGallery();
2643 else openListView();
2644 });
2645 });
2646
2647 let toastTimer = null;
2648 function showToast(msg) {
2649 const t = document.getElementById('toast');
2650 t.textContent = msg;
2651 t.classList.add('is-shown');
2652 clearTimeout(toastTimer);
2653 toastTimer = setTimeout(() => t.classList.remove('is-shown'), 2400);
2654 }
2655
2656 document.querySelectorAll('[data-toast]').forEach((el) => {
2657 el.addEventListener('click', () => showToast(el.dataset.toast));
2658 });
2659
2660 document.getElementById('btn-checkout').addEventListener('click', () => {
2661 if (state.bag.length === 0) {
2662 showToast('Your bag is currently empty');
2663 } else {
2664 showToast('Proceeding to Zestwell Studio checkout…');
2665 }
2666 });
2667
2668 /* =========================================================================
2669 8. ASSET LOADING, OPENING ENTRANCE & RENDER LOOP
2670 ========================================================================= */
2671 let introStarted = false;
2672
2673 function runOpeningAnimation() {
2674 if (introStarted) return;
2675 introStarted = true;
2676
2677 // Redraw crisp 3D labels once webfonts are active
2678 PRINTS.forEach((p, i) => {
2679 drawLabelCanvas(labelCanvases[i], p);
2680 labelTextures[i].needsUpdate = true;
2681 });
2682
2683 const veil = document.getElementById('veil');
2684 if (isReduced()) {
2685 veil.style.display = 'none';
2686 return;
2687 }
2688
2689 // 1. Veil fade (0ms delay, 900ms ease-out)
2690 veil.animate([{ opacity: 1 }, { opacity: 0 }], {
2691 duration: 900,
2692 easing: 'ease-out',
2693 fill: 'forwards',
2694 }).onfinish = () => {
2695 veil.style.display = 'none';
2696 };
2697
2698 // 2. Camera step-in (0ms delay, 1400ms expo-out)
2699 const D = getWalkOffsetD();
2700 const wp = getWalkPoseParams();
2701 introCam = {
2702 elapsed: 0,
2703 duration: 1.4,
2704 fromTh: D + 0.16,
2705 toTh: D,
2706 fromR: wp.r - 0.35,
2707 toR: wp.r,
2708 };
2709 camState.th = introCam.fromTh;
2710 camState.targetTh = introCam.toTh;
2711 camState.r = introCam.fromR;
2712
2713 // 3. Staggered text lines + nav children
2714 const maskItems = Array.from(document.querySelectorAll('.gui .mask-inner'));
2715 const navItems = Array.from(document.querySelectorAll('header.nav > *'));
2716
2717 maskItems.forEach((el, i) => {
2718 el.animate(
2719 [{ transform: 'translateY(105%)' }, { transform: 'translateY(0%)' }],
2720 {
2721 duration: 1000,
2722 delay: 250 + i * 60,
2723 easing: 'cubic-bezier(0.2, 0.7, 0.2, 1)',
2724 fill: 'backwards',
2725 }
2726 );
2727 });
2728
2729 navItems.forEach((el, idx) => {
2730 const i = maskItems.length + idx;
2731 el.animate([{ opacity: 0 }, { opacity: 1 }], {
2732 duration: 1000,
2733 delay: 250 + i * 60,
2734 easing: 'cubic-bezier(0.2, 0.7, 0.2, 1)',
2735 fill: 'backwards',
2736 });
2737 });
2738 }
2739
2740 // Load Artwork Sprite Sheet
2741 const sheetPromise = new Promise((resolve) => {
2742 const img = new Image();
2743 img.crossOrigin = 'anonymous';
2744 img.onload = () => {
2745 const baseTex = new THREE.Texture(img);
2746 baseTex.colorSpace = THREE.SRGBColorSpace;
2747 baseTex.needsUpdate = true;
2748 const maxAniso = renderer.capabilities.getMaxAnisotropy();
2749
2750 CROPS.forEach(({ x, y, w, h }, i) => {
2751 const tex = baseTex.clone();
2752 tex.colorSpace = THREE.SRGBColorSpace;
2753 tex.anisotropy = maxAniso;
2754 tex.repeat.set(w / SHEET_W, h / SHEET_H);
2755 tex.offset.set(x / SHEET_W, 1 - (y + h) / SHEET_H);
2756 tex.needsUpdate = true;
2757
2758 printMats[i].color.set('#ffffff');
2759 printMats[i].map = tex;
2760 printMats[i].needsUpdate = true;
2761 });
2762 resolve();
2763 };
2764 img.onerror = () => resolve();
2765 img.src = SHEET_URL;
2766 });
2767
2768 const failsafeTimer = setTimeout(runOpeningAnimation, 4000);
2769 Promise.all([sheetPromise, document.fonts.ready]).then(() => {
2770 clearTimeout(failsafeTimer);
2771 runOpeningAnimation();
2772 });
2773
2774 // Resize Handler
2775 function onResize() {
2776 const w = window.innerWidth;
2777 const h = window.innerHeight;
2778 camera.aspect = w / h;
2779 camera.fov = w >= h ? 56 : 70;
2780 camera.updateProjectionMatrix();
2781 renderer.setSize(w, h);
2782 renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
2783
2784 if (!glide && !introCam) {
2785 if (state.focusedMesh) {
2786 Object.assign(camState, getFocusPoseParams(state.focusedMesh.userData.wall));
2787 } else {
2788 Object.assign(camState, getWalkPoseParams());
2789 }
2790 }
2791 refreshAllDomCrops();
2792 updateOpenPill();
2793 }
2794
2795 window.addEventListener('resize', onResize);
2796
2797 // Initialize List & Bag UI
2798 renderListGrid();
2799 renderBag();
2800
2801 // Main Animation Loop
2802 let lastTime = performance.now();
2803
2804 function animate(now) {
2805 requestAnimationFrame(animate);
2806 const dt = Math.min(0.05, (now - lastTime) / 1000);
2807 lastTime = now;
2808
2809 if (introCam) {
2810 introCam.elapsed += dt;
2811 const t = Math.min(1, introCam.elapsed / introCam.duration);
2812 const ease = t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
2813 camState.th = introCam.fromTh + (introCam.toTh - introCam.fromTh) * ease;
2814 camState.r = introCam.fromR + (introCam.toR - introCam.fromR) * ease;
2815 if (t >= 1) introCam = null;
2816 } else if (glide) {
2817 glide.elapsed += dt;
2818 const t = Math.min(1, glide.elapsed / glide.duration);
2819 const eTh = 1 - Math.pow(1 - t, 4);
2820 const eYaw = 1 - Math.pow(1 - t, 2);
2821 const eCub = 1 - Math.pow(1 - t, 3);
2822
2823 camState.th = glide.from.th + (glide.to.th - glide.from.th) * eTh;
2824 camState.targetTh = camState.th;
2825 camState.yaw = glide.from.yaw + (glide.to.yaw - glide.from.yaw) * eYaw;
2826 camState.r = glide.from.r + (glide.to.r - glide.from.r) * eCub;
2827 camState.y = glide.from.y + (glide.to.y - glide.from.y) * eCub;
2828 camState.pitch = glide.from.pitch + (glide.to.pitch - glide.from.pitch) * eCub;
2829
2830 if (t >= 1) glide = null;
2831 } else if (!state.focusedMesh) {
2832 if (isReduced()) {
2833 camState.th = camState.targetTh;
2834 } else {
2835 camState.th += (camState.targetTh - camState.th) * (1 - Math.exp(-dt / 0.36));
2836 }
2837 }
2838
2839 applyCameraPose();
2840 updateOpenPill();
2841 renderer.render(scene, camera);
2842 }
2843
2844 window.addEventListener('load', () => {
2845 lastTime = performance.now();
2846 requestAnimationFrame(animate);
2847 });
2848 </script>
2849</body>
2850</html>
Keep looking