Spaces:
Running
Running
Update index.html
Browse files- index.html +25 -7
index.html
CHANGED
|
@@ -46,9 +46,9 @@
|
|
| 46 |
.background-overlay {
|
| 47 |
position: fixed;
|
| 48 |
inset: 0;
|
| 49 |
-
background: rgba(0, 0, 0, 0.
|
| 50 |
-
backdrop-filter: blur(
|
| 51 |
-
-webkit-backdrop-filter: blur(
|
| 52 |
z-index: 0;
|
| 53 |
}
|
| 54 |
|
|
@@ -674,9 +674,17 @@
|
|
| 674 |
|
| 675 |
<div class="container mx-auto py-4 md:py-8 px-4">
|
| 676 |
<!-- Header -->
|
| 677 |
-
<header class="text-center mb-8 md:mb-12">
|
| 678 |
-
<h1 class="header-text mb-6">Deck Doctor</h1>
|
| 679 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 680 |
<!-- Search -->
|
| 681 |
<div class="search-container">
|
| 682 |
<i class="fas fa-search search-icon"></i>
|
|
@@ -692,6 +700,8 @@
|
|
| 692 |
</button>
|
| 693 |
<div class="autocomplete-dropdown" id="autocomplete"></div>
|
| 694 |
</div>
|
|
|
|
|
|
|
| 695 |
</header>
|
| 696 |
|
| 697 |
<!-- Main Card Display -->
|
|
@@ -1266,11 +1276,19 @@
|
|
| 1266 |
const query = buildCardQueryString(card);
|
| 1267 |
console.log('Query string:', query); // Debug logging
|
| 1268 |
|
| 1269 |
-
const response = await fetch(`https://api.deck.doctor/v1/mtg/search?q=${encodeURIComponent(query)}&topk=
|
| 1270 |
const data = await response.json();
|
| 1271 |
|
| 1272 |
if (data?.length > 0) {
|
| 1273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1274 |
$('gallery-section').classList.remove('hidden');
|
| 1275 |
}
|
| 1276 |
} catch (error) {
|
|
|
|
| 46 |
.background-overlay {
|
| 47 |
position: fixed;
|
| 48 |
inset: 0;
|
| 49 |
+
background: rgba(0, 0, 0, 0.6);
|
| 50 |
+
backdrop-filter: blur(10px);
|
| 51 |
+
-webkit-backdrop-filter: blur(5px);
|
| 52 |
z-index: 0;
|
| 53 |
}
|
| 54 |
|
|
|
|
| 674 |
|
| 675 |
<div class="container mx-auto py-4 md:py-8 px-4">
|
| 676 |
<!-- Header -->
|
| 677 |
+
<header class="text-center mb-8 md:mb-12">
|
|
|
|
| 678 |
|
| 679 |
+
<h1 class="header-text text-4xl md:text-6xl lg:text-8xl mb-4 md:mb-6">
|
| 680 |
+
Deck Doctor
|
| 681 |
+
</h1>
|
| 682 |
+
<div class="flex justify-center gap-5 md:gap-8 text-xs md:text-sm flex-wrap">
|
| 683 |
+
<span class="text-white/40"><i class="fas fa-shield-alt mr-2"></i>Name Search</span>
|
| 684 |
+
<span class="text-white/40"><i class="fas fa-chart-line mr-2"></i>Deck Analysis</span>
|
| 685 |
+
<span class="text-white/40"><i class="fas fa-search mr-2"></i>Smart Discovery</span>
|
| 686 |
+
</div>
|
| 687 |
+
|
| 688 |
<!-- Search -->
|
| 689 |
<div class="search-container">
|
| 690 |
<i class="fas fa-search search-icon"></i>
|
|
|
|
| 700 |
</button>
|
| 701 |
<div class="autocomplete-dropdown" id="autocomplete"></div>
|
| 702 |
</div>
|
| 703 |
+
|
| 704 |
+
|
| 705 |
</header>
|
| 706 |
|
| 707 |
<!-- Main Card Display -->
|
|
|
|
| 1276 |
const query = buildCardQueryString(card);
|
| 1277 |
console.log('Query string:', query); // Debug logging
|
| 1278 |
|
| 1279 |
+
const response = await fetch(`https://api.deck.doctor/v1/mtg/search?q=${encodeURIComponent(query)}&topk=12`);
|
| 1280 |
const data = await response.json();
|
| 1281 |
|
| 1282 |
if (data?.length > 0) {
|
| 1283 |
+
// Filter out the current card more robustly
|
| 1284 |
+
const filteredResults = data.filter(([c]) => {
|
| 1285 |
+
// Check multiple identifiers to ensure we exclude the current card
|
| 1286 |
+
return c.id !== card.id &&
|
| 1287 |
+
c.name !== card.name &&
|
| 1288 |
+
(!c.scryfall_uri || c.scryfall_uri !== card.scryfall_uri);
|
| 1289 |
+
}).slice(0, 11); // Take at most 11 cards after filtering
|
| 1290 |
+
|
| 1291 |
+
displayGallery(filteredResults);
|
| 1292 |
$('gallery-section').classList.remove('hidden');
|
| 1293 |
}
|
| 1294 |
} catch (error) {
|