@asante-org/atlascopco-vt-litesitegenerator 3.0.7 → 3.0.8

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.
@@ -34,3 +34,4 @@ export declare const CarouselNoArrows: Story;
34
34
  * (renders as a full solid-colour card).
35
35
  */
36
36
  export declare const PerCardColour: Story;
37
+ export declare const FourSlides: Story;
@@ -2443,11 +2443,19 @@
2443
2443
  scrollDownBtn: hero.querySelector(".lsg-hero__scroll-down-btn"),
2444
2444
  scrollDownTarget: hero.nextElementSibling,
2445
2445
  }, { transition: transition, autoplay: isCarousel });
2446
- // DAM video fade-in on canplay
2447
- hero.querySelectorAll(".lsg-hero__video").forEach(function (video) {
2448
- video.addEventListener("canplay", function () {
2449
- video.classList.add("lsg-hero__video--ready");
2450
- }, { once: true });
2446
+ // DAM video fade-in on canplay. The element is .lsg-hero-card__video (LsgHeroCard owns it),
2447
+ // and the SCSS keys the opacity transition on .lsg-hero-card__video--ready.
2448
+ hero.querySelectorAll(".lsg-hero-card__video").forEach(function (video) {
2449
+ var markReady = function () { return video.classList.add("lsg-hero-card__video--ready"); };
2450
+ // Server-rendered markup (AEM) can reach a playable readyState before this footer
2451
+ // clientlib runs, in which case "canplay" has already fired and never arrives again.
2452
+ // HAVE_FUTURE_DATA (3) is the readyState "canplay" corresponds to.
2453
+ if (video.readyState >= 3) {
2454
+ markReady();
2455
+ }
2456
+ else {
2457
+ video.addEventListener("canplay", markReady, { once: true });
2458
+ }
2451
2459
  });
2452
2460
  });
2453
2461
  }