ajout de boutton
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import {Element, MenuElement} from "./element.js";
|
import {Element, MenuElement} from "./element.js";
|
||||||
import {Grid} from "./grid.js";
|
|
||||||
import {fenetre} from "./windows.js";
|
import {fenetre} from "./windows.js";
|
||||||
import {LoginWindow} from "./login.js";
|
import {LoginWindow} from "./login.js";
|
||||||
import { GlobalChat } from "./global_chat.js";
|
import { GlobalChat } from "./global_chat.js";
|
||||||
|
import {avatarWindows} from "./avatarWindows.js";
|
||||||
|
|
||||||
function direBonjour() {
|
function direBonjour() {
|
||||||
alert("clicked !");
|
alert("clicked !");
|
||||||
@@ -16,15 +15,12 @@ const registeredElement = new MenuElement("registered");
|
|||||||
const explorerElement = new MenuElement("explorer");
|
const explorerElement = new MenuElement("explorer");
|
||||||
const accueilElement = new MenuElement("accueil");
|
const accueilElement = new MenuElement("accueil");
|
||||||
const globalChatElement = new MenuElement("global_chat");
|
const globalChatElement = new MenuElement("global_chat");
|
||||||
|
const avatarElement = new MenuElement("avatar");
|
||||||
// Start of the grid (commented if we dont use it yet)
|
|
||||||
// const gridgreen = new Grid('#143a0fff', -1, 25, 0.12, "normal");
|
|
||||||
// const gridReverseRed = new Grid('#3a0f0f75', -1, 12.5, 0.09, "reverse");
|
|
||||||
|
|
||||||
// Windows and screens
|
// Windows and screens
|
||||||
const test = new fenetre();
|
|
||||||
const loginWindow = new LoginWindow();
|
const loginWindow = new LoginWindow();
|
||||||
const global_chat = new GlobalChat();
|
const global_chat = new GlobalChat();
|
||||||
|
const avatar_windows = new avatarWindows();
|
||||||
|
|
||||||
|
|
||||||
// Actions UI
|
// Actions UI
|
||||||
document.getElementById("login").addEventListener("click", () => {
|
document.getElementById("login").addEventListener("click", () => {
|
||||||
@@ -44,3 +40,13 @@ document.getElementById("global_chat").addEventListener("click", () => {
|
|||||||
global_chat.show();
|
global_chat.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById("avatar").addEventListener("click", () => {
|
||||||
|
// Toggle global chat visibility
|
||||||
|
if (avatarWindows.main && avatarWindows.main.style.display !== "none") {
|
||||||
|
avatarWindows.hide();
|
||||||
|
} else {
|
||||||
|
avatarWindows.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import {fenetre} from "./windows.js";
|
||||||
|
|
||||||
|
export class avatarWindows extends fenetre {
|
||||||
|
constructor(){
|
||||||
|
super(320, 240, "Avatar");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<button id="registered" aria-label="Enregistré">Enregistré</button>
|
<button id="registered" aria-label="Enregistré">Enregistré</button>
|
||||||
<button id="login" aria-label="Login">Login</button>
|
<button id="login" aria-label="Login">Login</button>
|
||||||
<button id="global_chat" aria-label="Global chat">Global chat</button>
|
<button id="global_chat" aria-label="Global chat">Global chat</button>
|
||||||
|
<button id="avatar" aria-label="avatar">avatar</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<button onclick="direBonjour()" style="position: absolute; top: 20%; left: 50%; z-index: 1;">
|
<button onclick="direBonjour()" style="position: absolute; top: 20%; left: 50%; z-index: 1;">
|
||||||
|
|||||||
Reference in New Issue
Block a user