0
0
Fork 0

Merge pull request #79 from Oliver-Akins/dev

v1.2.7
This commit is contained in:
Oliver 2021-03-04 13:43:05 -07:00 committed by GitHub
commit ba26fc6568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 94 additions and 59 deletions

View file

@ -72,7 +72,7 @@ interface GameRejoined extends response {
} }
interface RandomizeTeam { interface RandomizeTeams {
game_code: string; game_code: string;
} }
interface TeamsRandomized extends response { interface TeamsRandomized extends response {

View file

@ -16,7 +16,7 @@ from that directory.
6. In the webserver of your choice, you must also setup an 6. In the webserver of your choice, you must also setup an
`example.com/socket.io` route that reverse proxies the websocket connection `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 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 Example: Change
```js ```js

View file

@ -32,7 +32,7 @@
<p class="centre"> <p class="centre">
To use this site you must be using a laptop, desktop, or iPad. 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, 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> <br><br>
{{ userAgent }} {{ userAgent }}
</p> </p>

View file

@ -4,7 +4,7 @@
class="bottom-bar clickable" class="bottom-bar clickable"
@click.stop="modal = true" @click.stop="modal = true"
> >
Made By: Oliver Akins (Alkali Metal) Made By: Oliver Akins
</div> </div>
<ModalAnimation <ModalAnimation
:show="modal" :show="modal"
@ -15,7 +15,7 @@
Ghost Writer is designed and created by Ghost Writer is designed and created by
<a href="https://resonym.com" target="_blank" rel="noopener">Resonym</a> <a href="https://resonym.com" target="_blank" rel="noopener">Resonym</a>
<br> <br>
Online Prototype Made By: Oliver Akins (Alkali Metal) Online Prototype Made By: Oliver Akins
<br> <br>
<a <a
v-if="$store.state.survey_link" v-if="$store.state.survey_link"
@ -28,18 +28,6 @@
</button> </button>
</a> </a>
</p> </p>
<hr>
<p>
Tooling:
<ul>
<li
v-for="(link, name) in tooling"
:key="name"
>
<a :href="link">{{ name }}</a>
</li>
</ul>
</p>
</ModalAnimation> </ModalAnimation>
</div> </div>
</template> </template>
@ -54,16 +42,6 @@ export default {
}, },
data() {return { data() {return {
modal: false, 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: {}, computed: {},
methods: {}, methods: {},

76
web/src/config.js Normal file
View 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`;

View file

@ -4,17 +4,14 @@ import store from './store';
import io from 'socket.io-client'; import io from 'socket.io-client';
import clipboard from "vue-clipboard2"; import clipboard from "vue-clipboard2";
import VueSocketIOExt from 'vue-socket.io-extended'; import VueSocketIOExt from 'vue-socket.io-extended';
import {websocket_uri, dev_websocket_uri} from "./config";
Vue.config.productionTip = false; 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(clipboard);
Vue.use(VueSocketIOExt, io(websocket_uri)); Vue.use(VueSocketIOExt, io(
process.env.NODE_ENV === `development` ? websocket_uri : dev_websocket_uri
));
new Vue({ new Vue({
store, store,

View file

@ -1,42 +1,26 @@
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import * as conf from "../config";
Vue.use(Vuex); Vue.use(Vuex);
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
survey_link: ``, survey_link: conf.survey_url,
team_1: { team_1: conf.team_settings[0],
name: `Sun`, team_2: conf.team_settings[1],
icon: `sun.svg`,
eyes: { writer_name: conf.writer_name,
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`,
writer_card_button: `Answer Question`, writer_card_button: `Answer Question`,
writer_object_choose_button: `Choose Object`, writer_object_choose_button: `Choose Object`,
guesser_name: `Medium`, guesser_name: conf.guesser_name,
guesser_card_button: `Ask Spirit`, 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 // DO NOT EDIT ANYTHING BELOW THIS COMMENT