-
Notifications
You must be signed in to change notification settings - Fork 4
/
script.js
63 lines (50 loc) · 1.85 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var isOpen = true
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
window.onload = function() {
if (width <= 1000) {
isOpen = false
}
handleNav()
}
function handleNav() {
if (isOpen) {
//Opens the sidebar
document.getElementById("SideBar").style.width = "200px";
document.getElementById("SideBar").style.padding = "20px";
document.getElementById("Main").style.marginLeft = "250px";
document.getElementById("MenuButton").innerHTML = "×"
document.getElementById("MiniBar").style.marginLeft = "250px";
if (width > 1000) {
document.getElementById("MiniBar").style.display = "none";
}
} else {
//Closes the sidebar
document.getElementById("SideBar").style.width = "0px";
document.getElementById("SideBar").style.padding = "0px";
document.getElementById("Main").style.marginLeft = "5px";
document.getElementById("MenuButton").innerHTML = "→"
document.getElementById("MiniBar").style.marginLeft = "5px";
if (width > 1000) {
document.getElementById("MiniBar").style.display = "block";
}
}
isOpen = !isOpen
}
// script.js
(function() {
// Load Google Tag Manager script asynchronously
var gtagScript = document.createElement('script');
gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-9CPRSLKZTZ';
gtagScript.async = true;
document.head.appendChild(gtagScript);
// Initialize dataLayer if not already initialized
window.dataLayer = window.dataLayer || [];
// Function to push data to dataLayer
function gtag() {
dataLayer.push(arguments);
}
// Call gtag function to set up tracking
gtag('js', new Date());
// Configure Google Analytics with your tracking ID
gtag('config', 'G-9CPRSLKZTZ');
})();