From 5ddc2d7080ec96e24326c5c144bd87ebe9acd8d3 Mon Sep 17 00:00:00 2001
From: Simone Margaritelli <evilsocket@gmail.com>
Date: Tue, 5 Nov 2019 18:30:09 +0100
Subject: [PATCH] fix: fixed issue with webui in landcape (fixes #523)

---
 pwnagotchi/ui/web/static/css/style.css  |  8 ++++++--
 pwnagotchi/ui/web/templates/index.html  |  2 +-
 pwnagotchi/ui/web/templates/status.html | 20 ++++++++++----------
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/pwnagotchi/ui/web/static/css/style.css b/pwnagotchi/ui/web/static/css/style.css
index 060a984..94f6679 100644
--- a/pwnagotchi/ui/web/static/css/style.css
+++ b/pwnagotchi/ui/web/static/css/style.css
@@ -9,14 +9,18 @@
 }
 
 img#ui {
-    width:100%;
+    width: 100vw;
+    height:100%;
+    max-width:100vw;
+    object-fit: contain;
 }
 
 .full {
     position: absolute;
     top:0;
     left:0;
-    width:100%;
+    height: 100vh;
+    width: 100vw;
 }
 
 .pixelated {
diff --git a/pwnagotchi/ui/web/templates/index.html b/pwnagotchi/ui/web/templates/index.html
index 50ec1e2..7aaac13 100644
--- a/pwnagotchi/ui/web/templates/index.html
+++ b/pwnagotchi/ui/web/templates/index.html
@@ -1,7 +1,7 @@
 <html>
 <head>
     <title>{{ title }}</title>
-    <link rel="stylesheet" type="text/css" href="/css/style.css"/>
+    <link rel="stylesheet" type="text/css" href="/css/style.css?v=1.1"/>
 </head>
 <body>
 <div class="full pixelated">
diff --git a/pwnagotchi/ui/web/templates/status.html b/pwnagotchi/ui/web/templates/status.html
index ddeb866..57c9f23 100644
--- a/pwnagotchi/ui/web/templates/status.html
+++ b/pwnagotchi/ui/web/templates/status.html
@@ -1,12 +1,12 @@
 <html>
-  <head>
-      <title>{{ title }}</title>
-      <meta http-equiv="refresh" content="{{ go_back_after }};URL=/">
-      <link rel="stylesheet" type="text/css" href="/css/style.css"/>
-  </head>
-  <body>
-    <div class="status">
-        {{ message }}
-    </div>
-  </body>
+<head>
+    <title>{{ title }}</title>
+    <meta http-equiv="refresh" content="{{ go_back_after }};URL=/">
+    <link rel="stylesheet" type="text/css" href="/css/style.css?v=1.1"/>
+</head>
+<body>
+<div class="status">
+    {{ message }}
+</div>
+</body>
 </html>
\ No newline at end of file