@widelab-nc/widelab 1.1.17 → 1.1.19
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 +23 -6
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -86,13 +86,29 @@ function contactFormOpenAnimation() {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
// Scroll disable
|
|
89
|
+
// Scroll disable when mobile menu opened
|
|
90
90
|
function disableScrollMenu() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
function observeNavOverlay() {
|
|
92
|
+
const target = document.querySelector('.w-nav-overlay');
|
|
93
|
+
const config = { attributes: true, attributeFilter: ['style'] };
|
|
94
|
+
const callback = function(mutationsList, observer) {
|
|
95
|
+
for(const mutation of mutationsList) {
|
|
96
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
|
|
97
|
+
const displayValue = target.style.display;
|
|
98
|
+
if (displayValue === 'none') {
|
|
99
|
+
document.body.classList.remove('is-scroll-off');
|
|
100
|
+
lenis.start();
|
|
101
|
+
} else {
|
|
102
|
+
document.body.classList.add('is-scroll-off');
|
|
103
|
+
lenis.stop();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const observer = new MutationObserver(callback);
|
|
109
|
+
observer.observe(target, config);
|
|
110
|
+
}
|
|
111
|
+
observeNavOverlay();
|
|
96
112
|
}
|
|
97
113
|
|
|
98
114
|
// Hero move to reveal footer
|
|
@@ -1155,6 +1171,7 @@ window.scrollTriggerRefresh = function() {
|
|
|
1155
1171
|
pageTransitionAnimation();
|
|
1156
1172
|
customCursorOnClick();
|
|
1157
1173
|
contactFormOpenAnimation();
|
|
1174
|
+
disableScrollMenu();
|
|
1158
1175
|
if (window.innerWidth < 992) {
|
|
1159
1176
|
disableScrollMenu();
|
|
1160
1177
|
}
|