Update results.html
Browse files- results.html +205 -133
results.html
CHANGED
|
@@ -10,10 +10,15 @@
|
|
| 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 |
--border: #e2e8f0;
|
| 18 |
--accent: #6366f1;
|
| 19 |
--accent-2: #ec4899;
|
|
@@ -22,6 +27,20 @@
|
|
| 22 |
--transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
|
| 23 |
}
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
* {
|
| 26 |
margin: 0;
|
| 27 |
padding: 0;
|
|
@@ -35,6 +54,7 @@
|
|
| 35 |
color: var(--text-main);
|
| 36 |
min-height: 100vh;
|
| 37 |
overflow-x: hidden;
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
.orb {
|
|
@@ -44,6 +64,7 @@
|
|
| 44 |
z-index: 0;
|
| 45 |
pointer-events: none;
|
| 46 |
opacity: 0.15;
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
.orb-1 {
|
|
@@ -83,6 +104,7 @@
|
|
| 83 |
z-index: 1000;
|
| 84 |
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
|
| 85 |
gap: 15px;
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
.brand {
|
|
@@ -117,17 +139,17 @@
|
|
| 117 |
.search-bar {
|
| 118 |
display: flex;
|
| 119 |
align-items: center;
|
| 120 |
-
background:
|
| 121 |
border: 1px solid var(--border);
|
| 122 |
border-radius: 100px;
|
| 123 |
padding: 4px;
|
| 124 |
-
transition: var(--transition);
|
| 125 |
width: 100%;
|
| 126 |
}
|
| 127 |
|
| 128 |
.search-bar:focus-within {
|
| 129 |
border-color: var(--accent);
|
| 130 |
-
background:
|
| 131 |
box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
|
| 132 |
}
|
| 133 |
|
|
@@ -145,6 +167,27 @@
|
|
| 145 |
color: var(--text-sub);
|
| 146 |
}
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
.tabs-bar {
|
| 149 |
position: fixed;
|
| 150 |
top: 105px;
|
|
@@ -225,7 +268,7 @@
|
|
| 225 |
.gsc-result:hover {
|
| 226 |
border-color: var(--accent) !important;
|
| 227 |
transform: translateX(-5px) !important;
|
| 228 |
-
background:
|
| 229 |
box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08) !important;
|
| 230 |
}
|
| 231 |
|
|
@@ -408,7 +451,7 @@
|
|
| 408 |
}
|
| 409 |
}
|
| 410 |
|
| 411 |
-
/*
|
| 412 |
.gs-favicon {
|
| 413 |
width: 20px;
|
| 414 |
height: 20px;
|
|
@@ -446,7 +489,10 @@
|
|
| 446 |
</button>
|
| 447 |
</form>
|
| 448 |
</div>
|
| 449 |
-
<
|
|
|
|
|
|
|
|
|
|
| 450 |
</nav>
|
| 451 |
|
| 452 |
<div class="tabs-bar">
|
|
@@ -516,152 +562,178 @@
|
|
| 516 |
</div>
|
| 517 |
|
| 518 |
<script>
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
const sidebarToggle = document.getElementById('sidebarToggle');
|
| 533 |
-
const sidebarContent = document.getElementById('sidebarContent');
|
| 534 |
-
|
| 535 |
-
if (sidebarToggle) {
|
| 536 |
-
sidebarToggle.addEventListener('click', () => {
|
| 537 |
-
sidebarContent.classList.toggle('active');
|
| 538 |
-
const icon = sidebarToggle.querySelector('.fa-chevron-down, .fa-chevron-up');
|
| 539 |
-
if (sidebarContent.classList.contains('active')) {
|
| 540 |
-
icon.classList.remove('fa-chevron-down');
|
| 541 |
-
icon.classList.add('fa-chevron-up');
|
| 542 |
} else {
|
| 543 |
-
|
| 544 |
-
|
| 545 |
}
|
| 546 |
-
}
|
| 547 |
-
}
|
| 548 |
-
|
| 549 |
-
document.querySelectorAll('.tab-pill').forEach(btn => {
|
| 550 |
-
btn.classList.toggle('active', btn.dataset.tab === currentTab);
|
| 551 |
-
});
|
| 552 |
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
loadSurfEngine(currentTab);
|
| 557 |
-
} else {
|
| 558 |
-
loadingText.textContent = "ูุฑุฌู ุฅุฏุฎุงู ููู
ุฉ ุจุญุซ ููุจุฏุก.";
|
| 559 |
-
}
|
| 560 |
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
document.querySelectorAll('.tab-pill').forEach(btn => {
|
| 566 |
-
btn.classList.toggle('active', btn.dataset.tab === tab);
|
| 567 |
});
|
| 568 |
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
const
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
const gcseDiv = document.createElement('div');
|
| 578 |
-
gcseDiv.className = 'gcse-searchresults-only';
|
| 579 |
-
gcseDiv.setAttribute('data-query', query);
|
| 580 |
-
resultsContainer.appendChild(gcseDiv);
|
| 581 |
-
setTimeout(() => {
|
| 582 |
-
loadingText.style.display = 'none';
|
| 583 |
-
}, 1000);
|
| 584 |
};
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 598 |
});
|
| 599 |
-
});
|
| 600 |
|
| 601 |
-
document.getElementById('search-form').addEventListener('submit', (e) => {
|
| 602 |
-
e.preventDefault();
|
| 603 |
-
query = inputField.value;
|
| 604 |
if (query) {
|
| 605 |
-
|
| 606 |
-
|
| 607 |
loadSurfEngine(currentTab);
|
|
|
|
|
|
|
| 608 |
}
|
| 609 |
-
});
|
| 610 |
-
|
| 611 |
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 612 |
-
// ุงูู
ุฑุงูุจ ุงูุฐูู: ุฅุฒุงูุฉ ุนูุงุตุฑ ุบูุบู + ุฅุถุงูุฉ ุงููุงู ุงูููู ุจุฐูุงุก
|
| 613 |
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 614 |
-
const observer = new MutationObserver((mutations) => {
|
| 615 |
-
// ุฅุฎูุงุก ุนูุงุตุฑ ุบูุบู ุบูุฑ ุงูู
ุฑุบูุจ ูููุง
|
| 616 |
-
document.querySelectorAll(
|
| 617 |
-
'.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader'
|
| 618 |
-
).forEach(el => el.remove());
|
| 619 |
-
|
| 620 |
-
// ุฅุถุงูุฉ ุดุนุงุฑ ุงูู
ููุน (ูุงู ุงูููู) ููู ูุชูุฌุฉ
|
| 621 |
-
document.querySelectorAll('.gsc-result').forEach(result => {
|
| 622 |
-
if (result.dataset.faviconAdded) return;
|
| 623 |
-
|
| 624 |
-
const link = result.querySelector('a.gs-title');
|
| 625 |
-
if (!link) return;
|
| 626 |
-
|
| 627 |
-
let domain = '';
|
| 628 |
-
try {
|
| 629 |
-
if (link.href) {
|
| 630 |
-
const url = new URL(link.href);
|
| 631 |
-
domain = url.hostname;
|
| 632 |
-
}
|
| 633 |
-
} catch (e) {
|
| 634 |
-
// ูุชุฌุงูู ุงูุฃุฎุทุงุก ููุณุชุฎุฏู
ุฃููููุฉ ุงูุชุฑุงุถูุฉ
|
| 635 |
-
}
|
| 636 |
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 641 |
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
|
|
|
|
|
|
| 652 |
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
|
|
|
|
|
|
| 658 |
}
|
|
|
|
| 659 |
|
| 660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 661 |
});
|
| 662 |
-
});
|
| 663 |
|
| 664 |
-
|
|
|
|
| 665 |
</script>
|
| 666 |
</body>
|
| 667 |
</html>
|
|
|
|
| 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 |
+
/* =========================================
|
| 14 |
+
1. ูุธุงู
ุงูุฃููุงู ูุงููุถุน ุงูุฏุงูู
|
| 15 |
+
========================================= */
|
| 16 |
:root {
|
| 17 |
--bg-base: #f8fafc;
|
| 18 |
--bg-nav: rgba(255, 255, 255, 0.85);
|
| 19 |
--bg-card: #ffffff;
|
| 20 |
+
--bg-input: #f1f5f9;
|
| 21 |
+
--bg-input-focus: #ffffff;
|
| 22 |
--border: #e2e8f0;
|
| 23 |
--accent: #6366f1;
|
| 24 |
--accent-2: #ec4899;
|
|
|
|
| 27 |
--transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
|
| 28 |
}
|
| 29 |
|
| 30 |
+
/* ุงููุถุน ุงูุฏุงูู */
|
| 31 |
+
[data-theme="dark"] {
|
| 32 |
+
--bg-base: #0f172a;
|
| 33 |
+
--bg-nav: rgba(15, 23, 42, 0.9);
|
| 34 |
+
--bg-card: #1e293b;
|
| 35 |
+
--bg-input: #334155;
|
| 36 |
+
--bg-input-focus: #1e293b;
|
| 37 |
+
--border: #334155;
|
| 38 |
+
--accent: #818cf8;
|
| 39 |
+
--accent-2: #f472b6;
|
| 40 |
+
--text-main: #f1f5f9;
|
| 41 |
+
--text-sub: #94a3b8;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
* {
|
| 45 |
margin: 0;
|
| 46 |
padding: 0;
|
|
|
|
| 54 |
color: var(--text-main);
|
| 55 |
min-height: 100vh;
|
| 56 |
overflow-x: hidden;
|
| 57 |
+
transition: background-color 0.3s ease, color 0.3s ease;
|
| 58 |
}
|
| 59 |
|
| 60 |
.orb {
|
|
|
|
| 64 |
z-index: 0;
|
| 65 |
pointer-events: none;
|
| 66 |
opacity: 0.15;
|
| 67 |
+
transition: opacity 0.3s;
|
| 68 |
}
|
| 69 |
|
| 70 |
.orb-1 {
|
|
|
|
| 104 |
z-index: 1000;
|
| 105 |
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
|
| 106 |
gap: 15px;
|
| 107 |
+
transition: background 0.3s, border-color 0.3s;
|
| 108 |
}
|
| 109 |
|
| 110 |
.brand {
|
|
|
|
| 139 |
.search-bar {
|
| 140 |
display: flex;
|
| 141 |
align-items: center;
|
| 142 |
+
background: var(--bg-input);
|
| 143 |
border: 1px solid var(--border);
|
| 144 |
border-radius: 100px;
|
| 145 |
padding: 4px;
|
| 146 |
+
transition: var(--transition), background-color 0.3s;
|
| 147 |
width: 100%;
|
| 148 |
}
|
| 149 |
|
| 150 |
.search-bar:focus-within {
|
| 151 |
border-color: var(--accent);
|
| 152 |
+
background: var(--bg-input-focus);
|
| 153 |
box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
|
| 154 |
}
|
| 155 |
|
|
|
|
| 167 |
color: var(--text-sub);
|
| 168 |
}
|
| 169 |
|
| 170 |
+
/* ุฒุฑ ุชุจุฏูู ุงูุณู
ุฉ */
|
| 171 |
+
#theme-toggle {
|
| 172 |
+
background: none;
|
| 173 |
+
border: none;
|
| 174 |
+
color: var(--text-main);
|
| 175 |
+
cursor: pointer;
|
| 176 |
+
padding: 5px;
|
| 177 |
+
font-size: 20px;
|
| 178 |
+
width: 40px;
|
| 179 |
+
height: 40px;
|
| 180 |
+
border-radius: 50%;
|
| 181 |
+
display: flex;
|
| 182 |
+
align-items: center;
|
| 183 |
+
justify-content: center;
|
| 184 |
+
transition: background 0.3s, color 0.3s;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
#theme-toggle:hover {
|
| 188 |
+
background: var(--border);
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
.tabs-bar {
|
| 192 |
position: fixed;
|
| 193 |
top: 105px;
|
|
|
|
| 268 |
.gsc-result:hover {
|
| 269 |
border-color: var(--accent) !important;
|
| 270 |
transform: translateX(-5px) !important;
|
| 271 |
+
background: var(--bg-input) !important;
|
| 272 |
box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08) !important;
|
| 273 |
}
|
| 274 |
|
|
|
|
| 451 |
}
|
| 452 |
}
|
| 453 |
|
| 454 |
+
/* ุฃููููุงุช ุงูู
ูุงูุน */
|
| 455 |
.gs-favicon {
|
| 456 |
width: 20px;
|
| 457 |
height: 20px;
|
|
|
|
| 489 |
</button>
|
| 490 |
</form>
|
| 491 |
</div>
|
| 492 |
+
<!-- ุฒุฑ ุชุจุฏูู ุงููุถุน ุงูุฏุงูู/ุงููุงุชุญ -->
|
| 493 |
+
<button id="theme-toggle" aria-label="ุชุบููุฑ ุงูุณู
ุฉ">
|
| 494 |
+
<i class="fa-solid fa-moon"></i>
|
| 495 |
+
</button>
|
| 496 |
</nav>
|
| 497 |
|
| 498 |
<div class="tabs-bar">
|
|
|
|
| 562 |
</div>
|
| 563 |
|
| 564 |
<script>
|
| 565 |
+
(function() {
|
| 566 |
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 567 |
+
// ุฅุฏุงุฑุฉ ุงูุณู
ุฉ (ุฏุงูู/ูุงุชุญ)
|
| 568 |
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 569 |
+
const themeToggle = document.getElementById('theme-toggle');
|
| 570 |
+
const themeIcon = themeToggle.querySelector('i');
|
| 571 |
+
|
| 572 |
+
function setTheme(theme) {
|
| 573 |
+
document.documentElement.setAttribute('data-theme', theme);
|
| 574 |
+
localStorage.setItem('surfgo-theme', theme);
|
| 575 |
+
if (theme === 'dark') {
|
| 576 |
+
themeIcon.classList.remove('fa-moon');
|
| 577 |
+
themeIcon.classList.add('fa-sun');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 578 |
} else {
|
| 579 |
+
themeIcon.classList.remove('fa-sun');
|
| 580 |
+
themeIcon.classList.add('fa-moon');
|
| 581 |
}
|
| 582 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 583 |
|
| 584 |
+
// ุงุณุชุนุงุฏุฉ ุงูุณู
ุฉ ุงูู
ุญููุธุฉ ุฃู ุงุณุชุฎุฏุงู
ุงููุงุชุญ ูุฅูุชุฑุงุถู
|
| 585 |
+
const savedTheme = localStorage.getItem('surfgo-theme') || 'light';
|
| 586 |
+
setTheme(savedTheme);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 587 |
|
| 588 |
+
themeToggle.addEventListener('click', () => {
|
| 589 |
+
const current = document.documentElement.getAttribute('data-theme');
|
| 590 |
+
const next = current === 'dark' ? 'light' : 'dark';
|
| 591 |
+
setTheme(next);
|
|
|
|
|
|
|
| 592 |
});
|
| 593 |
|
| 594 |
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 595 |
+
// ู
ุญุฑูุงุช ุงูุจุญุซ ูุงูุฅุนุฏุงุฏุงุช ุงูุฃุฎุฑู
|
| 596 |
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 597 |
+
const ENGINES = {
|
| 598 |
+
all: '75aa960081baa4f0c',
|
| 599 |
+
news: '35b0f5b6012e94f78',
|
| 600 |
+
images: '23c7fd94975714dd8',
|
| 601 |
+
videos: 'b11f5dceb04784b9f'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
};
|
| 603 |
+
|
| 604 |
+
const params = new URLSearchParams(window.location.search);
|
| 605 |
+
let query = params.get('q');
|
| 606 |
+
let currentTab = params.get('tab') || 'all';
|
| 607 |
+
const inputField = document.getElementById('main-input');
|
| 608 |
+
const resultsContainer = document.getElementById('results-container');
|
| 609 |
+
const loadingText = document.getElementById('loading-text');
|
| 610 |
+
const sidebarToggle = document.getElementById('sidebarToggle');
|
| 611 |
+
const sidebarContent = document.getElementById('sidebarContent');
|
| 612 |
+
|
| 613 |
+
if (sidebarToggle) {
|
| 614 |
+
sidebarToggle.addEventListener('click', () => {
|
| 615 |
+
sidebarContent.classList.toggle('active');
|
| 616 |
+
const icon = sidebarToggle.querySelector('.fa-chevron-down, .fa-chevron-up');
|
| 617 |
+
if (sidebarContent.classList.contains('active')) {
|
| 618 |
+
icon.classList.remove('fa-chevron-down');
|
| 619 |
+
icon.classList.add('fa-chevron-up');
|
| 620 |
+
} else {
|
| 621 |
+
icon.classList.remove('fa-chevron-up');
|
| 622 |
+
icon.classList.add('fa-chevron-down');
|
| 623 |
+
}
|
| 624 |
+
});
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
document.querySelectorAll('.tab-pill').forEach(btn => {
|
| 628 |
+
btn.classList.toggle('active', btn.dataset.tab === currentTab);
|
| 629 |
});
|
|
|
|
| 630 |
|
|
|
|
|
|
|
|
|
|
| 631 |
if (query) {
|
| 632 |
+
inputField.value = query;
|
| 633 |
+
document.title = `${query} - SurfGO`;
|
| 634 |
loadSurfEngine(currentTab);
|
| 635 |
+
} else {
|
| 636 |
+
loadingText.textContent = "ูุฑุฌู ุฅุฏุฎุงู ููู
ุฉ ุจุญุซ ููุจุฏุก.";
|
| 637 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 638 |
|
| 639 |
+
function loadSurfEngine(tab) {
|
| 640 |
+
const cx = ENGINES[tab];
|
| 641 |
+
resultsContainer.innerHTML = '';
|
| 642 |
+
loadingText.style.display = 'block';
|
| 643 |
+
document.querySelectorAll('.tab-pill').forEach(btn => {
|
| 644 |
+
btn.classList.toggle('active', btn.dataset.tab === tab);
|
| 645 |
+
});
|
| 646 |
+
|
| 647 |
+
const oldScript = document.getElementById('cse-logic');
|
| 648 |
+
if (oldScript) oldScript.remove();
|
| 649 |
+
|
| 650 |
+
const script = document.createElement('script');
|
| 651 |
+
script.id = 'cse-logic';
|
| 652 |
+
script.src = `https://cse.google.com/cse.js?cx=${cx}`;
|
| 653 |
+
script.async = true;
|
| 654 |
+
script.onload = () => {
|
| 655 |
+
const gcseDiv = document.createElement('div');
|
| 656 |
+
gcseDiv.className = 'gcse-searchresults-only';
|
| 657 |
+
gcseDiv.setAttribute('data-query', query);
|
| 658 |
+
resultsContainer.appendChild(gcseDiv);
|
| 659 |
+
setTimeout(() => {
|
| 660 |
+
loadingText.style.display = 'none';
|
| 661 |
+
}, 1000);
|
| 662 |
+
};
|
| 663 |
+
document.head.appendChild(script);
|
| 664 |
+
}
|
| 665 |
|
| 666 |
+
document.querySelectorAll('.tab-pill').forEach(btn => {
|
| 667 |
+
btn.addEventListener('click', () => {
|
| 668 |
+
currentTab = btn.dataset.tab;
|
| 669 |
+
const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query || '')}&tab=${currentTab}`;
|
| 670 |
+
window.history.pushState({ path: newUrl }, '', newUrl);
|
| 671 |
+
if (query) loadSurfEngine(currentTab);
|
| 672 |
+
else {
|
| 673 |
+
document.querySelectorAll('.tab-pill').forEach(b => b.classList.toggle('active', b.dataset
|
| 674 |
+
.tab === currentTab));
|
| 675 |
+
}
|
| 676 |
+
});
|
| 677 |
+
});
|
| 678 |
|
| 679 |
+
document.getElementById('search-form').addEventListener('submit', (e) => {
|
| 680 |
+
e.preventDefault();
|
| 681 |
+
query = inputField.value;
|
| 682 |
+
if (query) {
|
| 683 |
+
const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query)}&tab=${currentTab}`;
|
| 684 |
+
window.history.pushState({ path: newUrl }, '', newUrl);
|
| 685 |
+
loadSurfEngine(currentTab);
|
| 686 |
}
|
| 687 |
+
});
|
| 688 |
|
| 689 |
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 690 |
+
// ุงูู
ุฑุงูุจ ุงูุฐูู: ุฅุฎูุงุก ุนูุงุตุฑ ุบูุบู + ุฃููููุงุช ุงูู
ูุงูุน
|
| 691 |
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 692 |
+
const observer = new MutationObserver(() => {
|
| 693 |
+
document.querySelectorAll(
|
| 694 |
+
'.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader'
|
| 695 |
+
).forEach(el => el.remove());
|
| 696 |
+
|
| 697 |
+
document.querySelectorAll('.gsc-result').forEach(result => {
|
| 698 |
+
if (result.dataset.faviconAdded) return;
|
| 699 |
+
const link = result.querySelector('a.gs-title');
|
| 700 |
+
if (!link) return;
|
| 701 |
+
|
| 702 |
+
let domain = '';
|
| 703 |
+
try {
|
| 704 |
+
if (link.href) {
|
| 705 |
+
const url = new URL(link.href);
|
| 706 |
+
domain = url.hostname;
|
| 707 |
+
}
|
| 708 |
+
} catch (e) {}
|
| 709 |
+
|
| 710 |
+
const favicon = document.createElement('img');
|
| 711 |
+
favicon.className = 'gs-favicon';
|
| 712 |
+
favicon.alt = 'ุดุนุงุฑ ุงูู
ููุน';
|
| 713 |
+
favicon.loading = 'lazy';
|
| 714 |
+
|
| 715 |
+
if (domain) {
|
| 716 |
+
favicon.src = `https://www.google.com/s2/favicons?domain=${domain}&sz=32`;
|
| 717 |
+
favicon.onerror = () => {
|
| 718 |
+
favicon.src =
|
| 719 |
+
'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236366f1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>';
|
| 720 |
+
};
|
| 721 |
+
} else {
|
| 722 |
+
favicon.src =
|
| 723 |
+
'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236366f1"><circle cx="12" cy="12" r="10"/></svg>';
|
| 724 |
+
}
|
| 725 |
+
|
| 726 |
+
if (link.firstChild) {
|
| 727 |
+
link.insertBefore(favicon, link.firstChild);
|
| 728 |
+
} else {
|
| 729 |
+
link.appendChild(favicon);
|
| 730 |
+
}
|
| 731 |
+
result.dataset.faviconAdded = 'true';
|
| 732 |
+
});
|
| 733 |
});
|
|
|
|
| 734 |
|
| 735 |
+
observer.observe(document.body, { childList: true, subtree: true });
|
| 736 |
+
})();
|
| 737 |
</script>
|
| 738 |
</body>
|
| 739 |
</html>
|