forked from lubiana/futtern
19 lines
No EOL
720 B
JavaScript
19 lines
No EOL
720 B
JavaScript
// Sparkle effect on mouse move
|
|
document.addEventListener('mousemove', function (e) {
|
|
const emojis = ['✨', '💖', '🌟', '💅', '🦄', '🎉', '🌈'];
|
|
const sparkle = document.createElement('div');
|
|
sparkle.className = 'emoji-footprint';
|
|
sparkle.textContent = emojis[Math.floor(Math.random() * emojis.length)];
|
|
sparkle.style.left = e.pageX + 'px';
|
|
sparkle.style.top = e.pageY + 'px';
|
|
document.body.appendChild(sparkle);
|
|
|
|
setTimeout(() => {
|
|
sparkle.remove();
|
|
}, 1000);
|
|
});
|
|
|
|
export function initEmojiFootprint() {
|
|
// The sparkle effect is already initialized when this module is imported
|
|
// This function can be used if we need to control when the effect starts
|
|
}
|