mirror of
https://github.com/WatchOutNewsAgency/wona.github.com.git
synced 2026-02-10 15:00:54 +00:00
Compare commits
3 Commits
7f968ddd5d
...
anee-branc
| Author | SHA1 | Date | |
|---|---|---|---|
| 58cb5c09f2 | |||
| 2f6bdbdf54 | |||
| 1518f633c6 |
@ -1,15 +1,9 @@
|
|||||||
|
<!-- Google tag (gtag.js) -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0DKSQSXFTB"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
<!-- Google Analytics -->
|
gtag('config', 'G-0DKSQSXFTB');
|
||||||
<script type="text/javascript">
|
</script>
|
||||||
|
|
||||||
var _gaq = _gaq || [];
|
|
||||||
_gaq.push(['_setAccount', 'UA-35663579-1']);
|
|
||||||
_gaq.push(['_trackPageview']);
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
||||||
@ -105,17 +105,20 @@
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Mobile menu elements
|
// Mobile menu elements
|
||||||
const mobileToggle = document.getElementById('mobile-menu-toggle');
|
|
||||||
const mobileNav = document.getElementById('mobile-nav');
|
const mobileNav = document.getElementById('mobile-nav');
|
||||||
const mobileNavOverlay = document.getElementById('mobile-nav-overlay');
|
const mobileNavOverlay = document.getElementById('mobile-nav-overlay');
|
||||||
const mobileNavClose = document.getElementById('mobile-nav-close');
|
const mobileNavClose = document.getElementById('mobile-nav-close');
|
||||||
|
const mobileToggle = document.getElementById('mobile-menu-toggle');
|
||||||
// Function to open mobile menu
|
// Function to open mobile menu
|
||||||
function openMobileMenu() {
|
function openMobileMenu() {
|
||||||
if (mobileNav && mobileNavOverlay) {
|
if (mobileNav && mobileNavOverlay) {
|
||||||
mobileNav.classList.add('show');
|
mobileNav.classList.add('show');
|
||||||
mobileNavOverlay.classList.add('show');
|
mobileNavOverlay.classList.add('show');
|
||||||
mobileToggle.classList.add('active');
|
const toggle = document.getElementById('mobile-menu-toggle');
|
||||||
|
if (toggle) {
|
||||||
|
toggle.parentElement.removeChild(toggle);
|
||||||
|
}
|
||||||
document.body.style.overflow = 'hidden'; // Prevent body scroll
|
document.body.style.overflow = 'hidden'; // Prevent body scroll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,9 +128,29 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
if (mobileNav && mobileNavOverlay) {
|
if (mobileNav && mobileNavOverlay) {
|
||||||
mobileNav.classList.remove('show');
|
mobileNav.classList.remove('show');
|
||||||
mobileNavOverlay.classList.remove('show');
|
mobileNavOverlay.classList.remove('show');
|
||||||
mobileToggle.classList.remove('active');
|
|
||||||
document.body.style.overflow = ''; // Restore body scroll
|
document.body.style.overflow = ''; // Restore body scroll
|
||||||
|
if (!document.getElementById('mobile-menu-toggle')) {
|
||||||
|
const newToggle = document.createElement('button');
|
||||||
|
newToggle.type = 'button';
|
||||||
|
newToggle.id = 'mobile-menu-toggle';
|
||||||
|
newToggle.className = 'navbar-toggle visible-xs position-fixed top-0 end-0 m-3 z-1030';
|
||||||
|
newToggle.innerHTML = `
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
`;
|
||||||
|
|
||||||
|
const container = document.querySelector('.pre-nav');
|
||||||
|
if (container) container.appendChild(newToggle);
|
||||||
|
|
||||||
|
newToggle.addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
openMobileMenu();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Close all open dropdowns
|
// Close all open dropdowns
|
||||||
const openDropdowns = document.querySelectorAll('.mobile-nav .dropdown.open');
|
const openDropdowns = document.querySelectorAll('.mobile-nav .dropdown.open');
|
||||||
openDropdowns.forEach(function(dropdown) {
|
openDropdowns.forEach(function(dropdown) {
|
||||||
|
|||||||
Reference in New Issue
Block a user