-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (25 loc) · 1.36 KB
/
index.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
const copyButton = document.getElementById("copy-button");
const modalEmail = document.getElementById("modal-email");
const copyDone = document.getElementById("copy-done");
const contactButton = document.getElementById("contact-button");
const modal = document.getElementById("modal");
const modalContent = document.getElementById("modal-content");
const navigationCheck = document.getElementById("navigation-check");
const navigation = document.getElementById("navigation");
const scrollDown = document.getElementById("scroll-down-button");
const capabilitiesHeading = document.getElementById("capabilities-heading");
const reviews = document.getElementById("reviews");
copyButton.addEventListener("click", copyEmailToClipboard);
contactButton.addEventListener("click", () => modal.style.display = "flex");
modal.addEventListener("click", () => modal.style.display = "none");
modalContent.addEventListener("click", (event) => event.stopPropagation());
navigationCheck.addEventListener("click", () => navigation.classList.toggle("navigation-open"));
scrollDown.addEventListener("click", () => capabilitiesHeading.scrollIntoView({
"behavior": "smooth",
}));
function copyEmailToClipboard() {
navigator.clipboard.writeText(modalEmail.innerText);
copyDone.classList.remove("copy-done-animation");
void copyDone.offsetWidth;
copyDone.classList.add("copy-done-animation");
}