{"size": 540, "ext": "js", "max_stars_repo_path": "assets/js/notifications.js", "max_stars_repo_name": "1eedaegon/draw-game-practice", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "assets/js/notifications.js", "max_issues_repo_name": "1eedaegon/draw-game-practice", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assets/js/notifications.js", "max_forks_repo_name": "1eedaegon/draw-game-practice", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.0, "max_line_length": 65, "alphanum_fraction": 0.6962962963}
const body = document.querySelector('body');

const fireNotification = (text, color) => {
  const notification = document.createElement('div');
  notification.innerText = text;
  notification.style.background = color;
  notification.className = 'notification';
  body.appendChild(notification);
};

export const handleNewUser = ({ nickname }) => {
  fireNotification(`${nickname} has joined!`, 'rgb(0,122,255)');
};

export const handleDisconnected = ({ nickname }) => {
  fireNotification(`${nickname} just left!`, 'rgb(255, 149, 0)');
};
