Add mobile image display and optimize gallery loading
Update gallery component to conditionally load mobile-optimized images for smaller screens and refactor Dropbox integration to fetch images from separate desktop and mobile folders. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1f7e7e89-a520-4970-9645-37daadc466dc Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 047c052f-7045-4b74-a78d-c75e84aaddd0 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/1f7e7e89-a520-4970-9645-37daadc466dc/5JDNRWP Replit-Helium-Checkpoint-Created: true
This commit is contained in:
+10
-17
@@ -353,26 +353,19 @@ export async function registerRoutes(
|
||||
}
|
||||
});
|
||||
|
||||
// Gallery API - serves photos from Cloudinary (gallery-data.json)
|
||||
const folderArtists: Record<string, string> = {
|
||||
"2": "Folx Stadl",
|
||||
"3": "Folx Stadl",
|
||||
"4": "Folx Stadl",
|
||||
"5": "Folx Stadl",
|
||||
"6": "Folx Stadl",
|
||||
};
|
||||
|
||||
// Gallery API - serves optimized photos from Dropbox
|
||||
app.get("/api/gallery", async (req, res) => {
|
||||
try {
|
||||
const galleryPath = path.join(process.cwd(), "server/gallery-data.json");
|
||||
let data: any[] = JSON.parse(fs.readFileSync(galleryPath, "utf-8"));
|
||||
let data: any[] = [];
|
||||
|
||||
data = data.map((img: any) => {
|
||||
if (!img.artist && folderArtists[img.folder]) {
|
||||
return { ...img, artist: folderArtists[img.folder] };
|
||||
}
|
||||
return img;
|
||||
});
|
||||
if (isConnected()) {
|
||||
data = await fetchGalleryFromDropbox();
|
||||
}
|
||||
|
||||
if (data.length === 0) {
|
||||
const galleryPath = path.join(process.cwd(), "server/gallery-data.json");
|
||||
data = JSON.parse(fs.readFileSync(galleryPath, "utf-8"));
|
||||
}
|
||||
|
||||
const shuffled = [...data];
|
||||
for (let i = shuffled.length - 1; i > 0; i--) {
|
||||
|
||||
Reference in New Issue
Block a user