AnesKAM commited on
Commit
5ca80ba
ยท
verified ยท
1 Parent(s): a491371

Update results.html

Browse files
Files changed (1) hide show
  1. results.html +622 -398
results.html CHANGED
@@ -5,312 +5,527 @@
5
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0" name="viewport" />
6
  <title>SurfGO | ู†ุชุงุฆุฌ ุงู„ุจุญุซ</title>
7
  <link href="https://fonts.googleapis.com" rel="preconnect" />
8
- <link
9
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&amp;family=Tajawal:wght@300;400;500;700&amp;display=swap"
10
- rel="stylesheet" />
11
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet" />
12
  <style>
13
  :root {
14
- --bg-base: #f8fafc;
15
- --bg-nav: rgba(255, 255, 255, 0.85);
16
  --bg-card: #ffffff;
17
- --bg-input: #f1f5f9;
18
  --bg-input-focus: #ffffff;
19
- --border: #e2e8f0;
20
- --accent: #6366f1;
21
- --accent-2: #ec4899;
22
- --text-main: #0f172a;
23
- --text-sub: #64748b;
24
- --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
 
 
 
 
 
 
 
 
25
  }
26
 
27
  [data-theme="dark"] {
28
- --bg-base: #0f172a;
29
- --bg-nav: rgba(15, 23, 42, 0.9);
30
- --bg-card: #1e293b;
31
- --bg-input: #334155;
32
- --bg-input-focus: #1e293b;
33
- --border: #334155;
34
- --accent: #818cf8;
 
35
  --accent-2: #f472b6;
36
- --text-main: #f1f5f9;
37
- --text-sub: #94a3b8;
 
 
 
 
38
  }
39
 
40
- * {
41
- margin: 0;
42
- padding: 0;
43
- box-sizing: border-box;
44
- outline: none;
45
- }
46
 
47
  body {
48
- font-family: 'Plus Jakarta Sans', 'Tajawal', sans-serif;
49
  background: var(--bg-base);
50
  color: var(--text-main);
51
  min-height: 100vh;
52
  overflow-x: hidden;
53
- transition: background-color 0.3s ease, color 0.3s ease;
54
  }
55
 
56
- .orb {
 
57
  position: fixed;
58
- border-radius: 50%;
59
- filter: blur(100px);
60
  z-index: 0;
61
  pointer-events: none;
62
- opacity: 0.15;
63
- transition: opacity 0.3s;
64
  }
65
-
66
- .orb-1 {
67
- top: -10%;
68
- left: -10%;
69
- width: 50vw;
70
- height: 50vw;
71
- background: var(--accent);
 
 
 
72
  }
73
- .orb-2 {
74
- bottom: -10%;
75
- right: -10%;
76
- width: 40vw;
77
- height: 40vw;
78
- background: var(--accent-2);
 
 
 
 
79
  }
 
80
 
 
81
  .navbar {
82
  position: fixed;
83
- top: 16px;
84
  left: 50%;
85
  transform: translateX(-50%);
86
  width: 95%;
87
- max-width: 1300px;
88
  height: auto;
89
- min-height: 72px;
90
  background: var(--bg-nav);
91
- backdrop-filter: blur(24px);
 
92
  border: 1px solid var(--border);
93
- border-radius: 20px;
94
  display: flex;
95
  flex-wrap: wrap;
96
  align-items: center;
97
  justify-content: space-between;
98
- padding: 10px 20px;
99
  z-index: 1000;
100
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
101
- gap: 15px;
102
- transition: background 0.3s, border-color 0.3s;
103
  }
104
 
 
105
  .brand {
106
- font-weight: 700;
107
- font-size: 22px;
 
108
  text-decoration: none;
109
  color: var(--text-main);
110
  display: flex;
111
  align-items: center;
112
  gap: 10px;
 
 
113
  }
114
-
115
  .brand-icon {
116
- width: 38px;
117
- height: 38px;
118
- background: linear-gradient(135deg, var(--accent), var(--accent-2));
119
- border-radius: 11px;
120
  display: flex;
121
  align-items: center;
122
  justify-content: center;
123
  color: #fff;
 
124
  flex-shrink: 0;
 
125
  }
 
126
 
 
127
  .search-container {
128
  flex: 1;
129
- max-width: 600px;
130
  width: 100%;
131
- margin: 0;
132
  }
133
-
134
  .search-bar {
135
  display: flex;
136
  align-items: center;
137
  background: var(--bg-input);
138
- border: 1px solid var(--border);
139
- border-radius: 100px;
140
- padding: 4px;
141
- transition: var(--transition), background-color 0.3s;
142
  width: 100%;
143
  }
144
-
145
  .search-bar:focus-within {
146
  border-color: var(--accent);
147
  background: var(--bg-input-focus);
148
- box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
149
  }
150
-
151
  .search-bar input {
152
  flex: 1;
153
  background: transparent;
154
  border: none;
155
- padding: 10px 18px;
156
  color: var(--text-main);
157
- font-size: 15px;
158
- width: 100%;
 
159
  }
160
-
161
- .search-bar input::placeholder {
162
- color: var(--text-sub);
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
 
164
 
 
165
  #theme-toggle {
166
- background: none;
167
- border: none;
168
- color: var(--text-main);
169
  cursor: pointer;
170
- padding: 5px;
171
- font-size: 20px;
172
- width: 40px;
173
- height: 40px;
174
  border-radius: 50%;
175
  display: flex;
176
  align-items: center;
177
  justify-content: center;
178
- transition: background 0.3s, color 0.3s;
 
 
179
  }
180
- #theme-toggle:hover { background: var(--border); }
181
 
 
182
  .tabs-bar {
183
  position: fixed;
184
- top: 105px;
185
  left: 50%;
186
  transform: translateX(-50%);
187
  width: 95%;
188
- max-width: 1300px;
189
  display: flex;
190
- gap: 8px;
191
  z-index: 999;
192
  overflow-x: auto;
193
- padding-bottom: 5px;
194
  scrollbar-width: none;
195
  }
196
  .tabs-bar::-webkit-scrollbar { display: none; }
197
 
198
  .tab-pill {
199
- padding: 8px 16px;
200
- border-radius: 100px;
201
  background: var(--bg-card);
202
- border: 1px solid var(--border);
203
  color: var(--text-sub);
 
204
  font-size: 13px;
 
205
  cursor: pointer;
206
- transition: 0.3s;
207
  display: flex;
208
  align-items: center;
209
  gap: 6px;
210
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
211
  white-space: nowrap;
 
212
  }
213
- .tab-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
 
 
 
 
 
 
 
214
 
 
215
  .page-wrapper {
216
- max-width: 1300px;
217
- margin: 180px auto 50px;
 
 
218
  padding: 0 16px;
219
  display: flex;
220
  flex-direction: column;
221
- gap: 30px;
222
  }
223
  .results-area { min-width: 0; width: 100%; }
224
 
225
- /* ุจุทุงู‚ุงุช ุงู„ู†ุชุงุฆุฌ (ุนุงู…ุฉ) โ€“ ุจูŠุถุงุก ุชู…ุงู…ุงู‹ ููŠ ุงู„ูˆุถุน ุงู„ูุงุชุญ */
226
- .gsc-result,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  .tavily-result {
228
- background: #ffffff !important; /* ุฃุจูŠุถ ุตู„ุจ ููŠ ุงู„ูˆุถุน ุงู„ูุงุชุญ */
229
- border: 1px solid var(--border);
230
- border-radius: 16px;
231
- padding: 16px;
232
- margin-bottom: 15px;
233
  transition: var(--transition);
234
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
235
  display: flex;
236
- gap: 12px;
237
  align-items: flex-start;
 
238
  }
