Release v1.5.1
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
$pageTitle = $title ?? 'Release';
|
||||
$release = $release ?? null;
|
||||
$tracks = $tracks ?? [];
|
||||
$bundles = is_array($bundles ?? null) ? $bundles : [];
|
||||
$storePluginEnabled = (bool)($store_plugin_enabled ?? false);
|
||||
$releaseCover = (string)($release['cover_url'] ?? '');
|
||||
$returnUrl = (string)($_SERVER['REQUEST_URI'] ?? '/releases');
|
||||
@@ -153,6 +154,64 @@ ob_start();
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($storePluginEnabled && $bundles): ?>
|
||||
<div class="bundle-zone" style="display:grid; gap:10px;">
|
||||
<div class="badge">Bundle Deals</div>
|
||||
<div style="display:grid; gap:10px;">
|
||||
<?php foreach ($bundles as $bundle): ?>
|
||||
<?php
|
||||
$bundleId = (int)($bundle['id'] ?? 0);
|
||||
$bundleName = trim((string)($bundle['name'] ?? 'Bundle'));
|
||||
$bundlePriceRow = (float)($bundle['bundle_price'] ?? 0);
|
||||
$bundleCurrencyRow = (string)($bundle['currency'] ?? 'GBP');
|
||||
$bundleLabelRow = trim((string)($bundle['purchase_label'] ?? ''));
|
||||
$bundleLabelRow = $bundleLabelRow !== '' ? $bundleLabelRow : 'Buy Bundle';
|
||||
$bundleCovers = is_array($bundle['covers'] ?? null) ? $bundle['covers'] : [];
|
||||
$bundleCount = (int)($bundle['release_count'] ?? 0);
|
||||
$regularTotal = (float)($bundle['regular_total'] ?? 0);
|
||||
$saving = max(0, $regularTotal - $bundlePriceRow);
|
||||
?>
|
||||
<div class="bundle-card">
|
||||
<div class="bundle-stack" style="--cover-count:<?= max(1, min(5, count($bundleCovers))) ?>;" aria-hidden="true">
|
||||
<?php if ($bundleCovers): ?>
|
||||
<?php foreach (array_slice($bundleCovers, 0, 5) as $i => $cover): ?>
|
||||
<span class="bundle-cover" style="--i:<?= (int)$i ?>;">
|
||||
<img src="<?= htmlspecialchars((string)$cover, ENT_QUOTES, 'UTF-8') ?>" alt="">
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<span class="bundle-cover bundle-fallback">AC</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="bundle-copy">
|
||||
<div class="bundle-title"><?= htmlspecialchars($bundleName, ENT_QUOTES, 'UTF-8') ?></div>
|
||||
<div class="bundle-meta">
|
||||
<?= $bundleCount > 0 ? $bundleCount . ' releases' : 'Multi-release bundle' ?>
|
||||
<?php if ($saving > 0): ?>
|
||||
<span class="bundle-save">Save <?= htmlspecialchars($bundleCurrencyRow, ENT_QUOTES, 'UTF-8') ?> <?= number_format($saving, 2) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" action="/store/cart/add" style="margin:0;">
|
||||
<input type="hidden" name="item_type" value="bundle">
|
||||
<input type="hidden" name="item_id" value="<?= $bundleId ?>">
|
||||
<input type="hidden" name="title" value="<?= htmlspecialchars($bundleName, ENT_QUOTES, 'UTF-8') ?>">
|
||||
<input type="hidden" name="cover_url" value="<?= htmlspecialchars((string)($bundleCovers[0] ?? $releaseCover), ENT_QUOTES, 'UTF-8') ?>">
|
||||
<input type="hidden" name="currency" value="<?= htmlspecialchars($bundleCurrencyRow, ENT_QUOTES, 'UTF-8') ?>">
|
||||
<input type="hidden" name="price" value="<?= htmlspecialchars(number_format($bundlePriceRow, 2, '.', ''), ENT_QUOTES, 'UTF-8') ?>">
|
||||
<input type="hidden" name="qty" value="1">
|
||||
<input type="hidden" name="return_url" value="<?= htmlspecialchars($returnUrl, ENT_QUOTES, 'UTF-8') ?>">
|
||||
<button type="submit" class="track-buy-btn">
|
||||
<i class="fa-solid fa-cart-plus"></i>
|
||||
<span><?= htmlspecialchars($bundleLabelRow, ENT_QUOTES, 'UTF-8') ?> <?= htmlspecialchars($bundleCurrencyRow, ENT_QUOTES, 'UTF-8') ?> <?= number_format($bundlePriceRow, 2) ?></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($release['credits'])): ?>
|
||||
<div style="padding:12px 14px; border-radius:14px; border:1px solid rgba(255,255,255,0.08); background:rgba(0,0,0,0.2);">
|
||||
<div class="badge" style="font-size:9px;">Credits</div>
|
||||
@@ -192,6 +251,15 @@ ob_start();
|
||||
.track-buy-btn{height:34px;border:1px solid rgba(255,255,255,.18);border-radius:999px;background:rgba(255,255,255,.08);color:#e9eefc;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;font-size:12px;white-space:nowrap}
|
||||
.track-buy-btn:hover{background:rgba(255,255,255,.14)}
|
||||
.track-play-btn[disabled]{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.08);color:var(--muted);cursor:not-allowed}
|
||||
.bundle-card{display:grid;grid-template-columns:max-content minmax(0,1fr) auto;gap:14px;align-items:center;padding:12px;border-radius:14px;border:1px solid rgba(255,255,255,.1);background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01))}
|
||||
.bundle-stack{position:relative;height:70px;width:calc(70px + (max(0, var(--cover-count, 1) - 1) * 16px));}
|
||||
.bundle-cover{position:absolute;left:calc(var(--i,0) * 16px);top:0;width:70px;height:70px;border-radius:10px;overflow:hidden;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);box-shadow:0 8px 20px rgba(0,0,0,.35)}
|
||||
.bundle-cover img{width:100%;height:100%;object-fit:cover}
|
||||
.bundle-fallback{display:grid;place-items:center;font-size:11px;color:var(--muted)}
|
||||
.bundle-copy{min-width:0}
|
||||
.bundle-title{font-size:17px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.bundle-meta{margin-top:6px;font-size:12px;color:var(--muted);display:flex;flex-wrap:wrap;gap:10px;align-items:center}
|
||||
.bundle-save{color:#9ff7d5;font-weight:700;letter-spacing:.08em;text-transform:uppercase;font-size:11px}
|
||||
.ac-dock{position:fixed;left:14px;right:14px;bottom:14px;z-index:50}
|
||||
.ac-dock-inner{display:grid;grid-template-columns:minmax(210px,280px) 96px minmax(160px,1fr) 110px 110px 44px;gap:10px;align-items:center;padding:12px;border-radius:14px;border:1px solid rgba(255,255,255,.14);background:rgba(10,11,15,.95)}
|
||||
.ac-dock-meta{display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:10px;min-width:0}
|
||||
@@ -221,7 +289,10 @@ ob_start();
|
||||
gap: 10px !important;
|
||||
}
|
||||
.track-buy-btn { font-size: 11px; padding: 0 10px; }
|
||||
.ac-dock {
|
||||
.bundle-card{grid-template-columns:1fr;gap:10px}
|
||||
.bundle-stack{height:62px}
|
||||
.bundle-cover{width:62px;height:62px}
|
||||
.ac-dock {
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
bottom: 8px;
|
||||
|
||||
Reference in New Issue
Block a user