Compare commits

...

1 Commits

Author SHA1 Message Date
Flatlogic Bot
eb400ea536 Auto commit: 2025-11-23T18:39:57.826Z 2025-11-23 18:39:57 +00:00
70 changed files with 499 additions and 141 deletions

112
api/import.php Normal file
View File

@ -0,0 +1,112 @@
<?php
require_once __DIR__ . '/../db/config.php';
header('Content-Type: application/json');
$response = [
'success' => false,
'files' => [],
'errors' => []
];
function getUploadErrorMessage($errorCode) {
switch ($errorCode) {
case UPLOAD_ERR_INI_SIZE:
return 'The uploaded file exceeds the upload_max_filesize directive in php.ini.';
case UPLOAD_ERR_FORM_SIZE:
return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.';
case UPLOAD_ERR_PARTIAL:
return 'The uploaded file was only partially uploaded.';
case UPLOAD_ERR_NO_FILE:
return 'No file was uploaded.';
case UPLOAD_ERR_NO_TMP_DIR:
return 'Missing a temporary folder.';
case UPLOAD_ERR_CANT_WRITE:
return 'Failed to write file to disk.';
case UPLOAD_ERR_EXTENSION:
return 'A PHP extension stopped the file upload.';
default:
return 'Unknown upload error.';
}
}
if (!isset($_FILES['photos'])) {
$response['errors'][] = 'No files were sent. The key "photos" is missing from the request.';
echo json_encode($response);
exit;
}
$upload_dir = __DIR__ . '/../assets/uploads/';
if (!is_dir($upload_dir)) {
if (!mkdir($upload_dir, 0775, true)) {
$response['errors'][] = 'Failed to create upload directory: ' . $upload_dir;
echo json_encode($response);
exit;
}
}
if (!is_writable($upload_dir)) {
$response['errors'][] = 'The upload directory is not writable: ' . $upload_dir;
echo json_encode($response);
exit;
}
$files = $_FILES['photos'];
$file_count = count($files['name']);
$successful_uploads = 0;
try {
$pdo = db();
$stmt = $pdo->prepare(
'INSERT INTO photos (filename, filepath, filesize) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE updated_at = CURRENT_TIMESTAMP'
);
} catch (PDOException $e) {
$response['errors'][] = 'Database connection failed: ' . $e->getMessage();
error_log('DB Connection Error: ' . $e->getMessage());
echo json_encode($response);
exit;
}
for ($i = 0; $i < $file_count; $i++) {
$errorCode = $files['error'][$i];
$filename = basename($files['name'][$i]);
if ($errorCode !== UPLOAD_ERR_OK) {
$response['errors'][] = "Error uploading '$filename': " . getUploadErrorMessage($errorCode);
continue;
}
$filepath = $upload_dir . $filename;
$relative_path = 'assets/uploads/' . $filename;
if (!move_uploaded_file($files['tmp_name'][$i], $filepath)) {
$response['errors'][] = "Failed to move uploaded file '$filename'. Check permissions and paths.";
continue;
}
try {
$stmt->execute([$filename, $relative_path, $files['size'][$i]]);
$response['files'][] = [
'filename' => $filename,
'filepath' => $relative_path
];
$successful_uploads++;
} catch (PDOException $e) {
$response['errors'][] = "Failed to save file '$filename' to database: " . $e->getMessage();
error_log("DB Insert Error for $filename: " . $e->getMessage());
// Optionally, delete the file if DB insert fails
// unlink($filepath);
}
}
if ($successful_uploads > 0) {
$response['success'] = true;
}
if ($successful_uploads < $file_count) {
$response['success'] = false; // Mark as failure if any file failed
}
echo json_encode($response);

33
api/pexels.php Normal file
View File

@ -0,0 +1,33 @@
<?php
header('Content-Type: application/json');
require_once __DIR__.'/../includes/pexels.php';
$qs = isset($_GET['queries']) ? explode(',', $_GET['queries']) : ['person,face','city,street','nature,mountain','animal,cat','food,pizza'];
$out = [];
foreach ($qs as $q) {
$u = 'https://api.pexels.com/v1/search?query=' . urlencode(trim($q)) . '&orientation=square&per_page=3&page=1';
$d = pexels_get($u);
if ($d && !empty($d['photos'])) {
foreach($d['photos'] as $p) {
$src = $p['src']['large'] ?? null;
$dest = __DIR__.'/../assets/images/pexels/'.$p['id'].'.jpg';
if ($src && !file_exists($dest)) {
download_to($src, $dest);
}
$out[] = [
'src' => 'assets/images/pexels/'.$p['id'].'.jpg',
'photographer' => $p['photographer'] ?? 'Unknown',
'photographer_url' => $p['photographer_url'] ?? '',
'alt' => $p['alt'] ?? 'Photo by '.$p['photographer'],
];
}
} else {
// Fallback: Picsum
$out[] = [
'src' => 'https://picsum.photos/600/600',
'photographer' => 'Random Picsum',
'photographer_url' => 'https://picsum.photos/',
'alt' => 'Random placeholder image'
];
}
}
echo json_encode($out);

