diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-11-05 10:11:43 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-11-05 10:11:43 +0000 |
| commit | 591ba844bd979e6f9c371a1e7ed84205d2c93750 (patch) | |
| tree | ceec9187305f431691dbe0d004681cbb7a3e52a4 /frontend | |
| parent | c6c93acc32893d891adb39011674c02f3f04999e (diff) | |
add qr to tetris playing screen
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/components/TetrisBoard.vue | 7 | ||||
| -rw-r--r-- | frontend/src/views/HostView.vue | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/frontend/src/components/TetrisBoard.vue b/frontend/src/components/TetrisBoard.vue index 0185e53..9767d03 100644 --- a/frontend/src/components/TetrisBoard.vue +++ b/frontend/src/components/TetrisBoard.vue @@ -6,7 +6,8 @@ import { type Board } from '@/model/board'; const props = defineProps({ networked: Boolean, - inputQueue: Array<string> + inputQueue: Array<string>, + qrCode: String, }); const renderBoard: Ref<Board> = ref([[]]); @@ -292,6 +293,10 @@ onMounted(() => { To do a hard drop, use the arrow up key or <kbd>K</kbd>. </p> </div> + <div v-if="networked"> + <h2>Join this game</h2> + <QRCode size=200 level="M" :value="qrCode"></QRCode> + </div> </div> </div> diff --git a/frontend/src/views/HostView.vue b/frontend/src/views/HostView.vue index 5b29289..4b25aa8 100644 --- a/frontend/src/views/HostView.vue +++ b/frontend/src/views/HostView.vue @@ -70,6 +70,6 @@ function openSocket(id: string) { <p>Connected clients: {{ numClients }}</p> <button @click="startGame">Start game</button> </template> - <TetrisBoard v-if="started" :networked="true" :input-queue="inputQueue"></TetrisBoard> + <TetrisBoard v-if="started" :networked="true" :input-queue="inputQueue" :qrCode="url"></TetrisBoard> </main> </template> |
