Aleksmorshen commited on
Commit
be944ad
·
verified ·
1 Parent(s): 295c7f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -11
app.py CHANGED
@@ -10,25 +10,29 @@ HTML_TEMPLATE = """
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
  <title>Flask App with Iframe</title>
12
  <style>
 
 
 
 
 
 
13
  body {
14
  font-family: sans-serif;
15
- margin: 0;
16
- padding: 0;
17
- box-sizing: border-box;
18
  }
19
 
20
  h1 {
21
  text-align: center;
22
  padding: 1rem;
23
  background-color: #f0f0f0;
 
24
  }
25
 
26
  .iframe-container {
27
- width: 100%;
28
- overflow: hidden; /* Prevent scrolling */
29
- padding-bottom: 56.25%; /* 16:9 aspect ratio (you can adjust) */
30
- position: relative;
31
- height: 100%;
32
  }
33
 
34
  .iframe-container iframe {
@@ -36,7 +40,7 @@ HTML_TEMPLATE = """
36
  top: 0;
37
  left: 0;
38
  width: 100%;
39
- height: 300%;
40
  border: 0;
41
  }
42
  </style>
@@ -47,7 +51,7 @@ HTML_TEMPLATE = """
47
  <iframe
48
  src="https://rebus.tg/site/67ab09cbd76e2/index"
49
  frameborder="0"
50
- allowfullscreen> <!-- Important for mobile -->
51
  </iframe>
52
  </div>
53
  </body>
@@ -56,7 +60,7 @@ HTML_TEMPLATE = """
56
 
57
  @app.route('/')
58
  def index():
59
- """Renders the main page with an embedded iframe, adapted for mobile."""
60
  return render_template_string(HTML_TEMPLATE)
61
 
62
  if __name__ == '__main__':
 
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
  <title>Flask App with Iframe</title>
12
  <style>
13
+ html, body {
14
+ height: 100%;
15
+ margin: 0;
16
+ overflow: hidden; /* Prevent scrollbars */
17
+ }
18
+
19
  body {
20
  font-family: sans-serif;
21
+ display: flex; /* Use flexbox to fill the screen */
22
+ flex-direction: column; /* Stack header and iframe vertically */
 
23
  }
24
 
25
  h1 {
26
  text-align: center;
27
  padding: 1rem;
28
  background-color: #f0f0f0;
29
+ margin: 0; /* Remove default header margins */
30
  }
31
 
32
  .iframe-container {
33
+ flex-grow: 1; /* Allow iframe container to take up remaining space */
34
+ overflow: hidden; /* Clip content if necessary */
35
+ position: relative; /* For absolute positioning of the iframe */
 
 
36
  }
37
 
38
  .iframe-container iframe {
 
40
  top: 0;
41
  left: 0;
42
  width: 100%;
43
+ height: 100%;
44
  border: 0;
45
  }
46
  </style>
 
51
  <iframe
52
  src="https://rebus.tg/site/67ab09cbd76e2/index"
53
  frameborder="0"
54
+ allowfullscreen>
55
  </iframe>
56
  </div>
57
  </body>
 
60
 
61
  @app.route('/')
62
  def index():
63
+ """Renders the main page with an iframe filling the whole screen."""
64
  return render_template_string(HTML_TEMPLATE)
65
 
66
  if __name__ == '__main__':