@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/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/index.js +37 -26
package/package.json
CHANGED
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
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
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
|