239
- /* ููŠ ุงู„ูˆุถุน ุงู„ุฏุงูƒู† ู†ุนูŠุฏ ุงู„ู„ูˆู† ุงู„ุฏุงูƒู† ู„ู„ุจุทุงู‚ุงุช */
240
- [data-theme="dark"] .gsc-result,
241
- [data-theme="dark"] .tavily-result {
242
- background: var(--bg-card) !important;
 
 
 
 
 
243
  }
244
 
245
- .gsc-result:hover,
246
  .tavily-result:hover {
247
- border-color: var(--accent);
248
- transform: translateX(-5px);
249
- background: var(--bg-input) !important;
250
- box-shadow: 0 8px 30px rgba(99,102,241,0.08);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  }
252
- [data-theme="dark"] .gsc-result:hover,
253
- [data-theme="dark"] .tavily-result:hover {
254
- background: var(--bg-input) !important;
 
 
255
  }
256
 
257
- /* Google CSE overrides */
258
  .gsc-control-cse { background: transparent !important; border: none !important; padding: 0 !important; }
259
- .gs-title, .gs-title * { color: var(--accent) !important; text-decoration: none !important; font-size: 16px !important; }
260
- .gs-snippet { color: var(--text-sub) !important; line-height: 1.6 !important; font-size: 14px !important; }
261
-
262
- .gsc-adBlock, .gsc-branding, .gsc-search-box, .gcsc-branding, .gsc-branding-text, .gsc-branding-img, .gsc-branding-img-noclear,
263
- .gs-watermark, .gsc-results-branding, .gcsc-find-more-on-google, .gcsc-find-more-on-google-root,
264
- .gsc-result-info, .gsc-orderby, .gsc-selected-option-container, .gsc-thumbnail-inside,
 
 
 
265
  .gsc-tabsArea, .gsc-tabsAreaInvisible, .gsc-refinementHeader, .gsc-refinementBlock {
266
- display: none !important; visibility: hidden !important; opacity: 0 !important; height: 0 !important;
267
- width: 0 !important; margin: 0 !important; padding: 0 !important; pointer-events: none !important;
268
  }
269
  .gsc-above-wrapper-area { border: none !important; padding: 0 !important; margin: 0 !important; height: 0 !important; }
270
 
271
- /* Tavily card specifics */
272
- .tavily-favicon {
273
- width: 24px; height: 24px; border-radius: 4px; margin-top: 2px; flex-shrink: 0;
 
 
 
 
 
 
 
274
  }
275
- .tavily-content { flex: 1; }
276
- .tavily-title {
277
- font-size: 16px; font-weight: 600; color: var(--accent); text-decoration: none;
278
- display: block; margin-bottom: 6px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  }
280
- .tavily-title:hover { text-decoration: underline; }
281
- .tavily-url { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; word-break: break-all; }
282
- .tavily-snippet { font-size: 14px; color: var(--text-sub); line-height: 1.6; }
283
 
