2024-06-25 00:30:57 +00:00
|
|
|
// disables kudos button after click
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
const kudosButton = document.querySelector('.kudos-button');
|
|
|
|
const kudosText = document.querySelector('.kudos-text');
|
|
|
|
const emojiSpan = kudosButton.querySelector('.emoji');
|
|
|
|
|
|
|
|
kudosButton.addEventListener('click', () => {
|
2024-06-25 01:56:55 +00:00
|
|
|
cabin.event('kudos')
|
2024-06-25 00:30:57 +00:00
|
|
|
kudosButton.disabled = true;
|
|
|
|
kudosButton.classList.add('clicked');
|
|
|
|
|
|
|
|
kudosText.textContent = 'Thanks!';
|
|
|
|
kudosText.classList.add('thanks');
|
|
|
|
|
|
|
|
// Rotate the emoji
|
|
|
|
emojiSpan.style.transform = 'rotate(360deg)';
|
|
|
|
|
|
|
|
// Change the emoji after rotation
|
|
|
|
setTimeout(() => {
|
|
|
|
emojiSpan.textContent = '🎉';
|
|
|
|
}, 150); // Half of the transition time for a smooth mid-rotation change
|
|
|
|
});
|
|
|
|
});
|