@widelab-nc/widelab 1.1.25 → 1.1.27

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.25",
3
+ "version": "1.1.27",
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
@@ -928,6 +928,8 @@ window.badgeColorChange = function(e) {
928
928
  }
929
929
  }
930
930
 
931
+
932
+
931
933
  // Stats section headline animation
932
934
  window.statsHeadlineAnimation = function() {
933
935
  const statsHeadlineAnimation = gsap.timeline({
@@ -992,7 +994,10 @@ window.counterUpAnimation = function() {
992
994
  });
993
995
  }
994
996
 
995
- // Sliders on Clients page
997
+
998
+
999
+
1000
+
996
1001
  window.heroSliders = function(e) {
997
1002
  console.log("Initializing Splide on element:", e);
998
1003
 
@@ -1016,6 +1021,67 @@ window.heroSliders = function(e) {
1016
1021
  const slider = new Splide(e, config).mount();
1017
1022
  console.log("Splide instance:", slider);
1018
1023
 
1024
+ const descriptions = e.querySelectorAll('.slider-description');
1025
+
1026
+ // Set the initial state: Hide descriptions except the one in the active slide
1027
+ descriptions.forEach(desc => {
1028
+ if (!desc.closest('.splide__slide').classList.contains('is-active')) {
1029
+ gsap.set(desc, { opacity: 0 });
1030
+ }
1031
+ });
1032
+
1033
+ if (window.innerWidth > 992) {
1034
+ slider.on('click', function () {
1035
+ slider.go('+1');
1036
+ });
1037
+ }
1038
+
1039
+ // Hide descriptions instantly on slide change
1040
+ slider.on('move', function() {
1041
+ gsap.set(descriptions, { opacity: 0 });
1042
+ });
1043
+
1044
+ // Show description on new active slide
1045
+ slider.on('active', function (slide) {
1046
+ gsap.to(slide.slide.querySelectorAll('.slider-description'), { opacity: 1, duration: 0.15, ease: 'linear' });
1047
+ });
1048
+
1049
+ gsap.from(e, {
1050
+ scrollTrigger: {
1051
+ trigger: e,
1052
+ start: 'top bottom',
1053
+ end: 'bottom bottom+=15%',
1054
+ scrub: 1,
1055
+ once: true,
1056
+ },
1057
+ x: '10%',
1058
+ opacity: 0,
1059
+ ease: 'linear',
1060
+ });
1061
+ }
1062
+
1063
+
1064
+
1065
+ // Sliders on Services page
1066
+ window.servicesSliders = function(e) {
1067
+ const config = {
1068
+ type: 'loop',
1069
+ perPage: 1,
1070
+ gap: 0,
1071
+ arrows: false,
1072
+ drag: false,
1073
+ duration: 0.15,
1074
+ easing: 'cubic-bezier(0.83, 0, 0.17, 1)',
1075
+ classes: {
1076
+ pagination: 'splide__pagination services-pagination',
1077
+ page: 'splide__pagination__page services-page',
1078
+ },
1079
+ breakpoints: {
1080
+ 992: { drag: true, fixedWidth: '90%' },
1081
+ 480: {},
1082
+ },
1083
+ };
1084
+ const slider = new Splide(e, config).mount();
1019
1085
  if (window.innerWidth > 992) {
1020
1086
  slider.on('click', function () {
1021
1087
  slider.go('+1');