284
- .sidebar { width: 100%; order: 2; margin-top: 20px; }
285
- .widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 20px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
286
- .sidebar-toggle { display: none; width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 15px; text-align: center; font-weight: 600; color: var(--text-main); cursor: pointer; margin-bottom: 15px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  .sidebar-content { display: block; }
288
 
 
 
 
 
 
 
 
 
 
 
289
  @media (max-width: 767px) {
290
- .navbar { top: 10px; border-radius: 16px; padding: 12px 16px; }
291
  .brand { font-size: 18px; }
292
- .brand-icon { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
293
- .tabs-bar { top: 135px; }
294
- .page-wrapper { margin-top: 190px; }
295
- .sidebar-toggle { display: block; }
 
296
  .sidebar-content { display: none; }
297
  .sidebar-content.active { display: block; }
298
- .gsc-result, .tavily-result { padding: 14px; }
299
  }
300
  @media (min-width: 768px) {
301
- .navbar { flex-wrap: nowrap; padding: 0 20px; height: 72px; gap: 0; }
302
- .search-container { margin: 0 24px; }
303
- .tabs-bar { top: 105px; overflow-x: visible; padding-bottom: 0; }
304
- .tab-pill { padding: 8px 20px; font-size: 13px; gap: 8px; }
305
- .page-wrapper { display: grid; grid-template-columns: 1fr 300px; margin: 180px auto 50px; }
306
  .sidebar { order: unset; margin-top: 0; }
307
- .gsc-result, .tavily-result { padding: 22px; }
308
  }
309
  </style>
310
  </head>
311
  <body>
312
- <div class="orb orb-1"></div>
313
- <div class="orb orb-2"></div>
314
 
315
  <nav class="navbar">
316
  <a class="brand" href="index.html">
@@ -319,282 +534,291 @@
319
  </a>
320
  <div class="search-container">
321
  <form class="search-bar" id="search-form">
322
- <input id="main-input" placeholder="ุงุจุญุซ ููŠ ุงู„ูˆูŠุจ..." type="text" />
323
- <button style="background:none; border:none; color:var(--accent); cursor:pointer; padding:0 15px;" type="submit">
324
- <i class="fa-solid fa-search"></i>
325
  </button>
326
  </form>
327
  </div>
328
- <button id="theme-toggle" aria-label="ุชุบูŠูŠุฑ ุงู„ุณู…ุฉ">
329
- <i class="fa-solid fa-moon"></i>
330
- </button>
331
  </nav>
332
 
333
- <div class="tabs-bar">
334
- <button class="tab-pill active" data-tab="all"><i class="fa-solid fa-globe"></i> ุงู„ูˆูŠุจ</button>
335
- <button class="tab-pill" data-tab="news"><i class="fa-solid fa-newspaper"></i> ุฃุฎุจุงุฑ</button>
336
- <button class="tab-pill" data-tab="images"><i class="fa-solid fa-image"></i> ุตูˆุฑ</button>
337
- <button class="tab-pill" data-tab="videos"><i class="fa-solid fa-play"></i> ููŠุฏูŠูˆ</button>
338
  </div>
339
 
340
  <div class="page-wrapper">
341
- <main class="results-area">
342
- <div id="loading-text" style="color:var(--text-sub); margin-bottom:20px; font-size: 14px;">
343
- ุฌุงุฑูŠ ุงุณุชุฏุนุงุก ุงู„ุจูŠุงู†ุงุช ู…ู† SurfGO...
344
- </div>
345
  <div id="results-container"></div>
346
  </main>
347
 
348
- <aside class="sidebar">
349
- <button class="sidebar-toggle" id="sidebarToggle">
350
- <i class="fa-solid fa-server" style="margin-left: 8px; color: var(--accent);"></i> ุงู„ู…ุญุฑูƒุงุช ุงู„ู†ุดุทุฉ
351
- <i class="fa-solid fa-chevron-down" style="margin-right: 8px; font-size: 12px;"></i>
352
  </button>
353
  <div class="sidebar-content" id="sidebarContent">
354
  <div class="widget">
355
- <div class="brand-icon" style="margin: 0 auto 15px auto;"><i class="fa-solid fa-server"></i></div>
356
- <h3 style="font-size: 16px; margin-bottom: 15px;">ุงู„ู…ุญุฑูƒุงุช ุงู„ู†ุดุทุฉ</h3>
357
- <div style="display: flex; flex-direction: column; gap: 10px; text-align: right;">
358
- <div style="display: flex; align-items: center; justify-content: space-between; background: var(--bg-base); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);">
359
- <span style="font-size: 13px;">Tavily (ุงู„ูˆูŠุจ)</span>
360
- <div style="display: flex; align-items: center; gap: 5px; color: #10b981; font-size: 11px;">
361
- <span style="width: 6px; height: 6px; background: #10b981; border-radius: 50%;"></span> ู†ุดุท
362
- </div>
363
- </div>
364
- <div style="display: flex; align-items: center; justify-content: space-between; background: var(--bg-base); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);">
365
- <span style="font-size: 13px;">ุฃุฎุจุงุฑ Google</span>
366
- <div style="display: flex; align-items: center; gap: 5px; color: #10b981; font-size: 11px;">
367
- <span style="width: 6px; height: 6px; background: #10b981; border-radius: 50%;"></span> ู†ุดุท
368
- </div>
369
- </div>
370
- <div style="display: flex; align-items: center; justify-content: space-between; background: var(--bg-base); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);">
371
- <span style="font-size: 13px;">ุตูˆุฑ Google</span>
372
- <div style="display: flex; align-items: center; gap: 5px; color: #10b981; font-size: 11px;">
373
- <span style="width: 6px; height: 6px; background: #10b981; border-radius: 50%;"></span> ู†ุดุท
374
- </div>
375
- </div>
376
- <div style="display: flex; align-items: center; justify-content: space-between; background: var(--bg-base); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);">
377
- <span style="font-size: 13px;">ููŠุฏูŠูˆ Google</span>
378
- <div style="display: flex; align-items: center; gap: 5px; color: #10b981; font-size: 11px;">
379
- <span style="width: 6px; height: 6px; background: #10b981; border-radius: 50%;"></span> ู†ุดุท
380
- </div>
381
- </div>
382
  </div>
383
- <p style="font-size: 11px; color: var(--text-sub); margin-top: 15px;">ู…ุฏุนูˆู… ุจูˆุงุณุทุฉ AnesNT Core</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  </div>
385
  </div>
386
  </aside>
387
  </div>
388
 
389
  <script>
390
- (function() {
391
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
392
- // ุฅุนุฏุงุฏุงุช ุงู„ู…ูุงุชูŠุญ (ูŠููุถู„ ู…ุชุบูŠุฑุงุช ุจูŠุฆุฉ)
393
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
394
- const TAVILY_API_KEYS = [
395
- "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",
396
- "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",
397
- "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"
398
- ];
399
-
400
- const GOOGLE_ENGINES = {
401
- news: '35b0f5b6012e94f78',
402
- images: '23c7fd94975714dd8',
403
- videos: 'b11f5dceb04784b9f'
404
- };
405
-
406
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
407
- // ุฅุฏุงุฑุฉ ุงู„ุณู…ุฉ
408
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
409
- const themeToggle = document.getElementById('theme-toggle');
410
- const themeIcon = themeToggle.querySelector('i');
411
- function setTheme(theme) {
412
- document.documentElement.setAttribute('data-theme', theme);
413
- localStorage.setItem('surfgo-theme', theme);
414
- themeIcon.classList.toggle('fa-moon', theme === 'light');
415
- themeIcon.classList.toggle('fa-sun', theme === 'dark');
416
- }
417
- const savedTheme = localStorage.getItem('surfgo-theme') || 'light';
418
- setTheme(savedTheme);
419
- themeToggle.addEventListener('click', () => {
420
- const current = document.documentElement.getAttribute('data-theme');
421
- setTheme(current === 'dark' ? 'light' : 'dark');
422
- });
423
-
424
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
425
- // ุนู†ุงุตุฑ ุงู„ูˆุงุฌู‡ุฉ
426
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
427
- const params = new URLSearchParams(window.location.search);
428
- let query = params.get('q');
429
- let currentTab = params.get('tab') || 'all';
430
- const inputField = document.getElementById('main-input');
431
- const resultsContainer = document.getElementById('results-container');
432
- const loadingText = document.getElementById('loading-text');
433
- const sidebarToggle = document.getElementById('sidebarToggle');
434
- const sidebarContent = document.getElementById('sidebarContent');
435
-
436
- sidebarToggle?.addEventListener('click', () => {
437
- sidebarContent.classList.toggle('active');
438
- const icon = sidebarToggle.querySelector('.fa-chevron-down, .fa-chevron-up');
439
- if (sidebarContent.classList.contains('active')) {
440
- icon.classList.replace('fa-chevron-down', 'fa-chevron-up');
441
- } else {
442
- icon.classList.replace('fa-chevron-up', 'fa-chevron-down');
443
- }
 
 
 
 
 
 
 
444
  });
 
 
 
 
 
 
 
 
 
 
 
445
 
446
- function updateTabUI(tab) {
447
- document.querySelectorAll('.tab-pill').forEach(btn => btn.classList.toggle('active', btn.dataset.tab === tab));
448
- }
449
- updateTabUI(currentTab);
450
-
451
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
452
- // ุฏุงู„ุฉ ู‚ุต ุงู„ู†ุต ุฅู„ู‰ 22 ูƒู„ู…ุฉ
453
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
454
- function truncateWords(text, maxWords = 22) {
455
- if (!text) return '';
456
- const words = text.trim().split(/\s+/);
457
- if (words.length <= maxWords) return text;
458
- return words.slice(0, maxWords).join(' ') + '...';
459
- }
460
 
461
- // ุชุทุจูŠู‚ ุงู„ู‚ุต ุนู„ู‰ ุฌู…ูŠุน ู…ู‚ุชุทูุงุช Google ุจุนุฏ ุงู„ุชุญู…ูŠู„
462
- function truncateGoogleSnippets() {
463
- document.querySelectorAll('.gs-snippet').forEach(el => {
464
- if (el.dataset.truncated) return;
465
- const original = el.textContent || '';
466
- el.textContent = truncateWords(original);
467
- el.dataset.truncated = 'true';
468
- });
469
- }
470
 
471
- if (query) {
472
- inputField.value = query;
473
- document.title = `${query} - SurfGO`;
474
- loadTabResults(currentTab);
475
- } else {
476
- loadingText.textContent = "ูŠุฑุฌู‰ ุฅุฏุฎุงู„ ูƒู„ู…ุฉ ุจุญุซ ู„ู„ุจุฏุก.";
477
- }
 
 
 
 
 
478
 
479
- function loadTabResults(tab) {
480
- resultsContainer.innerHTML = '';
481
- loadingText.style.display = 'block';
482
- updateTabUI(tab);
 
 
 
 
 
483
 
484
- if (tab === 'all') {
485
- fetchTavilyResults(query);
486
- } else {
487
- loadGoogleCSE(tab);
488
- }
489
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
 
491
- function loadGoogleCSE(tab) {
492
- const cx = GOOGLE_ENGINES[tab];
493
- if (!cx) return;
494
-
495
- const oldScript = document.getElementById('cse-logic');
496
- if (oldScript) oldScript.remove();
497
-
498
- const script = document.createElement('script');
499
- script.id = 'cse-logic';
500
- script.src = `https://cse.google.com/cse.js?cx=${cx}`;
501
- script.async = true;
502
- script.onload = () => {
503
- const gcseDiv = document.createElement('div');
504
- gcseDiv.className = 'gcse-searchresults-only';
505
- gcseDiv.setAttribute('data-query', query);
506
- resultsContainer.appendChild(gcseDiv);
507
- // ู†ู†ุชุธุฑ ู‚ู„ูŠู„ุงู‹ ุซู… ู†ู‚ุต ุงู„ู…ู‚ุชุทูุงุช
508
- setTimeout(() => {
509
- truncateGoogleSnippets();
510
- loadingText.style.display = 'none';
511
- }, 1200);
512
- };
513
- document.head.appendChild(script);
514
- }
515
 
516
- async function fetchTavilyResults(searchQuery, keyIndex = 0) {
517
- if (keyIndex >= TAVILY_API_KEYS.length) {
518
- loadingText.textContent = "ุนุฐุฑุงู‹ุŒ ุฌู…ูŠุน ู…ูุงุชูŠุญ API ุบูŠุฑ ุตุงู„ุญุฉ. ุญุงูˆู„ ู„ุงุญู‚ุงู‹.";
519
- return;
520
- }
521
- const apiKey = TAVILY_API_KEYS[keyIndex];
522
- try {
523
- const response = await fetch('https://api.tavily.com/search', {
524
- method: 'POST',
525
- headers: { 'Content-Type': 'application/json' },
526
- body: JSON.stringify({
527
- api_key: apiKey,
528
- query: searchQuery,
529
- search_depth: 'ultra-fast',
530
- max_results: 20,
531
- include_favicon: true
532
- })
533
- });
534
- if (!response.ok) throw new Error(`HTTP ${response.status}`);
535
- const data = await response.json();
536
- if (data.error) throw new Error(data.error);
537
- renderTavilyResults(data.results || []);
538
- loadingText.style.display = 'none';
539
- } catch (error) {
540
- console.warn(`Tavily key ${keyIndex+1} ูุดู„:`, error);
541
- fetchTavilyResults(searchQuery, keyIndex + 1);
542
- }
543
  }
544
-
545
- function renderTavilyResults(results) {
546
- resultsContainer.innerHTML = '';
547
- if (!results.length) {
548
- resultsContainer.innerHTML = '<p style="color:var(--text-sub); text-align:center; margin-top:40px;">ู„ุง ุชูˆุฌุฏ ู†ุชุงุฆุฌ.</p>';
549
- return;
550
- }
551
- results.forEach(item => {
552
- const card = document.createElement('div');
553
- card.className = 'tavily-result';
554
- const favicon = item.favicon || '';
555
- // ู‚ุต ุงู„ู…ุญุชูˆู‰ ุฅู„ู‰ 22 ูƒู„ู…ุฉ
556
- const truncatedContent = truncateWords(item.content, 22);
557
- card.innerHTML = `
558
- ${favicon ? `<img class="tavily-favicon" src="${favicon}" alt="favicon" onerror="this.style.display='none'">` : ''}
559
- <div class="tavily-content">
560
- <a class="tavily-title" href="${item.url}" target="_blank" rel="noopener">${item.title}</a>
561
- <div class="tavily-url">${item.url}</div>
562
- <p class="tavily-snippet">${truncatedContent}</p>
563
- </div>
564
- `;
565
- resultsContainer.appendChild(card);
566
  });
 
 
 
 
 
 
 
 
567
  }
 
568
 
569
- // ุฃุญุฏุงุซ ุงู„ุชุจูˆูŠุจุงุช ูˆุงู„ุจุญุซ
570
- document.querySelectorAll('.tab-pill').forEach(btn => {
571
- btn.addEventListener('click', () => {
572
- currentTab = btn.dataset.tab;
573
- const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query || '')}&tab=${currentTab}`;
574
- window.history.pushState({ path: newUrl }, '', newUrl);
575
- if (query) loadTabResults(currentTab);
576
- else updateTabUI(currentTab);
577
- });
578
- });
579
-
580
- document.getElementById('search-form').addEventListener('submit', (e) => {
581
- e.preventDefault();
582
- query = inputField.value.trim();
583
- if (query) {
584
- const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query)}&tab=${currentTab}`;
585
- window.history.pushState({ path: newUrl }, '', newUrl);
586
- loadTabResults(currentTab);
587
- }
 
 
 
 
588
  });
 
 
589
 
590
- // ู…ุฑุงู‚ุจ DOM ู„ุฅุฎูุงุก ุนู†ุงุตุฑ Google ุบูŠุฑ ุงู„ู…ุฑุบูˆุจ ููŠู‡ุง + ู‚ุต ุงู„ู…ู‚ุชุทูุงุช ุชู„ู‚ุงุฆูŠุงู‹
591
- const observer = new MutationObserver(() => {
592
- document.querySelectorAll('.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader')
593
- .forEach(el => el.remove());
594
- truncateGoogleSnippets();
 
 
 
 
 
595
  });
596
- observer.observe(document.body, { childList: true, subtree: true });
597
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
598
  </script>
599
  </body>
600
  </html>
 
5
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0" name="viewport" />
6
  <title>SurfGO | ู†ุชุงุฆุฌ ุงู„ุจุญุซ</title>
7
  <link href="https://fonts.googleapis.com" rel="preconnect" />
8
+ <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin />
9
+ <link href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Tajawal:wght@300;400;500;700&display=swap" rel="stylesheet" />
 
10
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet" />
11
  <style>
12
  :root {
13
+ --bg-base: #f0f2f8;
14
+ --bg-nav: rgba(255,255,255,0.75);
15
  --bg-card: #ffffff;
16
+ --bg-input: #e8ebf5;
17
  --bg-input-focus: #ffffff;
18
+ --border: rgba(99,102,241,0.12);
19
+ --border-hover: rgba(99,102,241,0.4);
20
+ --accent: #5b5ef4;
21
+ --accent-2: #e0427a;
22
+ --accent-glow: rgba(91,94,244,0.18);
23
+ --text-main: #12132a;
24
+ --text-sub: #6b7280;
25
+ --text-faint: #9ca3af;
26
+ --shadow-card: 0 2px 12px rgba(91,94,244,0.07), 0 1px 3px rgba(0,0,0,0.04);
27
+ --shadow-hover: 0 8px 32px rgba(91,94,244,0.13), 0 2px 8px rgba(0,0,0,0.06);
28
+ --radius-nav: 22px;
29
+ --radius-card: 18px;
30
+ --radius-pill: 100px;
31
+ --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
32
  }
33
 
34
  [data-theme="dark"] {
35
+ --bg-base: #0c0d1d;
36
+ --bg-nav: rgba(18,20,40,0.88);
37
+ --bg-card: #13152e;
38
+ --bg-input: #1c1f3d;
39
+ --bg-input-focus: #13152e;
40
+ --border: rgba(130,133,255,0.13);
41
+ --border-hover: rgba(130,133,255,0.4);
42
+ --accent: #8284fc;
43
  --accent-2: #f472b6;
44
+ --accent-glow: rgba(130,133,255,0.16);
45
+ --text-main: #eef0ff;
46
+ --text-sub: #9099c0;
47
+ --text-faint: #5a6080;
48
+ --shadow-card: 0 2px 14px rgba(0,0,0,0.28);
49
+ --shadow-hover: 0 10px 36px rgba(130,133,255,0.14);
50
  }
51
 
52
+ *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; outline:none; }
 
 
 
 
 
53
 
54
  body {
55
+ font-family: 'Tajawal', sans-serif;
56
  background: var(--bg-base);
57
  color: var(--text-main);
58
  min-height: 100vh;
59
  overflow-x: hidden;
60
+ transition: background 0.35s, color 0.35s;
61
  }
62
 
63
+ /* โ”€โ”€โ”€ Background mesh โ”€โ”€โ”€ */
64
+ .bg-mesh {
65
  position: fixed;
66
+ inset: 0;
 
67
  z-index: 0;
68
  pointer-events: none;
69
+ overflow: hidden;
 
70
  }
71
+ .bg-mesh::before {
72
+ content: '';
73
+ position: absolute;
74
+ top: -20%;
75
+ right: -15%;
76
+ width: 55vw;
77
+ height: 55vw;
78
+ background: radial-gradient(circle, rgba(91,94,244,0.13) 0%, transparent 70%);
79
+ border-radius: 50%;
80
+ animation: drift 18s ease-in-out infinite alternate;
81
  }
82
+ .bg-mesh::after {
83
+ content: '';
84
+ position: absolute;
85
+ bottom: -15%;
86
+ left: -10%;
87
+ width: 45vw;
88
+ height: 45vw;
89
+ background: radial-gradient(circle, rgba(224,66,122,0.1) 0%, transparent 70%);
90
+ border-radius: 50%;
91
+ animation: drift 22s ease-in-out infinite alternate-reverse;
92
  }
93
+ @keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(4%,3%) scale(1.06); } }
94
 
95
+ /* โ”€โ”€โ”€ Navbar โ”€โ”€โ”€ */
96
  .navbar {
97
  position: fixed;
98
+ top: 14px;
99
  left: 50%;
100
  transform: translateX(-50%);
101
  width: 95%;
102
+ max-width: 1280px;
103
  height: auto;
104
+ min-height: 68px;
105
  background: var(--bg-nav);
106
+ backdrop-filter: blur(28px) saturate(1.6);
107
+ -webkit-backdrop-filter: blur(28px) saturate(1.6);
108
  border: 1px solid var(--border);
109
+ border-radius: var(--radius-nav);
110
  display: flex;
111
  flex-wrap: wrap;
112
  align-items: center;
113
  justify-content: space-between;
114
+ padding: 10px 18px;
115
  z-index: 1000;
116
+ box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.6) inset;
117
+ gap: 12px;
118
+ transition: background 0.35s, border-color 0.35s;
119
  }
