Aslam
This commit is contained in:
parent
d4a35a87c0
commit
a887a75aed
9
.htaccess
Normal file
9
.htaccess
Normal file
@ -0,0 +1,9 @@
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
|
||||
# Stop processing if file or directory exists
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
|
||||
# Redirect all other requests to index.php
|
||||
RewriteRule ^(.*)$ index.php [L,QSA]
|
||||
38
app/Controllers/ApkController.php
Normal file
38
app/Controllers/ApkController.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Core\Controller;
|
||||
use App\Services\ApkService;
|
||||
|
||||
class ApkController extends Controller {
|
||||
protected $apkService;
|
||||
|
||||
public function __construct() {
|
||||
$this->apkService = new ApkService();
|
||||
}
|
||||
|
||||
public function detail($params) {
|
||||
$apk = $this->apkService->getBySlug($params['slug']);
|
||||
if (!$apk) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
echo "APK Not Found";
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->view('apk_detail', [
|
||||
'apk' => $apk,
|
||||
'title' => $apk['title'] . ' v' . $apk['version'] . ' APK Download'
|
||||
]);
|
||||
}
|
||||
|
||||
public function download($params) {
|
||||
$apk = $this->apkService->getBySlug($params['slug']);
|
||||
if ($apk) {
|
||||
$this->apkService->incrementDownload($apk['id']);
|
||||
// In a real app, this would be a link to a file or a CDN.
|
||||
// For now, let's redirect to a mock download URL or back.
|
||||
$this->redirect($apk['download_url'] === '#' ? '/apk/' . $apk['slug'] . '?downloaded=1' : $apk['download_url']);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
app/Controllers/HomeController.php
Normal file
22
app/Controllers/HomeController.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Core\Controller;
|
||||
use App\Services\ApkService;
|
||||
|
||||
class HomeController extends Controller {
|
||||
protected $apkService;
|
||||
|
||||
public function __construct() {
|
||||
$this->apkService = new ApkService();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$apks = $this->apkService->getLatest(12);
|
||||
return $this->view('home', [
|
||||
'apks' => $apks,
|
||||
'title' => 'ApkNusa - Professional APK Download Portal'
|
||||
]);
|
||||
}
|
||||
}
|
||||
25
app/Core/Controller.php
Normal file
25
app/Core/Controller.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
class Controller {
|
||||
protected function view($name, $data = []) {
|
||||
extract($data);
|
||||
$viewFile = __DIR__ . "/../../views/{$name}.php";
|
||||
if (file_exists($viewFile)) {
|
||||
require_once $viewFile;
|
||||
} else {
|
||||
echo "View {$name} not found";
|
||||
}
|
||||
}
|
||||
|
||||
protected function json($data) {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
protected function redirect($url) {
|
||||
header("Location: {$url}");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
38
app/Core/Router.php
Normal file
38
app/Core/Router.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
class Router {
|
||||
protected $routes = [];
|
||||
|
||||
public function add($method, $path, $handler) {
|
||||
$path = preg_replace('/\{([a-z]+)\}/', '(?P<\1>[^/]+)', $path);
|
||||
$this->routes[] = [
|
||||
'method' => strtoupper($method),
|
||||
'path' => '#^' . $path . '$#',
|
||||
'handler' => $handler
|
||||
];
|
||||
}
|
||||
|
||||
public function dispatch($method, $uri) {
|
||||
$uri = parse_url($uri, PHP_URL_PATH);
|
||||
|
||||
foreach ($this->routes as $route) {
|
||||
if ($route['method'] === strtoupper($method) && preg_match($route['path'], $uri, $matches)) {
|
||||
$handler = $route['handler'];
|
||||
$params = array_filter($matches, 'is_string', ARRAY_FILTER_USE_KEY);
|
||||
|
||||
if (is_array($handler)) {
|
||||
[$controllerClass, $methodName] = $handler;
|
||||
$controller = new $controllerClass();
|
||||
return $controller->$methodName($params);
|
||||
}
|
||||
|
||||
return $handler($params);
|
||||
}
|
||||
}
|
||||
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
echo "404 Not Found";
|
||||
}
|
||||
}
|
||||
37
app/Services/ApkService.php
Normal file
37
app/Services/ApkService.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
require_once __DIR__ . '/../../db/config.php';
|
||||
|
||||
class ApkService {
|
||||
protected $db;
|
||||
|
||||
public function __construct() {
|
||||
$this->db = db();
|
||||
}
|
||||
|
||||
public function getLatest($limit = 10) {
|
||||
$stmt = $this->db->prepare("SELECT * FROM apks WHERE status = 'published' ORDER BY created_at DESC LIMIT :limit");
|
||||
$stmt->bindValue(':limit', (int)$limit, \PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
|
||||
public function getBySlug($slug) {
|
||||
$stmt = $this->db->prepare("SELECT * FROM apks WHERE slug = :slug AND status = 'published' LIMIT 1");
|
||||
$stmt->execute(['slug' => $slug]);
|
||||
return $stmt->fetch();
|
||||
}
|
||||
|
||||
public function incrementDownload($apkId) {
|
||||
$stmt = $this->db->prepare("UPDATE apks SET total_downloads = total_downloads + 1 WHERE id = :id");
|
||||
$stmt->execute(['id' => $apkId]);
|
||||
|
||||
$stmt = $this->db->prepare("INSERT INTO downloads (apk_id, ip_address) VALUES (:apk_id, :ip)");
|
||||
$stmt->execute([
|
||||
'apk_id' => $apkId,
|
||||
'ip' => $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -1,302 +1,72 @@
|
||||
body {
|
||||
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
|
||||
background-size: 400% 400%;
|
||||
animation: gradient 15s ease infinite;
|
||||
color: #212529;
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: #F5F7F9;
|
||||
color: #263238;
|
||||
}
|
||||
|
||||
.main-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.hover-lift {
|
||||
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
.hover-lift:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1) !important;
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 85vh;
|
||||
box-shadow: 0 20px 40px rgba(0,0,0,0.2);
|
||||
backdrop-filter: blur(15px);
|
||||
-webkit-backdrop-filter: blur(15px);
|
||||
.line-clamp-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chat-header {
|
||||
padding: 1.5rem;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.floating-animation {
|
||||
animation: floating 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.chat-messages {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
@keyframes floating {
|
||||
0% { transform: translate(0, 0px); }
|
||||
50% { transform: translate(0, 15px); }
|
||||
100% { transform: translate(0, -0px); }
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
.btn-success {
|
||||
background-color: #00C853;
|
||||
border-color: #00C853;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
.btn-success:hover {
|
||||
background-color: #00B248;
|
||||
border-color: #00B248;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 10px;
|
||||
.text-success {
|
||||
color: #00C853 !important;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
.bg-success {
|
||||
background-color: #00C853 !important;
|
||||
}
|
||||
|
||||
.message {
|
||||
max-width: 85%;
|
||||
padding: 0.85rem 1.1rem;
|
||||
border-radius: 16px;
|
||||
line-height: 1.5;
|
||||
font-size: 0.95rem;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
||||
animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
.bg-success-subtle {
|
||||
background-color: #E8F5E9 !important;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(20px) scale(0.95); }
|
||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||
}
|
||||
|
||||
.message.visitor {
|
||||
align-self: flex-end;
|
||||
background: linear-gradient(135deg, #212529 0%, #343a40 100%);
|
||||
color: #fff;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.message.bot {
|
||||
align-self: flex-start;
|
||||
background: #ffffff;
|
||||
color: #212529;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.chat-input-area {
|
||||
padding: 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.chat-input-area form {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.chat-input-area input {
|
||||
flex: 1;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 12px;
|
||||
padding: 0.75rem 1rem;
|
||||
outline: none;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.chat-input-area input:focus {
|
||||
border-color: #23a6d5;
|
||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
|
||||
}
|
||||
|
||||
.chat-input-area button {
|
||||
background: #212529;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.chat-input-area button:hover {
|
||||
background: #000;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
/* Background Animations */
|
||||
.bg-animations {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.blob {
|
||||
position: absolute;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
filter: blur(80px);
|
||||
animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
|
||||
}
|
||||
|
||||
.blob-1 {
|
||||
top: -10%;
|
||||
left: -10%;
|
||||
background: rgba(238, 119, 82, 0.4);
|
||||
}
|
||||
|
||||
.blob-2 {
|
||||
bottom: -10%;
|
||||
right: -10%;
|
||||
background: rgba(35, 166, 213, 0.4);
|
||||
animation-delay: -7s;
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
.blob-3 {
|
||||
top: 40%;
|
||||
left: 30%;
|
||||
background: rgba(231, 60, 126, 0.3);
|
||||
animation-delay: -14s;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
@keyframes move {
|
||||
0% { transform: translate(0, 0) rotate(0deg) scale(1); }
|
||||
33% { transform: translate(150px, 100px) rotate(120deg) scale(1.1); }
|
||||
66% { transform: translate(-50px, 200px) rotate(240deg) scale(0.9); }
|
||||
100% { transform: translate(0, 0) rotate(360deg) scale(1); }
|
||||
}
|
||||
|
||||
.admin-link {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.admin-link:hover {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Admin Styles */
|
||||
.admin-container {
|
||||
max-width: 900px;
|
||||
margin: 3rem auto;
|
||||
padding: 2.5rem;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 20px 50px rgba(0,0,0,0.15);
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.admin-container h1 {
|
||||
margin-top: 0;
|
||||
color: #212529;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0 8px;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.table th {
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 1rem;
|
||||
color: #6c757d;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.75rem;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.table td {
|
||||
background: #fff;
|
||||
padding: 1rem;
|
||||
.btn-white {
|
||||
background-color: #FFFFFF;
|
||||
color: #00C853;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table tr td:first-child { border-radius: 12px 0 0 12px; }
|
||||
.table tr td:last-child { border-radius: 0 12px 12px 0; }
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.25rem;
|
||||
.btn-white:hover {
|
||||
background-color: #F5F7F9;
|
||||
color: #00B248;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.rounded-4 { border-radius: 1rem !important; }
|
||||
.rounded-5 { border-radius: 1.5rem !important; }
|
||||
|
||||
.form-control {
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 12px;
|
||||
background: #fff;
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
.navbar-brand i {
|
||||
font-size: 1.5rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
outline: none;
|
||||
border-color: #23a6d5;
|
||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.1);
|
||||
}
|
||||
@ -1,39 +1,11 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const chatForm = document.getElementById('chat-form');
|
||||
const chatInput = document.getElementById('chat-input');
|
||||
const chatMessages = document.getElementById('chat-messages');
|
||||
|
||||
const appendMessage = (text, sender) => {
|
||||
const msgDiv = document.createElement('div');
|
||||
msgDiv.classList.add('message', sender);
|
||||
msgDiv.textContent = text;
|
||||
chatMessages.appendChild(msgDiv);
|
||||
chatMessages.scrollTop = chatMessages.scrollHeight;
|
||||
};
|
||||
|
||||
chatForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const message = chatInput.value.trim();
|
||||
if (!message) return;
|
||||
|
||||
appendMessage(message, 'visitor');
|
||||
chatInput.value = '';
|
||||
|
||||
try {
|
||||
const response = await fetch('api/chat.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ message })
|
||||
});
|
||||
const data = await response.json();
|
||||
|
||||
// Artificial delay for realism
|
||||
setTimeout(() => {
|
||||
appendMessage(data.reply, 'bot');
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
appendMessage("Sorry, something went wrong. Please try again.", 'bot');
|
||||
}
|
||||
// Basic interaction for toasts
|
||||
const toasts = document.querySelectorAll('.toast');
|
||||
toasts.forEach(toastEl => {
|
||||
const toast = new bootstrap.Toast(toastEl, { delay: 5000 });
|
||||
toast.show();
|
||||
});
|
||||
});
|
||||
|
||||
// Lazy load or pre-fetch images if needed
|
||||
console.log('ApkNusa ready.');
|
||||
});
|
||||
174
index.php
174
index.php
@ -1,150 +1,32 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
spl_autoload_register(function ($class) {
|
||||
$prefix = 'App\\';
|
||||
$base_dir = __DIR__ . '/app/';
|
||||
|
||||
$len = strlen($prefix);
|
||||
if (strncmp($prefix, $class, $len) !== 0) {
|
||||
return;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
$relative_class = substr($class, $len);
|
||||
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
require $file;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
});
|
||||
|
||||
use App\Core\Router;
|
||||
|
||||
$router = new Router();
|
||||
|
||||
// Routes
|
||||
$router->add('GET', '/', ['App\Controllers\HomeController', 'index']);
|
||||
$router->add('GET', '/apk/{slug}', ['App\Controllers\ApkController', 'detail']);
|
||||
$router->add('GET', '/apk/{slug}/download', ['App\Controllers\ApkController', 'download']);
|
||||
|
||||
$method = $_SERVER['REQUEST_METHOD'];
|
||||
$uri = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$router->dispatch($method, $uri);
|
||||
130
views/apk_detail.php
Normal file
130
views/apk_detail.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/" class="text-success text-decoration-none">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="#" class="text-success text-decoration-none">Apps</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page"><?php echo $apk['title']; ?></li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="row g-5">
|
||||
<div class="col-lg-8">
|
||||
<div class="bg-white p-5 rounded-4 border-0 shadow-sm mb-5">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center align-items-md-start mb-5">
|
||||
<img src="<?php echo $apk['image_url']; ?>" class="rounded-4 me-md-5 mb-4 mb-md-0" width="160" height="160" alt="<?php echo $apk['title']; ?>">
|
||||
<div class="text-center text-md-start">
|
||||
<h1 class="display-5 fw-bold mb-2"><?php echo $apk['title']; ?> <span class="badge bg-light text-dark fs-6 fw-normal align-middle">v<?php echo $apk['version']; ?></span></h1>
|
||||
<p class="lead text-muted mb-4">Official and original version. Verified safe for Android device.</p>
|
||||
<div class="d-flex flex-wrap gap-2 justify-content-center justify-content-md-start mb-4">
|
||||
<span class="badge bg-success-subtle text-success px-3 py-2 rounded-pill fw-medium"><i class="bi bi-download me-1"></i> <?php echo number_format($apk['total_downloads']); ?> Downloads</span>
|
||||
<span class="badge bg-info-subtle text-info px-3 py-2 rounded-pill fw-medium"><i class="bi bi-shield-check me-1"></i> Verified Safe</span>
|
||||
<span class="badge bg-light text-dark px-3 py-2 rounded-pill fw-medium"><i class="bi bi-calendar3 me-1"></i> <?php echo date('M d, Y', strtotime($apk['created_at'])); ?></span>
|
||||
<?php if ($apk['is_vip']): ?>
|
||||
<span class="badge bg-warning-subtle text-warning px-3 py-2 rounded-pill fw-medium"><i class="bi bi-star-fill me-1"></i> VIP</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<a href="/apk/<?php echo $apk['slug']; ?>/download" class="btn btn-success btn-lg px-5 rounded-pill shadow-sm py-3 fw-bold w-100 w-md-auto mb-3">
|
||||
<i class="bi bi-download me-2"></i> Download APK Now
|
||||
</a>
|
||||
<p class="text-muted small">File size: ~45MB (approx.) | Android 6.0 or higher</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h4 class="fw-bold mb-4">Description</h4>
|
||||
<p class="text-muted"><?php echo nl2br(htmlspecialchars($apk['description'])); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="row g-4 mb-5">
|
||||
<div class="col-md-6">
|
||||
<div class="p-4 rounded-4 bg-light border-0">
|
||||
<h6 class="fw-bold mb-3">Main Features</h6>
|
||||
<ul class="list-unstyled mb-0 text-muted small">
|
||||
<li class="mb-2"><i class="bi bi-check-circle-fill text-success me-2"></i> Original APK from developer</li>
|
||||
<li class="mb-2"><i class="bi bi-check-circle-fill text-success me-2"></i> No extra files needed</li>
|
||||
<li class="mb-2"><i class="bi bi-check-circle-fill text-success me-2"></i> Fast and direct download</li>
|
||||
<li><i class="bi bi-check-circle-fill text-success me-2"></i> Regular updates included</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="p-4 rounded-4 bg-light border-0">
|
||||
<h6 class="fw-bold mb-3">System Requirements</h6>
|
||||
<ul class="list-unstyled mb-0 text-muted small">
|
||||
<li class="mb-2"><i class="bi bi-info-circle me-2"></i> Android 6.0+ (Marshmallow)</li>
|
||||
<li class="mb-2"><i class="bi bi-memory me-2"></i> 2GB RAM minimum recommended</li>
|
||||
<li class="mb-2"><i class="bi bi-hdd-network me-2"></i> Stable internet connection</li>
|
||||
<li><i class="bi bi-cpu me-2"></i> ARMv8 or newer processor</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center p-4 rounded-4 bg-success bg-opacity-10">
|
||||
<h6 class="fw-bold mb-3">Is this safe to download?</h6>
|
||||
<p class="text-muted small mb-0">Yes, every APK on ApkNusa is scanned for malware and verified to ensure it is the original, unmodified file from the developer.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="position-sticky" style="top: 2rem;">
|
||||
<div class="bg-white p-4 rounded-4 border-0 shadow-sm mb-4">
|
||||
<h5 class="fw-bold mb-4">Popular Similar Apps</h5>
|
||||
<div class="vstack gap-4">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<img src="https://img.icons8.com/color/144/facebook-new.png" class="rounded-3" width="48" height="48" alt="Facebook">
|
||||
<div>
|
||||
<h6 class="fw-bold mb-0">Facebook</h6>
|
||||
<span class="text-muted small">Social Media</span>
|
||||
</div>
|
||||
<a href="#" class="btn btn-light btn-sm ms-auto rounded-pill px-3 fw-medium">View</a>
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<img src="https://img.icons8.com/color/144/tiktok.png" class="rounded-3" width="48" height="48" alt="TikTok">
|
||||
<div>
|
||||
<h6 class="fw-bold mb-0">TikTok</h6>
|
||||
<span class="text-muted small">Entertainment</span>
|
||||
</div>
|
||||
<a href="#" class="btn btn-light btn-sm ms-auto rounded-pill px-3 fw-medium">View</a>
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<img src="https://img.icons8.com/color/144/youtube-play.png" class="rounded-3" width="48" height="48" alt="YouTube">
|
||||
<div>
|
||||
<h6 class="fw-bold mb-0">YouTube</h6>
|
||||
<span class="text-muted small">Video Player</span>
|
||||
</div>
|
||||
<a href="#" class="btn btn-light btn-sm ms-auto rounded-pill px-3 fw-medium">View</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-4 opacity-10">
|
||||
<a href="#" class="btn btn-outline-success w-100 rounded-pill fw-medium">See all Apps</a>
|
||||
</div>
|
||||
|
||||
<div class="bg-success text-white p-4 rounded-4 border-0 shadow-sm text-center">
|
||||
<i class="bi bi-trophy display-4 mb-3"></i>
|
||||
<h5 class="fw-bold mb-3">Join our community</h5>
|
||||
<p class="small text-white-50 mb-4">Register today to enjoy premium features, earn rewards, and track your download history.</p>
|
||||
<a href="/register" class="btn btn-white text-success fw-bold w-100 rounded-pill py-2">Join Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($_GET['downloaded'])): ?>
|
||||
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
|
||||
<div id="liveToast" class="toast show bg-success text-white" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="d-flex">
|
||||
<div class="toast-body">
|
||||
<i class="bi bi-check-circle-fill me-2"></i> Download started successfully!
|
||||
</div>
|
||||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
57
views/footer.php
Normal file
57
views/footer.php
Normal file
@ -0,0 +1,57 @@
|
||||
</main>
|
||||
<footer class="bg-white border-top py-5">
|
||||
<div class="container">
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-4">
|
||||
<a class="navbar-brand fw-bold text-success" href="/">
|
||||
<i class="bi bi-robot"></i> ApkNusa
|
||||
</a>
|
||||
<p class="text-muted mt-3 pe-lg-5">
|
||||
ApkNusa is your premier source for professional APK downloads, offering the latest and safest Android applications and games.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-6 col-lg-2">
|
||||
<h6 class="fw-bold mb-3">Popular</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="#" class="text-muted text-decoration-none py-1 d-block small">Top Games</a></li>
|
||||
<li><a href="#" class="text-muted text-decoration-none py-1 d-block small">Top Apps</a></li>
|
||||
<li><a href="#" class="text-muted text-decoration-none py-1 d-block small">New Releases</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6 col-lg-2">
|
||||
<h6 class="fw-bold mb-3">Resources</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="#" class="text-muted text-decoration-none py-1 d-block small">Support Center</a></li>
|
||||
<li><a href="#" class="text-muted text-decoration-none py-1 d-block small">Terms of Service</a></li>
|
||||
<li><a href="#" class="text-muted text-decoration-none py-1 d-block small">Privacy Policy</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<h6 class="fw-bold mb-3">Subscribe</h6>
|
||||
<p class="text-muted small">Stay updated with the latest APK releases.</p>
|
||||
<div class="input-group">
|
||||
<input type="email" class="form-control border-light-subtle" placeholder="Your email address">
|
||||
<button class="btn btn-success px-3" type="button">Subscribe</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-5 text-black-50 opacity-25">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6 text-center text-md-start">
|
||||
<span class="text-muted small">© <?php echo date('Y'); ?> ApkNusa. All rights reserved.</span>
|
||||
</div>
|
||||
<div class="col-md-6 text-center text-md-end mt-3 mt-md-0">
|
||||
<div class="d-flex justify-content-center justify-content-md-end gap-3">
|
||||
<a href="#" class="text-muted"><i class="bi bi-facebook"></i></a>
|
||||
<a href="#" class="text-muted"><i class="bi bi-twitter-x"></i></a>
|
||||
<a href="#" class="text-muted"><i class="bi bi-instagram"></i></a>
|
||||
<a href="#" class="text-muted"><i class="bi bi-github"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
48
views/header.php
Normal file
48
views/header.php
Normal file
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo $title ?? 'ApkNusa'; ?></title>
|
||||
<meta name="description" content="<?php echo $_SERVER['PROJECT_DESCRIPTION'] ?? 'Download Professional APKs with ApkNusa.'; ?>">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/assets/css/custom.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom py-3">
|
||||
<div class="container">
|
||||
<a class="navbar-brand fw-bold text-success" href="/">
|
||||
<i class="bi bi-robot"></i> ApkNusa
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto align-items-center">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3" href="/">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3" href="#">Games</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3" href="#">Apps</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3" href="#">Categories</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-3">
|
||||
<a class="btn btn-outline-dark rounded-pill px-4" href="/login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-2">
|
||||
<a class="btn btn-success rounded-pill px-4" href="/register">Join Free</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<main class="py-5">
|
||||
66
views/home.php
Normal file
66
views/home.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<div class="container">
|
||||
<div class="row align-items-center mb-5">
|
||||
<div class="col-lg-7">
|
||||
<h1 class="display-4 fw-bold mb-3">Download the Best <span class="text-success">Android APKs</span> Professionally</h1>
|
||||
<p class="lead text-muted mb-4">Fast, safe, and secure downloads for your favorite mobile apps and games. No registration required to browse.</p>
|
||||
<div class="d-flex gap-2">
|
||||
<a href="#" class="btn btn-success btn-lg px-4 rounded-pill">Explore Apps</a>
|
||||
<a href="#" class="btn btn-outline-dark btn-lg px-4 rounded-pill">Top Games</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5 d-none d-lg-block">
|
||||
<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">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="mb-5">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2 class="fw-bold mb-0">Latest Releases</h2>
|
||||
<a href="#" class="text-success text-decoration-none fw-medium">View All <i class="bi bi-arrow-right"></i></a>
|
||||
</div>
|
||||
<div class="row g-4">
|
||||
<?php foreach ($apks as $apk): ?>
|
||||
<div class="col-md-6 col-lg-4 col-xl-3">
|
||||
<div class="card h-100 border-0 shadow-sm rounded-4 hover-lift">
|
||||
<div class="card-body p-4">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<img src="<?php echo $apk['image_url']; ?>" class="rounded-3 me-3" width="60" height="60" alt="<?php echo $apk['title']; ?>">
|
||||
<div>
|
||||
<h5 class="card-title fw-bold mb-0 text-truncate" style="max-width: 150px;"><?php echo $apk['title']; ?></h5>
|
||||
<span class="badge bg-light text-dark fw-normal">v<?php echo $apk['version']; ?></span>
|
||||
<?php if ($apk['is_vip']): ?>
|
||||
<span class="badge bg-warning text-dark ms-1"><i class="bi bi-star-fill"></i> VIP</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<p class="card-text text-muted small mb-4 line-clamp-2"><?php echo $apk['description']; ?></p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted small"><i class="bi bi-download me-1"></i> <?php echo number_format($apk['total_downloads']); ?></span>
|
||||
<a href="/apk/<?php echo $apk['slug']; ?>" class="btn btn-light rounded-pill px-3 btn-sm fw-medium">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</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">Start your referral journey today</h2>
|
||||
<p class="mb-0 text-white-50">Join our community, share your favorite APKs, and earn reward points for every successful referral download.</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">Get Started</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
Loading…
x
Reference in New Issue
Block a user