update elements to tailwindcss ui

This commit is contained in:
2024-08-29 20:18:25 -05:00
parent 67af774f47
commit 26c19849ad
12 changed files with 291 additions and 130 deletions

View File

@@ -21,14 +21,12 @@ if (!file_exists('../' . $_ENV['DB_FILE_PATH'])) {
$dbFilePath = '../' . $_ENV['DB_FILE_PATH'];
$database = new Database($dbFilePath);
$albumClass = new Album($database);
$galleryClass = new Gallery($database);
$requestUri = trim($_SERVER['REQUEST_URI'], '/');
$requestParts = explode('/', $requestUri);
if ($requestParts[0] === 'gallery' && isset($requestParts[1])) {
// Gallery view
$galleryClass = new Gallery($database);
$album = urldecode($requestParts[1]);
$page = isset($requestParts[2]) ? (int)$requestParts[2] : 1;
@@ -48,18 +46,29 @@ if ($requestParts[0] === 'gallery' && isset($requestParts[1])) {
$startPage = max(1, $page - floor($paginationRange / 2));
$endPage = min($totalPages, $startPage + $paginationRange - 1);
include '../src/views/header.phtml';
$pageType = 'gallery';
include '../src/views/menubar.phtml';
// Render gallery view
include '../src/views/gallery.phtml';
include '../src/views/footer.phtml';
} else {
// Album view
$albumClass = new Album($database);
$albums = $albumClass->getAlbums();
$albumPreviews = [];
foreach ($albums as $album) {
$albumPreviews[$album] = $albumClass->getAlbumPreview($album);
}
$album = 'Album List';
include '../src/views/header.phtml';
$pageType = 'album';
include '../src/views/menubar.phtml';
// Render album view
include '../src/views/albums.phtml';
include '../src/views/footer.phtml';
}
?>