diff --git a/public/static/css/game.css b/public/static/css/game.css index b5488ea..b3def48 100644 --- a/public/static/css/game.css +++ b/public/static/css/game.css @@ -15,6 +15,17 @@ right: 0; background-color: #000000; opacity: 0.5; + z-index: 4; +} + +#panningBlockerCover { + display: none; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + opacity: 0; z-index: 3; } @@ -22,7 +33,7 @@ position: absolute; bottom: 30px; right: 20px; - z-index: 2; + z-index: 3; } #guess.result { diff --git a/public/static/css/maps.css b/public/static/css/maps.css index 8e32d05..acfb23d 100644 --- a/public/static/css/maps.css +++ b/public/static/css/maps.css @@ -77,6 +77,7 @@ div.mapItem>div.buttonContainer { #restrictions { margin-top: 1em; + margin-bottom: 1em; font-family: 'Roboto', sans-serif; } diff --git a/public/static/js/game.js b/public/static/js/game.js index abf5f77..4fe154d 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -301,11 +301,21 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 }); Game.transitToResultMap(); Game.showSummary(); - //document.getElementById('continueButton').style.display = 'none'; - } else { + if (this.response.restrictions) { + Game.panorama.setOptions({ + clickToGo: !this.response.restrictions.noMove, + linksControl: !this.response.restrictions.noMove, + scrollwheel: !this.response.restrictions.noZoom + }); + + if (this.response.restrictions.noPan) { + document.getElementById('panningBlockerCover').style.display = 'block'; + } + } + Game.panoId = this.response.place.panoId; Game.pov = this.response.place.pov; @@ -442,6 +452,13 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 }); // needs to be set visible after the show guess map hid it in mobile view document.getElementById("navigation").style.visibility = 'visible'; + Game.panorama.setOptions({ + clickToGo: true, + linksControl: true, + scrollwheel: true + }); + document.getElementById('panningBlockerCover').style.display = null; + Game.initialize(); }, diff --git a/src/Controller/GameFlowController.php b/src/Controller/GameFlowController.php index 71ea558..668e895 100644 --- a/src/Controller/GameFlowController.php +++ b/src/Controller/GameFlowController.php @@ -194,6 +194,13 @@ class GameFlowController } } } + + $response['restrictions'] = [ + 'timeLimit' => $challenge->getTimeLimit(), + 'noMove' => $challenge->getNoMove(), + 'noPan' => $challenge->getNoPan(), + 'noZoom' => $challenge->getNoZoom() + ]; } return $response; diff --git a/views/game.php b/views/game.php index 8795d3a..2c9624a 100644 --- a/views/game.php +++ b/views/game.php @@ -25,6 +25,7 @@

+
diff --git a/views/maps.php b/views/maps.php index dfb9d2f..c097e4c 100644 --- a/views/maps.php +++ b/views/maps.php @@ -65,14 +65,14 @@ TODO: condition!
-
- - -
+
+ + +