diff --git a/src/front/index.html b/src/front/index.html
index 6471bae..de47004 100644
--- a/src/front/index.html
+++ b/src/front/index.html
@@ -36,6 +36,7 @@
+
-
diff --git a/src/front/static/ts/main.ts b/src/front/static/ts/main.ts
index 5301e4e..731a972 100644
--- a/src/front/static/ts/main.ts
+++ b/src/front/static/ts/main.ts
@@ -1,6 +1,8 @@
import { oneko } from "./oneko.ts";
import ProfileMenu from "./views/ProfileMenu.ts";
+import FriendsMenu from "./views/Friends.ts";
let profile_view = new ProfileMenu;
+let friends_view = new FriendsMenu;
export async function isLogged(): Promise {
let uuid_req = await fetch("http://localhost:3001/me", {
@@ -40,7 +42,6 @@ const routes = [
{ path: "/login", view: () => import("./views/LoginPage.ts") },
{ path: "/register", view: () => import("./views/RegisterPage.ts") },
- { path: "/friends", view: () => import("./views/Friends.ts") },
{ path: "/profile", view: () => import("./views/Profile.ts") },
{ path: "/settings", view: () => import("./views/Settings.ts") },
];
@@ -74,11 +75,17 @@ window.addEventListener("popstate", router);
document.addEventListener("DOMContentLoaded", () => {
isLogged();
+
+
document.body.addEventListener("click", e => {
if (!e.target.closest("#taskbar-menu") && !e.target.matches("#profile-button")) {
profile_view.open = false;
document.getElementById("taskbar-menu").innerHTML = "";
}
+ if (e.target.matches("#friends-btn")) {
+ friends_view.open = !friends_view.open;
+ friends_view.run();
+ }
if (e.target.matches("[data-link]")) {
e.preventDefault();
navigationManager(e.target.href);
@@ -114,6 +121,8 @@ function updateClock()
clock.innerHTML = `${days[now.getDay()]} ${now.getDate()} ${months[now.getMonth()]} ` + hours + ":" + minutes;
}
+friends_view.run();
+
setInterval(updateClock, 5000);
updateClock();
diff --git a/src/front/static/ts/views/Friends.ts b/src/front/static/ts/views/Friends.ts
index 2a9d0b3..7e11e4e 100644
--- a/src/front/static/ts/views/Friends.ts
+++ b/src/front/static/ts/views/Friends.ts
@@ -5,6 +5,8 @@ import { isLogged, navigationManager } from "../main.ts"
export default class extends Aview {
+ open: Boolean = false;
+
constructor() {
super();
this.setTitle("friends list");
@@ -13,28 +15,22 @@ export default class extends Aview {
async getHTML() {
return `
-
-