modified: app.py

This commit is contained in:
SimolZimol
2025-12-12 04:18:19 +01:00
parent ba7950c30c
commit 30e5ee31ee

40
app.py
View File

@@ -4,54 +4,51 @@ app = Flask(__name__)
MAINTENANCE_MESSAGE = """ MAINTENANCE_MESSAGE = """
<!DOCTYPE html> <!DOCTYPE html>
<html lang=\"de\"> <html lang="de">
<head> <head>
<meta charset=\"UTF-8\"> <meta charset="UTF-8">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wartungsarbeiten</title> <title>Wartungsarbeiten</title>
<style> <style>
body { body {
min-height: 100vh; min-height: 100vh;
margin: 0; margin: 0;
background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%); background: linear-gradient(135deg, #232526 0%, #414345 100%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: 'Segoe UI', Arial, sans-serif; font-family: 'Segoe UI', Arial, sans-serif;
} }
.container { .container {
background: #fff; background: #18191a;
padding: 2.5rem 3.5rem; padding: 2.5rem 3.5rem;
border-radius: 18px; border-radius: 18px;
box-shadow: 0 6px 32px rgba(0,0,0,0.12); box-shadow: 0 6px 32px rgba(0,0,0,0.32);
text-align: center; text-align: center;
max-width: 420px; max-width: 420px;
border: 1px solid #232526;
} }
h1 { h1 {
color: #00796b; color: #00bfae;
font-size: 2.2rem; font-size: 2.2rem;
margin-bottom: 1.2rem; margin-bottom: 1.2rem;
letter-spacing: 1px;
} }
p { p {
color: #333; color: #e0e0e0;
font-size: 1.1rem; font-size: 1.1rem;
margin-bottom: 0.8rem; margin-bottom: 0.8rem;
} }
a { a {
color: #00796b; color: #00bfae;
text-decoration: none; text-decoration: none;
font-weight: 500; font-weight: 500;
transition: color 0.2s; transition: color 0.2s;
} }
a:hover { a:hover {
color: #004d40; color: #00e6d0;
text-decoration: underline; text-decoration: underline;
} }
.icon {
font-size: 3.5rem;
margin-bottom: 0.7rem;
color: #00796b;
}
@media (max-width: 600px) { @media (max-width: 600px) {
.container { .container {
padding: 1.2rem 0.5rem; padding: 1.2rem 0.5rem;
@@ -62,19 +59,20 @@ MAINTENANCE_MESSAGE = """
</style> </style>
</head> </head>
<body> <body>
<div class=\"container\"> <div class="container">
<div class=\"icon\">🔧</div>
<h1>Wartungsarbeiten</h1> <h1>Wartungsarbeiten</h1>
<p>Die Website <a href=\"https://projekt-senegal.de/\">projekt-senegal.de</a> ist derzeit wegen Wartungsarbeiten nicht erreichbar.</p> <p>Die Website <a href="https://projekt-senegal.de/">projekt-senegal.de</a> ist derzeit wegen Wartungsarbeiten nicht erreichbar.</p>
<p>Wir sind bald wieder für Sie da.<br>Vielen Dank für Ihr Verständnis!</p> <p>Wir sind bald wieder für Sie da.<br>Vielen Dank für Ihr Verständnis!</p>
</div> </div>
</body> </body>
</html> </html>
""" """
@app.route("/") # Alle Pfade auf die Wartungsseite routen
def maintenance(): @app.route("/", defaults={"path": ""})
return render_template_string(MAINTENANCE_MESSAGE) @app.route("/<path:path>")
def maintenance(path=None):
return render_template_string(MAINTENANCE_MESSAGE), 503
if __name__ == "__main__": if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000) app.run(host="0.0.0.0", port=5000)