Compare commits
No commits in common. "c48c63debb41b404f4261d2ff86ba8171c101d0d" and "e455c97c67bae1e5a633c8eeee1ce028a05032c1" have entirely different histories.
c48c63debb
...
e455c97c67
@ -243,6 +243,7 @@ impl Game {
|
|||||||
|
|
||||||
if supply || provinces {
|
if supply || provinces {
|
||||||
self.state = GameState::Over;
|
self.state = GameState::Over;
|
||||||
|
}
|
||||||
|
|
||||||
for p in self.players.iter_mut() {
|
for p in self.players.iter_mut() {
|
||||||
p.draw_pile.append(&mut p.played_cards);
|
p.draw_pile.append(&mut p.played_cards);
|
||||||
@ -250,7 +251,6 @@ impl Game {
|
|||||||
p.draw_pile.append(&mut p.discard_pile);
|
p.draw_pile.append(&mut p.discard_pile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn is_active_player(&self, player_id: &str) -> bool {
|
fn is_active_player(&self, player_id: &str) -> bool {
|
||||||
match self.players.get(self.active_player) {
|
match self.players.get(self.active_player) {
|
||||||
|
@ -52,33 +52,17 @@
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
img.card:hover {
|
|
||||||
box-shadow: 0 0 5px white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.player-hand {
|
.player-hand {
|
||||||
height: 145px;
|
border: 1px solid red;
|
||||||
|
height: 165px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: grid;
|
box-sizing: border-box;
|
||||||
justify-content: center;
|
overflow-x: scroll;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(10px, max-content));
|
display: flex;
|
||||||
padding-right: 115px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.player-hand img.card {
|
|
||||||
transform: rotate(3deg);
|
|
||||||
transition: transform 0.1s ease-in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.player-hand img.card:hover {
|
.player-hand img.card:hover {
|
||||||
box-shadow: 0 0 5px blue;
|
box-shadow: 0 0 5px blue;
|
||||||
transform: scale(1.2);
|
|
||||||
transition: transform 0.1s ease-in;
|
|
||||||
}
|
|
||||||
|
|
||||||
.player-hand img.card:hover ~ img.card {
|
|
||||||
transform: translate(60px, 0) rotate(3deg);
|
|
||||||
transition: transform 0.1s ease-in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-window {
|
.chat-window {
|
||||||
@ -89,21 +73,6 @@ img.card:hover {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-window h4 {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-window .players {
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0 5px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-window .players li {
|
|
||||||
}
|
|
||||||
|
|
||||||
#chat li[data-repeat]::after {
|
#chat li[data-repeat]::after {
|
||||||
content: "x" attr(data-repeat);
|
content: "x" attr(data-repeat);
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
@ -238,17 +207,6 @@ img.card:hover {
|
|||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inplay-area h3 {
|
|
||||||
position: relative;
|
|
||||||
top: 50px;
|
|
||||||
left: 30px;
|
|
||||||
transform-origin: 0 0;
|
|
||||||
transform: rotate(90deg);
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inplay-area.inactive {
|
.inplay-area.inactive {
|
||||||
height: 0;
|
height: 0;
|
||||||
transition: height 0.4s ease;
|
transition: height 0.4s ease;
|
||||||
@ -258,7 +216,6 @@ img.card:hover {
|
|||||||
|
|
||||||
.inplay-area img.card {
|
.inplay-area img.card {
|
||||||
margin-left: -55px;
|
margin-left: -55px;
|
||||||
transform: translate(85px, 10px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.turn-status {
|
.turn-status {
|
||||||
@ -283,7 +240,6 @@ img.card:hover {
|
|||||||
.opponent-area {
|
.opponent-area {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 145px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.opponent-status {
|
.opponent-status {
|
||||||
@ -462,7 +418,7 @@ img.card:hover {
|
|||||||
view: function(vnode) {
|
view: function(vnode) {
|
||||||
return [m(".chat-window",
|
return [m(".chat-window",
|
||||||
m("h4", "Players"),
|
m("h4", "Players"),
|
||||||
m("ul", {class: "players" }, vnode.attrs.players.map(function(p) {
|
m("ul", vnode.attrs.players.map(function(p) {
|
||||||
return m("li", p.name);
|
return m("li", p.name);
|
||||||
})),
|
})),
|
||||||
m("h4", "Messages"),
|
m("h4", "Messages"),
|
||||||
@ -649,6 +605,7 @@ img.card:hover {
|
|||||||
ondragover: dragover,
|
ondragover: dragover,
|
||||||
ondrop: drop,
|
ondrop: drop,
|
||||||
},
|
},
|
||||||
|
"Player Hand",
|
||||||
vnode.attrs.hand.map(function(card, i) {
|
vnode.attrs.hand.map(function(card, i) {
|
||||||
return m("img", {
|
return m("img", {
|
||||||
class: "card",
|
class: "card",
|
||||||
@ -656,8 +613,6 @@ img.card:hover {
|
|||||||
draggable: true,
|
draggable: true,
|
||||||
ondragstart: dragStart,
|
ondragstart: dragStart,
|
||||||
"data-index": i,
|
"data-index": i,
|
||||||
onmouseenter: mouseenter,
|
|
||||||
onmouseleave: mouseleave,
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -701,13 +656,10 @@ img.card:hover {
|
|||||||
ondragover: dragover,
|
ondragover: dragover,
|
||||||
ondrop: drop,
|
ondrop: drop,
|
||||||
},
|
},
|
||||||
m("h3", "In-Play"),
|
"Player play area",
|
||||||
m(".turn-status",
|
m(".turn-status",
|
||||||
"Actions: " + vnode.attrs.actions + " | Buys: " + vnode.attrs.buys + " | ",
|
"Actions: " + vnode.attrs.actions + " | Buys: " + vnode.attrs.buys + " | ",
|
||||||
m("img", {
|
m("img", {src: "/static/images/64px-Coin.png", style: "height: 16px;"}),
|
||||||
src: "/static/images/64px-Coin.png",
|
|
||||||
style: "height: 16px; position: relative; top: 2px;",
|
|
||||||
}),
|
|
||||||
": " + vnode.attrs.coin
|
": " + vnode.attrs.coin
|
||||||
),
|
),
|
||||||
cards.map(function(card) {
|
cards.map(function(card) {
|
||||||
@ -716,8 +668,6 @@ img.card:hover {
|
|||||||
src: "/static/images/cards/" + card.toLowerCase() + ".jpg",
|
src: "/static/images/cards/" + card.toLowerCase() + ".jpg",
|
||||||
draggable: true,
|
draggable: true,
|
||||||
//ondragstart: dragStart,
|
//ondragstart: dragStart,
|
||||||
onmouseenter: mouseenter,
|
|
||||||
onmouseleave: mouseleave,
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user