Update -> refactor and optimize UI , code ,...

This commit is contained in:
2026-04-10 11:35:25 +03:30
parent 3327207f05
commit 0de951fd91
20 changed files with 1085 additions and 282 deletions

21
public/router.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
$uri = $_SERVER['REQUEST_URI'];
$path = parse_url($uri, PHP_URL_PATH);
// Strip trailing slash
$path = rtrim($path, '/') ?: '/';
// Route: /view/{id}
if (preg_match('#^/view/([a-f0-9]+)$#i', $path, $m)) {
$_GET['id'] = $m[1];
require __DIR__ . '/view.php';
exit;
}
// Route: static assets
if (preg_match('#\.(css|js|png|jpg|ico|svg|woff2?)$#', $path)) {
return false; // let PHP built-in server serve the file
}
// Route: / or /index.php
require __DIR__ . '/index.php';