1 parent 0d00302 commit 29c2a6dCopy full SHA for 29c2a6d
1 file changed
script.js
@@ -28,4 +28,15 @@
28
document.querySelectorAll('.cta-bot').forEach(a => {
29
a.href='https://t.me/MetridexBot'; a.target='_blank'; a.rel='noopener';
30
});
31
+
32
+ // Compensate body padding for fixed nav exact height
33
+ const nav = document.getElementById('siteNav');
34
+ function setOffset(){
35
+ if(!nav) return;
36
+ const h = nav.getBoundingClientRect().height || 72;
37
+ document.body.classList.add('has-fixed-nav');
38
+ document.body.style.paddingTop = h + 'px';
39
+ }
40
+ window.addEventListener('load', setOffset);
41
+ window.addEventListener('resize', setOffset);
42
})();
0 commit comments