@widelab-nc/widehue 1.0.12 → 1.0.13

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/widehue",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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
@@ -521,37 +521,48 @@ window.textScroll = function(e) {
521
521
  };
522
522
 
523
523
 
524
- window.heroFixedSections = function(e) {
525
- let panels = gsap.utils.toArray(".herofixedsection");
526
- // Create a ScrollTrigger for each panel just to track when each panel's top hits the top of the viewport (only needed for snapping)
527
- let tops = panels.map(panel => ScrollTrigger.create({trigger: panel, start: "top top"}));
528
524
 
529
- panels.forEach((panel, i) => {
530
- ScrollTrigger.create({
531
- trigger: panel,
532
- start: () => panel.offsetHeight < window.innerHeight ? "top top" : "bottom bottom", // if it's shorter than the viewport, we prefer to pin it at the top
533
- pin: true,
534
- markers: false,
535
- pinSpacing: false,
536
- scrub: 3,
525
+ window.HoverMaskVideo = function(e) {
526
+ const hoverTitles = $(".hover-title");
527
+ const hoverMasks = $(".hover-mask");
528
+ const hoverListItems = $(".hover-list-item");
529
+
530
+ hoverTitles.each(function(index) {
531
+ const animation = gsap.fromTo(
532
+ hoverMasks[index],
533
+ { height: '0vh' }, // Start from 0vh
534
+ {
535
+ height: '73vh', // Go to 73vh
536
+ ease: 'loader',
537
+ duration: 1.5,
538
+ paused: true // Animation starts in reverse
539
+ }
540
+ );
541
+
542
+ $(this).on("mouseenter", () => {
543
+ animation.duration(1.5).play(); // Set duration to 1.5s and play
544
+ const closestListItem = $(this).closest(".hover-list-item")[0];
545
+ if (closestListItem) {
546
+ closestListItem.style.zIndex = 10;
547
+ }
548
+ });
549
+
550
+ $(this).on("mouseleave", () => {
551
+ animation.duration(0).reverse(); // Set duration to 0s and reverse
552
+ const closestListItem = $(this).closest(".hover-list-item")[0];
553
+ if (closestListItem) {
554
+ closestListItem.style.zIndex = ''; // Remove inline style
555
+ }
537
556
  });
538
557
  });
558
+ };
559
+
560
+
561
+
562
+
563
+
539
564
 
540
- // Adding fade out effect for .cover-bg element
541
- let coverBg = document.querySelector('.cover-bg');
542
565
 
543
- if (coverBg) {
544
- ScrollTrigger.create({
545
- trigger: '.cover-bg',
546
- start: "bottom center+=300", // Define the start point with an offset
547
- end: "bottom top+=400", // Define the end point
548
- scrub: true, // Smoothly scrub the animation based on the scroll position
549
- onUpdate: self => {
550
- gsap.to(coverBg, {opacity: self.progress, overwrite: true});
551
- },
552
- });
553
- }
554
- }
555
566
  // Case study mask animation
556
567
  window.caseStudyInteraction = function(e) {
557
568
  // Video mask animation