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"
This commit is contained in:
Kum1ta
2024-08-05 00:26:27 +02:00
parent 28793464ca
commit 6c47454e28
6 changed files with 165 additions and 9 deletions

View File

@ -6,12 +6,24 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/30 13:50:35 by edbernar #+# #+# */
/* Updated: 2024/08/04 19:20:02 by edbernar ### ########.fr */
/* 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");
});