Create index.html
Browse files- index.html +66 -0
index.html
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ar" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<title>Genisi AI | Dashboard</title>
|
| 6 |
+
<style>
|
| 7 |
+
body { background: #0b0f1a; color: white; font-family: sans-serif; margin: 0; display: flex; height: 100vh; }
|
| 8 |
+
.sidebar { width: 260px; background: #161b2c; padding: 25px; border-left: 1px solid #2d3748; }
|
| 9 |
+
.content { flex: 1; display: flex; flex-direction: column; }
|
| 10 |
+
#chat { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
|
| 11 |
+
.msg { padding: 12px; border-radius: 10px; max-width: 80%; line-height: 1.5; }
|
| 12 |
+
.user { align-self: flex-end; background: #0ea5e9; }
|
| 13 |
+
.ai { align-self: flex-start; background: #1e293b; border: 1px solid #334155; }
|
| 14 |
+
.input-box { padding: 20px; background: #0b0f1a; display: flex; gap: 10px; }
|
| 15 |
+
input { flex: 1; padding: 12px; border-radius: 8px; border: 1px solid #334155; background: #1e293b; color: white; }
|
| 16 |
+
button { background: #0ea5e9; border: none; padding: 10px 20px; border-radius: 8px; color: white; cursor: pointer; }
|
| 17 |
+
select { background: #1e293b; color: white; padding: 10px; border-radius: 8px; border: 1px solid #334155; margin-bottom: 20px; width: 100%; }
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body>
|
| 21 |
+
<div class="sidebar">
|
| 22 |
+
<h2>Genisi AI</h2>
|
| 23 |
+
<p style="color: #94a3b8; font-size: 12px;">المطور: AnesNT</p>
|
| 24 |
+
<select id="model">
|
| 25 |
+
<option value="kimi-k2.5-fw">Kimi K2.5 (عربي)</option>
|
| 26 |
+
<option value="gemma-4-31b-t">Gemma 4 (برمجة)</option>
|
| 27 |
+
<option value="flux">توليد صور Flux</option>
|
| 28 |
+
</select>
|
| 29 |
+
</div>
|
| 30 |
+
<div class="content">
|
| 31 |
+
<div id="chat"></div>
|
| 32 |
+
<div class="input-box">
|
| 33 |
+
<input type="text" id="userInput" placeholder="اسأل Genisi أي شيء...">
|
| 34 |
+
<button onclick="run()">إرسال</button>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
+
|
| 38 |
+
<script>
|
| 39 |
+
async function run() {
|
| 40 |
+
const input = document.getElementById('userInput');
|
| 41 |
+
const chat = document.getElementById('chat');
|
| 42 |
+
const model = document.getElementById('model').value;
|
| 43 |
+
const val = input.value.trim();
|
| 44 |
+
if(!val) return;
|
| 45 |
+
|
| 46 |
+
chat.innerHTML += `<div class="msg user">${val}</div>`;
|
| 47 |
+
input.value = "";
|
| 48 |
+
|
| 49 |
+
const isImg = model === 'flux';
|
| 50 |
+
const res = await fetch(isImg ? '/api/image' : '/api/chat', {
|
| 51 |
+
method: 'POST',
|
| 52 |
+
headers: { 'Content-Type': 'application/json' },
|
| 53 |
+
body: JSON.stringify({ message: val, prompt: val, model: model })
|
| 54 |
+
});
|
| 55 |
+
const data = await res.json();
|
| 56 |
+
|
| 57 |
+
if(isImg) {
|
| 58 |
+
chat.innerHTML += `<div class="msg ai"><img src="data:image/png;base64,${data.result.image}" style="width:100%;"></div>`;
|
| 59 |
+
} else {
|
| 60 |
+
chat.innerHTML += `<div class="msg ai">${data.reply || data.error}</div>`;
|
| 61 |
+
}
|
| 62 |
+
chat.scrollTop = chat.scrollHeight;
|
| 63 |
+
}
|
| 64 |
+
</script>
|
| 65 |
+
</body>
|
| 66 |
+
</html>
|