@widelab-nc/widelab 1.0.16 → 1.0.17

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.0.16",
3
+ "version": "1.0.17",
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
@@ -734,7 +734,6 @@ function customGsapEasing() {
734
734
  });
735
735
  });
736
736
  // Map boxes link special code
737
- document.addEventListener('DOMContentLoaded', (event) => {
738
737
  const elements = document.querySelectorAll('.map_info-wrapper');
739
738
  for (let i = 0; i < elements.length; i++) {
740
739
  const href = elements[i].getAttribute('href');
@@ -742,6 +741,42 @@ function customGsapEasing() {
742
741
  elements[i].style.cursor = 'pointer';
743
742
  }
744
743
  }
744
+ }
745
+
746
+ // Stats section headline animation
747
+ window.statsHeadlineAnimation = function() {
748
+ const statsHeadlineAnimation = gsap.timeline({
749
+ scrollTrigger: {
750
+ trigger: '#statsKnow',
751
+ start: 'center center',
752
+ toggleActions: 'restart none none reverse',
753
+ end: '+=500',
754
+ },
755
+ pause: 'paused',
756
+ ease: 'defaultEase',
757
+ }),
758
+ homeStatsHeading = new SplitText('#statsDone', {
759
+ type: 'lines',
760
+ linesClass: 'stats-line',
761
+ }),
762
+ homeStatsHeadingMask = new SplitText('#statsDone', {
763
+ type: 'lines',
764
+ linesClass: 'stats-line-mask',
765
+ });
766
+ statsHeadlineAnimation.to(
767
+ '#statsKnow',
768
+ {
769
+ duration: 0.5,
770
+ opacity: 0,
771
+ display: 'none',
772
+ },
773
+ '>'
774
+ );
775
+ statsHeadlineAnimation.from('.stats-line', {
776
+ duration: 0.5,
777
+ opacity: 0,
778
+ y: '100%',
779
+ stagger: 0.25,
745
780
  });
746
781
  }
747
782