summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events.txt2
-rw-r--r--play.css2
-rw-r--r--play.html26
-rw-r--r--play.js25
4 files changed, 31 insertions, 24 deletions
diff --git a/events.txt b/events.txt
index 83549fe..28d5fc6 100644
--- a/events.txt
+++ b/events.txt
@@ -555,7 +555,7 @@ CARD 76 - Warsaw Pact Summit
# The Warsaw Pact holds a summit in Bucharest. The Communist player chooses who dominates the summit, the hardliners or the reformers. The Communist may either make 2 Support Checks with a +2 drm against Student and intellectual spaces, or place 4 SPs in spaces with no influence that are not controlled by the Democratic player.
warsaw_pact_summit
if game.phase === 3
-prompt ' spaces with no Democratic influence'
+prompt ' spaces with no Democratic SPs'
add_infl_free 4
else
prompt 'Select a Student or Intellectual space'
diff --git a/play.css b/play.css
index c49ffed..b94d8f6 100644
--- a/play.css
+++ b/play.css
@@ -258,7 +258,7 @@ header.your_turn { background-color: orange; }
top: 65px;
height: 35px;
width: 36px;
- display: block;
+ /*display: block;*/
}
.r0 {left: 554px}
diff --git a/play.html b/play.html
index e7d8924..2196b22 100644
--- a/play.html
+++ b/play.html
@@ -52,7 +52,7 @@
<div id="log"></div>
</aside>
-<main data-min-zoom="0.5" data-max-zoom = "2.0>
+<main data-min-zoom="0.5" data-max-zoom = "2.0">
<!-- MAP, EVENTS -->
<section id="sec_map">
@@ -61,24 +61,24 @@
<div id="pieces">
<div id="overlay">
<h2 id="space-characteristics"></h2>
- <img id="turn-tracker" src="images/Turn.gif">
- <div class="us-action-round-tracker" id="action-round-tracker"></div>
- <img id="stability-track" src="images/SV_Stability.gif">
- <img id="dem-TST" src="images/US_Tiananmen_Square.gif">
- <img id="com-TST" src="images/SV_Tiananmen_Square.gif">
- <img id="vp" src="images/VP.gif">
+ <img id="turn-tracker" class="hide" src="images/Turn.gif">
+ <div class="us-action-round-tracker hide" id="action-round-tracker"></div>
+ <img id="stability-track" class="hide" src="images/SV_Stability.gif">
+ <img id="dem-TST" class="hide" src="images/US_Tiananmen_Square.gif">
+ <img id="com-TST" class="hide" src="images/SV_Tiananmen_Square.gif">
+ <img id="vp" class="hide" src="images/VP.gif">
<div class="germany marker" id="East_Germany">
- <p class="times_held" id="East_Germany_times_held">1</p></div>
+ <p class="times_held hide" id="East_Germany_times_held">1</p></div>
<div class="poland marker" id="Poland">
- <p class="times_held" id="Poland_times_held">1</p></div>
+ <p class="times_held hide" id="Poland_times_held">1</p></div>
<div class="czech marker" id="Czechoslovakia">
- <p class="times_held" id="Czechoslovakia_times_held">1</p></div>
+ <p class="times_held hide" id="Czechoslovakia_times_held">1</p></div>
<div class="hungary marker" id="Hungary">
- <p class="times_held" id="Hungary_times_held">1</p></div>
+ <p class="times_held hide" id="Hungary_times_held">1</p></div>
<div class="romania marker" id="Romania">
- <p class="times_held" id="Romania_times_held">1</p></div>
+ <p class="times_held hide" id="Romania_times_held">1</p></div>
<div class="bulgaria marker" id="Bulgaria">
- <p class="times_held" id="Bulgaria_times_held">1</p></div>
+ <p class="times_held hide" id="Bulgaria_times_held">1</p></div>
<!-- PERMANENT EVENT MARKERS ON THE BOARD -->
diff --git a/play.js b/play.js
index 90eebb2..d7f9f75 100644
--- a/play.js
+++ b/play.js
@@ -121,6 +121,8 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi
// CREATE CARDS
+ const is_mobile = window.matchMedia("(pointer: coarse)").matches
+
for (let c = 1; c <= last_card; ++c) {
const hand_card = document.createElement('img');
@@ -129,14 +131,17 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi
hand_card.src = `cards/e${c}.gif`
hand_card.my_card = c;
hand_card.addEventListener('mousedown', on_click_card);
- hand_card.addEventListener('mouseenter', () => {
- hover_timeout = setTimeout(() => {
- hand_card.classList.add('zoom');
- }, 500) })
- hand_card.addEventListener('mouseleave', () => {
- clearTimeout(hover_timeout);
- hand_card.classList.remove('zoom');
- });
+
+ if(!is_mobile) {
+ hand_card.addEventListener('mouseenter', () => {
+ hover_timeout = setTimeout(() => {
+ hand_card.classList.add('zoom');
+ }, 500) })
+ hand_card.addEventListener('mouseleave', () => {
+ clearTimeout(hover_timeout);
+ hand_card.classList.remove('zoom');
+ });
+ }
ui.cards.push(hand_card);
}
@@ -274,6 +279,7 @@ let ui = {
}
+
function on_update() {
//console.log('on_update called')
//console.log('view.valid_spaces: ', view.valid_spaces)
@@ -291,7 +297,6 @@ function on_update() {
});
//Check influence values
- //const pieces = view.pieces
for (let i = 1; i < spaces.length; i ++) {
@@ -357,10 +362,12 @@ function on_update() {
marker.classList.remove('held')
marker.style.display = 'block'
times_held.classList.add('outlined_text')
+ times_held.classList.remove('hide')
} else if (view.times_held[find_country_index(country)] > 0 ) {
//console.log('setting ', country)
marker.classList.add('held')
marker.style.display = 'block'
+ times_held.classList.remove('hide')
times_held.innerHTML = view.times_held[find_country_index(country)]
}
else {marker.style.display = 'none'}