@widelab-nc/widelab 1.1.45 → 1.1.46
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 -12
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -552,25 +552,36 @@ window.hueAwardsAnimation = function(e) {
|
|
|
552
552
|
|
|
553
553
|
|
|
554
554
|
|
|
555
|
+
window.navbarThemeWatcher = function () {
|
|
556
|
+
function checkNavbarTheme() {
|
|
557
|
+
var stack = document.elementsFromPoint(window.innerWidth / 2, 20);
|
|
558
|
+
var isDark = stack.some(function (el) {
|
|
559
|
+
return el.closest && el.closest('.is-dark-bg');
|
|
560
|
+
});
|
|
561
|
+
document.body.classList.toggle('is-nav-dark', isDark);
|
|
562
|
+
}
|
|
555
563
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
});
|
|
564
|
+
var ticking = false;
|
|
565
|
+
function onScroll() {
|
|
566
|
+
if (!ticking) {
|
|
567
|
+
requestAnimationFrame(function () {
|
|
568
|
+
checkNavbarTheme();
|
|
569
|
+
ticking = false;
|
|
570
|
+
});
|
|
571
|
+
ticking = true;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
window.addEventListener('scroll', onScroll, { passive: true });
|
|
576
|
+
window.addEventListener('resize', onScroll);
|
|
577
|
+
checkNavbarTheme();
|
|
568
578
|
};
|
|
569
579
|
|
|
570
580
|
|
|
571
581
|
|
|
572
582
|
|
|
573
583
|
|
|
584
|
+
|
|
574
585
|
window.stickyServices = function (e) {
|
|
575
586
|
var wrapper = e;
|
|
576
587
|
if (!wrapper || wrapper.dataset.stickyServicesInit === 'true') return;
|