view react_games/public/landing_page.js @ 156:cd35e600ae34

[MarkDown Converter] Fixed few things and made a test
author June Park <parkjune1995@gmail.com>
date Mon, 12 Jan 2026 15:20:39 -0800
parents fb9bcd3145cb
children
line wrap: on
line source

const createStars = (x, y) => {
  const star = document.createElement("div");

  star.style.position = 'fixed';
  star.style.left = x + 'px';
  star.style.top = y + 'px';
  star.style.width = '4px';
  star.style.height = '4px';
  star.style.background = 'white';
  star.style.borderRadius = '50%';
  star.style.pointerEvents = 'none';
  star.style.zIndex = '1000';
  star.style.animation = 'sparkleAnim 1s ease-out forwards';

  document.body.appendChild(star);

  setTimeout(() => {
    star.remove();
  }, 1000);
}

document.addEventListener('mousemove', (e) => {
  if (Math.random() > 0.99) {
    createStars(e.clientX, e.clientY);
  }
});