@widelab-nc/widelab 1.1.25 → 1.1.26

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.26",
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
@@ -992,7 +992,10 @@ window.counterUpAnimation = function() {
992
992
  });
993
993
  }
994
994
 
995
- // Sliders on Clients page
995
+
996
+
997
+
998
+
996
999
  window.heroSliders = function(e) {
997
1000
  console.log("Initializing Splide on element:", e);
998
1001
 
@@ -1016,11 +1019,31 @@ window.heroSliders = function(e) {
1016
1019
  const slider = new Splide(e, config).mount();
1017
1020
  console.log("Splide instance:", slider);
1018
1021
 
1022
+ const descriptions = e.querySelectorAll('.slider-description');
1023
+
1024
+ // Set the initial state: Hide descriptions except the one in the active slide
1025
+ descriptions.forEach(desc => {
1026
+ if (!desc.closest('.splide__slide').classList.contains('is-active')) {
1027
+ gsap.set(desc, { opacity: 0 });
1028
+ }
1029
+ });
1030
+
1019
1031
  if (window.innerWidth > 992) {
1020
1032
  slider.on('click', function () {
1021
1033
  slider.go('+1');
1022
1034
  });
1023
1035
  }
1036
+
1037
+ // Hide descriptions instantly on slide change
1038
+ slider.on('move', function() {
1039
+ gsap.set(descriptions, { opacity: 0 });
1040
+ });
1041
+
1042
+ // Show description on new active slide
1043
+ slider.on('active', function (slide) {
1044
+ gsap.to(slide.slide.querySelectorAll('.slider-description'), { opacity: 1, duration: 0.15, ease: 'linear' });
1045
+ });
1046
+
1024
1047
  gsap.from(e, {
1025
1048
  scrollTrigger: {
1026
1049
  trigger: e,
@@ -1037,6 +1060,10 @@ window.heroSliders = function(e) {
1037
1060
 
1038
1061
 
1039
1062
 
1063
+
1064
+
1065
+
1066
+
1040
1067
  // Case study - What's next interaction
1041
1068
  window.whatsNext = function() {
1042
1069
  const caseItem = document.querySelectorAll('.whats-next_links_item.is-case');