From 8a22654f577467fa36b5312884a754c7e7348fff Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 3 Oct 2024 09:51:53 +0100 Subject: Updates to visuals on loading --- events.txt | 2 +- play.css | 2 +- play.html | 26 +++++++++++++------------- play.js | 25 ++++++++++++++++--------- 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 @@
-
@@ -61,24 +61,24 @@

- -
- - - - + +
+ + + +
-

1

+

1

-

1

+

1

-

1

+

1

-

1

+

1

-

1

+

1

-

1

+

1

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'} -- cgit v1.2.3