Aleksmorshen commited on
Commit
f668250
·
verified ·
1 Parent(s): 217832c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -10
app.py CHANGED
@@ -4,7 +4,7 @@ app = Flask(__name__)
4
 
5
  HTML_TEMPLATE = """
6
  <!DOCTYPE html>
7
- <html lang="en">
8
  <head>
9
  <meta charset="UTF-8">
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -13,26 +13,26 @@ HTML_TEMPLATE = """
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 {
@@ -43,6 +43,11 @@ HTML_TEMPLATE = """
43
  height: 100%;
44
  border: 0;
45
  }
 
 
 
 
 
46
  </style>
47
  </head>
48
  <body>
@@ -54,14 +59,21 @@ HTML_TEMPLATE = """
54
  allowfullscreen>
55
  </iframe>
56
  </div>
 
 
 
 
 
 
 
57
  </body>
58
  </html>
59
  """
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__':
67
- app.run(debug=True, host='0.0.0.0', port=7860)
 
4
 
5
  HTML_TEMPLATE = """
6
  <!DOCTYPE html>
7
+ <html lang="ru">
8
  <head>
9
  <meta charset="UTF-8">
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
13
  html, body {
14
  height: 100%;
15
  margin: 0;
16
+ overflow: hidden;
17
  }
18
 
19
  body {
20
  font-family: sans-serif;
21
+ display: flex;
22
+ flex-direction: column;
23
  }
24
 
25
  h1 {
26
  text-align: center;
27
  padding: 1rem;
28
  background-color: #f0f0f0;
29
+ margin: 0;
30
  }
31
 
32
  .iframe-container {
33
+ flex-grow: 1;
34
+ overflow: hidden;
35
+ position: relative;
36
  }
37
 
38
  .iframe-container iframe {
 
43
  height: 100%;
44
  border: 0;
45
  }
46
+
47
+ /* Скрываем блок с текстом "Создано в Ребусе" */
48
+ div:has(> a[href*="rebus.tg"]) {
49
+ display: none;
50
+ }
51
  </style>
52
  </head>
53
  <body>
 
59
  allowfullscreen>
60
  </iframe>
61
  </div>
62
+
63
+ <script>
64
+ document.addEventListener("DOMContentLoaded", function() {
65
+ let elements = document.querySelectorAll("div a[href*='rebus.tg']");
66
+ elements.forEach(el => el.parentElement.style.display = 'none');
67
+ });
68
+ </script>
69
  </body>
70
  </html>
71
  """
72
 
73
  @app.route('/')
74
  def index():
75
+ """Рендерит главную страницу с iframe, заполняющим весь экран."""
76
  return render_template_string(HTML_TEMPLATE)
77
 
78
  if __name__ == '__main__':
79
+ app.run(debug=True, host='0.0.0.0', port=7860)