Browse Source

Pridana nova verze s doplnenou upravou stranky (Na strance pro slozeni doplneno info o drzeni kostky)

master
Marek 5 months ago
parent
commit
2c302aef6c
  1. 16
      src/web_ui.py

16
src/web_ui.py

@ -166,10 +166,22 @@ def solve():
return "<h1 style='text-align:center; margin-top:50px;'>Kostka uz je slozena!</h1><br><div style='text-align:center;'><a href='/'>Zpet do menu</a></div>"
try:
solution = kociemba.solve(k_string)
return f"<body style='text-align:center; margin-top:50px;'><h1>Reseni:</h1><h2 style='color:blue;'>{solution}</h2><br><a href='/' style='padding: 10px; background: #2ecc71; color: white; text-decoration:none; border-radius: 5px;'>Skladat novou</a></body>"
return f"""
<body style="font-family: Arial; text-align: center; margin-top: 50px;">
<h1>Reseni:</h1>
<h2 style="color:blue; letter-spacing: 2px;">{solution}</h2>
<p style="font-size: 18px; font-weight: bold; color: #e67e22; margin-top: 30px; background-color: #fdf2e9; padding: 10px; display: inline-block; border-radius: 5px;">
Pri skladani drzte kostku zelenou k sobe a bilou dolu.
</p>
<br><br>
<a href="/" style="padding: 12px 25px; background: #2ecc71; color: white; text-decoration:none; border-radius: 5px; font-size: 16px;">Skladat novou</a>
</body>
"""
except Exception as e:
return f"<h2 style='color:red; text-align:center; margin-top:50px;'>Nelze najit reseni: {e}</h2><div style='text-align:center;'><a href='/'>Zpet do menu</a></div>"
def start_server():
print("Spoustim webove rozhrani... Otevri prohlizec")
app.run(host='0.0.0.0', port=80)

Loading…
Cancel
Save