forked from ChromeGaming/Community-Page
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (41 loc) · 1.63 KB
/
script.js
File metadata and controls
50 lines (41 loc) · 1.63 KB
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
const nav = document.querySelector(".nav"),
searchIcon = document.querySelector("#searchIcon"),
navOpenBtn = document.querySelector(".navOpenBtn"),
navCloseBtn = document.querySelector(".navCloseBtn");
searchIcon.addEventListener("click", () => {
nav.classList.toggle("openSearch");
nav.classList.remove("openNav");
if (nav.classList.contains("openSearch")) {
return searchIcon.classList.replace("uil-search", "uil-times");
}
searchIcon.classList.replace("uil-times", "uil-search");
});
navOpenBtn.addEventListener("click", () => {
nav.classList.add("openNav");
nav.classList.remove("openSearch");
searchIcon.classList.replace("uil-times", "uil-search");
});
navCloseBtn.addEventListener("click", () => {
nav.classList.remove("openNav");
});
document.addEventListener("DOMContentLoaded", function() {
const discordButton = document.getElementById('discord-button');
const discordPopup = document.getElementById('discord-popup');
const closeBtn = document.getElementById('close-btn');
discordButton.addEventListener('click', function() {
discordPopup.style.display = 'block';
});
closeBtn.addEventListener('click', function() {
discordPopup.style.display = 'none';
});
});
document.addEventListener("DOMContentLoaded", function() {
const discordPopup = document.getElementById('discord-popup');
const closeBtn = document.getElementById('close-btn');
discordButton.addEventListener('click', function() {
discordPopup.style.display = 'block';
});
closeBtn.addEventListener('click', function() {
discordPopup.style.display = 'none';
});
});