summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css15
-rw-r--r--play.js29
2 files changed, 25 insertions, 19 deletions
diff --git a/play.css b/play.css
index 535ba84..f9ed02e 100644
--- a/play.css
+++ b/play.css
@@ -194,10 +194,10 @@ header.your_turn { background-color: orange; }
background-image: url(images/USd_blank.gif);
background-size: contain;
}
-
+/*
.demInfl:hover {
cursor: pointer;
-}
+}*/
.comInfl {
position: absolute;
@@ -207,10 +207,10 @@ header.your_turn { background-color: orange; }
height: 35px;
width: 35px;
}
-
+/*
.comInfl:hover {
cursor: pointer;
-}
+}*/
.comInfl.controlled {
background-image: url(images/SV_blank.gif);
@@ -551,11 +551,10 @@ left: 660px}
border-radius: 5px;
transition: transform .3s ease 0.5s;
}
-
+/*
.hand_card:hover {
cursor: pointer;
- /*transform: scale(1.75);*/
-}
+}*/
.zoom {
transform: scale(1.75)
@@ -577,7 +576,7 @@ left: 660px}
}
.discard_card:hover, .event_card:hover {
- cursor: pointer;
+ /*cursor: pointer;*/
transform: scale(2);
}
diff --git a/play.js b/play.js
index dd38b44..61e841f 100644
--- a/play.js
+++ b/play.js
@@ -182,12 +182,12 @@ function is_card_enabled(card) {
function on_click_space(evt) {
if (evt.button === 0) {
const space = evt.target.my_space;
- console.log('on_click_space_called with space:', space);
+ //console.log('on_click_space_called with space:', space);
if (send_action('infl', space)) {
- console.log('send_action with infl:', space);
+ //console.log('send_action with infl:', space);
evt.stopPropagation();
} else if (send_action('sc', space)) {
- console.log('send_action with sc:', space);
+ //console.log('send_action with sc:', space);
evt.stopPropagation();
} else {
// console.log('send_action failed for space:', space);
@@ -199,9 +199,9 @@ function on_click_space(evt) {
function on_click_card(evt) {
if (evt.button === 0) {
const card = evt.target.my_card;
- console.log('on_click_card_called with card:', card);
+ //console.log('on_click_card_called with card:', card);
if (is_action('card', card)) {
- console.log('in action card')
+ //console.log('in action card')
if (send_action('card', card)) {
evt.stopPropagation();
}
@@ -211,15 +211,15 @@ function on_click_card(evt) {
function is_action(action) {
//console.log('is_action called with: ', action)
- console.log('view.actions', view.actions)
+ //console.log('view.actions', view.actions)
if (view.actions && view.actions[action])
return true
return false
}
function is_card_action(action, card) {
- console.log('is_card_action called with action', action, 'card', card)
- console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action])
+ //console.log('is_card_action called with action', action, 'card', card)
+ //console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action])
if (view.actions && view.actions[action] && view.actions[action].includes(card))
return true
return false
@@ -417,9 +417,15 @@ function on_update() {
if (view.hand.length && view.is_pwr_struggle === false) {
document.getElementById("hand_panel").classList.remove("hide")
+ //console.log('view.actions.card', view.actions.card)
for (let c of view.hand) {
let card = ui.cards[c]
document.getElementById("hand").appendChild(card);
+ if (view.actions && view.actions.card && view.actions.card.includes(c)) {
+ card.classList.add('action')
+ } else {
+ card.classList.remove('action')
+ }
if (view.valid_cards.includes(c)) {
card.classList.add('selected')
} else {
@@ -450,7 +456,7 @@ if (!view.is_pwr_struggle) {
}
// DISCARD FOR EVENTS
-console.log('view.discard',view.discard)
+//console.log('view.discard',view.discard)
if(view.discard) {
//document.getElementById("discard").replaceChildren()
document.getElementById("discard_panel").classList.remove("hide")
@@ -484,6 +490,7 @@ for (let c of view.strategy_removed) {
if (view.played_card > 0) {
document.getElementById("played_card_panel").classList.remove("hide")
document.getElementById("played_card").appendChild(ui.cards[view.played_card]);
+ document.getElementById("played_card").classList.remove("hand_card")
} else {
document.getElementById("played_card_panel").classList.add("hide")
}
@@ -517,7 +524,7 @@ if (!view.is_pwr_struggle) {
document.getElementById("opp_hand_panel").classList.add("hide")
}
} else {
- console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand )
+ //console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand )
if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) {
document.getElementById("opp_hand_panel").classList.remove("hide")
for (let c of view.opp_hand) {
@@ -699,7 +706,7 @@ if (view.persistent_events.includes(97)) {
action_button("end_round", "End Round")
action_button("undo", "Undo")
-console.log('view.strategy_deck', view.strategy_deck)
+console.log('view.actions', view.actions)
}
// =========================== LOG FUNCTIONS ==============================================