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:
@ -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");
|
||||
});
|
Reference in New Issue
Block a user