Update results.html
Browse files- 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 |
-
|
| 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: #
|
| 15 |
-
--bg-nav: rgba(255,
|
| 16 |
--bg-card: #ffffff;
|
| 17 |
-
--bg-input: #
|
| 18 |
--bg-input-focus: #ffffff;
|
| 19 |
-
--border:
|
| 20 |
-
--
|
| 21 |
-
--accent
|
| 22 |
-
--
|
| 23 |
-
--
|
| 24 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
[data-theme="dark"] {
|
| 28 |
-
--bg-base: #
|
| 29 |
-
--bg-nav: rgba(
|
| 30 |
-
--bg-card: #
|
| 31 |
-
--bg-input: #
|
| 32 |
-
--bg-input-focus: #
|
| 33 |
-
--border:
|
| 34 |
-
--
|
|
|
|
| 35 |
--accent-2: #f472b6;
|
| 36 |
-
--
|
| 37 |
-
--text-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
-
* {
|
| 41 |
-
margin: 0;
|
| 42 |
-
padding: 0;
|
| 43 |
-
box-sizing: border-box;
|
| 44 |
-
outline: none;
|
| 45 |
-
}
|
| 46 |
|
| 47 |
body {
|
| 48 |
-
font-family: '
|
| 49 |
background: var(--bg-base);
|
| 50 |
color: var(--text-main);
|
| 51 |
min-height: 100vh;
|
| 52 |
overflow-x: hidden;
|
| 53 |
-
transition: background
|
| 54 |
}
|
| 55 |
|
| 56 |
-
|
|
|
|
| 57 |
position: fixed;
|
| 58 |
-
|
| 59 |
-
filter: blur(100px);
|
| 60 |
z-index: 0;
|
| 61 |
pointer-events: none;
|
| 62 |
-
|
| 63 |
-
transition: opacity 0.3s;
|
| 64 |
}
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
-
.
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
}
|
|
|
|
| 80 |
|
|
|
|
| 81 |
.navbar {
|
| 82 |
position: fixed;
|
| 83 |
-
top:
|
| 84 |
left: 50%;
|
| 85 |
transform: translateX(-50%);
|
| 86 |
width: 95%;
|
| 87 |
-
max-width:
|
| 88 |
height: auto;
|
| 89 |
-
min-height:
|
| 90 |
background: var(--bg-nav);
|
| 91 |
-
backdrop-filter: blur(
|
|
|
|
| 92 |
border: 1px solid var(--border);
|
| 93 |
-
border-radius:
|
| 94 |
display: flex;
|
| 95 |
flex-wrap: wrap;
|
| 96 |
align-items: center;
|
| 97 |
justify-content: space-between;
|
| 98 |
-
padding: 10px
|
| 99 |
z-index: 1000;
|
| 100 |
-
box-shadow: 0
|
| 101 |
-
gap:
|
| 102 |
-
transition: background 0.
|
| 103 |
}
|
| 104 |
|
|
|
|
| 105 |
.brand {
|
| 106 |
-
font-
|
| 107 |
-
font-
|
|
|
|
| 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:
|
| 117 |
-
height:
|
| 118 |
-
background: linear-gradient(135deg, var(--accent), var(--accent-2));
|
| 119 |
-
border-radius:
|
| 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:
|
| 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:
|
| 139 |
-
border-radius:
|
| 140 |
-
padding: 4px;
|
| 141 |
-
transition: var(--transition)
|
| 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
|
| 149 |
}
|
| 150 |
-
|
| 151 |
.search-bar input {
|
| 152 |
flex: 1;
|
| 153 |
background: transparent;
|
| 154 |
border: none;
|
| 155 |
-
padding:
|
| 156 |
color: var(--text-main);
|
| 157 |
-
font-
|
| 158 |
-
|
|
|
|
| 159 |
}
|
| 160 |
-
|
| 161 |
-
.search-
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
}
|
|
|
|
| 164 |
|
|
|
|
| 165 |
#theme-toggle {
|
| 166 |
-
background:
|
| 167 |
-
border:
|
| 168 |
-
color: var(--text-
|
| 169 |
cursor: pointer;
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
width: 40px;
|
| 173 |
-
height: 40px;
|
| 174 |
border-radius: 50%;
|
| 175 |
display: flex;
|
| 176 |
align-items: center;
|
| 177 |
justify-content: center;
|
| 178 |
-
|
|
|
|
|
|
|
| 179 |
}
|
| 180 |
-
#theme-toggle:hover { background: var(--
|
| 181 |
|
|
|
|
| 182 |
.tabs-bar {
|
| 183 |
position: fixed;
|
| 184 |
-
top:
|
| 185 |
left: 50%;
|
| 186 |
transform: translateX(-50%);
|
| 187 |
width: 95%;
|
| 188 |
-
max-width:
|
| 189 |
display: flex;
|
| 190 |
-
gap:
|
| 191 |
z-index: 999;
|
| 192 |
overflow-x: auto;
|
| 193 |
-
padding-bottom:
|
| 194 |
scrollbar-width: none;
|
| 195 |
}
|
| 196 |
.tabs-bar::-webkit-scrollbar { display: none; }
|
| 197 |
|
| 198 |
.tab-pill {
|
| 199 |
-
padding:
|
| 200 |
-
border-radius:
|
| 201 |
background: var(--bg-card);
|
| 202 |
-
border:
|
| 203 |
color: var(--text-sub);
|
|
|
|
| 204 |
font-size: 13px;
|
|
|
|
| 205 |
cursor: pointer;
|
| 206 |
-
transition:
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
|
|
|
|
| 215 |
.page-wrapper {
|
| 216 |
-
|
| 217 |
-
|
|
|
|
|
|
|
| 218 |
padding: 0 16px;
|
| 219 |
display: flex;
|
| 220 |
flex-direction: column;
|
| 221 |
-
gap:
|
| 222 |
}
|
| 223 |
.results-area { min-width: 0; width: 100%; }
|
| 224 |
|
| 225 |
-
/*
|
| 226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
.tavily-result {
|
| 228 |
-
background:
|
| 229 |
-
border:
|
| 230 |
-
border-radius:
|
| 231 |
-
padding:
|
| 232 |
-
margin-bottom:
|
| 233 |
transition: var(--transition);
|
| 234 |
-
box-shadow:
|
| 235 |
display: flex;
|
| 236 |
-
gap:
|
| 237 |
align-items: flex-start;
|
|
|
|
| 238 |
}
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
}
|
| 244 |
|
| 245 |
-
.gsc-result:hover,
|
| 246 |
.tavily-result:hover {
|
| 247 |
-
border-color: var(--
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
}
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
|
|
|
|
|
|
| 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.
|
| 261 |
-
|
| 262 |
-
.gsc-
|
| 263 |
-
.
|
| 264 |
-
.gsc-
|
|
|
|
|
|
|
|
|
|
| 265 |
.gsc-tabsArea, .gsc-tabsAreaInvisible, .gsc-refinementHeader, .gsc-refinementBlock {
|
| 266 |
-
display: none !important; visibility: hidden !important;
|
| 267 |
-
width: 0 !important; margin: 0 !important; padding: 0 !important;
|
| 268 |
}
|
| 269 |
.gsc-above-wrapper-area { border: none !important; padding: 0 !important; margin: 0 !important; height: 0 !important; }
|
| 270 |
|
| 271 |
-
/*
|
| 272 |
-
.
|
| 273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
}
|
| 275 |
-
|
| 276 |
-
.
|
| 277 |
-
|
| 278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
.
|
| 285 |
-
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
.sidebar-content { display: block; }
|
| 288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
@media (max-width: 767px) {
|
| 290 |
-
.navbar { top: 10px; border-radius: 16px; padding:
|
| 291 |
.brand { font-size: 18px; }
|
| 292 |
-
.brand-icon { width: 32px; height: 32px;
|
| 293 |
-
.tabs-bar { top:
|
| 294 |
-
.page-wrapper { margin-top:
|
| 295 |
-
.
|
|
|
|
| 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
|
| 302 |
-
.search-container { margin: 0
|
| 303 |
-
.tabs-bar { top:
|
| 304 |
-
.
|
| 305 |
-
.page-wrapper { display: grid; grid-template-columns: 1fr 300px; margin: 180px auto 50px; }
|
| 306 |
.sidebar { order: unset; margin-top: 0; }
|
| 307 |
-
.
|
| 308 |
}
|
| 309 |
</style>
|
| 310 |
</head>
|
| 311 |
<body>
|
| 312 |
-
<div class="
|
| 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
|
| 324 |
-
<i class="fa-solid fa-
|
| 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"
|
| 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:
|
| 351 |
-
<i class="fa-solid fa-chevron-down" style="
|
| 352 |
</button>
|
| 353 |
<div class="sidebar-content" id="sidebarContent">
|
| 354 |
<div class="widget">
|
| 355 |
-
<div class="
|
| 356 |
-
|
| 357 |
-
|
| 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 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
</div>
|
| 385 |
</div>
|
| 386 |
</aside>
|
| 387 |
</div>
|
| 388 |
|
| 389 |
<script>
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
setTheme(
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 444 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 445 |
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
}
|
| 449 |
-
|
| 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 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
const original = el.textContent || '';
|
| 466 |
-
el.textContent = truncateWords(original);
|
| 467 |
-
el.dataset.truncated = 'true';
|
| 468 |
-
});
|
| 469 |
-
}
|
| 470 |
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 483 |
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 490 |
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 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 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 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 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 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 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 588 |
});
|
|
|
|
|
|
|
| 589 |
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
});
|
| 596 |
-
|
| 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>
|