Compare commits

...

12 Commits

Author SHA1 Message Date
8218883faf Merge pull request 'Feature In-Game Compass' (#27) from feature/in-game-compass into develop
Reviewed-on: https://gitea.e5tv.hu/esoko/mapguesser/pulls/27
Reviewed-by: Pőcze Bence <bence@pocze.ch>
2021-04-29 19:15:44 +02:00
145cb5f637 Merge branch 'develop' into feature/in-game-compass
All checks were successful
default-pipeline default-pipeline #151
2021-04-29 19:00:11 +02:00
6d3f74f911 increased the left margin for mobile view
All checks were successful
default-pipeline default-pipeline #150
2021-04-29 18:59:24 +02:00
b22f13887f clicking on compass sets the heading direction to north
All checks were successful
default-pipeline default-pipeline #144
2021-04-29 12:39:44 +02:00
2a3f2212a7 replaced span with div for the compass item
All checks were successful
default-pipeline default-pipeline #143
2021-04-29 12:12:17 +02:00
98df08e5fa Merge branch 'feature/return-to-starting-point-button' into feature/in-game-compass 2021-04-29 12:10:02 +02:00
d42280eb10 only the image is rotated, not the whole div
All checks were successful
default-pipeline default-pipeline #141
2021-04-29 09:18:24 +02:00
0739c65961 Merge branch 'feature/return-to-starting-point-button' into feature/in-game-compass 2021-04-29 09:11:32 +02:00
ea599809b8 Merge branch 'feature/return-to-starting-point-button' into feature/in-game-compass 2021-04-29 08:34:39 +02:00
08c38c6374 reverted style tailoring for guess
All checks were successful
default-pipeline default-pipeline #129
2021-04-28 20:46:52 +02:00
854775011c tailored the style for the navigation buttons
All checks were successful
default-pipeline default-pipeline #128
2021-04-28 20:42:42 +02:00
e33d8c02e9 added compass button and coupled its transform:rotate style attribute with the POV heading value 2021-04-28 20:33:17 +02:00
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<polygon id="needleNorth" points="50,0 33,50 66,50" style="fill:red;stroke:black;stroke-width:1" />
<polygon id="needleSouth" points="50,100 33,50 66,50" style="fill:white;stroke:black;stroke-width:1" />
Sorry, your browser does not support inline SVG.
</svg>

After

Width:  |  Height:  |  Size: 328 B

View File

@ -387,6 +387,10 @@
document.getElementById('currentRound').innerHTML = String(Game.rounds.length) + '/' + String(Game.NUMBER_OF_ROUNDS);
Game.loadPano(Game.panoId, Game.pov);
// update the compass
const heading = Game.panorama.getPov().heading;
document.getElementById("compass").style.transform = "translateY(-50%) rotate(" + heading + "deg)";
},
handleErrorResponse: function (error) {
@ -863,6 +867,9 @@
Game.panorama.addListener('pov_changed', function () {
Game.rewriteGoogleLink();
const heading = Game.panorama.getPov().heading;
document.getElementById("compass").style.transform = "translateY(-50%) rotate(" + heading + "deg)";
});
if (COOKIES_CONSENT) {
@ -950,4 +957,8 @@
document.getElementById('returnToStart').onclick = function () {
Game.loadPano(Game.panoId, Game.pov);
}
document.getElementById('compassContainer').onclick = function () {
Game.panorama.setPov({ heading: 0, pitch: Game.panorama.getPov().pitch });
}
})();

View File

@ -60,6 +60,14 @@
</div>
</div>
<div id="navigation">
<div id="compassContainer" class="navigationItem">
<div>
<img src="<?= $_ENV['STATIC_ROOT'] ?>/img/circle_background.svg?rev=<?= REVISION ?>" alt="Circle Background" class="circleBackground" />
</div>
<div>
<img id="compass" src="<?= $_ENV['STATIC_ROOT'] ?>/img/compass.svg?rev=<?= REVISION ?>" alt="compass icon" class="navigationIcon" />
</div>
</div>
<div id="returnToStart" class="navigationItem">
<div>
<img src="<?= $_ENV['STATIC_ROOT'] ?>/img/circle_background.svg?rev=<?= REVISION ?>" alt="Circle Background" class="circleBackground" />