120
 
121
+ /* โ”€โ”€โ”€ Brand โ”€โ”€โ”€ */
122
  .brand {
123
+ font-family: 'Syne', sans-serif;
124
+ font-weight: 800;
125
+ font-size: 21px;
126
  text-decoration: none;
127
  color: var(--text-main);
128
  display: flex;
129
  align-items: center;
130
  gap: 10px;
131
+ letter-spacing: -0.02em;
132
+ flex-shrink: 0;
133
  }
 
134
  .brand-icon {
135
+ width: 36px;
136
+ height: 36px;
137
+ background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
138
+ border-radius: 10px;
139
  display: flex;
140
  align-items: center;
141
  justify-content: center;
142
  color: #fff;
143
+ font-size: 15px;
144
  flex-shrink: 0;
145
+ box-shadow: 0 4px 14px var(--accent-glow);
146
  }
147
+ .brand span { transition: color 0.3s; }
148
 
149
+ /* โ”€โ”€โ”€ Search bar โ”€โ”€โ”€ */
150
  .search-container {
151
  flex: 1;
152
+ max-width: 580px;
153
  width: 100%;
 
154
  }
 
155
  .search-bar {
156
  display: flex;
157
  align-items: center;
158
  background: var(--bg-input);
159
+ border: 1.5px solid var(--border);
160
+ border-radius: var(--radius-pill);
161
+ padding: 4px 4px 4px 16px;
162
+ transition: var(--transition);
163
  width: 100%;
164
  }
 