113
assets/css/custom.css Normal file
View File

@ -0,0 +1,113 @@
/* General Styles */
body {
font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
transition: background-color 0.3s, color 0.3s;
}
:root {
--light-bg: #FFFFFF;
--light-surface: #F8F9FA;
--light-text-primary: #212529;
--light-text-secondary: #6C757D;
--dark-bg: #121212;
--dark-surface: #1E1E1E;
--dark-text-primary: #E9ECEF;
--dark-text-secondary: #ADB5BD;
--accent-color: #0D6EFD;
}
body.light-theme {
background-color: var(--light-bg);
color: var(--light-text-primary);
}
body.dark-theme {
background-color: var(--dark-bg);
color: var(--dark-text-primary);
}
/* Layout */
.main-container {
display: flex;
height: 100vh;
}
.sidebar {
width: 250px;
flex-shrink: 0;
padding: 1rem;
border-right: 1px solid #dee2e6;
}
body.light-theme .sidebar {
background-color: var(--light-surface);
border-right: 1px solid #dee2e6;
}
body.dark-theme .sidebar {
background-color: var(--dark-surface);
border-right: 1px solid #343a40;
}
.main-content {
flex-grow: 1;
padding: 1rem;
overflow-y: auto;
}
/* Sidebar */
.sidebar h4 {
font-size: 1.1rem;
font-weight: 600;
}
.sidebar .nav-link {
color: var(--light-text-secondary);
}
body.dark-theme .sidebar .nav-link {
color: var(--dark-text-secondary);
}
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
color: var(--accent-color);
}
/* Header */
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
/* Search Bar */
.search-bar {
flex-grow: 1;
margin-right: 1rem;
}
/* Gallery */
.photo-gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1rem;
}
.photo-item img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 0.25rem;
transition: transform 0.2s;
}
.photo-item img:hover {
transform: scale(1.05);
}
/* Theme switcher */
.theme-switcher {
cursor: pointer;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

92
assets/js/main.js Normal file
View File

@ -0,0 +1,92 @@
document.addEventListener('DOMContentLoaded', () => {
const themeSwitcher = document.getElementById('theme-switcher');
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
if (currentTheme) {
document.body.classList.add(currentTheme);
if (currentTheme === 'dark-theme') {
themeSwitcher.innerHTML = '<i class="bi bi-sun-fill"></i>';
} else {
themeSwitcher.innerHTML = '<i class="bi bi-moon-fill"></i>';
}
} else {
// Default to light
document.body.classList.add('light-theme');
themeSwitcher.innerHTML = '<i class="bi bi-moon-fill"></i>';
}
themeSwitcher.addEventListener('click', () => {
if (document.body.classList.contains('dark-theme')) {
document.body.classList.remove('dark-theme');
document.body.classList.add('light-theme');
localStorage.setItem('theme', 'light-theme');
themeSwitcher.innerHTML = '<i class="bi bi-moon-fill"></i>';
} else {
document.body.classList.remove('light-theme');
document.body.classList.add('dark-theme');
localStorage.setItem('theme', 'dark-theme');
themeSwitcher.innerHTML = '<i class="bi bi-sun-fill"></i>';
}
});
// Folder import functionality
const importFolderBtn = document.getElementById('import-folder-btn');
const folderInput = document.getElementById('folder-input');
const photoGallery = document.querySelector('.photo-gallery');
if (importFolderBtn && folderInput && photoGallery) {
importFolderBtn.addEventListener('click', () => {
folderInput.click();
});
folderInput.addEventListener('change', (event) => {
const files = event.target.files;
if (files.length > 0) {
const formData = new FormData();
const imageFiles = Array.from(files).filter(file => file.type.startsWith('image/'));
if (imageFiles.length > 0) {
imageFiles.forEach(file => {
formData.append('photos[]', file);
});
// Show a loading indicator
photoGallery.innerHTML = '<div class="col"><p>Uploading...</p></div>';
fetch('api/import.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
console.log('Server response:', data); // Log the full response
photoGallery.innerHTML = ''; // Clear loading indicator
if (data.success && data.files.length > 0) {
// On success, refresh the page to show all images from the DB
window.location.reload();
} else {
let errorMessages = 'Upload failed. Please try again.';
if (data.errors && data.errors.length > 0) {
// Create a list of error messages
errorMessages = '<ul>';
data.errors.forEach(err => {
errorMessages += `<li>${err}</li>`;
});
errorMessages += '</ul>';
}
photoGallery.innerHTML = `<div class="col"><p><strong>Upload Failed:</strong></p>${errorMessages}</div>`;
}
})
.catch(error => {
console.error('Error uploading files:', error);
photoGallery.innerHTML = '<div class="col"><p>An error occurred during upload. Check the browser console for details.</p></div>';
});
} else {
photoGallery.innerHTML = '<div class="col"><p>No images found in the selected folder.</p></div>';
}
}
});
}
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,24 @@
<?php
require_once __DIR__ . '/../config.php';
try {
$pdo = db();
$sql = "
CREATE TABLE IF NOT EXISTS `photos` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`filename` VARCHAR(255) NOT NULL,
`filepath` VARCHAR(1024) NOT NULL,
`thumbnail_path` VARCHAR(1024),
`filesize` INT,
`width` INT,
`height` INT,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `filepath_idx` (`filepath`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
";
$pdo->exec($sql);
echo "Table 'photos' created successfully." . PHP_EOL;
} catch (PDOException $e) {
die("DB ERROR: " . $e->getMessage());
}

26
includes/pexels.php Normal file
View File

@ -0,0 +1,26 @@
<?php
// includes/pexels.php
function pexels_key() {
$k = getenv('PEXELS_KEY');
return $k && strlen($k) > 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
}
function pexels_get($url) {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ],
CURLOPT_TIMEOUT => 15,
]);
$resp = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true);
return null;
}
function download_to($srcUrl, $destPath) {
$data = file_get_contents($srcUrl);
if ($data === false) return false;
if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true);
return file_put_contents($destPath, $data) !== false;
}

