2022-10-11 13:28:46 +04:00
|
|
|
const body = document.body
|
2021-08-13 14:34:50 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
function copyLink(/** @type {Event} */ ev) {
|
2021-07-23 11:00:33 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
/** @type {HTMLSpanElement} */
|
|
|
|
let elem = ev.currentTarget
|
2021-07-23 11:00:33 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
navigator.clipboard.writeText(elem.dataset.link)
|
2021-07-23 11:00:33 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
let wrapper = elem.parentElement.parentElement.parentElement
|
|
|
|
let msg = wrapper.querySelector('.copied')
|
2021-07-23 11:00:33 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
msg.classList.add(...fadeAnimIn)
|
2021-07-23 11:00:33 +04:00
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
msg.classList.remove(...fadeAnimIn)
|
2021-07-23 11:00:33 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
msg.classList.add('show')
|
|
|
|
msg.classList.add(...fadeAnimOut)
|
2021-08-13 14:34:50 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
setTimeout(() => {
|
|
|
|
msg.classList.remove(...fadeAnimOut)
|
|
|
|
msg.classList.remove(...fadeAnimIn)
|
|
|
|
}, 600)
|
2021-08-13 14:34:50 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
}, 1500)
|
|
|
|
}
|
2021-08-13 14:34:50 +04:00
|
|
|
|
2022-10-11 13:28:46 +04:00
|
|
|
function styleValue(/** @type {string} */ prop) {
|
|
|
|
return prop.replace('px', '') * 1
|
|
|
|
}
|