<?php global $zon, $site_url; ?>
<div class="mx-2">
    <div class="m-grid-start home">
        <?= count(HomeFeedGames()) > 0 ? LoadFile("navbar/content") : '' ?>
        <?php if (count(HomeFeedGames()) > 0) {
            foreach (HomeFeedGames() as $game) { ?>
                <div data-card-size="<?= $game['game_card_size'] == 'md' ? 'md' : '' ?>"
                    data-game-f="<?= $game['is_featured'] == 1 ? 'Yes' : 'No' ?>"
                    class="m-game-card wow <?php echo $zon['config']['animate_class'] ?>">
                    <a class="m-game-link" href="<?= $site_url ?>g/<?= makeSlug($game['game_name']) ?>">
                        <picture style="background-image: url('<?= $game['game_image_url'] ?>')" class="m-game-thumbnail">
                            <div class="m-game-details">
                                <p>
                                    <?= $game['game_name'] ?>
                                </p>
                            </div>
                        </picture>
                    </a>
                </div>
            <?php }
        } ?>
    </div>

    <div class="mx-2">
        <div class="m-category-grid mb-6">
            <?php foreach (getCategory() as $category) {
                $game = GameByCategoryWise($category['name'], 1)[0];
                ?>
                <a href="<?= $site_url . urlencode(makeSlug($category['name'])) ?>">
                <div class="m-category-card wow <?php echo $zon['config']['animate_class'] ?>">
                    <img src="<?= $game['game_image_url'] ?>" alt="<?= $category['name'] ?>">
                    <div class="text">
                            <?= $category['name'] ?>
                        <p>
                            <?php echo count(GameByCategoryWise($category['name'])) ?> Games
                        </p>
                    </div>
                </div>
                </a>
            <?php } ?>
        </div>
    </div>

    <div class="mx-2">
        <?php if (getAd("1,3", 'status') == 0) { ?>
            <div style="max-width: 700px; margin: auto; background-color: #ffffff69; min-height: 100px" class="advert-space mt-6 mb-6">
                <?= getAd("1,3", 'code') ?>
            </div>
        <?php } ?>
    </div>


    <div class="mx-2">
        <div class="about-content bg-white mt-10 p-6">
            <span class="uppercase text-xs font-bold mb-4">About
                <?= $zon['config']['site_name'] ?>
            </span>
            <div class="html-content">
                <?= $zon['config']['footer_content'] ?>
            </div>
        </div>
    </div>
</div>