Hani-al commited on
Commit
c0fc9c8
·
verified ·
1 Parent(s): a48842d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +1 -19
index.html CHANGED
@@ -1,19 +1 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
1
+ <!doctype html><html lang="ar" dir="rtl"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>API Prototype - Before</title><style>body{font:16px Arial;background:#f4f4f5;color:#222;margin:0}main{max-width:850px;margin:auto;padding:22px}.box{background:#fff;padding:22px;border:1px solid #ddd;border-radius:10px;margin-top:18px}label{display:block;margin:12px 0;font-weight:bold}input{width:100%;padding:10px;box-sizing:border-box;margin-top:5px;border:1px solid #bbb;border-radius:6px}button{padding:11px 15px;border:0;border-radius:6px;background:#555;color:#fff;font-weight:bold;margin:5px 3px 0 0}pre,#out{white-space:pre-wrap;background:#f1f1f1;padding:14px;border-radius:6px;direction:ltr;text-align:left}#history{white-space:pre-line}</style><main><h1>النموذج الأولي لـ API — قبل التحديث</h1><p>نسخة أولية بسيطة: إدخال قيم وإرجاع تحليل وصفي.</p><section class="box"><label>القيمة الأولى<input id="a" type="number"></label><label>القيمة الثانية<input id="b" type="number"></label><button onclick="run()">إرسال الطلب</button><button onclick="show()">السجل</button><h3>طلب API تجريبي</h3><pre id="req">POST /api/analyze</pre><div id="out">لم يتم إرسال طلب.</div><div id="history">لا توجد اختبارات.</div></section></main><script>let k='api_before';function run(){let x=+a.value,y=+b.value;if(!Number.isFinite(x)||!Number.isFinite(y)){out.textContent='خطأ: أدخل رقمين صالحين';return}let r={time:new Date().toLocaleString('ar'),a:x,b:y,sum:x+y,avg:(x+y)/2};let h=JSON.parse(localStorage.getItem(k)||'[]');h.push(r);localStorage.setItem(k,JSON.stringify(h));req.textContent='POST /api/analyze\n'+JSON.stringify({a:x,b:y},null,2);out.textContent='200 OK\n'+JSON.stringify({sum:r.sum,average:r.avg},null,2);show()}function show(){let h=JSON.parse(localStorage.getItem(k)||'[]');history.textContent='سجل الاختبارات ('+h.length+'):\n'+h.slice(-8).map((r,i)=>(i+1)+'. '+r.time+' | مجموع '+r.sum).join('\n')}show()</script></script></div></pre></h3></button></label></section></p></h1></main></style></title></html>