@widelab-nc/widelab 1.1.43 → 1.1.45

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widelab-nc/widelab",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
4
4
  "description": "Widelab starter template based on Finsweet template + add-ons.",
5
5
  "homepage": "https://widelab.co",
6
6
  "license": "ISC",
package/src/index.js CHANGED
@@ -513,6 +513,64 @@ window.customCursorTextUpdate = function(el) {
513
513
  el.addEventListener('pointerleave', maybeDeactivate);
514
514
  };
515
515
 
516
+
517
+ window.hueAwardsAnimation = function(e) {
518
+ let mm = gsap.matchMedia();
519
+ mm.add("(max-width: 991px)", () => {
520
+ const logoItems = e.querySelectorAll('.clients_collection_item_mask.is-3');
521
+
522
+ logoItems.forEach((maskEl) => {
523
+ const imgEl = maskEl.querySelector('.skills-item_img');
524
+ if (!imgEl) return;
525
+
526
+ gsap.set(maskEl, { height: '100%' });
527
+
528
+ gsap.to(maskEl, {
529
+ scrollTrigger: {
530
+ trigger: maskEl,
531
+ start: 'top bottom-=25%',
532
+ },
533
+ height: '0%',
534
+ duration: 0.7,
535
+ ease: 'loader2',
536
+ });
537
+
538
+ gsap.from(imgEl, {
539
+ scrollTrigger: {
540
+ trigger: maskEl,
541
+ start: 'top bottom-=25%',
542
+ },
543
+ opacity: 0,
544
+ delay: 0.4,
545
+ duration: 0.45,
546
+ ease: 'loader2',
547
+ });
548
+ });
549
+ });
550
+ };
551
+
552
+
553
+
554
+
555
+
556
+ window.navbarThemeSwitcher = function (e) {
557
+ var navbar = document.getElementById('heroNavbar');
558
+ if (!navbar) return;
559
+ ScrollTrigger.create({
560
+ trigger: e,
561
+ start: 'top center',
562
+ end: 'bottom center',
563
+ onEnter: () => navbar.classList.add('is-dark'),
564
+ onEnterBack: () => navbar.classList.add('is-dark'),
565
+ onLeave: () => navbar.classList.remove('is-dark'),
566
+ onLeaveBack: () => navbar.classList.remove('is-dark'),
567
+ });
568
+ };
569
+
570
+
571
+
572
+
573
+
516
574
  window.stickyServices = function (e) {
517
575
  var wrapper = e;
518
576
  if (!wrapper || wrapper.dataset.stickyServicesInit === 'true') return;
@@ -525,12 +583,11 @@ window.stickyServices = function (e) {
525
583
  if (count === 0) return;
526
584
 
527
585
  var currentActive = -1;
528
- var ticking = false;
586
+ var displayedProgress = 0;
529
587
 
530
588
  function setActive(index) {
531
589
  if (index === currentActive) return;
532
590
  currentActive = index;
533
-
534
591
  for (var i = 0; i < navItems.length; i++) {
535
592
  navItems[i].classList.toggle('is-active', i === index);
536
593
  }
@@ -539,39 +596,33 @@ window.stickyServices = function (e) {
539
596
  }
540
597
  }
541
598
 
542
- function update() {
543
- ticking = false;
544
-
599
+ function getTargetProgress() {
545
600
  var rect = wrapper.getBoundingClientRect();
546
601
  var total = wrapper.offsetHeight - window.innerHeight;
547
-
548
- // Wrapper not tall enough to scroll through (e.g. very tall viewport) — keep first item active.
549
- if (total <= 0) {
550
- setActive(0);
551
- return;
552
- }
553
-
602
+ if (total <= 0) return 0;
554
603
  var scrolled = -rect.top;
555
- var progress = Math.min(1, Math.max(0, scrolled / total));
556
- var activeIndex = Math.min(count - 1, Math.floor(progress * count));
557
-
558
- setActive(activeIndex);
604
+ return Math.min(1, Math.max(0, scrolled / total));
559
605
  }
560
606
 
561
- function onScrollOrResize() {
562
- if (!ticking) {
563
- requestAnimationFrame(update);
564
- ticking = true;
607
+ function loop() {
608
+ var target = getTargetProgress();
609
+ displayedProgress += (target - displayedProgress) * 0.18;
610
+ if (Math.abs(target - displayedProgress) < 0.001) {
611
+ displayedProgress = target;
565
612
  }
613
+ var activeIndex = Math.min(count - 1, Math.floor(displayedProgress * count));
614
+ setActive(activeIndex);
615
+ requestAnimationFrame(loop);
566
616
  }
567
617
 
568
- window.addEventListener('scroll', onScrollOrResize, { passive: true });
569
- window.addEventListener('resize', onScrollOrResize);
570
-
571
- update(); // set correct state immediately on load (handles page-load mid-scroll / refresh position)
618
+ loop();
572
619
  };
573
620
 
574
621
 
622
+
623
+
624
+
625
+
575
626
  window.heroAnimationOnLoad = function(e) {
576
627
  const videoMask = e.querySelector('.hero_headline_ract-mask');
577
628
  const heroAnimation = gsap.timeline({}),