stat2025 commited on
Commit
edba14b
·
verified ·
1 Parent(s): c00ee1d

Upload 2 files

Browse files
Files changed (2) hide show
  1. index.html +436 -0
  2. script.js +181 -0
index.html ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>صفحة البحث عن خريطة باحث</title>
7
+ <meta name="description" content="ابحث باسم الباحث أو جزء منه لفتح أو نسخ رابط الخريطة." />
8
+ <style>
9
+ :root{
10
+ --bg:#f5f7fb;
11
+ --card:#ffffff;
12
+ --text:#0b1324;
13
+ --muted:#5b6b86;
14
+ --line:#e6eaf2;
15
+ --shadow: 0 18px 55px rgba(13,32,62,.10);
16
+ --shadow2: 0 10px 28px rgba(13,32,62,.08);
17
+ --radius: 22px;
18
+
19
+ --primary:#2563eb;
20
+ --primary2:#7c3aed;
21
+ --mint:#10b981;
22
+ --danger:#ef4444;
23
+
24
+ --chip:#f1f5ff;
25
+ --chipText:#1e3a8a;
26
+
27
+ --btnText:#ffffff;
28
+ --focus: 0 0 0 6px rgba(37,99,235,.15);
29
+ }
30
+
31
+ *{box-sizing:border-box}
32
+ html,body{height:100%}
33
+ body{
34
+ margin:0;
35
+ font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
36
+ color:var(--text);
37
+ background:
38
+ radial-gradient(900px 480px at 18% 12%, rgba(124,58,237,.18), rgba(124,58,237,0) 60%),
39
+ radial-gradient(900px 520px at 82% 10%, rgba(37,99,235,.18), rgba(37,99,235,0) 62%),
40
+ radial-gradient(900px 520px at 50% 105%, rgba(16,185,129,.12), rgba(16,185,129,0) 55%),
41
+ linear-gradient(180deg, #f8fafc, #f5f7fb 55%, #eef2ff);
42
+ display:flex;
43
+ flex-direction:column;
44
+ overflow-x:hidden;
45
+ }
46
+
47
+ .wrap{
48
+ width:min(1020px, 92vw);
49
+ margin:0 auto;
50
+ padding: 34px 0 92px;
51
+ flex:1;
52
+ display:flex;
53
+ flex-direction:column;
54
+ gap: 18px;
55
+ }
56
+
57
+ /* Top bar */
58
+ .top{
59
+ display:flex;
60
+ align-items:center;
61
+ justify-content:space-between;
62
+ gap:12px;
63
+ flex-wrap:wrap;
64
+ }
65
+ .brand{
66
+ display:flex;
67
+ align-items:center;
68
+ gap:12px;
69
+ }
70
+ .logo{
71
+ width:44px;height:44px;border-radius:16px;
72
+ background:
73
+ radial-gradient(16px 16px at 28% 26%, rgba(255,255,255,.9), rgba(255,255,255,0) 60%),
74
+ linear-gradient(135deg, var(--primary), var(--primary2));
75
+ box-shadow: var(--shadow2);
76
+ }
77
+ .brandTitle{display:flex;flex-direction:column}
78
+ .brandTitle h1{
79
+ margin:0;
80
+ font-size: 18px;
81
+ letter-spacing:.2px;
82
+ line-height:1.2;
83
+ }
84
+ .brandTitle p{
85
+ margin:4px 0 0;
86
+ color:var(--muted);
87
+ font-size: 13px;
88
+ }
89
+
90
+ .chip{
91
+ display:inline-flex;
92
+ align-items:center;
93
+ gap:8px;
94
+ padding: 10px 12px;
95
+ border-radius:999px;
96
+ border:1px solid rgba(37,99,235,.15);
97
+ background: linear-gradient(180deg, #ffffff, var(--chip));
98
+ color: var(--chipText);
99
+ font-size: 12.5px;
100
+ box-shadow: 0 8px 18px rgba(13,32,62,.06);
101
+ white-space:nowrap;
102
+ }
103
+ .chip b{font-weight:800}
104
+
105
+ /* Hero card */
106
+ .hero{
107
+ position:relative;
108
+ border-radius: var(--radius);
109
+ background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
110
+ border: 1px solid rgba(230,234,242,.85);
111
+ box-shadow: var(--shadow);
112
+ overflow:hidden;
113
+ }
114
+ .hero::before{
115
+ content:"";
116
+ position:absolute; inset:-2px;
117
+ background:
118
+ radial-gradient(420px 260px at 15% 0%, rgba(124,58,237,.12), rgba(124,58,237,0) 60%),
119
+ radial-gradient(460px 280px at 85% 10%, rgba(37,99,235,.12), rgba(37,99,235,0) 62%);
120
+ pointer-events:none;
121
+ }
122
+ .heroInner{
123
+ position:relative;
124
+ padding: 26px 22px 18px;
125
+ }
126
+
127
+ .headline{
128
+ display:flex;
129
+ flex-direction:column;
130
+ align-items:center;
131
+ text-align:center;
132
+ gap:10px;
133
+ padding-bottom: 14px;
134
+ }
135
+ .headline h2{
136
+ margin:0;
137
+ font-size: clamp(22px, 2.2vw, 34px);
138
+ letter-spacing:.2px;
139
+ line-height:1.2;
140
+ }
141
+ .headline p{
142
+ margin:0;
143
+ color:var(--muted);
144
+ font-size: 14.5px;
145
+ line-height: 1.95;
146
+ max-width: 72ch;
147
+ }
148
+
149
+ /* Centered "boxed" fields */
150
+ .searchBox{
151
+ margin-top: 10px;
152
+ display:flex;
153
+ justify-content:center;
154
+ }
155
+ .searchPanel{
156
+ width:min(860px, 100%);
157
+ display:grid;
158
+ gap:12px;
159
+ }
160
+
161
+ .fieldsRow{
162
+ display:grid;
163
+ grid-template-columns: 1fr auto auto;
164
+ gap: 12px;
165
+ align-items:stretch;
166
+ justify-items:center;
167
+ }
168
+ @media(max-width: 720px){
169
+ .fieldsRow{ grid-template-columns: 1fr; }
170
+ }
171
+
172
+ .field{
173
+ width:100%;
174
+ background:#ffffff;
175
+ border:1px solid var(--line);
176
+ border-radius: 18px;
177
+ box-shadow: 0 10px 26px rgba(13,32,62,.06);
178
+ padding: 14px;
179
+ display:flex;
180
+ align-items:center;
181
+ gap: 10px;
182
+ justify-content:center; /* توسيط */
183
+ }
184
+ .field .icon{
185
+ width:38px;height:38px;border-radius:14px;
186
+ display:grid;place-items:center;
187
+ background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(124,58,237,.10));
188
+ border: 1px solid rgba(37,99,235,.12);
189
+ color:#1e3a8a;
190
+ font-size: 18px;
191
+ flex:0 0 auto;
192
+ }
193
+ .field input{
194
+ width:100%;
195
+ border:none;
196
+ outline:none;
197
+ font-size:16px;
198
+ padding: 0;
199
+ background:transparent;
200
+ text-align:center; /* توسيط داخل الحقل */
201
+ color: var(--text);
202
+ }
203
+ .field input::placeholder{ color: #94a3b8; }
204
+
205
+ .btn{
206
+ height: 66px;
207
+ min-width: 140px;
208
+ border-radius: 18px;
209
+ border:1px solid transparent;
210
+ cursor:pointer;
211
+ font-size: 15px;
212
+ font-weight: 750;
213
+ letter-spacing:.1px;
214
+ display:flex;
215
+ align-items:center;
216
+ justify-content:center;
217
+ gap:10px;
218
+ box-shadow: 0 10px 26px rgba(13,32,62,.08);
219
+ transition: transform .06s ease, box-shadow .2s ease, opacity .2s ease;
220
+ user-select:none;
221
+ }
222
+ .btn:active{ transform: translateY(1px); }
223
+ .btn.primary{
224
+ color: var(--btnText);
225
+ background: linear-gradient(135deg, var(--primary), var(--primary2));
226
+ }
227
+ .btn.ghost{
228
+ background:#ffffff;
229
+ border-color: var(--line);
230
+ color: #0f172a;
231
+ }
232
+ .btn:hover{ opacity:.94; }
233
+
234
+ .meta{
235
+ display:flex;
236
+ align-items:center;
237
+ justify-content:space-between;
238
+ gap: 10px;
239
+ flex-wrap:wrap;
240
+ color: var(--muted);
241
+ font-size: 13px;
242
+ margin-top: 6px;
243
+ padding: 0 4px;
244
+ }
245
+ .meta .pill{
246
+ display:inline-flex;
247
+ align-items:center;
248
+ gap:8px;
249
+ padding: 8px 10px;
250
+ border-radius: 999px;
251
+ border: 1px solid rgba(16,185,129,.20);
252
+ background: linear-gradient(180deg, #ffffff, rgba(16,185,129,.08));
253
+ color: #065f46;
254
+ font-weight: 700;
255
+ }
256
+
257
+ /* Results */
258
+ .results{
259
+ margin-top: 10px;
260
+ display:grid;
261
+ gap: 10px;
262
+ }
263
+ .resultCard{
264
+ background:#ffffff;
265
+ border:1px solid var(--line);
266
+ border-radius: 18px;
267
+ padding: 14px 14px;
268
+ box-shadow: 0 10px 26px rgba(13,32,62,.06);
269
+ display:flex;
270
+ align-items:center;
271
+ justify-content:space-between;
272
+ gap: 12px;
273
+ }
274
+ .rLeft{min-width:0;display:flex;flex-direction:column;gap:2px}
275
+ .rName{
276
+ font-weight: 800;
277
+ font-size: 15.5px;
278
+ line-height:1.7;
279
+ white-space:nowrap;
280
+ overflow:hidden;
281
+ text-overflow:ellipsis;
282
+ max-width: 66ch;
283
+ }
284
+ .rHint{
285
+ color: var(--muted);
286
+ font-size: 12.5px;
287
+ }
288
+ .rActions{
289
+ display:flex;
290
+ gap: 8px;
291
+ flex-wrap:wrap;
292
+ justify-content:flex-end;
293
+ }
294
+
295
+ .linkBtn, .copyBtn{
296
+ border-radius: 14px;
297
+ padding: 10px 12px;
298
+ border: 1px solid transparent;
299
+ font-size: 13.5px;
300
+ font-weight: 750;
301
+ cursor:pointer;
302
+ display:inline-flex;
303
+ align-items:center;
304
+ gap: 8px;
305
+ white-space:nowrap;
306
+ transition: transform .06s ease, opacity .2s ease;
307
+ user-select:none;
308
+ text-decoration:none;
309
+ }
310
+ .linkBtn{
311
+ color:#0b1324;
312
+ background: linear-gradient(180deg, #ffffff, #f1f5ff);
313
+ border-color: rgba(37,99,235,.18);
314
+ }
315
+ .copyBtn{
316
+ color:#064e3b;
317
+ background: linear-gradient(180deg, #ffffff, rgba(16,185,129,.10));
318
+ border-color: rgba(16,185,129,.22);
319
+ }
320
+ .linkBtn:active,.copyBtn:active{ transform: translateY(1px); }
321
+ .linkBtn:hover,.copyBtn:hover{ opacity:.92; }
322
+
323
+ .empty{
324
+ text-align:center;
325
+ color: var(--muted);
326
+ background:#ffffff;
327
+ border: 1px dashed rgba(148,163,184,.55);
328
+ border-radius: 18px;
329
+ padding: 18px 12px;
330
+ }
331
+
332
+ mark{
333
+ background: rgba(37,99,235,.10);
334
+ border: 1px solid rgba(37,99,235,.16);
335
+ color:#1e3a8a;
336
+ padding: 1px 6px;
337
+ border-radius: 999px;
338
+ }
339
+
340
+ /* Toast */
341
+ .toast{
342
+ position:fixed;
343
+ left:50%;
344
+ bottom: 78px;
345
+ transform: translateX(-50%) translateY(14px);
346
+ background: rgba(15,23,42,.92);
347
+ color:#fff;
348
+ padding: 10px 14px;
349
+ border-radius: 999px;
350
+ box-shadow: 0 18px 45px rgba(0,0,0,.18);
351
+ opacity:0;
352
+ pointer-events:none;
353
+ transition: opacity .22s ease, transform .22s ease;
354
+ font-size: 13px;
355
+ display:flex;
356
+ align-items:center;
357
+ gap:8px;
358
+ z-index: 50;
359
+ }
360
+ .toast.show{
361
+ opacity:1;
362
+ transform: translateX(-50%) translateY(0);
363
+ }
364
+
365
+ footer{
366
+ position:fixed;
367
+ left:0; right:0; bottom:0;
368
+ text-align:center;
369
+ padding: 10px 14px;
370
+ background: rgba(255,255,255,.82);
371
+ border-top: 1px solid rgba(230,234,242,.95);
372
+ backdrop-filter: blur(10px);
373
+ color:#475569;
374
+ font-size: 12.5px;
375
+ z-index: 40;
376
+ }
377
+ </style>
378
+ </head>
379
+ <body>
380
+ <div class="wrap">
381
+ <div class="top">
382
+ <div class="brand">
383
+ <div class="logo" aria-hidden="true"></div>
384
+ <div class="brandTitle">
385
+ <h1>صفحة البحث عن خريطة باحث</h1>
386
+ <p>ابحث بالاسم أو جزء منه — ثم افتح الخريطة أو انسخ الرابط</p>
387
+ </div>
388
+ </div>
389
+ <div class="chip" id="totalChip">📌 إجمالي الروابط: <b>—</b></div>
390
+ </div>
391
+
392
+ <section class="hero" aria-label="hero">
393
+ <div class="heroInner">
394
+ <div class="headline">
395
+ <h2>اكتب اسم الباحث لعرض الرابط فورًا</h2>
396
+ <p>
397
+ يدعم البحث بكلمة واحدة أو أكثر (مثال: “تركي” أو “تركي المحيفيظ”). يمكنك أيضًا استخدام زر <b>نسخ الرابط</b> للمشاركة بسرعة.
398
+ </p>
399
+ </div>
400
+
401
+ <div class="searchBox">
402
+ <div class="searchPanel" aria-label="search panel">
403
+ <div class="fieldsRow">
404
+ <div class="field" aria-label="search field">
405
+ <div class="icon" aria-hidden="true">🔎</div>
406
+ <input id="q" type="text" inputmode="search" autocomplete="off"
407
+ placeholder="اكتب الاسم أو جزء منه…" />
408
+ </div>
409
+
410
+ <button id="btnSearch" class="btn primary" type="button">
411
+ بحث <span aria-hidden="true">↵</span>
412
+ </button>
413
+
414
+ <button id="btnClear" class="btn ghost" type="button">
415
+ مسح <span aria-hidden="true">✕</span>
416
+ </button>
417
+ </div>
418
+
419
+ <div class="meta">
420
+ <div class="pill"><span aria-hidden="true">✅</span> <span id="countPill">النتائج: 0</span></div>
421
+ <div>نصيحة: اضغط Enter للبحث السريع</div>
422
+ </div>
423
+
424
+ <div class="results" id="results" aria-live="polite"></div>
425
+ </div>
426
+ </div>
427
+ </div>
428
+ </section>
429
+ </div>
430
+
431
+ <div class="toast" id="toast">تم نسخ الرابط <span aria-hidden="true">✔</span></div>
432
+
433
+ <footer>تصميم وإعداد الدعم الفني نوف الناصر</footer>
434
+ <script src="./script.js"></script>
435
+ </body>
436
+ </html>
script.js ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // بيانات الروابط (تم توليدها من ملف Excel)
2
+ const DATA = [{"name": "أروى سعيد بن عبدالله القحطاني", "url": "https://stat2025-map.static.hf.space/BCS/37.html"}, {"name": "أسماء درويش سالم الدوسري", "url": "https://stat2025-map.static.hf.space/BCS/15.html"}, {"name": "أمل احمد محمد مجرشي", "url": "https://stat2025-map.static.hf.space/BCS/28.html"}, {"name": "أمل بنت علي بن علي السماعيل", "url": "https://stat2025-map.static.hf.space/BCS/07.html"}, {"name": "أمل جعفر بن علي آل حماد", "url": "https://stat2025-map.static.hf.space/BCS/30.html"}, {"name": "أمل صالح بن احمد آل مزعل", "url": "https://stat2025-map.static.hf.space/BCS/47.html"}, {"name": "ابرار بنت يوسف بن علي آل حماد", "url": "https://stat2025-map.static.hf.space/BCS/44.html"}, {"name": "احلام صالح معيوض العصيمي", "url": "https://stat2025-map.static.hf.space/BCS/16.html"}, {"name": "اسعد بن ماجد بن احمد الهاشم", "url": "https://stat2025-map.static.hf.space/BCS/46.html"}, {"name": "اسماء بنت محمد بن حسين العدساني", "url": "https://stat2025-map.static.hf.space/BCS/09.html"}, {"name": "ايمان عبدالعزيز بن صالح الصالح", "url": "https://stat2025-map.static.hf.space/BCS/40.html"}, {"name": "باسمه احمد بن محمد القرني", "url": "https://stat2025-map.static.hf.space/BCS/21.html"}, {"name": "باقر عبدالله بن هاشم الهاشم", "url": "https://stat2025-map.static.hf.space/BCS/11.html"}, {"name": "تركي وحيد بن عيسى المحيفيظ", "url": "https://stat2025-map.static.hf.space/BCS/01.html"}, {"name": "حسن عادل بن حسين الوصيبعي", "url": "https://stat2025-map.static.hf.space/BCS/03.html"}, {"name": "زكي بن عيسى بن عبدالله القفاص", "url": "https://stat2025-map.static.hf.space/BCS/51.html"}, {"name": "زهراء بنت عايش بن علي الصاهود", "url": "https://stat2025-map.static.hf.space/BCS/33.html"}, {"name": "ساره خالد سليمان المحيسن", "url": "https://stat2025-map.static.hf.space/BCS/35.html"}, {"name": "ساره راشد عبدالله المديني", "url": "https://stat2025-map.static.hf.space/BCS/34.html"}, {"name": "ساره عبدالحميد بن حسين البوحمد", "url": "https://stat2025-map.static.hf.space/BCS/12.html"}, {"name": "سميه رياض بن عبدالله البراك", "url": "https://stat2025-map.static.hf.space/BCS/39.html"}, {"name": "سميه سامى بن احمد النعيم", "url": "https://stat2025-map.static.hf.space/BCS/05.html"}, {"name": "شريفه ابراهيم بن عبدالله العقيل", "url": "https://stat2025-map.static.hf.space/BCS/41.html"}, {"name": "شيماء عبدالرحمن بن دحباش سودي", "url": "https://stat2025-map.static.hf.space/BCS/19.html"}, {"name": "صالح دلي الشمري", "url": "https://stat2025-map.static.hf.space/BCS/48.html"}, {"name": "طيبه فالح بن عبدالله الرويشد", "url": "https://stat2025-map.static.hf.space/BCS/31.html"}, {"name": "عائشه سليمان بن نايف الحربي", "url": "https://stat2025-map.static.hf.space/BCS/13.html"}, {"name": "عبدالله خلف الجدعان", "url": "https://stat2025-map.static.hf.space/BCS/49.html"}, {"name": "عقيله محمدحسين بن علي الجباره", "url": "https://stat2025-map.static.hf.space/BCS/06.html"}, {"name": "علياء فيصل بن محمد الكثيري", "url": "https://stat2025-map.static.hf.space/BCS/36.html"}, {"name": "غدير عبدالعزيز بن سعد القاسم", "url": "https://stat2025-map.static.hf.space/BCS/38.html"}, {"name": "فارس ثاني الشمري", "url": "https://stat2025-map.static.hf.space/BCS/50.html"}, {"name": "فاطمه حسين بن ابراهيم القرقوش", "url": "https://stat2025-map.static.hf.space/BCS/45.html"}, {"name": "فايزه محمد مسعود الحازمي", "url": "https://stat2025-map.static.hf.space/BCS/32.html"}, {"name": "فيصل تركي فيصل القحطاني", "url": "https://stat2025-map.static.hf.space/BCS/18.html"}, {"name": "لطيفه صالح بن عبدالرحمن العبد القادر", "url": "https://stat2025-map.static.hf.space/BCS/25.html"}, {"name": "لطيفه علي بن حسين النعيم", "url": "https://stat2025-map.static.hf.space/BCS/29.html"}, {"name": "لين أحمد بن عبدالعزيز القصير", "url": "https://stat2025-map.static.hf.space/BCS/22.html"}, {"name": "محمد دبيان بن مفرج الشمري", "url": "https://stat2025-map.static.hf.space/BCS/27.html"}, {"name": "مرتضى عبدالجليل بن عيسى الحكيم", "url": "https://stat2025-map.static.hf.space/BCS/43.html"}, {"name": "مصطفى احمد بن جمعه الرمضان", "url": "https://stat2025-map.static.hf.space/BCS/10.html"}, {"name": "ممدوح مشعل ضيف الله الصخري", "url": "https://stat2025-map.static.hf.space/BCS/26.html"}, {"name": "منيره سعد بن احمد الجديدي", "url": "https://stat2025-map.static.hf.space/BCS/04.html"}, {"name": "منيره سعود بن عبدالعزيز القوز", "url": "https://stat2025-map.static.hf.space/BCS/42.html"}, {"name": "نبأ عادل بن عبدالكريم آل رضوان", "url": "https://stat2025-map.static.hf.space/BCS/23.html"}, {"name": "نجود عبدالعزيز بن عقيل العمري", "url": "https://stat2025-map.static.hf.space/BCS/20.html"}, {"name": "نوره عبدالله بن زهير الرزقي", "url": "https://stat2025-map.static.hf.space/BCS/24.html"}, {"name": "نوره عبدالله بن مانع الخالدي", "url": "https://stat2025-map.static.hf.space/BCS/02.html"}, {"name": "نوف صالح بن محمد السميح", "url": "https://stat2025-map.static.hf.space/BCS/08.html"}, {"name": "نيللي حسين عبدالله الجعص", "url": "https://stat2025-map.static.hf.space/BCS/17.html"}, {"name": "وضحه خالد بن مشرف الخالدي", "url": "https://stat2025-map.static.hf.space/BCS/14.html"}];
3
+
4
+ // --------- أدوات مساعدة للتطبيع (لتحسين البحث بالعربية) ----------
5
+ function normalizeArabic(s) {
6
+ if (!s) return "";
7
+ return String(s)
8
+ .trim()
9
+ .toLowerCase()
10
+ .replace(/[\u064B-\u065F\u0670\u06D6-\u06ED]/g, "") // تشكيل
11
+ .replace(/\u0640/g, "") // تطويل
12
+ .replace(/[إأآٱ]/g, "ا")
13
+ .replace(/ى/g, "ي")
14
+ .replace(/ة/g, "ه")
15
+ .replace(/\s+/g, " ");
16
+ }
17
+
18
+ function escapeHtml(str) {
19
+ return String(str)
20
+ .replaceAll("&", "&amp;")
21
+ .replaceAll("<", "&lt;")
22
+ .replaceAll(">", "&gt;")
23
+ .replaceAll('"', "&quot;")
24
+ .replaceAll("'", "&#039;");
25
+ }
26
+
27
+ // تظليل أول توكن فقط (بشكل آمن)
28
+ function highlightMatch(name, rawQuery) {
29
+ if (!rawQuery) return escapeHtml(name);
30
+ const tokens = rawQuery.trim().split(/\s+/).filter(Boolean);
31
+ if (!tokens.length) return escapeHtml(name);
32
+
33
+ const t = tokens[0];
34
+ const idx = name.indexOf(t);
35
+ if (idx === -1) return escapeHtml(name);
36
+
37
+ const before = escapeHtml(name.slice(0, idx));
38
+ const mid = escapeHtml(name.slice(idx, idx + t.length));
39
+ const after = escapeHtml(name.slice(idx + t.length));
40
+ return `${before}<mark>${mid}</mark>${after}`;
41
+ }
42
+
43
+ // --------- DOM ----------
44
+ const elQ = document.getElementById("q");
45
+ const elResults = document.getElementById("results");
46
+ const elCount = document.getElementById("countPill");
47
+ const elTotal = document.getElementById("totalChip");
48
+ const toast = document.getElementById("toast");
49
+
50
+ elTotal.innerHTML = `📌 إجمالي الروابط: <b>${DATA.length}</b>`;
51
+
52
+ function showToast(msg = "تم نسخ الرابط ✔") {
53
+ toast.textContent = msg;
54
+ toast.classList.add("show");
55
+ clearTimeout(window.__toastT);
56
+ window.__toastT = setTimeout(() => toast.classList.remove("show"), 1200);
57
+ }
58
+
59
+ async function copyLink(url) {
60
+ try {
61
+ await navigator.clipboard.writeText(url);
62
+ showToast("تم نسخ الرابط ✔");
63
+ } catch (e) {
64
+ // fallback
65
+ const ta = document.createElement("textarea");
66
+ ta.value = url;
67
+ document.body.appendChild(ta);
68
+ ta.select();
69
+ document.execCommand("copy");
70
+ document.body.removeChild(ta);
71
+ showToast("تم نسخ الرابط ✔");
72
+ }
73
+ }
74
+
75
+ function renderResults(list, rawQuery) {
76
+ elResults.innerHTML = "";
77
+
78
+ if (!list.length) {
79
+ elCount.textContent = "النتائج: 0";
80
+ elResults.innerHTML = `<div class="empty">لا توجد نتائج مطابقة. جرّب كتابة جزء آخر من الاسم.</div>`;
81
+ return;
82
+ }
83
+
84
+ elCount.textContent = `النتائج: ${list.length}`;
85
+
86
+ const frag = document.createDocumentFragment();
87
+
88
+ list.forEach(item => {
89
+ const row = document.createElement("div");
90
+ row.className = "resultCard";
91
+
92
+ const left = document.createElement("div");
93
+ left.className = "rLeft";
94
+
95
+ const nm = document.createElement("div");
96
+ nm.className = "rName";
97
+ nm.innerHTML = highlightMatch(item.name, rawQuery);
98
+
99
+ const hint = document.createElement("div");
100
+ hint.className = "rHint";
101
+ hint.textContent = "رابط خريطة الباحث جاهز للفتح أو النسخ";
102
+
103
+ left.appendChild(nm);
104
+ left.appendChild(hint);
105
+
106
+ const actions = document.createElement("div");
107
+ actions.className = "rActions";
108
+
109
+ const open = document.createElement("a");
110
+ open.className = "linkBtn";
111
+ open.href = item.url;
112
+ open.target = "_blank";
113
+ open.rel = "noopener";
114
+ open.innerHTML = `فتح الخريطة <span aria-hidden="true">↗</span>`;
115
+
116
+ const copy = document.createElement("button");
117
+ copy.className = "copyBtn";
118
+ copy.type = "button";
119
+ copy.innerHTML = `نسخ الرابط <span aria-hidden="true">⧉</span>`;
120
+ copy.addEventListener("click", () => copyLink(item.url));
121
+
122
+ actions.appendChild(open);
123
+ actions.appendChild(copy);
124
+
125
+ row.appendChild(left);
126
+ row.appendChild(actions);
127
+
128
+ frag.appendChild(row);
129
+ });
130
+
131
+ elResults.appendChild(frag);
132
+ }
133
+
134
+ // --------- Search ----------
135
+ function doSearch() {
136
+ const raw = (elQ.value || "").trim();
137
+ const q = normalizeArabic(raw);
138
+
139
+ if (!q) {
140
+ elCount.textContent = "النتائج: 0";
141
+ elResults.innerHTML = "";
142
+ return;
143
+ }
144
+
145
+ const tokens = q.split(" ").filter(Boolean);
146
+
147
+ const matched = DATA.filter(d => {
148
+ const nameNorm = normalizeArabic(d.name);
149
+ return tokens.every(t => nameNorm.includes(t));
150
+ });
151
+
152
+ matched.sort((a, b) => {
153
+ const al = (a.name || "").length;
154
+ const bl = (b.name || "").length;
155
+ if (al !== bl) return al - bl;
156
+ return (a.name || "").localeCompare(b.name || "", "ar");
157
+ });
158
+
159
+ renderResults(matched, raw);
160
+ }
161
+
162
+ document.getElementById("btnSearch").addEventListener("click", doSearch);
163
+ document.getElementById("btnClear").addEventListener("click", () => {
164
+ elQ.value = "";
165
+ elQ.focus();
166
+ elResults.innerHTML = "";
167
+ elCount.textContent = "النتائج: 0";
168
+ });
169
+
170
+ let t = null;
171
+ elQ.addEventListener("input", () => {
172
+ clearTimeout(t);
173
+ t = setTimeout(doSearch, 140);
174
+ });
175
+
176
+ elQ.addEventListener("keydown", (e) => {
177
+ if (e.key === "Enter") doSearch();
178
+ });
179
+
180
+ // حالة ابتدائية
181
+ elCount.textContent = "النتائج: 0";