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 { 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 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 }}

diff --git a/web/src/components/Attributions.vue b/web/src/components/Attributions.vue index d6b93c0..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

-
-

- 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: {}, diff --git a/web/src/config.js b/web/src/config.js new file mode 100644 index 0000000..87b7db1 --- /dev/null +++ b/web/src/config.js @@ -0,0 +1,76 @@ +/** + * 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 = ``; + + +/** + * 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 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`; + +/** + * The icon name for the Eye displayed on the main board. + */ +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. + */ +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 = `http://${window.location.hostname}: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, diff --git a/web/src/store/index.js b/web/src/store/index.js index 23b359a..590a946 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -1,42 +1,26 @@ 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`, - 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, - }, - }, - writer_name: `Spirit`, + team_1: conf.team_settings[0], + team_2: conf.team_settings[1], + + 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`, + eye_icon: conf.eye_icon, - discard_hand_icon: `trash.svg`, + discard_hand_icon: conf.discard_hand_icon, //===========================================================================// // DO NOT EDIT ANYTHING BELOW THIS COMMENT