Files
METH_Transcendence/site/interface/site/main.js
Kum1ta c562e32af3 Websocket (client)
- add variable for know if websocket is connected and used it for don t send something if not connected
Notification system (client)
	- created new class notification who can use with exported variable "createNotification"
	- available methods :  info, success, warning, error
	- add "todo" in main file
Site
	- add new stylesheet "notification.css"
2024-08-05 00:26:27 +02:00

29 lines
1.3 KiB
JavaScript

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/30 13:50:35 by edbernar #+# #+# */
/* Updated: 2024/08/04 23:47:45 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
import { liveChat } from "./liveChat/main.js";
import { createNotification } from "./notification/main.js";
document.addEventListener('DOMContentLoaded', () => {
liveChat();
});
document.addEventListener("keydown", (e) => {
if (e.key === "/")
createNotification.info("Hello");
if (e.key === "*")
createNotification.success("Hello");
if (e.key === "-")
createNotification.error("Hello");
});