Spaces:
Build error
Build error
| from fastapi import FastAPI, Request | |
| from fastapi.responses import HTMLResponse | |
| from jinja2 import Environment, DictLoader | |
| app = FastAPI() | |
| # Template HTML con tutti i bottoni | |
| templates = { | |
| "index.html": """ | |
| <!DOCTYPE html> | |
| <html lang="it"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Giorgio's Intelligence</title> | |
| <style> | |
| body { | |
| font-family: 'Segoe UI', sans-serif; | |
| background: linear-gradient(to right, #1f1c2c, #928dab); | |
| color: white; | |
| text-align: center; | |
| padding: 50px; | |
| } | |
| .container { | |
| background-color: rgba(0,0,0,0.5); | |
| padding: 30px; | |
| border-radius: 15px; | |
| box-shadow: 0 0 20px rgba(255,255,255,0.2); | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | |
| gap: 20px; | |
| } | |
| .button { | |
| padding: 15px; | |
| background-color: #ffffff; | |
| color: #1f1c2c; | |
| text-decoration: none; | |
| border-radius: 8px; | |
| font-weight: bold; | |
| box-shadow: 0 0 10px rgba(255,255,255,0.3); | |
| transition: transform 0.2s; | |
| } | |
| .button:hover { | |
| transform: scale(1.05); | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Giorgio's Intelligence</h1> | |
| <div class="container"> | |
| <a href="/immagini" class="button">🎨 Genera Immagini</a> | |
| <a href="/video" class="button">🎥 Genera Video</a> | |
| <a href="/3d" class="button">🧊 Genera 3D</a> | |
| <a href="/musica" class="button">🎵 Genera Musica</a> | |
| <a href="/voce" class="button">🗣️ Sintetizza Voce</a> | |
| <a href="/grafici" class="button">📊 Crea Grafici</a> | |
| <a href="/tabelle" class="button">📋 Crea Tabelle</a> | |
| <a href="/chat" class="button">💬 Conversazione</a> | |
| <a href="/testo" class="button">✍️ Genera Testo</a> | |
| <a href="/riassunto" class="button">📚 Riassunto</a> | |
| <a href="/domande" class="button">❓ Rispondi a Domande</a> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| } | |
| env = Environment(loader=DictLoader(templates)) | |
| async def home(request: Request): | |
| template = env.get_template("index.html") | |
| html = template.render() | |
| return HTMLResponse(content=html) | |