From 292df8b28d017120a1a50ab7db006756b2fb9005 Mon Sep 17 00:00:00 2001 From: Jeep <14239220+vsrisuknimit@users.noreply.github.com> Date: Mon, 11 Jan 2021 22:15:07 -0500 Subject: [PATCH 01/20] draft on keyboard shortcut not listening yet not sure --- src/KeyboardNavigation.ts | 12 ++++++++++++ src/components/PlayerHome.ts | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/KeyboardNavigation.ts diff --git a/src/KeyboardNavigation.ts b/src/KeyboardNavigation.ts new file mode 100644 index 0000000000..2e74900bd0 --- /dev/null +++ b/src/KeyboardNavigation.ts @@ -0,0 +1,12 @@ + +export enum KeyboardNavigation { + GAMEBOARD = 'q', + TURMOILBOARD = 'w', + MILESTONESAWARDS = 'e', + TAGOVERVIEW = 'r', + GAMELOG = 't', + ACTION = 'a', + HAND = 's', + PLAYEDCARDS = 'd', + COLONIES = 'f', +} diff --git a/src/components/PlayerHome.ts b/src/components/PlayerHome.ts index 840feaeab1..f4ffad14a2 100644 --- a/src/components/PlayerHome.ts +++ b/src/components/PlayerHome.ts @@ -17,6 +17,7 @@ import {DynamicTitle} from './common/DynamicTitle'; import {Button} from './common/Button'; import {SortableCards} from './SortableCards'; import {TopBar} from './TopBar'; +import {KeyboardNavigation} from '../../src/KeyboardNavigation'; const dialogPolyfill = require('dialog-polyfill'); @@ -49,6 +50,11 @@ export const PlayerHome = Vue.component('player-home', { }, mixins: [PlayerMixin], methods: { + navigatePage: function(event: any) { + if (event.keyCode === KeyboardNavigation.COLONIES) { + window.location.href = 'colonies'; + } + }, getPlayerCssForTurnOrder: ( player: PlayerModel, highlightActive: boolean, @@ -97,7 +103,7 @@ export const PlayerHome = Vue.component('player-home', { ); }, template: ` -