İçeriğe geç
Tüm kodlar

ER3NSHOP

Kurulum sihirbazlı online mağaza sistemi

38 satır · 2,7 KBHamİndir
<?php
$categories = section_categories($s);
$cols = ['3' => 'lg:grid-cols-3', '4' => 'lg:grid-cols-4', '6' => 'lg:grid-cols-6'][$s['columns']] ?? 'lg:grid-cols-4';
?>
<?php if ($categories): ?>
    <?= section_title_html($s['title'], '', url('urunler')) ?>

    <?php if ($s['style'] === 'pills'): ?>
        <div class="flex flex-wrap gap-2">
            <?php foreach ($categories as $category): ?>
                <a href="<?= category_url($category) ?>" class="rounded-full border border-zinc-200 bg-white px-5 py-2.5 text-sm font-medium text-ink transition hover:border-ink"><?= e($category['name']) ?></a>
            <?php endforeach ?>
        </div>
    <?php elseif ($s['style'] === 'tiles'): ?>
        <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 <?= $cols ?>">
            <?php foreach ($categories as $category): ?>
                <a href="<?= category_url($category) ?>" class="group flex items-center gap-4 rounded-2xl border border-zinc-200 bg-white p-3 transition hover:border-zinc-300 hover:shadow-lg hover:shadow-zinc-900/5">
                    <span class="size-16 shrink-0 overflow-hidden rounded-xl bg-zinc-100"><?= image_tag($category['image'], $category['name'], 'h-full w-full object-cover', 'text-2xl') ?></span>
                    <span class="flex-1 font-semibold text-ink"><?= e($category['name']) ?></span>
                    <?= icon('arrow', 'size-4 text-zinc-400 transition group-hover:translate-x-0.5 group-hover:text-ink', '2') ?>
                </a>
            <?php endforeach ?>
        </div>
    <?php else: ?>
        <div class="grid grid-cols-2 gap-4 sm:gap-6 <?= $cols ?>">
            <?php foreach ($categories as $category): ?>
                <a href="<?= category_url($category) ?>" class="group relative aspect-[4/5] overflow-hidden rounded-3xl bg-zinc-100">
                    <div class="h-full w-full transition duration-700 ease-out-soft group-hover:scale-[1.04]"><?= image_tag($category['image'], $category['name'], 'h-full w-full object-cover', 'text-[9rem]') ?></div>
                    <div class="absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent"></div>
                    <div class="absolute inset-x-0 bottom-0 flex items-end justify-between p-5 sm:p-6">
                        <span class="font-display text-xl <?= heading_weight_class() ?> tracking-tight text-white sm:text-2xl"><?= e($category['name']) ?></span>
                        <span class="flex size-10 items-center justify-center rounded-full bg-white text-ink transition group-hover:rotate-[-45deg]"><?= icon('arrow', 'size-4', '2') ?></span>
                    </div>
                </a>
            <?php endforeach ?>
        </div>
    <?php endif ?>
<?php endif ?>

Lisans bilgisi projenin LICENSE dosyasında.