/uploads/articles/pexim 6_55.jpeg
/uploads/articles/pexim 3_70.jpeg
/uploads/articles/pexim 2_56.jpeg
/uploads/articles/pexim_22.jpeg
/uploads/articles/pexim 5_41.jpeg
/uploads/articles/PEXIM 7_50.jpeg
/uploads/articles/trinity_11.jpg
/uploads/articles/IMG_7236_26.jpg
The Pexim Foundation Annual Dinner 2025 at Trinity College, Cambridge








{
showCopyNotification('Link copied!');
}).catch(err => {
console.error('Failed to copy link:', err);
fallbackCopyTextToClipboard(articleUrl);
});
} else {
// Fallback for older browsers
fallbackCopyTextToClipboard(articleUrl);
}
}
/**
* Fallback method for copying text
*/
function fallbackCopyTextToClipboard(text) {
const textArea = document.createElement("textarea");
textArea.value = text;
// Avoid scrolling to bottom
textArea.style.top = "0";
textArea.style.left = "0";
textArea.style.position = "fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
const successful = document.execCommand('copy');
if (successful) {
showCopyNotification('Link copied!');
} else {
console.error('Failed to copy link');
}
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);
}
document.body.removeChild(textArea);
}
/**
* Show copy notification
*/
function showCopyNotification(message) {
// Remove existing notifications
const existingNotifications = document.querySelectorAll('.copy-notification');
existingNotifications.forEach(notification => notification.remove());
// Create notification element
const notification = document.createElement('div');
notification.className = 'copy-notification';
notification.textContent = message;
notification.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
background: #28a745;
color: white;
padding: 12px 20px;
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 1000;
font-size: 14px;
font-weight: 500;
opacity: 0;
transform: translateY(-20px);
transition: all 0.3s ease;
`;
document.body.appendChild(notification);
// Animate in
setTimeout(() => {
notification.style.opacity = '1';
notification.style.transform = 'translateY(0)';
}, 100);
// Remove after 3 seconds
setTimeout(() => {
notification.style.opacity = '0';
notification.style.transform = 'translateY(-20px)';
setTimeout(() => {
if (notification.parentNode) {
notification.parentNode.removeChild(notification);
}
}, 300);
}, 3000);
}
Comments
0 komentaraLeave a comment
💬 No comments yet. Be the first!