Begin foundational logic in order of webpage state

This commit is contained in:
Oliver-Akins 2020-09-18 00:07:08 -06:00
parent c2ad722758
commit e35a57ffd8

View file

@ -1,27 +1,47 @@
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
<div id="app">
<WS-Entry
v-if="state == 'ws-url'"
@set-ws-url="websocket_url = $event"
/>
<Game-Code
v-else-if="state == 'game-code'"
@set-game-code="game_code = $event"
/>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
import GameCodeEntry from `./components/GameCode`;
import WebsocketEntry from `./components/WebsocketURL`;
export default {
name: 'App',
components: {
HelloWorld
}
name: 'App',
components: {
'WS-Entry': WebsocketEntry,
'Game-Code': GameCodeEntry,
},
data() {return {
state: `ws-url`,
websocket_url: ``,
game_code: ``,
}},
methods: {
set_ws(ws_uri) {
this.websocket_url = ws_uri;
this.state = `game-code`;
},
set_gamecode(gamecode) {
this.game_code = gamecode;
this.state = `game`;
},
},
}
</script>
<style lang="stylus">
#app
font-family Avenir, Helvetica, Arial, sans-serif
-webkit-font-smoothing antialiased
-moz-osx-font-smoothing grayscale
text-align center
color #2c3e50
margin-top 60px
#app {
height: 100vh
width: 100vw
}
</style>