const seed = 'none' const scenario = 'standard' const options = 'none' //const rules = require("./rules") const stability=0 const US_tiananmen=0 const USSR_tiananmen=0 const toolbar = document.getElementById('toolbar') const vpMarker = document.getElementById('vp') const mapContainer = document.querySelector('.map') let handActive=0 let doInfl=0 let doSupportCheck=0 let availableOps=0 let demTSTPos=0 let comTSTPos=0 let demTSTPrev=0 let comTSTPrev=0 let turn=1 let actionRound=1 let supportCheckTargetName='' let supportCheckTargetCountry=0 let vp = 0 let germanyRevolution=0 let polandRevolution=0 let czechRevolution=0 let hungaryRevolution=0 let romaniaRevolution=0 let buglariaRevolution=0 let germanyHeld=0 let polandHeld=0 let czechHeld=0 let hungaryHeld=0 let romaniaHeld=0 let bulgariaHeld=0 const countryNames= [ null, "East Germany", "Poland", "Czechoslovakia", "Hungary", "Romania", "Bulgaria" ] const overlay = document.getElementById('overlay'); const spaceNameElement = document.getElementById('space-name'); const spaceCharacteristicsElement = document.getElementById('space-characteristics'); // Event listener to track mouse movement over the map document.querySelector('.map').addEventListener('mousemove', function(event) { const x = event.offsetX; // X-coordinate of mouse relative to container const y = event.offsetY; // Y-coordinate of mouse relative to container spaceCharacteristicsElement.innerText = `X: ${x}, Y: ${y}`; }) // Call game setup material // const game = rules.setup(seed, scenario, options) // Create map areas dynamically based on coordinates function createMap() { spaces.forEach((space) => { if (space && space.box) { const { x, y, h, w } = space.box; const spaceArea = document.createElement('div'); spaceArea.classList.add('space-area', space.country) spaceArea.id=space.name; spaceArea.style.left = x + 'px'; spaceArea.style.top = y + 'px'; spaceArea.style.width = w + 'px'; spaceArea.style.height = h + 'px'; //spaceArea.addEventListener('click', changeInfl) //spaceArea.addEventListener('click', finishSupportCheck) /*if (space.demInfl > 0 && space.demInfl - space.comInfl >= space.stability) { const img = document.createElement('img') img.classList.add('demInfl', space.country) img.id=space.name img.src = `images/US_${space.demInfl}.gif` spaceArea.appendChild(img) } else if (space.demInfl > 0) {*/ const dem_img = document.createElement('img') dem_img.classList.add('demInfl', space.country) dem_img.id=space.name dem_img.src = `images/USd_blank.gif` spaceArea.appendChild(dem_img) const demInflValue = document.createElement('p') demInflValue.className='demInflValue' demInflValue.id=space.name demInflValue.innerText=space.demInfl spaceArea.appendChild(demInflValue) //} /*} else if (space.comInfl > 0 && space.comInfl - space.demInfl >= space.stability) { const img = document.createElement('img') img.className='comInfl' img.id=space.name img.src = `images/SV_${space.comInfl}.gif` spaceArea.appendChild(img) } else if (space.comInfl > 0) {*/ const com_img = document.createElement('img') com_img.className='comInfl' com_img.id=space.name com_img.src = `images/SVd_blank.gif` spaceArea.appendChild(com_img) const comInflValue = document.createElement('p') comInflValue.className='comInflValue' comInflValue.id=space.name comInflValue.innerText=space.comInfl spaceArea.appendChild(comInflValue) //} mapContainer.appendChild(spaceArea); } }); } //setup() createMap() console.log('Hello') console.log('game:',game) let ui = { favicon: document.getElementById('favicon'), player: [ document.getElementById("role_Democrat"), document.getElementById("role_Communist"), ], cards: [ null ], events_panel: document.getElementById("events_panel"), hand_panel: document.getElementById("hand_panel"), } console.log('strategy deck', game.strategy_deck) //function changeInfl() {} //function finishSupportCheck() {}