From 4306045991dcbef3b634e5490837adacd7e30d41 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Mon, 23 Sep 2019 15:10:26 +0200 Subject: [PATCH] Add player name --- src/views/Lobby.vue | 84 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/src/views/Lobby.vue b/src/views/Lobby.vue index 5a382f3..3e27b6c 100644 --- a/src/views/Lobby.vue +++ b/src/views/Lobby.vue @@ -2,7 +2,30 @@
-
+
+ + + +
+
+
+

Join someone's session

+
+ + + +
+ + Join + +
+
+

Host a new session

@@ -49,24 +72,16 @@
- + Create
-
-
-

Join someone's session

-
- - - -
- - Join - -
-
@@ -85,16 +100,33 @@ .body { flex: 1; - display: flex; + display: grid; padding: 10px; padding-top: 0; + grid-template: 150px 1fr / 1fr 1fr; + + #info { + grid-row: 1; + grid-column: 1 / end; + } + + #join, + #host { + grid-row: 2; + } + + #join { + grid-column: 2; + } + #host { + grid-column: 1; + } section { margin: 10px; border: 1px solid rgba($white, 20%); border-radius: 10px; padding: 20px; - flex: 1; header { font-family: $fantasy; h1 { @@ -125,13 +157,19 @@ @media (max-width: 500px) { .body { + grid-template: 120px 1fr 1fr /1fr; + #info, + #join, + #host { + grid-row: auto; + grid-column: auto; + } section { padding: 10px; header h1 { font-size: 14pt; } } - flex-flow: column-reverse; } } @@ -147,6 +185,7 @@ import { allSets, setNames } from "../mlpccg"; } }) export default class Lobby extends Vue { + private playerName!: string; private hostType!: string; private hostDraftType!: string; private hostDraftSet!: string; @@ -157,6 +196,11 @@ export default class Lobby extends Vue { private data() { return { + playerName: + "Guest-" + + Math.random() + .toString() + .slice(2, 8), hostType: "game", hostDraftType: "set", hostDraftSet: "FF", @@ -167,6 +211,10 @@ export default class Lobby extends Vue { }; } + private async create() {} + + private async join() {} + private get canHost(): boolean { switch (this.hostType) { case "game":