Spaces:
Runtime error
Runtime error
Upload PromptForge v1.0 — Structured prompt generator for Google AI Studio
Browse files- backend/main.py +8 -4
- frontend/index.html +1 -1
- frontend/simple.css +16 -1
- frontend/simple.html +10 -1
backend/main.py
CHANGED
|
@@ -73,6 +73,13 @@ async def _startup() -> None:
|
|
| 73 |
|
| 74 |
@app.get("/", response_class=HTMLResponse, tags=["Frontend"])
|
| 75 |
async def serve_frontend() -> HTMLResponse:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
index = _FRONTEND_DIR / "index.html"
|
| 77 |
if index.exists():
|
| 78 |
return HTMLResponse(content=index.read_text(), status_code=200)
|
|
@@ -80,10 +87,7 @@ async def serve_frontend() -> HTMLResponse:
|
|
| 80 |
|
| 81 |
@app.get("/simple", response_class=HTMLResponse, tags=["Frontend"])
|
| 82 |
async def serve_simple() -> HTMLResponse:
|
| 83 |
-
|
| 84 |
-
if simple.exists():
|
| 85 |
-
return HTMLResponse(content=simple.read_text(), status_code=200)
|
| 86 |
-
return HTMLResponse("<h1>Simple page not found.</h1>")
|
| 87 |
|
| 88 |
|
| 89 |
# ── System ────────────────────────────────────────────────────────────────────
|
|
|
|
| 73 |
|
| 74 |
@app.get("/", response_class=HTMLResponse, tags=["Frontend"])
|
| 75 |
async def serve_frontend() -> HTMLResponse:
|
| 76 |
+
simple = _FRONTEND_DIR / "simple.html"
|
| 77 |
+
if simple.exists():
|
| 78 |
+
return HTMLResponse(content=simple.read_text(), status_code=200)
|
| 79 |
+
return HTMLResponse("<h1>Simple page not found.</h1>")
|
| 80 |
+
|
| 81 |
+
@app.get("/advanced", response_class=HTMLResponse, tags=["Frontend"])
|
| 82 |
+
async def serve_advanced() -> HTMLResponse:
|
| 83 |
index = _FRONTEND_DIR / "index.html"
|
| 84 |
if index.exists():
|
| 85 |
return HTMLResponse(content=index.read_text(), status_code=200)
|
|
|
|
| 87 |
|
| 88 |
@app.get("/simple", response_class=HTMLResponse, tags=["Frontend"])
|
| 89 |
async def serve_simple() -> HTMLResponse:
|
| 90 |
+
return await serve_frontend()
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
# ── System ────────────────────────────────────────────────────────────────────
|
frontend/index.html
CHANGED
|
@@ -6,7 +6,6 @@
|
|
| 6 |
<title>PromptForge v4.0</title>
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet"/>
|
| 9 |
-
<a href="/simple" class="btn-outline">✨ Simple Mode</a>
|
| 10 |
<link rel="stylesheet" href="/static/style.css"/>
|
| 11 |
</head>
|
| 12 |
<body>
|
|
@@ -52,6 +51,7 @@
|
|
| 52 |
<span class="api-dot-sm" id="dot-hf" title="Hugging Face">HF</span>
|
| 53 |
<span class="api-dot-sm" id="dot-google" title="Google Gemini">GG</span>
|
| 54 |
</div>
|
|
|
|
| 55 |
<button class="theme-toggle" id="btn-theme" title="Toggle theme (Alt+T)">🌙</button>
|
| 56 |
<a class="sidebar-link" href="/docs" target="_blank" title="API Docs">📖</a>
|
| 57 |
</div>
|
|
|
|
| 6 |
<title>PromptForge v4.0</title>
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet"/>
|
|
|
|
| 9 |
<link rel="stylesheet" href="/static/style.css"/>
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 51 |
<span class="api-dot-sm" id="dot-hf" title="Hugging Face">HF</span>
|
| 52 |
<span class="api-dot-sm" id="dot-google" title="Google Gemini">GG</span>
|
| 53 |
</div>
|
| 54 |
+
<a class="sidebar-link" href="/" title="Simple Mode">✨</a>
|
| 55 |
<button class="theme-toggle" id="btn-theme" title="Toggle theme (Alt+T)">🌙</button>
|
| 56 |
<a class="sidebar-link" href="/docs" target="_blank" title="API Docs">📖</a>
|
| 57 |
</div>
|
frontend/simple.css
CHANGED
|
@@ -373,4 +373,19 @@ body {
|
|
| 373 |
}
|
| 374 |
#toast.show {
|
| 375 |
opacity: 1;
|
| 376 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
}
|
| 374 |
#toast.show {
|
| 375 |
opacity: 1;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
/* Footer Actions */
|
| 379 |
+
.footer-actions {
|
| 380 |
+
margin-top: 40px;
|
| 381 |
+
border-top: 1px solid var(--border);
|
| 382 |
+
padding-top: 32px;
|
| 383 |
+
display: flex;
|
| 384 |
+
justify-content: center;
|
| 385 |
+
}
|
| 386 |
+
.full-width {
|
| 387 |
+
width: 100%;
|
| 388 |
+
justify-content: center;
|
| 389 |
+
text-decoration: none;
|
| 390 |
+
font-weight: 500;
|
| 391 |
+
}
|
frontend/simple.html
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
</svg>
|
| 19 |
<span>PromptForge <span class="badge">simple</span></span>
|
| 20 |
</div>
|
| 21 |
-
<a href="/" class="btn-outline">
|
| 22 |
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 23 |
<path d="M12 5v14M5 12h14"></path>
|
| 24 |
</svg>
|
|
@@ -115,6 +115,15 @@
|
|
| 115 |
Export JSON
|
| 116 |
</button>
|
| 117 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
</main>
|
| 119 |
</div>
|
| 120 |
|
|
|
|
| 18 |
</svg>
|
| 19 |
<span>PromptForge <span class="badge">simple</span></span>
|
| 20 |
</div>
|
| 21 |
+
<a href="/advanced" class="btn-outline">
|
| 22 |
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 23 |
<path d="M12 5v14M5 12h14"></path>
|
| 24 |
</svg>
|
|
|
|
| 115 |
Export JSON
|
| 116 |
</button>
|
| 117 |
</div>
|
| 118 |
+
|
| 119 |
+
<div class="footer-actions">
|
| 120 |
+
<a href="/advanced" class="btn-secondary full-width">
|
| 121 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 122 |
+
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"></path>
|
| 123 |
+
</svg>
|
| 124 |
+
Switch to Advanced Mode
|
| 125 |
+
</a>
|
| 126 |
+
</div>
|
| 127 |
</main>
|
| 128 |
</div>
|
| 129 |
|