-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (22 loc) · 783 Bytes
/
index.js
File metadata and controls
24 lines (22 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const buttons = document.querySelectorAll('.button')
const emailBtn = document.querySelector('.emailBtn')
const tooltipText = document.querySelector('.tooltipText')
emailBtn.addEventListener('click', () => {
navigator.clipboard.writeText("miloclack@gmail.com");
tooltipText.style.visibility = 'visible';
setTimeout(() => {
tooltipText.style.visibility = 'hidden';
}, 2200);
})
buttons.forEach((button) => {
button.addEventListener('click', (e) => {
let url = e.target.firstElementChild.href
if (!e.target.classList.contains('inactiveLink')) {
if (e.target.classList.contains('projectLink')) {
window.open(url);
} else {
window.open(url, '_self');
}
}
})
})