| from flask import Flask, render_template_string |
|
|
| app = Flask(__name__) |
|
|
| HTML_TEMPLATE = """ |
| <!DOCTYPE html> |
| <html lang="ru"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>Замки Оптом</title> |
| <style> |
| html, body { |
| height: 100%; |
| margin: 0; |
| overflow: hidden; |
| } |
| |
| body { |
| font-family: sans-serif; |
| display: flex; |
| flex-direction: column; |
| } |
| |
| h1 { |
| text-align: center; |
| padding: 1rem; |
| background-color: #f0f0f0; |
| margin: 0; |
| z-index: 10; |
| position: relative; |
| } |
| |
| .iframe-container { |
| flex-grow: 1; |
| overflow: hidden; |
| position: relative; |
| } |
| |
| .iframe-container iframe { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| border: 0; |
| } |
| |
| /* Блокируем верхнюю часть iframe, где может быть "Создано в Ребусе" */ |
| .iframe-overlay { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 40px; /* Закрываем только верхнюю часть */ |
| background: white; |
| z-index: 20; |
| box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); |
| } |
| </style> |
| </head> |
| <body> |
| <h1>Замки Оптом</h1> |
| <div class="iframe-container"> |
| <div class="iframe-overlay"></div> <!-- Борд, скрывающий верхнюю часть --> |
| <iframe |
| src="https://rebus.tg/site/67ab09cbd76e2/index" |
| frameborder="0" |
| allowfullscreen> |
| </iframe> |
| </div> |
| </body> |
| </html> |
| """ |
|
|
| @app.route('/') |
| def index(): |
| """Рендерит страницу с бордом, скрывающим часть iframe.""" |
| return render_template_string(HTML_TEMPLATE) |
|
|
| if __name__ == '__main__': |
| app.run(debug=True, host='0.0.0.0', port=7860) |