diff --git a/src/map.js b/src/map.js index 7453e00..7787b24 100644 --- a/src/map.js +++ b/src/map.js @@ -251,16 +251,18 @@ export const generateMapSVG = function ( const dateId = dateString.replace(/[^A-Za-z0-9]/g, "-"); - return `

${lastDateString}

@@ -335,7 +342,7 @@ export const generateMapHTML = function (gameConfig, history) { // Playback playButton.addEventListener("click", function() { - const maps = document.querySelectorAll("svg.map"); + const maps = document.querySelectorAll(".map"); playButton.setAttribute("disabled", "disabled"); let prevIndex = 0; @@ -343,9 +350,11 @@ export const generateMapHTML = function (gameConfig, history) { function playNext() { if (prevIndex < maps.length) { + maps[prevIndex].innerHTML = ""; maps[prevIndex].classList.add("hidden"); } if (nextIndex < maps.length) { + maps[nextIndex].innerHTML = maps[nextIndex].innerHTML.replaceAll("", ""); maps[nextIndex].classList.remove("hidden"); } @@ -413,6 +422,11 @@ export const generateMapHTML = function (gameConfig, history) { } .map { + width: 100%; + text-align: center; + } + + .map svg { width: 90%; } @@ -452,7 +466,7 @@ export const generateMapHTML = function (gameConfig, history) { fill: var(--primary-color-darker) !important; } - svg.map.hidden { + .map.hidden { display: none; } @@ -492,11 +506,12 @@ export const generateMapHTML = function (gameConfig, history) { How can we make this game better?
- ${timelapseHTML} - ${mapSVGs} + ${timelapseControlsHTML} + ${mapSVG}
${spriteEmbeds}
+ ${timelapseSVGs} `;