+
+
diff --git a/public_html/js/input.js b/public_html/js/input.js
index 1203b48..6dd538f 100644
--- a/public_html/js/input.js
+++ b/public_html/js/input.js
@@ -40,6 +40,10 @@ class Input {
this.updateDir();
})
+ document.getElementById("retour_menu").addEventListener("click", (e) => {
+ phone.changeWindow(1)
+ });
+
window.addEventListener("keyup", (e)=>{
this.keysDown.delete(e.key.toLowerCase())
this.updateDir();
diff --git a/public_html/js/phone.js b/public_html/js/phone.js
index 9bd5d74..acbb7b1 100644
--- a/public_html/js/phone.js
+++ b/public_html/js/phone.js
@@ -2,6 +2,66 @@ class Phone{
constructor(){
this.position = 0;
this.messages = [];
+ this.name = document.getElementById("TitlePage");
+
+ this.content = document.getElementById("content");
+ this.contentmsg = document.getElementById("chatMessages");
+ this.inputDiv = document.getElementById("chatInputDiv");
+ this.webview = document.getElementById("webview");
+
+ this.webviewName = "Erreur"
+
+ this.chargeMainPage();
+ this.changeWindow(1)
+ }
+
+ chargeMainPage() {
+ document.getElementById("appli-concord").addEventListener("click", (e) => {
+ this.changeWindow(2)
+ });
+ document.getElementById("appli-gta6").addEventListener("click", (e) => {
+ this.webviewName = "GTA 6"
+ this.changeWindow("game.html")
+ });
+ document.getElementById("appli-vbuks").addEventListener("click", (e) => {
+ this.webviewName = "Free Vbucks"
+ this.changeWindow("assets/phone/webview/vbucks.html")
+ });
+ document.getElementById("appli-fb").addEventListener("click", (e) => {
+ this.webviewName = "FakeBook"
+ this.changeWindow("assets/phone/webview/fb.html")
+ });
+ }
+
+ changeWindow(window) {
+ //1 main view phone.changeWindow(
+ //2 concorde
+ //other webview
+ this.content.style.display="none";
+ this.contentmsg.style.display="none";
+ this.inputDiv.style.display="none";
+ this.webview.style.display = "none";
+ this.webview.src="";
+
+ switch (window) {
+ case 1:
+ this.name.innerText = "Pear phone"
+ this.content.style.display="block";
+ break;
+ case 2:
+ this.name.innerText = "Concord"
+ this.contentmsg.style.display="block";
+ this.inputDiv.style.display="block";
+ break;
+ default:
+ this.name.innerText = this.webviewName
+ this.webview.style.display = "block";
+ this.webview.style.width="100%";
+ this.webview.style.height="90%";
+ this.webview.style.border="0";
+ this.webview.src=window;
+ break;
+ }
}
addMessage(message){
@@ -29,9 +89,8 @@ class Phone{
msg.appendChild(h2);
msg.appendChild(p);
- let chatMessages = document.getElementById("chatMessages");
- chatMessages.appendChild(msg);
- chatMessages.scrollTop = chatMessages.scrollHeight;
+ this.contentmsg.appendChild(msg);
+ this.contentmsg.scrollTop = this.contentmsg.scrollHeight;
}
sendMessage(title, content){