diff --git a/html/templates/contracts.html b/html/templates/contracts.html
new file mode 100644
index 0000000..e69de29
diff --git a/html/templates/home.html b/html/templates/home.html
index e69de29..6692b32 100644
--- a/html/templates/home.html
+++ b/html/templates/home.html
@@ -0,0 +1,4 @@
+
+
Bienvenue sur SkamCraft
+
Application client pour l'API Space Tarders.
+
\ No newline at end of file
diff --git a/html/templates/login.html b/html/templates/login.html
new file mode 100644
index 0000000..6ffa211
--- /dev/null
+++ b/html/templates/login.html
@@ -0,0 +1,8 @@
+
+
Login
+
+
+
+
+
+
\ No newline at end of file
diff --git a/html/templates/register.html b/html/templates/register.html
new file mode 100644
index 0000000..e69de29
diff --git a/html/templates/ships.html b/html/templates/ships.html
new file mode 100644
index 0000000..e69de29
diff --git a/html/templates/systems.html b/html/templates/systems.html
new file mode 100644
index 0000000..e69de29
diff --git a/js/index.js b/js/index.js
index a155af6..e5bd147 100644
--- a/js/index.js
+++ b/js/index.js
@@ -1,13 +1,19 @@
import {UIRenderer} from "./ui/templeting_engine.js";
let UI = new UIRenderer("html");
+UI.render("templates/home.html")
+function init_menu_link(tag, template) {
+ UI.add_event(tag, "click", () => {
+ UI.render(`templates/${template}`);
+ })
+}
-UI.render("templates/home.html");
-
-UI.add_event("#btn1", "click", () => {
- UI.render("templates/test2.html");
-});
-UI.add_event("#btn2", "click", () => {
- UI.render("templates/test.html");
-})
\ No newline at end of file
+$(document).ready(() => {
+ init_menu_link("#contracts-link", "contracts.html");
+ init_menu_link("#ships-link", "ships.html");
+ init_menu_link("#systems-link", "systems.html");
+ init_menu_link("#signup-link", "register.html");
+ init_menu_link("#signin-link", "login.html");
+ init_menu_link(".nav-brand", "home.html");
+});
\ No newline at end of file
diff --git a/js/ui/templeting_engine.js b/js/ui/templeting_engine.js
index 05af941..886a52a 100644
--- a/js/ui/templeting_engine.js
+++ b/js/ui/templeting_engine.js
@@ -2,11 +2,11 @@ export class UIRenderer {
constructor(path) {
this.templatePath = path;
}
- render(template) {
+ render(template, tag = "#block-content") {
this.get_template((reponse) => {
$('body').html(reponse);
this.get_template((reponse) => {
- $('#block-content').html(reponse);
+ $(tag).html(reponse);
}, template)
});
}