diff --git a/src/components/CardGrid.astro b/src/components/CardGrid.astro index 759e9b5..36eb7f0 100644 --- a/src/components/CardGrid.astro +++ b/src/components/CardGrid.astro @@ -1,6 +1,5 @@ --- import BackToTop from "./BackToTop.astro" -import LeftSidebarDesktop from "./LeftSidebarDesktop.astro" ---
@@ -14,7 +13,6 @@ import LeftSidebarDesktop from "./LeftSidebarDesktop.astro"
-
@@ -114,6 +112,9 @@ import LeftSidebarDesktop from "./LeftSidebarDesktop.astro" // ── Global helpers ──────────────────────────────────────────────────────── window.copyImage = async function(img) { + const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || + (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); + try { const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); @@ -129,10 +130,17 @@ import LeftSidebarDesktop from "./LeftSidebarDesktop.astro" clean.src = img.src; }); + const blob = await new Promise((resolve, reject) => { + canvas.toBlob(b => b ? resolve(b) : reject(new Error('toBlob failed')), 'image/png'); + }); + + if (isIOS) { + const file = new File([blob], 'card.png', { type: 'image/png' }); + await navigator.share({ files: [file] }); + return; + } + if (navigator.clipboard && navigator.clipboard.write) { - const blob = await new Promise((resolve, reject) => { - canvas.toBlob(b => b ? resolve(b) : reject(new Error('toBlob failed')), 'image/png'); - }); await navigator.clipboard.write([new ClipboardItem({ "image/png": blob })]); showCopyToast('📋 Image copied!', '#198754'); } else { @@ -151,6 +159,7 @@ import LeftSidebarDesktop from "./LeftSidebarDesktop.astro" } } } catch (err) { + if (err.name === 'AbortError') return; console.error('Failed:', err); showCopyToast('❌ Copy failed', '#dc3545'); } diff --git a/src/layouts/Main.astro b/src/layouts/Main.astro index 70de6ff..dfe03d6 100644 --- a/src/layouts/Main.astro +++ b/src/layouts/Main.astro @@ -42,7 +42,5 @@ const { title } = Astro.props; - - diff --git a/src/pages/partials/cards.astro b/src/pages/partials/cards.astro index b7c1018..b656c7a 100644 --- a/src/pages/partials/cards.astro +++ b/src/pages/partials/cards.astro @@ -323,20 +323,6 @@ const facets = searchResults.results.slice(1).map((result: any) => { )} {pokemon.map((card: any, i: number) => ( - <> - {i > 0 && i % 10 === 0 && ( -
-
-
Sponsored
- -
-
- )}
@@ -360,7 +346,7 @@ const facets = searchResults.results.slice(1).map((result: any) => {
{card.productName}
-
{card.setName}
+
{card.setName}{card.setCode}
{card.number}