- Full gg.deals-style UI: deal feed with filters, game pages with price history charts, rankings, vouchers, news, prepaids, subscriptions, bundles, franchises, wishlist, API docs - Real data crawlers: * gg:crawl (Steam Store API + GOG Catalog + Epic free games) * gg:catalog (252K game slugs from gg.deals sitemaps) * gg:ggdeals (per-game prices via FlareSolverr session, JSON-LD parsing) * gg:seed / gg:crawl-covers (demo seed + Steam CDN cover art) - 24/7 self-updating scheduler (scripts/scheduler_loop.php, lockfile-protected) - Tailwind v4 dark/light theme, Alpine.js, Chart.js
31 lines
1.6 KiB
PHP
31 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Compact horizontal deal card for dashboard sections.
|
|
* $d: dashboardDeals row (best_price, best_store, best_kind, best_cut, best_hl, game, ends_within)
|
|
* $stores: code => store map
|
|
*/
|
|
$g = $d['game'];
|
|
$store = $stores[$d['best_store']] ?? null;
|
|
$year = isset($g['release_date']) && $g['release_date'] instanceof MongoDB\BSON\UTCDateTime
|
|
? (string) $g['release_date']->toDateTime()->format('Y')
|
|
: '';
|
|
?>
|
|
<div class="flex items-center gap-3 bg-card border border-line rounded-xl p-2.5 hover:border-accent/40 transition-colors group">
|
|
<a href="/game/<?= $g['slug'] ?>" class="shrink-0 rounded-md overflow-hidden ring-1 ring-line">
|
|
<img src="<?= esc($g['cover']['file']) ?>" alt="<?= esc($g['title']) ?>" class="w-[104px] h-[49px] object-cover group-hover:scale-[1.04] transition-transform" loading="lazy">
|
|
</a>
|
|
<div class="min-w-0 flex-1">
|
|
<a href="/game/<?= $g['slug'] ?>" class="block text-[13px] font-semibold text-zinc-100 truncate group-hover:text-accent"><?= esc($g['title']) ?></a>
|
|
<div class="mt-0.5 flex items-center gap-1.5 text-[11px] text-muted">
|
|
<?php if ($store): ?><?= view('partials/store_badge', ['store' => $store]) ?><?php endif; ?>
|
|
<span><?= $year ?></span>
|
|
</div>
|
|
</div>
|
|
<div class="text-right shrink-0">
|
|
<?php if ((int) $d['best_cut'] > 0): ?>
|
|
<div class="cut <?= cut_class((int) $d['best_cut']) ?> cut-badge mb-1">-<?= (int) $d['best_cut'] ?>%</div>
|
|
<?php endif; ?>
|
|
<div class="text-[15px] font-extrabold text-accent leading-none"><?= money($d['best_price']) ?></div>
|
|
</div>
|
|
</div>
|