Spaces:
Sleeping
Sleeping
Create templates/index.html
Browse files- templates/index.html +55 -0
templates/index.html
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<!-- Disable caching -->
|
| 8 |
+
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
| 9 |
+
<meta http-equiv="Pragma" content="no-cache" />
|
| 10 |
+
<meta http-equiv="Expires" content="0" />
|
| 11 |
+
<!-- Tailwind CDN -->
|
| 12 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 13 |
+
<title>Triangle AI Logo Generator</title>
|
| 14 |
+
</head>
|
| 15 |
+
<body class="bg-gray-100 flex items-center justify-center min-h-screen p-4">
|
| 16 |
+
<div class="bg-white p-6 rounded-2xl shadow-lg w-full max-w-md">
|
| 17 |
+
<h1 class="text-2xl font-bold mb-4">Triangle AI Logo Generator</h1>
|
| 18 |
+
<form action="/generate" method="post" class="space-y-4">
|
| 19 |
+
<textarea name="prompt" rows="4" required
|
| 20 |
+
class="w-full p-2 border rounded focus:outline-none focus:ring"
|
| 21 |
+
placeholder="Enter your prompt here">{{ prompt or '' }}</textarea>
|
| 22 |
+
<button type="submit" class="w-full p-2 bg-blue-500 text-white rounded hover:bg-blue-600">
|
| 23 |
+
Generate</button>
|
| 24 |
+
</form>
|
| 25 |
+
|
| 26 |
+
{% if image_url %}
|
| 27 |
+
<div class="mt-6">
|
| 28 |
+
<p class="font-medium">Result URL:</p>
|
| 29 |
+
<a href="{{ image_url }}" target="_blank" class="text-blue-600 break-all">{{ image_url }}</a>
|
| 30 |
+
<iframe src="{{ image_url }}" class="w-full h-64 mt-4 border rounded"></iframe>
|
| 31 |
+
</div>
|
| 32 |
+
{% endif %}
|
| 33 |
+
|
| 34 |
+
{% if error %}
|
| 35 |
+
<div class="mt-6 text-red-600">
|
| 36 |
+
<p>Error: {{ error }}</p>
|
| 37 |
+
<button onclick="clearCache()" class="mt-2 p-2 bg-red-500 text-white rounded">
|
| 38 |
+
Clear Cache & Reload</button>
|
| 39 |
+
</div>
|
| 40 |
+
{% endif %}
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
<script>
|
| 44 |
+
function clearCache() {
|
| 45 |
+
// Clear service worker caches
|
| 46 |
+
if (window.caches) {
|
| 47 |
+
caches.keys().then(names => names.forEach(name => caches.delete(name)))
|
| 48 |
+
.finally(() => location.reload());
|
| 49 |
+
} else {
|
| 50 |
+
location.reload();
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
</script>
|
| 54 |
+
</body>
|
| 55 |
+
</html>
|