165
  .search-bar:focus-within {
166
  border-color: var(--accent);
167
  background: var(--bg-input-focus);
168
+ box-shadow: 0 0 0 4px var(--accent-glow);
169
  }
 
170
  .search-bar input {
171
  flex: 1;
172
  background: transparent;
173
  border: none;
174
+ padding: 9px 0;
175
  color: var(--text-main);
176
+ font-family: 'Tajawal', sans-serif;
177
+ font-size: 14.5px;
178
+ min-width: 0;
179
  }
180
+ .search-bar input::placeholder { color: var(--text-faint); }
181
+ .search-btn {
182
+ background: linear-gradient(135deg, var(--accent), var(--accent-2));
183
+ border: none;
184
+ color: #fff;
185
+ cursor: pointer;
186
+ width: 36px;
187
+ height: 36px;
188
+ border-radius: 50%;
189
+ display: flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ font-size: 13px;
193
+ flex-shrink: 0;
194
+ transition: var(--transition);
195
+ box-shadow: 0 2px 10px var(--accent-glow);
196
  }
197
+ .search-btn:hover { transform: scale(1.07); box-shadow: 0 4px 16px var(--accent-glow); }
198
 
199
+ /* โ”€โ”€โ”€ Theme toggle โ”€โ”€โ”€ */
200
  #theme-toggle {
201
+ background: var(--bg-input);
202
+ border: 1.5px solid var(--border);
203
+ color: var(--text-sub);
204
  cursor: pointer;
205
+ width: 38px;
206
+ height: 38px;
 
 
207
  border-radius: 50%;
208
  display: flex;
209
  align-items: center;
210
  justify-content: center;
211
+ font-size: 15px;
212
+ transition: var(--transition);
213
+ flex-shrink: 0;
214
  }
215
+ #theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-input-focus); }
216
 
217
+ /* โ”€โ”€โ”€ Tabs โ”€โ”€โ”€ */
218
  .tabs-bar {
219
  position: fixed;
220
+ top: 98px;
221
  left: 50%;
222
  transform: translateX(-50%);
223
  width: 95%;
224
+ max-width: 1280px;
225
  display: flex;
226
+ gap: 6px;
227
  z-index: 999;
228
  overflow-x: auto;
229
+ padding-bottom: 4px;
230
  scrollbar-width: none;
231
  }
232
  .tabs-bar::-webkit-scrollbar { display: none; }
233
 
234
  .tab-pill {
235
+ padding: 7px 16px;
236
+ border-radius: var(--radius-pill);
237
  background: var(--bg-card);
238
+ border: 1.5px solid var(--border);
239
  color: var(--text-sub);
240
+ font-family: 'Tajawal', sans-serif;
241
  font-size: 13px;
242
+ font-weight: 500;
243
  cursor: pointer;
244
+ transition: var(--transition);
245
  display: flex;
246
  align-items: center;
247
  gap: 6px;
 
248
  white-space: nowrap;
249
+ box-shadow: var(--shadow-card);
250
  }
251
+ .tab-pill:hover { border-color: var(--border-hover); color: var(--accent); }
252
+ .tab-pill.active {
253
+ background: var(--accent);
254
+ color: #fff;
255
+ border-color: var(--accent);
256
+ box-shadow: 0 4px 16px var(--accent-glow);
257
+ }
258
+ .tab-pill i { font-size: 11px; }
259
 
260
+ /* โ”€โ”€โ”€ Page layout โ”€โ”€โ”€ */
261
  .page-wrapper {
262
+ position: relative;
263
+ z-index: 1;
264
+ max-width: 1280px;
265
+ margin: 170px auto 60px;
266
  padding: 0 16px;
267
  display: flex;
268
  flex-direction: column;
269
+ gap: 24px;
270
  }
271
  .results-area { min-width: 0; width: 100%; }
272
 
273
+ /* โ”€โ”€โ”€ Loading state โ”€โ”€โ”€ */
274
+ #loading-text {
275
+ color: var(--text-sub);
276
+ font-size: 13.5px;
277
+ margin-bottom: 18px;
278
+ display: flex;
279
+ align-items: center;
280
+ gap: 8px;
281
+ }
282
+ #loading-text::before {
283
+ content: '';
284
+ display: inline-block;
285
+ width: 14px;
286
+ height: 14px;
287
+ border: 2px solid var(--border);
288
+ border-top-color: var(--accent);
289
+ border-radius: 50%;
290
+ animation: spin 0.8s linear infinite;
291
+ flex-shrink: 0;
292
+ }
293
+ #loading-text.done::before { display: none; }
294
+ @keyframes spin { to { transform: rotate(360deg); } }
295
+
296
+ /* โ”€โ”€โ”€ Result cards โ”€โ”€โ”€ */
297
  .tavily-result {
298
+ background: var(--bg-card);
299
+ border: 1.5px solid var(--border);
300
+ border-radius: var(--radius-card);
301
+ padding: 18px 20px;
302
+ margin-bottom: 12px;
303
  transition: var(--transition);
304
+ box-shadow: var(--shadow-card);
305
  display: flex;
306
+ gap: 14px;
307
  align-items: flex-start;
308
+ animation: fadeSlideIn 0.35s ease both;
309
  }
