Improve photo gallery with artist names and infinite scrolling
Refactor photo gallery to include artist names extracted from filenames, implement pagination with infinite scrolling, and optimize image loading. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 79e0a082-1752-4a36-8483-997b7269c4f3 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/nFw7xof Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -18,6 +18,17 @@ interface GalleryImage {
|
||||
thumb: string;
|
||||
large: string;
|
||||
full: string;
|
||||
artist: string;
|
||||
}
|
||||
|
||||
function extractArtistFromFileName(fileName: string): string {
|
||||
if (/^DSC\d/i.test(fileName) || /^IMG[\s_]\d/i.test(fileName)) return "";
|
||||
const withoutExt = fileName.replace(/\.\w+$/, "");
|
||||
const cleaned = withoutExt
|
||||
.replace(/\s*\(\d+\)\s*$/, "")
|
||||
.replace(/\s*\d+\s*$/, "")
|
||||
.replace(/\s*\(\d+\)\s*$/, "");
|
||||
return cleaned.trim();
|
||||
}
|
||||
|
||||
function getAppKey(): string {
|
||||
@@ -237,6 +248,7 @@ export async function fetchGalleryFromDropbox(): Promise<GalleryImage[]> {
|
||||
thumb: link,
|
||||
large: link,
|
||||
full: link,
|
||||
artist: extractArtistFromFileName(file.name),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user