240
index.php
View File

@ -1,150 +1,108 @@
<?php <?php
declare(strict_types=1); require_once __DIR__ . '/db/config.php';
@ini_set('display_errors', '1');
@error_reporting(E_ALL); try {
@date_default_timezone_set('UTC'); $pdo = db();
$stmt = $pdo->query('SELECT * FROM photos ORDER BY created_at DESC');
$images = $stmt->fetchAll();
} catch (PDOException $e) {
// Handle DB error
$images = [];
// You might want to log an error here
}
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
?> ?>
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Style</title> <title><?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'Photo App'); ?></title>
<?php <meta name="description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'A Windows photos app like Google Photos'); ?>">
// Read project preview data from environment
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? ''; <!-- Bootstrap CSS -->
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
?> <!-- Bootstrap Icons -->
<?php if ($projectDescription): ?> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<!-- Meta description -->
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' /> <!-- Custom CSS -->
<!-- Open Graph meta tags --> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<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);
}
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;
}
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> </head>
<body> <body class="light-theme">
<main>
<div class="card"> <div class="main-container">
<h1>Analyzing your requirements and generating your website…</h1> <aside class="sidebar">
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes"> <h4 class="mb-4">My Photos</h4>
<span class="sr-only">Loading…</span>
</div> <div class="px-3 mb-3">
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p> <button id="import-folder-btn" class="btn btn-primary w-100"><i class="bi bi-folder-plus me-2"></i> Import Folder</button>
<p class="hint">This page will update automatically as the plan is implemented.</p> <input type="file" id="folder-input" webkitdirectory directory multiple style="display: none;" />
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p> </div>
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#"><i class="bi bi-image me-2"></i> Photos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="bi bi-star me-2"></i> Favorites</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="bi bi-images me-2"></i> Albums</a>
</li>
</ul>
<hr>
<h6>Filters</h6>
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" href="#"><i class="bi bi-people me-2"></i> Faces</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="bi bi-geo-alt me-2"></i> Places</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="bi bi-tag me-2"></i> Things</a>
</li>
</ul>
<div class="position-absolute bottom-0 mb-3">
<a class="nav-link" href="#"><i class="bi bi-gear me-2"></i> Settings</a>
</div>
</aside>
<main class="main-content">
<header class="header">
<div class="search-bar">
<input type="search" class="form-control" placeholder="Search photos, people, places...">
</div>
<div class="d-flex align-items-center">
<div id="theme-switcher" class="theme-switcher fs-4">
<i class="bi bi-moon-fill"></i>
</div>
</div>
</header>
<div class="photo-gallery">
<?php if (!empty($images)):
foreach ($images as $image):
?>
<div class="photo-item">
<img src="<?php echo htmlspecialchars($image['filepath']); ?>" alt="<?php echo htmlspecialchars($image['filename']); ?>" loading="lazy">
</div>
<?php
endforeach;
else:
?>
<div class="col">
<p>No images found. Please import photos to see them here.</p>
</div>
<?php endif; ?>
</div>
</main>
</div> </div>
</main>
<footer> <!-- Custom JS -->
Page updated: <?= htmlspecialchars($now) ?> (UTC) <script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</footer>
</body> </body>
</html> </html>