diff --git a/src/pages/index.vue b/src/pages/index.vue index 70a2e1c..7b28590 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -11,6 +11,25 @@ @click="createGame"> Create Game + + + + Join Game + + @@ -18,13 +37,23 @@ import { useRouter } from 'vue-router' const router = useRouter() +const lobbyId = ref('') const createGame = () => { - // Request to Server for new Game Lobby ID + // TODO Request to Server for new Game Lobby ID // This also starts a WebSocket and redirects to /create/[id] const id = 0xffffff router.push(`/create/${id}`) } + +const joinGame = () => { + // TODO Check if lobby exists + // if exists redirect to lobby + // if not, show info + if (lobbyId.value) { + router.push(`/create/${lobbyId.value}`) + } +}