Files
plugi/themes/theme-one/blocks/gallery/view.php
T
deepDiverPaul ed8ae3200b refresh theme-one starter blocks and layout
Redesign the master layout and content blocks with responsive styling, accessible navigation, and configurable CTA and quote sections. Add about-me, embedded-code, and FAQ blocks, and update the generated theme assets. Replace Alpine-based locale handling with vanilla JavaScript for locale flags and gallery lightboxes, and remove Alpine and DaisyUI dependencies.
2026-11-25 17:50:12 +01:00

24 lines
1.7 KiB
PHP

<?php
$itemCount = max(1, min(12, intval($block->setting('item_count'))));
$lightboxEnabled = (int) $block->setting('lightbox_enabled') === 1;
?>
<section class="px-4 py-12 sm:py-16" data-gallery data-gallery-lightbox="<?= $lightboxEnabled ? 'true' : 'false' ?>">
<div class="mx-auto max-w-7xl">
<h2 class="mb-8 text-3xl font-semibold tracking-tight text-slate-900 sm:text-4xl"><?= $block->setting('heading') ?></h2>
<div class="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4">
<?php for ($i = 0; $i < $itemCount; $i++): ?>
[block slug="gallery-item" id="gallery-item-<?= $i ?>"]
<?php endfor; ?>
</div>
<?php if ($lightboxEnabled) : ?>
<dialog class="m-auto max-h-[90vh] max-w-[90vw] overflow-visible border-0 bg-transparent p-0 text-white backdrop:bg-slate-950/80" data-gallery-dialog aria-label="Gallery image preview">
<form method="dialog" class="absolute right-2 top-2 z-10">
<button class="rounded-full bg-white/90 p-2 text-slate-900 shadow hover:bg-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white" aria-label="Close image preview">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 6l12 12M18 6L6 18" /></svg>
</button>
</form>
<img class="max-h-[90vh] max-w-[90vw] rounded-lg object-contain" data-gallery-lightbox-image alt="">
</dialog>
<?php endif; ?>
</div>
</section>