commit
ba26fc6568
7 changed files with 94 additions and 59 deletions
2
server/src/types/data.d.ts
vendored
2
server/src/types/data.d.ts
vendored
|
|
@ -72,7 +72,7 @@ interface GameRejoined extends response {
|
|||
}
|
||||
|
||||
|
||||
interface RandomizeTeam {
|
||||
interface RandomizeTeams {
|
||||
game_code: string;
|
||||
}
|
||||
interface TeamsRandomized extends response {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<p class="centre">
|
||||
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:
|
||||
<br><br>
|
||||
{{ userAgent }}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
class="bottom-bar clickable"
|
||||
@click.stop="modal = true"
|
||||
>
|
||||
Made By: Oliver Akins (Alkali Metal)
|
||||
Made By: Oliver Akins
|
||||
</div>
|
||||
<ModalAnimation
|
||||
:show="modal"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
Ghost Writer is designed and created by
|
||||
<a href="https://resonym.com" target="_blank" rel="noopener">Resonym</a>
|
||||
<br>
|
||||
Online Prototype Made By: Oliver Akins (Alkali Metal)
|
||||
Online Prototype Made By: Oliver Akins
|
||||
<br>
|
||||
<a
|
||||
v-if="$store.state.survey_link"
|
||||
|
|
@ -28,18 +28,6 @@
|
|||
</button>
|
||||
</a>
|
||||
</p>
|
||||
<hr>
|
||||
<p>
|
||||
Tooling:
|
||||
<ul>
|
||||
<li
|
||||
v-for="(link, name) in tooling"
|
||||
:key="name"
|
||||
>
|
||||
<a :href="link">{{ name }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</ModalAnimation>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -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: {},
|
||||
|
|
|
|||
76
web/src/config.js
Normal file
76
web/src/config.js
Normal file
|
|
@ -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`;
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue