@tokenoftrust/storefront-runner 3.12.3 → 3.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -454,10 +454,16 @@ a.article-card__tag:hover { text-decoration: underline; }
454
454
  .site-footer[data-variant="light-collapsible"] .footer-disclaimer p { color: var(--color-text); }
455
455
 
456
456
  /* --- Reveal-on-scroll (raw-chrome markup uses .reveal/.in) ---------------- */
457
- .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
457
+ /* Unmarked .reveal stays visible. Opacity 0 applies only with .is-below,
458
+ the same below-the-fold mark as [data-reveal], so an in-viewport block
459
+ is not hidden before a script adds .in. */
460
+ .reveal { opacity: 1; }
461
+ .reveal.is-below { transition: opacity .5s ease, transform .5s ease; }
462
+ .reveal.is-below:not(.in) { opacity: 0; transform: translateY(18px); }
458
463
  .reveal.in { opacity: 1; transform: none; }
459
464
  @media (prefers-reduced-motion: reduce) {
460
- .reveal { opacity: 1; transform: none; transition: none; }
465
+ .reveal,
466
+ .reveal.is-below:not(.in) { opacity: 1; transform: none; transition: none; }
461
467
  }
462
468
 
463
469
  /* --- Responsive ----------------------------------------------------------- */
@@ -582,14 +582,26 @@ const footerWidgets = await renderWidgetSlot(
582
582
  mountWidgetPostMessageBridge();
583
583
  </script>
584
584
 
585
- {/* Scroll-reveal + analytics pageview hook. ~0.5KB, no framework. */}
585
+ {/* Scroll-reveal. Initial-viewport blocks stay visible (no .is-below).
586
+ Only blocks below the fold start hidden, then .is-in shows them. */}
586
587
  <script>
587
- // Reveal-on-scroll (respects reduced motion via CSS).
588
+ // Reveal-on-scroll. Reduced motion stays visible via CSS and .is-in.
588
589
  const els = document.querySelectorAll("[data-reveal]");
589
- if (
590
- els.length &&
591
- !window.matchMedia("(prefers-reduced-motion: reduce)").matches
592
- ) {
590
+ const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
591
+ const fold = window.innerHeight || document.documentElement.clientHeight || 0;
592
+ const below: Element[] = [];
593
+ for (const el of els) {
594
+ const rect = el.getBoundingClientRect();
595
+ const laidOut = rect.width > 0 && rect.height > 0;
596
+ const inView = !laidOut || fold <= 0 || (rect.bottom > 0 && rect.top < fold);
597
+ if (reduce || inView || typeof IntersectionObserver !== "function") {
598
+ el.classList.add("is-in");
599
+ } else {
600
+ el.classList.add("is-below");
601
+ below.push(el);
602
+ }
603
+ }
604
+ if (below.length) {
593
605
  const io = new IntersectionObserver(
594
606
  (entries) => {
595
607
  for (const e of entries) {
@@ -601,9 +613,7 @@ const footerWidgets = await renderWidgetSlot(
601
613
  },
602
614
  { rootMargin: "0px 0px -8% 0px", threshold: 0.05 },
603
615
  );
604
- els.forEach((el) => io.observe(el));
605
- } else {
606
- els.forEach((el) => el.classList.add("is-in"));
616
+ for (const el of below) io.observe(el);
607
617
  }
608
618
  </script>
609
619
 
@@ -335,18 +335,30 @@
335
335
  h2:is(.display-xl, .display-lg, .display-md) { font-size: var(--heading-h2, var(--display-size)); }
336
336
  h3:is(.display-xl, .display-lg, .display-md) { font-size: var(--heading-h3, var(--display-size)); }
337
337
 
338
- /* Tasteful scroll-reveal; opt-in via [data-reveal], JS toggles .is-in. */
338
+ /* Scroll-reveal only after the script marks a block below the fold.
339
+ An unmarked [data-reveal] stays at opacity 1, so a block already in the
340
+ initial viewport is visible with no IntersectionObserver and no tenant flag. */
339
341
  [data-reveal] {
342
+ opacity: 1;
343
+ }
344
+ [data-reveal].is-below {
345
+ transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
346
+ }
347
+ [data-reveal].is-below:not(.is-in) {
340
348
  opacity: 0;
341
349
  transform: translateY(14px);
342
- transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
343
350
  }
344
351
  [data-reveal].is-in {
345
352
  opacity: 1;
346
353
  transform: none;
347
354
  }
348
355
  @media (prefers-reduced-motion: reduce) {
349
- [data-reveal] { opacity: 1; transform: none; }
356
+ [data-reveal],
357
+ [data-reveal].is-below:not(.is-in) {
358
+ opacity: 1;
359
+ transform: none;
360
+ transition: none;
361
+ }
350
362
  }
351
363
 
352
364
  /* Island animations (MobileNav drawer slide-in). Globally neutralized by the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/storefront-runner",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
6
6
  "packageManager": "pnpm@11.9.0",