310
+ .tavily-result:nth-child(1) { animation-delay: 0.04s; }
311
+ .tavily-result:nth-child(2) { animation-delay: 0.08s; }
312
+ .tavily-result:nth-child(3) { animation-delay: 0.12s; }
313
+ .tavily-result:nth-child(4) { animation-delay: 0.16s; }
314
+ .tavily-result:nth-child(n+5) { animation-delay: 0.20s; }
315
+
316
+ @keyframes fadeSlideIn {
317
+ from { opacity: 0; transform: translateY(10px); }
318
+ to { opacity: 1; transform: translateY(0); }
319
  }
320
 
 
321
  .tavily-result:hover {
322
+ border-color: var(--border-hover);
323
+ box-shadow: var(--shadow-hover);
324
+ transform: translateY(-2px);
325
+ }
326
+
327
+ .tavily-favicon {
328
+ width: 22px;
329
+ height: 22px;
330
+ border-radius: 5px;
331
+ margin-top: 3px;
332
+ flex-shrink: 0;
333
+ object-fit: contain;
334
+ }
335
+ .favicon-placeholder {
336
+ width: 22px;
337
+ height: 22px;
338
+ border-radius: 5px;
339
+ background: var(--bg-input);
340
+ display: flex;
341
+ align-items: center;
342
+ justify-content: center;
343
+ color: var(--text-faint);
344
+ font-size: 10px;
345
+ flex-shrink: 0;
346
+ margin-top: 3px;
347
+ }
348
+ .tavily-content { flex: 1; min-width: 0; }
349
+ .tavily-domain {
350
+ font-size: 11.5px;
351
+ color: var(--text-faint);
352
+ margin-bottom: 4px;
353
+ display: flex;
354
+ align-items: center;
355
+ gap: 4px;
356
+ }
357
+ .tavily-domain i { font-size: 9px; }
358
+ .tavily-title {
359
+ font-family: 'Tajawal', sans-serif;
360
+ font-size: 16px;
361
+ font-weight: 700;
362
+ color: var(--accent);
363
+ text-decoration: none;
364
+ display: block;
365
+ margin-bottom: 6px;
366
+ line-height: 1.4;
367
+ transition: color 0.2s;
368
  }
369
+ .tavily-title:hover { color: var(--accent-2); }
370
+ .tavily-snippet {
371
+ font-size: 13.5px;
372
+ color: var(--text-sub);
373
+ line-height: 1.65;
374
  }
375
 
376
+ /* โ”€โ”€โ”€ Google CSE overrides โ”€โ”€โ”€ */
377
  .gsc-control-cse { background: transparent !important; border: none !important; padding: 0 !important; }
378
+ .gs-title, .gs-title * { color: var(--accent) !important; text-decoration: none !important; font-size: 16px !important; font-weight: 700 !important; font-family: 'Tajawal', sans-serif !important; }
379
+ .gs-snippet { color: var(--text-sub) !important; line-height: 1.65 !important; font-size: 13.5px !important; font-family: 'Tajawal', sans-serif !important; }
380
+ .gsc-thumbnail-inside, .gsc-url-top { padding: 0 !important; }
381
+ .gsc-result { background: var(--bg-card) !important; border: 1.5px solid var(--border) !important; border-radius: var(--radius-card) !important; padding: 18px 20px !important; margin-bottom: 12px !important; box-shadow: var(--shadow-card) !important; }
382
+ .gsc-result:hover { border-color: var(--border-hover) !important; box-shadow: var(--shadow-hover) !important; }
383
+ .gsc-adBlock, .gsc-branding, .gsc-search-box, .gcsc-branding, .gsc-branding-text,
384
+ .gsc-branding-img, .gsc-branding-img-noclear, .gs-watermark, .gsc-results-branding,
385
+ .gcsc-find-more-on-google, .gcsc-find-more-on-google-root, .gsc-result-info,
386
+ .gsc-orderby, .gsc-selected-option-container, .gsc-thumbnail-inside,
387
  .gsc-tabsArea, .gsc-tabsAreaInvisible, .gsc-refinementHeader, .gsc-refinementBlock {
388
+ display: none !important; visibility: hidden !important; height: 0 !important;
389
+ width: 0 !important; margin: 0 !important; padding: 0 !important;
390
  }
391
  .gsc-above-wrapper-area { border: none !important; padding: 0 !important; margin: 0 !important; height: 0 !important; }
392
 
393
+ /* โ”€โ”€โ”€ Sidebar โ”€โ”€โ”€ */
394
+ .sidebar { width: 100%; order: 2; margin-top: 12px; }
395
+
396
+ .widget {
397
+ background: var(--bg-card);
398
+ border: 1.5px solid var(--border);
399
+ border-radius: var(--radius-card);
400
+ padding: 20px;
401
+ box-shadow: var(--shadow-card);
402
+ overflow: hidden;
403
  }
404
+
405
+ .widget-header {
406
+ display: flex;
407
+ align-items: center;
408
+ gap: 10px;
409
+ margin-bottom: 18px;
410
+ }
411
+ .widget-icon {
412
+ width: 32px;
413
+ height: 32px;
414
+ border-radius: 9px;
415
+ background: linear-gradient(135deg, var(--accent), var(--accent-2));
416
+ display: flex;
417
+ align-items: center;
418
+ justify-content: center;
419
+ color: #fff;
420
+ font-size: 13px;
421
+ flex-shrink: 0;
422
+ }
423
+ .widget-title {
424
+ font-family: 'Syne', sans-serif;
425
+ font-size: 14px;
426
+ font-weight: 700;
427
+ color: var(--text-main);
428
+ letter-spacing: -0.01em;
429
  }
 
 
 
430
 
431
+ .engine-item {
432
+ display: flex;
433
+ align-items: center;
434
+ justify-content: space-between;
435
+ background: var(--bg-input);
436
+ padding: 9px 13px;
437
+ border-radius: 11px;
438
+ border: 1.5px solid var(--border);
439
+ margin-bottom: 8px;
440
+ transition: var(--transition);
441
+ }
442
+ .engine-item:last-of-type { margin-bottom: 0; }
443
+ .engine-item:hover { border-color: var(--border-hover); }
444
+ .engine-name { font-size: 13px; font-weight: 500; color: var(--text-main); }
445
+ .engine-status {
446
+ display: flex;
447
+ align-items: center;
448
+ gap: 5px;
449
+ font-size: 11px;
450
+ color: #10b981;
451
+ font-weight: 600;
452
+ }
453
+ .status-dot {
454
+ width: 6px;
455
+ height: 6px;
456
+ background: #10b981;
457
+ border-radius: 50%;
458
+ animation: pulse-dot 2.5s ease-in-out infinite;
459
+ }
460
+ @keyframes pulse-dot {
461
+ 0%, 100% { opacity: 1; }
462
+ 50% { opacity: 0.4; }
463
+ }
464
+ .widget-footer {
465
+ font-size: 11px;
466
+ color: var(--text-faint);
467
+ text-align: center;
468
+ margin-top: 16px;
469
+ padding-top: 14px;
470
+ border-top: 1px solid var(--border);
471
+ }
472
+
473
+ .sidebar-toggle {
474
+ display: none;
475
+ width: 100%;
476
+ background: var(--bg-card);
477
+ border: 1.5px solid var(--border);
478
+ border-radius: var(--radius-card);
479
+ padding: 14px 18px;
480
+ text-align: right;
481
+ font-family: 'Tajawal', sans-serif;
482
+ font-size: 14px;
483
+ font-weight: 600;
484
+ color: var(--text-main);
485
+ cursor: pointer;
486
+ margin-bottom: 12px;
487
+ transition: var(--transition);
488
+ display: none;
489
+ align-items: center;
490
+ justify-content: space-between;
491
+ box-shadow: var(--shadow-card);
492
+ }
493
+ .sidebar-toggle:hover { border-color: var(--border-hover); }
494
  .sidebar-content { display: block; }
