Skip to content

Commit

Permalink
Remove tournament mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncheung00 committed Jun 13, 2023
1 parent b9b0495 commit ac7cc9a
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
"preview:https": "serve dist",
"reinstall": "rm -rf node_modules; yarn; vue-tsc --noEmit"
},
"version": "5.0.0-alpha.237"
"version": "5.0.0-alpha.238"
}
4 changes: 2 additions & 2 deletions src/components/units/AppWelcome.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="welcome">
<h2 id="app-welcome">Play and visualize two-player, abstract strategy games!</h2>
<p id="game-info"><strong>68+</strong> games integrated &emsp;&emsp;&emsp; <strong>9+</strong> puzzles strongly solved</p>
<h2 id="app-welcome">Play and visualize two-player abstract strategy games!</h2>
<p id="game-info"><strong>44+</strong> games integrated &emsp;&emsp;&emsp; <strong>9+</strong> puzzles strongly solved</p>
<div class="explore-buttons-container">
<button @click="exploreAllGames">Explore All Games</button>
<button @click="exploreAllPuzzles">Explore All Puzzles</button>
Expand Down
45 changes: 37 additions & 8 deletions src/components/units/GameBody/ImageAutoGUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<g v-if="!animationPlaying && piecesOverArrows">
<g v-for="(arrow, i) in richPositionData.arrows" :key="'arrow' + i">
<polyline
:points="formatArrowPolylinePoints(arrow, arrowThickness)"
:points="formatArrowPolylinePoints(arrow, arrowWidth)"
:class="'app-game-board-default-arrow ' + getBoardMoveElementHintClass(arrow.move)"
:opacity="options.showNextMoveHints && options.showNextMoveDeltaRemotenesses ? arrow.move.hintOpacity : 1"
@click="!isComputerTurn && store.dispatch(actionTypes.runMove, { move: arrow.move.str })"/>
Expand Down Expand Up @@ -51,7 +51,7 @@
:r="defaultMoveTokenRadius"
:class="'app-game-board-default-button ' + (token.move ? 'move ' : '') + getBoardMoveElementHintClass(token.move)"
:opacity="options.showNextMoveHints && options.showNextMoveDeltaRemotenesses ? token.move.hintOpacity : 1"
:style="'--xorigin: ' + centers[token.to][0] + 'px ' + centers[token.to][1] + 'px;'"
:style="'--tOrigin: ' + centers[token.to][0] + 'px ' + centers[token.to][1] + 'px;'"
@click="!isComputerTurn && store.dispatch(actionTypes.runMove, { move: token.move.str })"/>

