diff --git a/html/views/data/achievment.js b/html/views/data/achievment.js new file mode 100644 index 0000000..5373e1a --- /dev/null +++ b/html/views/data/achievment.js @@ -0,0 +1,9 @@ +class Achievment { + time = new Date; + name = ""; + game = 0; + image = ""; + text = ""; +} + +module.exports = Achievment; \ No newline at end of file diff --git a/html/views/data/action.js b/html/views/data/action.js new file mode 100644 index 0000000..b6f761e --- /dev/null +++ b/html/views/data/action.js @@ -0,0 +1,6 @@ +class Action { + button = null; + text = ""; +} + +module.exports = Action; \ No newline at end of file diff --git a/html/views/data/button.js b/html/views/data/button.js new file mode 100644 index 0000000..aa514b7 --- /dev/null +++ b/html/views/data/button.js @@ -0,0 +1,7 @@ +class Button { + icon = ""; + player = -1; + type = ""; +} + +module.exports = Button; \ No newline at end of file diff --git a/html/views/data/card.js b/html/views/data/card.js new file mode 100644 index 0000000..645eaca --- /dev/null +++ b/html/views/data/card.js @@ -0,0 +1,6 @@ +class Card { + name = ""; + image = ""; + action = ""; + onclick(){} +} \ No newline at end of file diff --git a/html/views/data/currentUser.js b/html/views/data/currentUser.js new file mode 100644 index 0000000..c74e6c2 --- /dev/null +++ b/html/views/data/currentUser.js @@ -0,0 +1,7 @@ +const User = require("./user"); + +class CurrentUser extends User { + +} + +module.exports = CurrentUser; \ No newline at end of file diff --git a/html/views/data/game.js b/html/views/data/game.js new file mode 100644 index 0000000..8a8c3b0 --- /dev/null +++ b/html/views/data/game.js @@ -0,0 +1,13 @@ +class Game { + name = ""; + image = ""; + run(){ + console.log("Game running"); + this.exit(); + } + exit(){ + global.menu.show(); + } +} + +module.exports = Game; \ No newline at end of file diff --git a/html/views/data/user.js b/html/views/data/user.js new file mode 100644 index 0000000..52a4282 --- /dev/null +++ b/html/views/data/user.js @@ -0,0 +1,20 @@ +const Card = require("./card"); + +class User { + name = []; + username = ""; + friends = []; + avatar = ""; + achievments = {}; + + getCard(){ + var card = new Card; + card.name = this.name; + card.image = this.avatar; + card.action = "Select"; + + return card; + } +} + +module.exports = User; \ No newline at end of file diff --git a/html/views/index.html b/html/views/index.html index 429eef5..abb7c37 100644 --- a/html/views/index.html +++ b/html/views/index.html @@ -4,25 +4,24 @@ Console hub - +
+ +
+
+
+
+
+ - + - - - - - - - - - + diff --git a/html/views/main.js b/html/views/main.js new file mode 100644 index 0000000..9523ee1 --- /dev/null +++ b/html/views/main.js @@ -0,0 +1,6 @@ +const gamepadConnected = require("./menu/connected"); + +console.log("Console-hub alpha"); + +gamepadConnected(); + diff --git a/html/views/menu/connected.js b/html/views/menu/connected.js new file mode 100644 index 0000000..b4144db --- /dev/null +++ b/html/views/menu/connected.js @@ -0,0 +1,14 @@ +const utils = require("../../utils"); +const gui = require("./gui"); + +function gamepadConnected(){ + console.log("Gamepad connected"); + + var view = document.getElementById("view"); + utils.removeChildNodes(view); + + gui.showTitle("Your profile"); + gui.showDescription("Select or login with your Pushr account to continue"); +} + +module.exports = gamepadConnected; \ No newline at end of file diff --git a/html/views/menu/gui.js b/html/views/menu/gui.js new file mode 100644 index 0000000..5f768e1 --- /dev/null +++ b/html/views/menu/gui.js @@ -0,0 +1,51 @@ + +function showTitle(title){ + var view = document.getElementById("view"); + var t = document.createElement("h1"); + t.classList.add("title--main") + t.innerText = title; + + view.appendChild(t); +} + +function showDescription(desc) { + var view = document.getElementById("view"); + var t = document.createElement("h2"); + t.classList.add("title--description") + t.innerText = desc; + + view.appendChild(t); +} + +global.cards = []; +global.currentCard = -1; +function getCard(card){ + var t = document.createElement("div"); + var title = document.createElement("span"); + title.innerText = card.name; + var image = document.createElement("img"); + image.src = card.image; + global.cards[global.cards.length] = card; + + t.appendChild(title); + t.appendChild(image); + + return t; +} + +function renderCardList(cards){ + var view = document.getElementById("view"); + + +} + +function showAction(action, side){ + +} +module.exports = { + showTitle, + showDescription, + getCard, + renderCardList, + showAction +} \ No newline at end of file