38751-vm/views/home.php
2026-02-25 00:35:00 +00:00

122 lines
6.8 KiB
PHP

<?php include 'header.php'; ?>
<div class="container">
<div class="row align-items-center mb-5 mt-4">
<div class="col-lg-7">
<h1 class="display-4 fw-bold mb-3"><?php echo __('hero_title'); ?></h1>
<p class="lead text-muted mb-4"><?php echo __('hero_subtitle'); ?></p>
<!-- Search bar added here -->
<div class="mb-4">
<form action="/" method="GET" class="position-relative">
<div class="input-group input-group-lg shadow-sm rounded-pill overflow-hidden border">
<span class="input-group-text bg-white border-0 px-4">
<i class="bi bi-search text-success"></i>
</span>
<input type="text" name="search" class="form-control border-0 px-2 py-3 fs-5" placeholder="<?php echo __('search_placeholder', 'Search for apps and games...'); ?>" value="<?php echo htmlspecialchars($_GET['search'] ?? ''); ?>">
<button class="btn btn-success px-5 fw-bold" type="submit"><?php echo __('search', 'Search'); ?></button>
</div>
</form>
</div>
<div class="d-flex gap-2">
<a href="#latest" class="btn btn-success btn-lg px-4 rounded-pill"><?php echo __('explore_apps'); ?></a>
<a href="/register" class="btn btn-outline-dark btn-lg px-4 rounded-pill"><?php echo __('join_referral'); ?></a>
</div>
</div>
<div class="col-lg-5 d-none d-lg-block text-center">
<div class="position-relative">
<div class="bg-success opacity-10 position-absolute rounded-circle" style="width: 400px; height: 400px; top: -50px; right: -50px; z-index: -1;"></div>
<img src="https://img.icons8.com/color/512/android-os.png" class="img-fluid floating-animation" alt="Android APKs" style="max-height: 350px;">
</div>
</div>
</div>
<section id="latest" class="mb-5">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2 class="fw-bold mb-0">
<?php if (!empty($_GET['search'])): ?>
<?php echo __('search_results_for', 'Search results for'); ?>: "<?php echo htmlspecialchars($_GET['search']); ?>"
<?php else: ?>
<?php echo __('latest_apks'); ?>
<?php endif; ?>
</h2>
<div class="dropdown">
<button class="btn btn-light dropdown-toggle rounded-pill" type="button" data-bs-toggle="dropdown">
<?php echo __('categories'); ?>
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/"><?php echo __('all_categories'); ?></a></li>
<?php
$db = db();
$categories = $db->query("SELECT * FROM categories")->fetchAll();
foreach ($categories as $cat): ?>
<li><a class="dropdown-item" href="/?category=<?php echo $cat['slug']; ?>"><?php echo $cat['name']; ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php if (empty($apks) && !empty($_GET['search'])): ?>
<div class="text-center py-5">
<i class="bi bi-search display-1 text-muted opacity-25 mb-4"></i>
<h3 class="fw-bold"><?php echo __('no_apks_found', 'No APKs found'); ?></h3>
<p class="text-muted"><?php echo __('try_another_search', 'Try another search term or browse categories.'); ?></p>
<a href="/" class="btn btn-outline-success rounded-pill px-4 mt-2"><?php echo __('view_all_apks', 'View All APKs'); ?></a>
</div>
<?php else: ?>
<!-- Grid optimized for 3 columns on desktop and mobile as requested -->
<div class="row g-2 g-md-4">
<?php foreach ($apks as $apk): ?>
<div class="col-4 col-md-4">
<div class="card h-100 border-0 shadow-sm rounded-4 hover-lift">
<div class="card-body p-2 p-md-4 text-center text-md-start">
<div class="d-md-flex align-items-center mb-2 mb-md-3">
<?php
$icon = !empty($apk['icon_path']) ? '/'.$apk['icon_path'] : $apk['image_url'];
?>
<img src="<?php echo $icon; ?>" class="rounded-3 mx-auto mx-md-0 mb-2 mb-md-0 d-block d-md-inline-block" width="50" height="50" alt="<?php echo $apk['title']; ?>" style="object-fit: cover; width: 50px; height: 50px;">
<div class="ms-md-3">
<h6 class="card-title fw-bold mb-0 text-truncate mx-auto" style="max-width: 100%;"><?php echo $apk['title']; ?></h6>
<span class="badge bg-light text-dark fw-normal d-none d-md-inline-block">v<?php echo $apk['version']; ?></span>
</div>
</div>
<p class="card-text text-muted small mb-3 line-clamp-2 d-none d-md-block"><?php echo $apk['description']; ?></p>
<div class="d-flex flex-column flex-md-row justify-content-between align-items-center gap-2">
<span class="text-muted small d-none d-md-inline-block"><i class="fas fa-download me-1"></i> <?php echo number_format($apk['total_downloads']); ?></span>
<a href="/apk/<?php echo $apk['slug']; ?>" class="btn btn-success rounded-pill px-3 btn-sm fw-medium w-100 w-md-auto"><?php echo __('details'); ?></a>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
<div class="bg-dark text-white p-5 rounded-5 mt-5">
<div class="row align-items-center text-center text-lg-start">
<div class="col-lg-8">
<h2 class="fw-bold mb-3"><?php echo __('referral_journey_title'); ?></h2>
<p class="mb-0 text-white-50"><?php echo __('referral_journey_text'); ?></p>
</div>
<div class="col-lg-4 text-center text-lg-end mt-4 mt-lg-0">
<a href="/register" class="btn btn-success btn-lg px-5 rounded-pill"><?php echo __('get_started'); ?></a>
</div>
</div>
</div>
</div>
<style>
@media (max-width: 767px) {
.card-title {
font-size: 0.8rem;
}
.btn-sm {
font-size: 0.7rem;
padding: 0.25rem 0.5rem;
}
}
</style>
<?php include 'footer.php'; ?>