<!-- Else use the svg corresponding to the move token. If no svg is mapped to the character, skip. -->
Expand All @@ -71,7 +71,7 @@
:height="pieces[token.token].scale * widthFactor"
:class="'app-game-board-default-button ' + (token.move ? 'move ' : '') + getBoardMoveElementHintClass(token.move)"
:opacity="options.showNextMoveHints && options.showNextMoveDeltaRemotenesses ? token.move.hintOpacity : 1"
:style="'--xorigin: ' + centers[token.to][0] + 'px ' + centers[token.to][1] + 'px;mask: url(#svgmask' + i + ');'"
:style="'--tOrigin: ' + centers[token.to][0] + 'px ' + centers[token.to][1] + 'px;mask: url(#svgmask' + i + ');'"
@click="!isComputerTurn && store.dispatch(actionTypes.runMove, { move: token.move.str })"/>
</g>
</g>
Expand All @@ -81,7 +81,7 @@
<g v-if="!piecesOverArrows">
<g v-for="(arrow, i) in richPositionData.arrows " :key="'arrow' + i">
<polyline
:points="formatArrowPolylinePoints(arrow, arrowThickness)"
:points="formatArrowPolylinePoints(arrow, arrowWidth)"
:class="'app-game-board-default-arrow ' + getBoardMoveElementHintClass(arrow.move)"
:opacity="options.showNextMoveHints && options.showNextMoveDeltaRemotenesses ? arrow.move.hintOpacity : 1"
@click="!isComputerTurn && store.dispatch(actionTypes.runMove, { move: arrow.move.str })"/>
Expand All @@ -96,8 +96,9 @@
:x2="centers[line.to][0]"
:y2="centers[line.to][1]"
:stroke-linecap="'round'"
:style="'--w: ' + lineWidth + ';--w2: ' + (lineWidth * 1.75) + ';'"
:stroke-width="lineWidth"
:class="'app-game-board-default-arrow ' + getBoardMoveElementHintClass(line.move)"
:class="'app-game-board-default-line ' + getBoardMoveElementHintClass(line.move)"
:opacity="options.showNextMoveHints && options.showNextMoveDeltaRemotenesses ? line.move.hintOpacity : 1"
@click="!isComputerTurn && store.dispatch(actionTypes.runMove, { move: line.move.str })"/>
</g>
Expand Down Expand Up @@ -161,8 +162,8 @@
const animationPlaying = computed(() => store.getters.animationPlaying);
const backgroundImagePath = computed(() => theTheme.value.backgroundImage || "");
const foregroundImagePath = computed(() => theTheme.value.foregroundImage || "");
const arrowThickness = computed(() =>
(theTheme.value.arrowThickness * widthFactor.value / 2) || 1.5);
const arrowWidth = computed(() =>
(theTheme.value.arrowWidth * widthFactor.value / 2) || 1.5);
const lineWidth = computed(() => theTheme.value.lineWidth || 0.9);
const defaultMoveTokenRadius = computed(() =>
(theTheme.value.defaultMoveTokenRadius * widthFactor.value) || 2);
Expand Down Expand Up @@ -301,14 +302,19 @@
100% { stroke-width: 1.5; }
}
@keyframes pulsing-line {
0% { stroke-width: var(--w); }
100% { stroke-width: var(--w2); }
}
@keyframes pulsing-token {
0% { transform: scale(1); }
100% { transform: scale(1.2); }
}
.app-game-board-default-button {
cursor: default;
transform-origin: var(--xorigin);
transform-origin: var(--tOrigin);
[data-turn="A"] &.move { fill: var(--turn1Color); }
[data-turn="B"] &.move { fill: var(--turn2Color); }
Expand Down Expand Up @@ -375,6 +381,29 @@
}
}
.app-game-board-default-line {
stroke: var(--primaryColor);
[data-turn="A"] & { stroke: var(--turn1Color); }
[data-turn="B"] & { stroke: var(--turn2Color); }
&.hint- {
&win { stroke: var(--winColor); }
&draw { stroke: var(--drawColor); }
&tie { stroke: var(--tieColor); }
&lose { stroke: var(--loseColor); }
&unsolved { stroke: var(--unsolvedColor); }
}
&:hover {
animation-name: pulsing-line;
animation-duration: 0.3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
animation-direction: alternate;
}
}
svg {
height: 20em;
width: 20em;
Expand Down
8 changes: 4 additions & 4 deletions src/models/datas/defaultApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const defaultPreferences: Types.Preferences = {

export const defaultDataSources: Types.DataSources = {
gitHubRepositoryAPI: "https://api.github.com/repos/GamesCrafters/GamesmanUni",
//onePlayerGameAPI: "https://nyc.cs.berkeley.edu/puzzles",
onePlayerGameAPI: "http://localhost:9001/",
//twoPlayerGameAPI: "https://nyc.cs.berkeley.edu/universal/v1/games",
twoPlayerGameAPI: "http://localhost:8082/games"
onePlayerGameAPI: "https://nyc.cs.berkeley.edu/puzzles",
//onePlayerGameAPI: "http://localhost:9001/",
twoPlayerGameAPI: "https://nyc.cs.berkeley.edu/universal/v1/games",
//twoPlayerGameAPI: "http://localhost:8082/games"
};

export const defaultAvailableMove: Types.Move = {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/apis/gamesCrafters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type AutoGUIv2Theme = {
backgroundImage: string;
foregroundImage: string;
piecesOverArrows: boolean;
arrowThickness: number;
arrowWidth: number;
lineWidth: number;
defaultMoveTokenRadius: number;
centers: Array<AutoGUIv2Coordinate>;
Expand Down

0 comments on commit ac7cc9a

Please sign in to comment.