modal share
All checks were successful
Deploy / Deploy to pre-production (push) Successful in 5s

This commit is contained in:
Julie Blanc 2025-12-23 19:17:52 +01:00
parent 08ebf7fc9e
commit 5914178e2f
19 changed files with 440 additions and 63 deletions

19
assets/js/share.js Normal file
View file

@ -0,0 +1,19 @@
export function copyLink() {
let buttons = document.querySelectorAll('.copy-link button');
buttons.forEach(function (button, index) {
console.log(button);
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);
});
});
});
}