Skip to content

Commit

Permalink
make the ui look nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
davefollett committed May 23, 2018
1 parent b4b90a8 commit ee350a6
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 7 deletions.
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>chess-fun-number-8-amazon-checkmate</title>
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>Chess Fun #8: Amazon Checkmate</title>
</head>
<body>
<noscript>
Expand Down
Binary file added src/assets/amazon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/check-orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/checkmate-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/king.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/queen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/safe-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/stalemate-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/ChessBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export default {
.grid {
display: grid;
grid-template-columns: repeat(10, 1fr);
/*grid-template-columns: repeat(10, 1fr);*/
grid-template-columns: repeat(10, 75px);
grid-gap: 2px;
align-items: center;
}
Expand Down
43 changes: 39 additions & 4 deletions src/components/ChessSquare.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="border">
{{ value }}
<div :class="[background, 'center']">
<img :src="require(`@/assets/${imagePath}`)" height="48" width="48">
</div>
</template>

Expand All @@ -11,16 +11,51 @@ export default {
row: Number,
column: Number,
},
data () {
return {
imageLoopup: {
"A": "amazon.png",
"K": "king.png",
"S": "stalemate-blue.png",
"+": "check-orange.png",
"X": "checkmate-red.png",
"B": "blank.png",
"-": "blank.png",
"O": "safe-green.png"
},
}
},
computed: {
value() {
return this.$store.getters.getSquareValue(this.row, this.column);
imagePath() {
return this.imageLoopup[this.$store.getters.getSquareValue(this.row, this.column)];
},
background() {
let result = "even-color";
if((this.row + this.column) % 2 === 0) {
result = "odd-color";
}
return result;
}
}
}
</script>

<style scoped>
.even-color {
/*background-color: tan;*/
background-color: #b6876b;
}
.odd-color {
/*background-color:peru;*/
/*background-color: #f4dfc1;*/
background-color: tan;
}
.center {
text-align: center;
}
.border {
border-style: solid;
border-width: 5px;
Expand Down
1 change: 1 addition & 0 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="home">
<h2> Codewars Solution Tester: <a href="https://www.codewars.com/kata/chess-fun-number-8-amazon-checkmate" target="_blank">Chess Fun #8: Amazon Checkmate</a></h2>
<ChessBoard></ChessBoard>
</div>
</template>
Expand Down

0 comments on commit ee350a6

Please sign in to comment.