495
 
496
+ /* โ”€โ”€โ”€ No results โ”€โ”€โ”€ */
497
+ .empty-state {
498
+ text-align: center;
499
+ padding: 60px 20px;
500
+ color: var(--text-sub);
501
+ }
502
+ .empty-state i { font-size: 40px; margin-bottom: 16px; color: var(--text-faint); }
503
+ .empty-state p { font-size: 15px; }
504
+
505
+ /* โ”€โ”€โ”€ Responsive โ”€โ”€โ”€ */
506
  @media (max-width: 767px) {
507
+ .navbar { top: 10px; border-radius: 16px; padding: 10px 14px; gap: 10px; }
508
  .brand { font-size: 18px; }
509
+ .brand-icon { width: 32px; height: 32px; font-size: 13px; }
510
+ .tabs-bar { top: 125px; }
511
+ .page-wrapper { margin-top: 176px; gap: 16px; }
512
+ .tavily-result { padding: 14px 15px; }
513
+ .sidebar-toggle { display: flex; }
514
  .sidebar-content { display: none; }
515
  .sidebar-content.active { display: block; }
 
516
  }
517
  @media (min-width: 768px) {
518
+ .navbar { flex-wrap: nowrap; padding: 0 22px; height: 68px; gap: 0; }
519
+ .search-container { margin: 0 20px; }
520
+ .tabs-bar { top: 98px; overflow-x: visible; padding-bottom: 0; }
521
+ .page-wrapper { display: grid; grid-template-columns: 1fr 288px; margin: 176px auto 60px; gap: 24px; }
 
522
  .sidebar { order: unset; margin-top: 0; }
523
+ .sidebar-toggle { display: none !important; }
524
  }
525
  </style>
526
  </head>
527
  <body>
528
+ <div class="bg-mesh" aria-hidden="true"></div>
 
529
 
530
  <nav class="navbar">
531
  <a class="brand" href="index.html">
 
534
  </a>
535
  <div class="search-container">
536
  <form class="search-bar" id="search-form">
537
+ <input id="main-input" placeholder="ุงุจุญุซ ููŠ ุงู„ูˆูŠุจ..." type="text" autocomplete="off" />
538
+ <button class="search-btn" type="submit" aria-label="ุจุญุซ">
539
+ <i class="fa-solid fa-magnifying-glass"></i>
540
  </button>
541
  </form>
542
  </div>
543
+ <button id="theme-toggle" aria-label="ุชุบูŠูŠุฑ ุงู„ุณู…ุฉ"></button>
 
 
544
  </nav>
545
 
546
+ <div class="tabs-bar" role="tablist">
547
+ <button class="tab-pill active" data-tab="all" role="tab"><i class="fa-solid fa-globe"></i> ุงู„ูˆูŠุจ</button>
548
+ <button class="tab-pill" data-tab="news" role="tab"><i class="fa-solid fa-newspaper"></i> ุฃุฎุจุงุฑ</button>
549
+ <button class="tab-pill" data-tab="images" role="tab"><i class="fa-solid fa-image"></i> ุตูˆุฑ</button>
550
+ <button class="tab-pill" data-tab="videos" role="tab"><i class="fa-solid fa-play"></i> ููŠุฏูŠูˆ</button>
551
  </div>
552
 
553
  <div class="page-wrapper">
554
+ <main class="results-area" role="main">
555
+ <div id="loading-text">ุฌุงุฑูŠ ุฌู„ุจ ุงู„ู†ุชุงุฆุฌโ€ฆ</div>
 
 
556
  <div id="results-container"></div>
557
  </main>
558
 
559
+ <aside class="sidebar" aria-label="ู…ุนู„ูˆู…ุงุช ุงู„ู…ุญุฑูƒุงุช">
560
+ <button class="sidebar-toggle" id="sidebarToggle" aria-expanded="false">
561
+ <span><i class="fa-solid fa-server" style="margin-left:8px; color:var(--accent);"></i> ุงู„ู…ุญุฑูƒุงุช ุงู„ู†ุดุทุฉ</span>
562
+ <i class="fa-solid fa-chevron-down" style="font-size:12px; color:var(--text-sub);"></i>
563
  </button>
564
  <div class="sidebar-content" id="sidebarContent">
565
  <div class="widget">
566
+ <div class="widget-header">
567
+ <div class="widget-icon"><i class="fa-solid fa-server"></i></div>
568
+ <span class="widget-title">ุงู„ู…ุญุฑูƒุงุช ุงู„ู†ุดุทุฉ</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  </div>
570
+ <div class="engine-item">
571
+ <span class="engine-name">Tavily (ุงู„ูˆูŠุจ)</span>
572
+ <span class="engine-status"><span class="status-dot"></span> ู†ุดุท</span>
573
+ </div>
574
+ <div class="engine-item">
575
+ <span class="engine-name">ุฃุฎุจุงุฑ Google</span>
576
+ <span class="engine-status"><span class="status-dot"></span> ู†ุดุท</span>
577
+ </div>
578
+ <div class="engine-item">
579
+ <span class="engine-name">ุตูˆุฑ Google</span>
580
+ <span class="engine-status"><span class="status-dot"></span> ู†ุดุท</span>
581
+ </div>
582
+ <div class="engine-item">
583
+ <span class="engine-name">ููŠุฏูŠูˆ Google</span>
584
+ <span class="engine-status"><span class="status-dot"></span> ู†ุดุท</span>
585
+ </div>
586
+ <p class="widget-footer">ู…ุฏุนูˆู… ุจูˆุงุณุทุฉ AnesNT Core</p>
587
  </div>
588
  </div>
589
  </aside>
590
  </div>
591
 
592
  <script>
