-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
21 lines (18 loc) · 728 Bytes
/
Copy pathapp.js
File metadata and controls
21 lines (18 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const elements = document.querySelectorAll("li")
const notification = document.querySelector('.notification')
for (const element of elements) {
element.addEventListener('click', function(e) {
var boxShadow = 'box-shadow: ' + window.getComputedStyle(this).getPropertyValue('box-shadow') + ';'
console.log(boxShadow.toString())
navigator.clipboard.writeText(boxShadow.toString()).then(function() {
/* clipboard successfully set */
notification.classList.add("notification--active")
console.log("Copied to Clipboard")
setTimeout(function(){
notification.classList.remove("notification--active")
}, 1200);
}, function() {
alert("Clipboard copy failed")
});
})
}