From c9a0eb5563edd6b03fc1acfadb4e1dc39a2c534e Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 17:36:29 -0700 Subject: [PATCH 01/12] Fix spelling error in README --- web/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/README.md b/web/README.md index 9b33762..3014a51 100644 --- a/web/README.md +++ b/web/README.md @@ -16,7 +16,7 @@ from that directory. 6. In the webserver of your choice, you must also setup an `example.com/socket.io` route that reverse proxies the websocket connection through to the Node.js server. If you do not want to set up this proxy, you can -bypass it by changing the URI in the `serc/main.js` file to have a specific URL and port. +bypass it by changing the URI in the `src/main.js` file to have a specific URL and port. Example: Change ```js From 3f7f30128ebc01c2a1959ddb8f7b0bd1d986775d Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 19:34:30 -0700 Subject: [PATCH 02/12] Fix name of type --- server/src/types/data.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/types/data.d.ts b/server/src/types/data.d.ts index 1653d17..ba72e6b 100644 --- a/server/src/types/data.d.ts +++ b/server/src/types/data.d.ts @@ -72,7 +72,7 @@ interface GameRejoined extends response { } -interface RandomizeTeam { +interface RandomizeTeams { game_code: string; } interface TeamsRandomized extends response { From af59cae747b5513467f4e8ffa77a2dfdac9e5ffc Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:01:43 -0700 Subject: [PATCH 03/12] Change email in mobile device warning. Once the code is open source, this will be changed to tell people to go to the GitHub repo. --- web/src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/App.vue b/web/src/App.vue index e7a1d48..51dc946 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -32,7 +32,7 @@

To use this site you must be using a laptop, desktop, or iPad. If you are on one of those devices and you still see this message, - please contact "oliver {at} akins.me" with the following information: + please contact "ghostwriter{at}resonym.com" with the following information:

{{ userAgent }}

From f3795a4feab925f46fcd359a87287612866c501a Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:14:17 -0700 Subject: [PATCH 04/12] Remove the tooling list --- web/src/components/Attributions.vue | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/web/src/components/Attributions.vue b/web/src/components/Attributions.vue index d6b93c0..1bfb8d1 100644 --- a/web/src/components/Attributions.vue +++ b/web/src/components/Attributions.vue @@ -28,18 +28,6 @@

-
-

- Tooling: -

-

@@ -54,16 +42,6 @@ export default { }, data() {return { modal: false, - tooling: { - "Vue.JS (With VueX)": "https://vuejs.org", - "Vue-Socket.io": "https://github.com/MetinSeylan/Vue-Socket.io", - "Vue-Clipboard2": "https://www.npmjs.com/package/vue-clipboard2", - "Toml": "https://www.npmjs.com/package/toml", - "tslog": "https://www.npmjs.com/package/tslog", - "Socket.io": "https://socket.io", - "Axios": "https://www.npmjs.com/package/axios", - "neat-csv": "https://github.com/sindresorhus/neat-csv", - } }}, computed: {}, methods: {}, From 3359c84fe4df277c5a3b8126c8f09ccaae31b2b0 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:17:40 -0700 Subject: [PATCH 05/12] Remove alias from attributions panel. --- web/src/components/Attributions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/Attributions.vue b/web/src/components/Attributions.vue index 1bfb8d1..efa6305 100644 --- a/web/src/components/Attributions.vue +++ b/web/src/components/Attributions.vue @@ -4,7 +4,7 @@ class="bottom-bar clickable" @click.stop="modal = true" > - Made By: Oliver Akins (Alkali Metal) + Made By: Oliver Akins Resonym
- Online Prototype Made By: Oliver Akins (Alkali Metal) + Online Prototype Made By: Oliver Akins
Date: Wed, 3 Mar 2021 22:22:14 -0700 Subject: [PATCH 06/12] Move the prod and dev websocket URI to a config file. --- web/src/config.js | 11 +++++++++++ web/src/main.js | 11 ++++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 web/src/config.js diff --git a/web/src/config.js b/web/src/config.js new file mode 100644 index 0000000..a887287 --- /dev/null +++ b/web/src/config.js @@ -0,0 +1,11 @@ +/** + * The URI that socket IO tries to connect to for websocket communication when + * built for production serving. + */ +export const websocket_uri = `/`; + +/** + * The websocket URI that Socket.IO tries to connect to when live-serving the + * site via webpack. + */ +export const dev_websocket_uri = 8081; \ No newline at end of file diff --git a/web/src/main.js b/web/src/main.js index 2f38b4d..40854df 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -4,17 +4,14 @@ import store from './store'; import io from 'socket.io-client'; import clipboard from "vue-clipboard2"; import VueSocketIOExt from 'vue-socket.io-extended'; +import {websocket_uri, dev_websocket_uri} from "./config"; Vue.config.productionTip = false; -// Get the URI for dev enfironments -let websocket_uri = `/`; -if (process.env.NODE_ENV === `development`) { - websocket_uri = `http://${window.location.hostname}:8081`; -}; - Vue.use(clipboard); -Vue.use(VueSocketIOExt, io(websocket_uri)); +Vue.use(VueSocketIOExt, io( + process.env.NODE_ENV === `development` ? websocket_uri : dev_websocket_uri +)); new Vue({ store, From 3af9e6cb9029259c799b649e22025eea8c8798ba Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:24:03 -0700 Subject: [PATCH 07/12] Correct config default --- web/src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/config.js b/web/src/config.js index a887287..39ebe35 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -8,4 +8,4 @@ export const websocket_uri = `/`; * The websocket URI that Socket.IO tries to connect to when live-serving the * site via webpack. */ -export const dev_websocket_uri = 8081; \ No newline at end of file +export const dev_websocket_uri = `http://${window.location.hostname}:8081`; \ No newline at end of file From 59cbad36d04c596e2abafd1cfcac2cb82187303d Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:26:42 -0700 Subject: [PATCH 08/12] Move survey URL to the JS config --- web/src/config.js | 7 +++++++ web/src/store/index.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/src/config.js b/web/src/config.js index 39ebe35..873d088 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -1,3 +1,10 @@ +/** + * The survey that will be offered to players to fill out after finishing a + * game so that they can give feedback. + */ +export const survey_url = ``; + + /** * The URI that socket IO tries to connect to for websocket communication when * built for production serving. diff --git a/web/src/store/index.js b/web/src/store/index.js index 23b359a..401af00 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -1,11 +1,12 @@ import Vue from 'vue'; import Vuex from 'vuex'; +import * as conf from "../config"; Vue.use(Vuex); export default new Vuex.Store({ state: { - survey_link: ``, + survey_link: conf.survey_url, team_1: { name: `Sun`, From 9b7b9d2af8895aea645afa21623214768de60cca Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:31:54 -0700 Subject: [PATCH 09/12] Move the team settings into the config. --- web/src/config.js | 35 +++++++++++++++++++++++++++++++++++ web/src/store/index.js | 23 +++-------------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/web/src/config.js b/web/src/config.js index 873d088..ca918ab 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -5,6 +5,41 @@ export const survey_url = ``; +/** + * This is an array of per-team settings, each team object consists of the + * following properties: + * + * name: string - The name of the team + * icon: string - The name of the icon used for the team + * eyes: object - The object of the answer index to how many eyes are on that spot + * + * There can be as many teams in this array as desired, but only the first two + * will be used. + */ +export const team_settings = [ + { + name: `Sun`, + icon: `sun.svg`, + eyes: { + 1: 0, 2: 0, + 3: 0, 4: 1, + 5: 0, 6: 1, + 7: 1, 8: 0, + } + }, + { + name: `Moon`, + icon: `moon.svg`, + eyes: { + 1: 0, 2: 0, + 3: 1, 4: 0, + 5: 1, 6: 1, + 7: 0, 8: 0, + } + } +] + + /** * The URI that socket IO tries to connect to for websocket communication when * built for production serving. diff --git a/web/src/store/index.js b/web/src/store/index.js index 401af00..75df02a 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -8,26 +8,9 @@ export default new Vuex.Store({ state: { survey_link: conf.survey_url, - team_1: { - name: `Sun`, - icon: `sun.svg`, - eyes: { - 1: 0, 2: 0, - 3: 0, 4: 1, - 5: 0, 6: 1, - 7: 1, 8: 0, - }, - }, - team_2: { - name: `Moon`, - icon: `moon.svg`, - eyes: { - 1: 0, 2: 0, - 3: 1, 4: 0, - 5: 1, 6: 1, - 7: 0, 8: 0, - }, - }, + team_1: conf.team_settings[0], + team_2: conf.team_settings[1], + writer_name: `Spirit`, writer_card_button: `Answer Question`, writer_object_choose_button: `Choose Object`, From 56cb1ed48397cf41d45e6fe15dd73f2dfdcace13 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:37:24 -0700 Subject: [PATCH 10/12] Migrate the position names into the config. --- web/src/config.js | 14 +++++++++++++- web/src/store/index.js | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/src/config.js b/web/src/config.js index ca918ab..2d7766c 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -37,7 +37,19 @@ export const team_settings = [ 7: 0, 8: 0, } } -] +]; + + +/** + * The name that is displayed for the players that answer the questions. + */ +export const writer_name = `Spirit`; + +/** + * The name that is displayed for the players that are trying to guess the + * object. + */ +export const guesser_name = `Medium`; /** diff --git a/web/src/store/index.js b/web/src/store/index.js index 75df02a..4c9d616 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -10,12 +10,12 @@ export default new Vuex.Store({ team_1: conf.team_settings[0], team_2: conf.team_settings[1], - - writer_name: `Spirit`, + + writer_name: conf.writer_name, writer_card_button: `Answer Question`, writer_object_choose_button: `Choose Object`, - guesser_name: `Medium`, + guesser_name: conf.guesser_name, guesser_card_button: `Ask Spirit`, eye_icon: `eye.svg`, From 45f3c201f9d2d4f1bff1bcd21f2eef5e75939717 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:37:56 -0700 Subject: [PATCH 11/12] Move the eye icon to the config --- web/src/config.js | 4 ++++ web/src/store/index.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/config.js b/web/src/config.js index 2d7766c..c460e35 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -51,6 +51,10 @@ export const writer_name = `Spirit`; */ export const guesser_name = `Medium`; +/** + * The icon name for the Eye displayed on the main board. + */ +export const eye_icon = `eye.svg`; /** * The URI that socket IO tries to connect to for websocket communication when diff --git a/web/src/store/index.js b/web/src/store/index.js index 4c9d616..b9ef675 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -18,7 +18,7 @@ export default new Vuex.Store({ guesser_name: conf.guesser_name, guesser_card_button: `Ask Spirit`, - eye_icon: `eye.svg`, + eye_icon: conf.eye_icon, discard_hand_icon: `trash.svg`, From 475f72d99a75e6c087189714f3ff7a7ccd13ef0f Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:38:18 -0700 Subject: [PATCH 12/12] Move the discard hand button icon to the config --- web/src/config.js | 7 +++++++ web/src/store/index.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/config.js b/web/src/config.js index c460e35..87b7db1 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -56,6 +56,13 @@ export const guesser_name = `Medium`; */ export const eye_icon = `eye.svg`; +/** + * The icon that is used for the discard hand button that mediums see in the + * lower right hand corner of the screen. + */ +export const discard_hand_icon = `trash.svg`; + + /** * The URI that socket IO tries to connect to for websocket communication when * built for production serving. diff --git a/web/src/store/index.js b/web/src/store/index.js index b9ef675..590a946 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -20,7 +20,7 @@ export default new Vuex.Store({ eye_icon: conf.eye_icon, - discard_hand_icon: `trash.svg`, + discard_hand_icon: conf.discard_hand_icon, //===========================================================================// // DO NOT EDIT ANYTHING BELOW THIS COMMENT