Skip to content

Commit

Permalink
First round of svg changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncheung00 committed Oct 6, 2023
1 parent f40258e commit a8198f2
Show file tree
Hide file tree
Showing 28 changed files with 134 additions and 241 deletions.
31 changes: 13 additions & 18 deletions src/components/units/GameBody/ImageAutoGUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<circle v-if="token.token == '-'"
:cx="centers[token.to][0]"
:cy="centers[token.to][1]"
:stroke-width="0"
:r="defaultMoveTokenRadius"
:class="'app-game-board-default-button ' + (token.move ? 'move ' : '') + getBoardMoveElementHintClass(token.move)"
:opacity="options.showNextMoveHints && options.showNextMoveDeltaRemotenesses ? token.move.hintOpacity : 1"
Expand All @@ -55,23 +56,17 @@

<!-- Else use the svg corresponding to the move token. If no svg is mapped to the character, skip. -->
<g v-else-if="token.token in entities">
<mask :id="'svgmask' + i">
<image
:x="centers[token.to][0] - 0.5 * entities[token.token].scale * widthFactor"
:y="centers[token.to][1] - 0.5 * entities[token.token].scale * widthFactor"
:width="entities[token.token].scale * widthFactor"
:height="entities[token.token].scale * widthFactor"
:href="getImageSource(entities[token.token].image)"/>
</mask>
<rect
<use
:x="centers[token.to][0] - 0.5 * entities[token.token].scale * widthFactor"
:y="centers[token.to][1] - 0.5 * entities[token.token].scale * widthFactor"
:width="entities[token.token].scale * widthFactor"
:height="entities[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="'--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 })"/>
:style="'--tOrigin: ' + centers[token.to][0] + 'px ' + centers[token.to][1] + 'px'"
:href="getImageSource(entities[token.token].image) + '#MoveButtonSVG'"
@click="!isComputerTurn && store.dispatch(actionTypes.runMove, { move: token.move.str })"
/>
</g>
</g>
</g>
Expand Down Expand Up @@ -318,15 +313,15 @@
cursor: default;
transform-origin: var(--tOrigin);
[data-turn="A"] &.move { fill: var(--turn1Color); }
[data-turn="B"] &.move { fill: var(--turn2Color); }
[data-turn="A"] &.move { fill: var(--turn1Color); stroke: var(--turn1Color); }
[data-turn="B"] &.move { fill: var(--turn2Color); stroke: var(--turn1Color); }
&.move.hint- {
&win { fill: var(--winColor); }
&draw { fill: var(--drawColor); }
&tie { fill: var(--tieColor); }
&lose { fill: var(--loseColor); }
&unsolved { fill: var(--unsolvedColor); }
&win { fill: var(--winColor); stroke: var(--winColor); }
&draw { fill: var(--drawColor); stroke: var(--drawColor); }
&tie { fill: var(--tieColor); stroke: var(--tieColor); }
&lose { fill: var(--loseColor); stroke: var(--loseColor); }
&unsolved { fill: var(--unsolvedColor); stroke: var(--unsolvedColor); }
}
&:hover {
Expand Down
3 changes: 1 addition & 2 deletions src/models/images/svg/0to10by1or2/grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 12 additions & 20 deletions src/models/images/svg/0to10by1or2/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 1 addition & 6 deletions src/models/images/svg/1dchess/grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 32 additions & 47 deletions src/models/images/svg/369mm/board.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 28 additions & 43 deletions src/models/images/svg/369mm/board6mm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/models/images/svg/369mm/z.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions src/models/images/svg/3spot/B.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions src/models/images/svg/3spot/R.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions src/models/images/svg/3spot/W.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/models/images/svg/3spot/grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a8198f2

Please sign in to comment.