-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
563 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require('./game-info.scss') | ||
|
||
module.exports = require('vue').component('game-info', { | ||
props: { | ||
score: Number | ||
}, | ||
template: require('./game-info.pug')() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.game-info | ||
div | ||
span.label Time: | ||
span.value 4:57 | ||
div | ||
span.label Turns: | ||
span.value 23 | ||
div | ||
span.label Score: | ||
span.value {{ score }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.game-info { | ||
border-bottom: 1px solid #555; | ||
padding-bottom: 1em; | ||
text-align: center; | ||
|
||
> div { | ||
display: inline-block; | ||
width: 200px; | ||
|
||
.label { | ||
margin-right: 5px; | ||
} | ||
|
||
.value { | ||
font-weight: bold; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require('./game-modal.scss') | ||
|
||
module.exports = require('vue').component('game-modal', { | ||
props: { | ||
score: Number | ||
}, | ||
template: require('./game-modal.pug')() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.game-modal | ||
.overlay | ||
.content | ||
.title You won! | ||
.score Score: {{ score }} | ||
button.uk-button.uk-button-default(@click="newGame()", type="button") New game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@import 'compass/css3/border-radius'; | ||
@import 'compass/css3/box-shadow'; | ||
@import 'variables'; | ||
|
||
.game-modal { | ||
bottom: 0; | ||
left: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
|
||
.overlay { | ||
background-color: rgba(darken($color-background, 10%), 0.9); | ||
bottom: 0; | ||
left: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
|
||
.content { | ||
background-color: rgba($color-background, 0.9); | ||
bottom: 0; | ||
height: 200px; | ||
left: 0; | ||
margin: auto; | ||
padding: 1em; | ||
position: absolute; | ||
right: 0; | ||
text-align: center; | ||
top: 0; | ||
width: 400px; | ||
z-index: 2; | ||
|
||
@include border-radius(10px); | ||
@include box-shadow(5px 5px 20px rgba(black, 0.8)); | ||
|
||
.title { | ||
font-size: 1.8em; | ||
padding: 0.5em; | ||
} | ||
|
||
.score { | ||
padding: 0.5em; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
div | ||
p game page/component | ||
game-modal(:score="score", v-if="stopped") | ||
game-info(:score="score") | ||
div(v-for="opponent in opponents") | ||
p {{ opponent.name }} | ||
opponent-discard(:discard="opponent.discard") | ||
player-hand(:hand="player.hand") | ||
button(@click="start", type="button", v-if="!started") Start | ||
button(@click="stop", type="button", v-if="started && !stopped") Stop | ||
button(@click="addBot", type="button") Add bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
module.exports = require('vue').component('home', { | ||
methods: { | ||
randomGameName | ||
}, | ||
template: require('./home.pug')() | ||
}) | ||
|
||
// Guaranteed random | ||
function randomGameName() { | ||
return '511fax' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
div | ||
p This is the main page (written in pug) | ||
p Create a new game | ||
router-link(:to="{ name: 'game', params: { gameId: randomGameName() }}") | ||
button.uk-button.uk-button-default(type="button") Create a new game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require('./opponent-card.scss') | ||
|
||
module.exports = require('vue').component('opponent-card', { | ||
props: { | ||
card: Object | ||
}, | ||
template: require('./opponent-card.pug')() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.opponent-card(:class="{ flipped: card.name }") | ||
.back | ||
.front | ||
p {{ card.name }} | ||
p {{ card.type.toUpperCase() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@import 'compass/css3/transform'; | ||
@import 'compass/css3/transition'; | ||
@import 'variables'; | ||
|
||
.opponent-card { | ||
display: inline-block; | ||
height: 150px; | ||
margin: 1em 2em; | ||
position: relative; | ||
width: 100px; | ||
|
||
@include transition(opacity 0.5s); | ||
|
||
.front, .back { | ||
background-color: $color-card-background; | ||
border-radius: 5px; | ||
bottom: 0; | ||
color: $color-text-dark; | ||
height: 100%; | ||
left: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
width: 100%; | ||
|
||
@include backface-visibility(hidden); | ||
@include transform(translateZ(0)); | ||
@include transition(transform 0.6s); | ||
@include transform-style(preserve-3d); | ||
} | ||
|
||
|
||
.back { | ||
background-image: url('../img/card_backside.jpg'); | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: 100%; | ||
font-size: 12px; | ||
} | ||
|
||
.front { | ||
@include transform(rotateY(-180deg)); | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: 90%; | ||
} | ||
|
||
&.flipped { | ||
.back { | ||
@include transform(rotateY(180deg)); | ||
} | ||
|
||
.front { | ||
@include transform(rotateY(0deg)); | ||
} | ||
} | ||
} |
Oops, something went wrong.