-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
34 lines (25 loc) · 930 Bytes
/
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
const embeddedText = document.querySelectorAll("div.embedded-link");
const hidden = document.querySelectorAll("div.hidden");
const option = document.querySelectorAll("div.option-box");
//box expanding for links
for(let i = 0; i < option.length; i++){
option[i].addEventListener("mouseover", function onHover () {
hidden[i].style.display='block';
option[i].style.height = '600px';
});
}
//box shrinking
for(let i = 0; i < option.length; i++){
option[i].addEventListener("mouseout", function onHoverExit () {
hidden[i].style.display='none';
option[i].style.height = '400px';
});
}
//copy link popup
for (let i = 0; i < embeddedText.length; i++){
embeddedText[i].addEventListener('click', function copyLink() {
navigator.clipboard.writeText(embeddedText[i].textContent);
//SweetAlert popup
swal("Link Copied!");
});
}