Update gallery images to use optimized Cloudinary URLs and portrait aspect ratio
Replaces Dropbox links with Cloudinary URLs, updates image aspect ratio to 9:16 for portrait display, and optimizes image loading in the gallery component and data. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1f7e7e89-a520-4970-9645-37daadc466dc Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: e9285bb1-8736-4b8d-ad7c-317df87a118d Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/1f7e7e89-a520-4970-9645-37daadc466dc/tSWS0WO Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
eb521f24e2
commit
0342071510
@ -13,6 +13,7 @@ interface GalleryImage {
|
|||||||
const PAGE_SIZE = 24;
|
const PAGE_SIZE = 24;
|
||||||
|
|
||||||
function thumbUrl(src: string) {
|
function thumbUrl(src: string) {
|
||||||
|
if (src.includes("res.cloudinary.com")) return src;
|
||||||
return `/api/gallery/thumb?src=${encodeURIComponent(src)}`;
|
return `/api/gallery/thumb?src=${encodeURIComponent(src)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +322,7 @@ export default function GalleryPage() {
|
|||||||
className="group relative rounded-lg overflow-hidden bg-card border border-card-border cursor-pointer flex flex-col"
|
className="group relative rounded-lg overflow-hidden bg-card border border-card-border cursor-pointer flex flex-col"
|
||||||
data-testid={`button-gallery-image-${i}`}
|
data-testid={`button-gallery-image-${i}`}
|
||||||
>
|
>
|
||||||
<div className="relative aspect-square w-full">
|
<div className="relative w-full" style={{ aspectRatio: "9/16" }}>
|
||||||
<LazyImage
|
<LazyImage
|
||||||
src={thumbUrl(img.thumb)}
|
src={thumbUrl(img.thumb)}
|
||||||
alt={img.artist || img.fileName}
|
alt={img.artist || img.fileName}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -353,7 +353,7 @@ export async function registerRoutes(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Gallery API - serves shuffled photos from Dropbox
|
// Gallery API - serves photos from Cloudinary (gallery-data.json)
|
||||||
const folderArtists: Record<string, string> = {
|
const folderArtists: Record<string, string> = {
|
||||||
"2": "Folx Stadl",
|
"2": "Folx Stadl",
|
||||||
"3": "Folx Stadl",
|
"3": "Folx Stadl",
|
||||||
@ -364,16 +364,8 @@ export async function registerRoutes(
|
|||||||
|
|
||||||
app.get("/api/gallery", async (req, res) => {
|
app.get("/api/gallery", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
let data: any[] = [];
|
const galleryPath = path.join(process.cwd(), "server/gallery-data.json");
|
||||||
|
let data: any[] = JSON.parse(fs.readFileSync(galleryPath, "utf-8"));
|
||||||
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"));
|
|
||||||
}
|
|
||||||
|
|
||||||
data = data.map((img: any) => {
|
data = data.map((img: any) => {
|
||||||
if (!img.artist && folderArtists[img.folder]) {
|
if (!img.artist && folderArtists[img.folder]) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user