593
+ (function () {
594
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
595
+ // Config
596
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
597
+ const TAVILY_API_KEYS = [
598
+ "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",
599
+ "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",
600
+ "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"
601
+ ];
602
+ const GOOGLE_ENGINES = {
603
+ news: '35b0f5b6012e94f78',
604
+ images: '23c7fd94975714dd8',
605
+ videos: 'b11f5dceb04784b9f'
606
+ };
607
+
608
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
609
+ // Theme
610
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
611
+ const themeBtn = document.getElementById('theme-toggle');
612
+ function setTheme(t) {
613
+ document.documentElement.setAttribute('data-theme', t);
614
+ localStorage.setItem('surfgo-theme', t);
615
+ themeBtn.innerHTML = t === 'dark'
616
+ ? '<i class="fa-solid fa-sun"></i>'
617
+ : '<i class="fa-solid fa-moon"></i>';
618
+ }
619
+ setTheme(localStorage.getItem('surfgo-theme') || 'light');
620
+ themeBtn.addEventListener('click', () => {
621
+ setTheme(document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark');
622
+ });
623
+
624
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
625
+ // State
626
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
627
+ const params = new URLSearchParams(window.location.search);
628
+ let query = params.get('q') || '';
629
+ let currentTab = params.get('tab') || 'all';
630
+
631
+ const inputEl = document.getElementById('main-input');
632
+ const resultsEl = document.getElementById('results-container');
633
+ const loadingEl = document.getElementById('loading-text');
634
+
635
+ // Sidebar toggle (mobile)
636
+ const sidebarToggle = document.getElementById('sidebarToggle');
637
+ const sidebarContent = document.getElementById('sidebarContent');
638
+ sidebarToggle?.addEventListener('click', () => {
639
+ const open = sidebarContent.classList.toggle('active');
640
+ sidebarToggle.setAttribute('aria-expanded', open);
641
+ const chevron = sidebarToggle.querySelector('.fa-chevron-down, .fa-chevron-up');
642
+ chevron?.classList.toggle('fa-chevron-down', !open);
643
+ chevron?.classList.toggle('fa-chevron-up', open);
644
+ });
645
+
646
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
647
+ // Tab management
648
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
649
+ function setActiveTab(tab) {
650
+ document.querySelectorAll('.tab-pill').forEach(btn => {
651
+ const active = btn.dataset.tab === tab;
652
+ btn.classList.toggle('active', active);
653
+ btn.setAttribute('aria-selected', active);
654
  });
655
+ }
656
+ setActiveTab(currentTab);
657
+
658
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
659
+ // Helpers
660
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
661
+ function truncateWords(text, max = 22) {
662
+ if (!text) return '';
663
+ const words = text.trim().split(/\s+/);
664
+ return words.length <= max ? text : words.slice(0, max).join(' ') + 'โ€ฆ';
665
+ }
666
 
667
+ function getDomain(url) {
668
+ try { return new URL(url).hostname.replace('www.', ''); }
669
+ catch { return url; }
670
+ }
 
 
 
 
 
 
 
 
 
 
671
 
672
+ function showLoading(visible) {
673
+ loadingEl.style.display = visible ? 'flex' : 'none';
674
+ if (!visible) loadingEl.classList.add('done');
675
+ }
 
 
 
 
 
676
 
677
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
678
+ // Boot
679
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
680
+ if (query) {
681
+ inputEl.value = query;
682
+ document.title = `${query} โ€“ SurfGO`;
683
+ loadTabResults(currentTab);
684
+ } else {
685
+ showLoading(false);
686
+ loadingEl.style.display = 'block';
687
+ loadingEl.textContent = 'ูŠุฑุฌู‰ ุฅุฏุฎุงู„ ูƒู„ู…ุฉ ุจุญุซ ู„ู„ุจุฏุก.';
688
+ }
689
 
690
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
691
+ // Tab loader
692
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
693
+ function loadTabResults(tab) {
694
+ resultsEl.innerHTML = '';
695
+ showLoading(true);
696
+ setActiveTab(tab);
697
+ tab === 'all' ? fetchTavilyResults(query) : loadGoogleCSE(tab);
698
+ }
699
 
700
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
701
+ // Google CSE
702
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
703
+ function loadGoogleCSE(tab) {
704
+ const cx = GOOGLE_ENGINES[tab];
705
+ if (!cx) return;
706
+ document.getElementById('cse-logic')?.remove();
707
+ const s = document.createElement('script');
708
+ s.id = 'cse-logic';
709
+ s.src = `https://cse.google.com/cse.js?cx=${cx}`;
710
+ s.async = true;
711
+ s.onload = () => {
712
+ const div = document.createElement('div');
713
+ div.className = 'gcse-searchresults-only';
714
+ div.setAttribute('data-query', query);
715
+ resultsEl.appendChild(div);
716
+ setTimeout(() => {
717
+ truncateGoogleSnippets();
718
+ showLoading(false);
719
+ }, 1400);
720
+ };
721
+ document.head.appendChild(s);
722
+ }
723
 
724
+ function truncateGoogleSnippets() {
725
+ document.querySelectorAll('.gs-snippet:not([data-done])').forEach(el => {
726
+ el.textContent = truncateWords(el.textContent);
727
+ el.dataset.done = '1';
728
+ });
729
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
 
731
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
732
+ // Tavily
733
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
734
+ async function fetchTavilyResults(q, idx = 0) {
735
+ if (idx >= TAVILY_API_KEYS.length) {
736
+ showLoading(false);
737
+ resultsEl.innerHTML = `<div class="empty-state"><i class="fa-solid fa-triangle-exclamation"></i><p>ุชุนุฐู‘ุฑ ุงู„ุงุชุตุงู„ ุจุงู„ุฎุงุฏู…. ุญุงูˆู„ ู…ุฌุฏุฏุงู‹.</p></div>`;
738
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  }
740
+ try {
741
+ const res = await fetch('https://api.tavily.com/search', {
742
+ method: 'POST',
743
+ headers: { 'Content-Type': 'application/json' },
744
+ body: JSON.stringify({
745
+ api_key: TAVILY_API_KEYS[idx],
746
+ query: q,
747
+ search_depth: 'ultra-fast',
748
+ max_results: 20,
749
+ include_favicon: true
750
+ })
 
 
 
 
 
 
 
 
 
 
 
751
  });
752
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
753
+ const data = await res.json();
754
+ if (data.error) throw new Error(data.error);
755
+ renderTavilyResults(data.results || []);
756
+ showLoading(false);
757
+ } catch (e) {
758
+ console.warn(`Tavily key ${idx + 1} failed:`, e);
759
+ fetchTavilyResults(q, idx + 1);
760
  }
761
+ }
762
 
763
+ function renderTavilyResults(results) {
764
+ resultsEl.innerHTML = '';
765
+ if (!results.length) {
766
+ resultsEl.innerHTML = `<div class="empty-state"><i class="fa-solid fa-magnifying-glass"></i><p>ู„ุง ุชูˆุฌุฏ ู†ุชุงุฆุฌ ู„ู‡ุฐุง ุงู„ุจุญุซ.</p></div>`;
767
+ return;
768
+ }
769
+ const frag = document.createDocumentFragment();
770
+ results.forEach(item => {
771
+ const card = document.createElement('div');
772
+ card.className = 'tavily-result';
773
+ const domain = getDomain(item.url);
774
+ const snippet = truncateWords(item.content, 22);
775
+ const faviconHTML = item.favicon
776
+ ? `<img class="tavily-favicon" src="${item.favicon}" alt="" loading="lazy" onerror="this.replaceWith(Object.assign(document.createElement('div'),{className:'favicon-placeholder',innerHTML:'<i class=\\'fa-solid fa-link\\'></i>'}));"/>`
777
+ : `<div class="favicon-placeholder"><i class="fa-solid fa-link"></i></div>`;
778
+ card.innerHTML = `
779
+ ${faviconHTML}
780
+ <div class="tavily-content">
781
+ <div class="tavily-domain"><i class="fa-solid fa-circle-dot"></i>${domain}</div>
782
+ <a class="tavily-title" href="${item.url}" target="_blank" rel="noopener noreferrer">${item.title}</a>
783
+ <p class="tavily-snippet">${snippet}</p>
784
+ </div>`;
785
+ frag.appendChild(card);
786
  });
787
+ resultsEl.appendChild(frag);
788
+ }
789
 
790
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
791
+ // Events
792
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
793
+ document.querySelectorAll('.tab-pill').forEach(btn => {
794
+ btn.addEventListener('click', () => {
795
+ currentTab = btn.dataset.tab;
796
+ const url = `${location.pathname}?q=${encodeURIComponent(query)}&tab=${currentTab}`;
797
+ history.pushState({}, '', url);
798
+ if (query) loadTabResults(currentTab);
799
+ else setActiveTab(currentTab);
800
  });
801
+ });
802
+
803
+ document.getElementById('search-form').addEventListener('submit', e => {
804
+ e.preventDefault();
805
+ query = inputEl.value.trim();
806
+ if (!query) return;
807
+ document.title = `${query} โ€“ SurfGO`;
808
+ const url = `${location.pathname}?q=${encodeURIComponent(query)}&tab=${currentTab}`;
809
+ history.pushState({}, '', url);
810
+ loadTabResults(currentTab);
811
+ });
812
+
813
+ // DOM observer โ€“ strip Google branding & truncate snippets
814
+ new MutationObserver(() => {
815
+ document.querySelectorAll(
816
+ '.gsc-adBlock,.gcsc-branding,.gsc-result-info,.gsc-tabsArea,.gsc-refinementHeader,.gsc-above-wrapper-area'
817
+ ).forEach(el => el.remove());
818
+ truncateGoogleSnippets();
819
+ }).observe(document.body, { childList: true, subtree: true });
820
+
821
+ })();
822
  </script>
823
  </body>
824
  </html>