From 24c8873b1440df7f96352697652f0cfedf02cde9 Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Wed, 9 Mar 2022 12:04:09 +0100
Subject: [PATCH] feat: slightly adjust #fe viewport

---
 frontend/src/css/main.css |  9 ++++-----
 frontend/src/index.html   |  3 +--
 frontend/src/js/main.js   | 10 ++++------
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/frontend/src/css/main.css b/frontend/src/css/main.css
index d16531f..2ca97a6 100644
--- a/frontend/src/css/main.css
+++ b/frontend/src/css/main.css
@@ -1,8 +1,7 @@
 /* ¯\_(ツ)_/¯ */
 
-#gioco {
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  background-color: black;
+body {
+  width: 100vw;
+  height: 100vh;
+  margin: 0;
 }
diff --git a/frontend/src/index.html b/frontend/src/index.html
index 1d1fd67..70a0ec4 100644
--- a/frontend/src/index.html
+++ b/frontend/src/index.html
@@ -5,12 +5,11 @@
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <link href="css/main.css" rel="stylesheet">
+  <script src="js/main.js" charset="utf-8"></script>
   <title>Ötzi App</title>
 </head>
 
 <body>
-  <script src="js/main.js" charset="utf-8"></script>
-  <div id="gioco"></div>
 </body>
 
 </html>
\ No newline at end of file
diff --git a/frontend/src/js/main.js b/frontend/src/js/main.js
index 48533cb..d6621e2 100644
--- a/frontend/src/js/main.js
+++ b/frontend/src/js/main.js
@@ -8,13 +8,11 @@ const backendEndpointURL = (endpoint) =>
 
 let config = {
   type: Phaser.AUTO,
+  width: 1200,
+  height: 800,
   pixelArt: true,
-
-  backgroundColor: "#000",
-  scale: {
-    parent: "gioco",
-    mode: Phaser.Scale.SHOW_ALL,
-  },
+  autoCenter: Phaser.Scale.CENTER_BOTH,
+  scaleMode: Phaser.Scale.FIT,
   physics: {
     default: "arcade",
     arcade: {
-- 
GitLab