23 lines
777 B
JavaScript
23 lines
777 B
JavaScript
export function copyLink() {
|
|
let buttons = document.querySelectorAll('.copy-link button');
|
|
buttons.forEach(function (button, index) {
|
|
let link = button.parentNode.querySelector("input").value;
|
|
|
|
button.addEventListener('click', function() {
|
|
navigator.clipboard.writeText(link).then(() => {
|
|
const originalText = button.textContent;
|
|
button.textContent = 'Lien copié';
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
}, 1000);
|
|
}).catch(err => {
|
|
console.error('Erreur lors de la copie:', err);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
|
|
export function shareModal() {
|
|
let buttons = document.querySelectorAll('.btn__share');
|
|
}
|