Update app.py
Browse files
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 |
-
|
| 16 |
-
|
| 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 |
-
|
| 28 |
-
overflow: hidden;
|
| 29 |
-
|
| 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:
|
| 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>
|
| 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
|
| 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__':
|