akagelks commited on
Commit
bafd3c2
·
verified ·
1 Parent(s): bd97b37

remover outras paginas 2, 3 pois nao clica mesmoe ajustar os demais filtros preciso clicar e filtrar - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +75 -26
index.html CHANGED
@@ -460,17 +460,7 @@
460
  <!-- Pagination -->
461
  <div class="flex justify-center mt-8">
462
  <nav class="flex items-center space-x-2">
463
- <button class="px-3 py-1 rounded-lg border border-gray-200 bg-white text-sm font-medium hover:bg-gray-50">
464
- <i class="fas fa-chevron-left"></i>
465
- </button>
466
  <button class="px-3 py-1 rounded-lg border border-blue-200 bg-blue-50 text-blue-600 text-sm font-medium">1</button>
467
- <button class="px-3 py-1 rounded-lg border border-gray-200 bg-white text-sm font-medium hover:bg-gray-50">2</button>
468
- <button class="px-3 py-1 rounded-lg border border-gray-200 bg-white text-sm font-medium hover:bg-gray-50">3</button>
469
- <span class="px-2 text-gray-500">...</span>
470
- <button class="px-3 py-1 rounded-lg border border-gray-200 bg-white text-sm font-medium hover:bg-gray-50">10</button>
471
- <button class="px-3 py-1 rounded-lg border border-gray-200 bg-white text-sm font-medium hover:bg-gray-50">
472
- <i class="fas fa-chevron-right"></i>
473
- </button>
474
  </nav>
475
  </div>
476
  </div>
@@ -533,9 +523,18 @@
533
  event.target.classList.add('border-blue-200', 'bg-blue-50', 'text-blue-600');
534
  event.target.classList.remove('border-gray-200', 'hover:bg-gray-50');
535
 
536
- console.log(`Filtering by TVL >= ${minTvl}`);
537
- // Here you would implement the actual filtering logic
538
- // For now we'll just log to console
 
 
 
 
 
 
 
 
 
539
  }
540
 
541
  function filterByCategory(category) {
@@ -549,23 +548,73 @@
549
  event.target.classList.add('border-blue-200', 'bg-blue-50', 'text-blue-600');
550
  event.target.classList.remove('border-gray-200', 'hover:bg-gray-50');
551
 
552
- console.log(`Filtering by category: ${category}`);
553
- // Here you would implement the actual filtering logic
554
- // For now we'll just log to console
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  }
556
 
557
- // Make dropdown items clickable
558
- document.querySelectorAll('.relative div a').forEach(item => {
559
- item.addEventListener('click', function(e) {
560
- e.preventDefault();
561
- const dropdown = this.closest('.relative').querySelector('button');
562
- dropdown.innerHTML = `<span class="mr-2">Sort by: ${this.textContent}</span><i class="fas fa-chevron-down text-xs"></i>`;
563
- dropdown.nextElementSibling.classList.add('hidden');
564
-
565
- console.log(`Sorting by: ${this.textContent}`);
566
- // Here you would implement the actual sorting logic
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
  });
568
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  </script>
570
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=akagelks/akadg" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
571
  </html>
 
460
  <!-- Pagination -->
461
  <div class="flex justify-center mt-8">
462
  <nav class="flex items-center space-x-2">
 
 
 
463
  <button class="px-3 py-1 rounded-lg border border-blue-200 bg-blue-50 text-blue-600 text-sm font-medium">1</button>
 
 
 
 
 
 
 
464
  </nav>
465
  </div>
466
  </div>
 
523
  event.target.classList.add('border-blue-200', 'bg-blue-50', 'text-blue-600');
524
  event.target.classList.remove('border-gray-200', 'hover:bg-gray-50');
525
 
526
+ // Filter pool cards based on TVL
527
+ const poolCards = document.querySelectorAll('.grid > div');
528
+ poolCards.forEach(card => {
529
+ const tvlText = card.querySelector('div:nth-child(4) > div:nth-child(1) > span:nth-child(2)').textContent;
530
+ const tvl = parseFloat(tvlText.replace(/[^0-9.]/g, '')) * (tvlText.includes('M') ? 1000000 : 1000);
531
+
532
+ if (tvl >= minTvl) {
533
+ card.style.display = 'block';
534
+ } else {
535
+ card.style.display = 'none';
536
+ }
537
+ });
538
  }
539
 
540
  function filterByCategory(category) {
 
548
  event.target.classList.add('border-blue-200', 'bg-blue-50', 'text-blue-600');
549
  event.target.classList.remove('border-gray-200', 'hover:bg-gray-50');
550
 
551
+ // Filter pool cards based on category
552
+ const poolCards = document.querySelectorAll('.grid > div');
553
+ poolCards.forEach(card => {
554
+ const poolName = card.querySelector('h3').textContent;
555
+ let matchesCategory = false;
556
+
557
+ if (category === 'all') {
558
+ matchesCategory = true;
559
+ } else if (category === 'stable') {
560
+ matchesCategory = poolName.includes('USDC') || poolName.includes('USDT');
561
+ } else if (category === 'concentrated') {
562
+ matchesCategory = poolName.includes('ETH') || poolName.includes('WBTC');
563
+ } else if (category === 'bluechip') {
564
+ matchesCategory = poolName.includes('MATIC');
565
+ }
566
+
567
+ card.style.display = matchesCategory ? 'block' : 'none';
568
+ });
569
  }
570
 
571
+ // Token filter functionality
572
+ let selectedTokens = new Set();
573
+
574
+ function toggleTokenDropdown() {
575
+ const dropdown = document.getElementById('token-dropdown');
576
+ dropdown.classList.toggle('hidden');
577
+ }
578
+
579
+ function filterTokens(searchTerm) {
580
+ const tokenItems = document.querySelectorAll('#token-list label');
581
+ tokenItems.forEach(item => {
582
+ const tokenName = item.querySelector('span').textContent;
583
+ if (tokenName.toLowerCase().includes(searchTerm.toLowerCase())) {
584
+ item.style.display = 'flex';
585
+ } else {
586
+ item.style.display = 'none';
587
+ }
588
+ });
589
+ }
590
+
591
+ document.querySelectorAll('#token-list input[type="checkbox"]').forEach(checkbox => {
592
+ checkbox.addEventListener('change', function() {
593
+ const token = this.value;
594
+ if (this.checked) {
595
+ selectedTokens.add(token);
596
+ } else {
597
+ selectedTokens.delete(token);
598
+ }
599
+ applyTokenFilters();
600
  });
601
  });
602
+
603
+ function applyTokenFilters() {
604
+ const poolCards = document.querySelectorAll('.grid > div');
605
+ if (selectedTokens.size === 0) {
606
+ poolCards.forEach(card => card.style.display = 'block');
607
+ return;
608
+ }
609
+
610
+ poolCards.forEach(card => {
611
+ const poolName = card.querySelector('h3').textContent;
612
+ const hasToken = Array.from(selectedTokens).some(token =>
613
+ poolName.includes(token)
614
+ );
615
+ card.style.display = hasToken ? 'block' : 'none';
616
+ });
617
+ }
618
  </script>
619
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=akagelks/akadg" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
620
  </html>