removed ads, fixed copy image for newer iOS
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
---
|
||||
import BackToTop from "./BackToTop.astro"
|
||||
import LeftSidebarDesktop from "./LeftSidebarDesktop.astro"
|
||||
---
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-2">
|
||||
@@ -14,7 +13,6 @@ import LeftSidebarDesktop from "./LeftSidebarDesktop.astro"
|
||||
<div id="facetContainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
<LeftSidebarDesktop />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-10 mt-0">
|
||||
<div class="d-flex flex-column gap-1 flex-md-row align-items-center mb-3 w-100 justify-content-start">
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
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');
|
||||
});
|
||||
|
||||
if (isIOS) {
|
||||
const file = new File([blob], 'card.png', { type: 'image/png' });
|
||||
await navigator.share({ files: [file] });
|
||||
return;
|
||||
}
|
||||
|
||||
if (navigator.clipboard && navigator.clipboard.write) {
|
||||
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');
|
||||
}
|
||||
|
||||
@@ -42,7 +42,5 @@ const { title } = Astro.props;
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.9/dist/chart.umd.min.js"></script>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
<script>import '../assets/js/priceChart.js';</script>
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1140571217687341" crossorigin="anonymous"></script>
|
||||
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -323,20 +323,6 @@ const facets = searchResults.results.slice(1).map((result: any) => {
|
||||
)}
|
||||
|
||||
{pokemon.map((card: any, i: number) => (
|
||||
<>
|
||||
{i > 0 && i % 10 === 0 && (
|
||||
<div class="col-12 col-md-8 col-xl-6 col-xxxl-12">
|
||||
<div class="rounded-4 d-flex flex-row align-items-center justify-content-center bg-body-secondary p-2 h-100" style="min-height: 280px;">
|
||||
<div class="text-body-tertiary small mb-2 align-self-start ps-1 mt-0 w-100">Sponsored</div>
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-format="fluid"
|
||||
data-ad-layout-key="-fc+50+9g-c8-9k"
|
||||
data-ad-client="ca-pub-1140571217687341"
|
||||
data-ad-slot="1206214613"></ins>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div class="col equal-height-col">
|
||||
<div class="inventory-button position-relative float-end shadow-filter text-center d-none">
|
||||
@@ -360,7 +346,7 @@ const facets = searchResults.results.slice(1).map((result: any) => {
|
||||
</div>
|
||||
<div class="h5 my-0">{card.productName}</div>
|
||||
<div class="d-flex flex-row lh-1 mt-1 justify-content-between">
|
||||
<div class="text-secondary flex-grow-1 d-none d-lg-flex">{card.setName}</div>
|
||||
<div class="text-secondary flex-grow-1"><span class="d-none d-lg-flex">{card.setName}</span><span class="d-flex d-lg-none">{card.setCode}</span></div>
|
||||
<div class="text-body-tertiary">{card.number}</div>
|
||||
<span class="ps-2 small-icon"><RarityIcon rarity={card.rarityName} /></span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user