Skip to content

Commit b440d79

Browse files
committed
Fix artwork image visibility in art gallery
- Correct z-index layering: placeholder (z-0), image (z-10), hover overlay (z-20) - Fix positioning: both placeholder and image use absolute inset-0 - Improve transitions: use opacity fade instead of display toggle - Consolidate image styling for consistent rendering Images now display properly with smooth loading transitions.
1 parent 5c9c356 commit b440d79

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

art.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,17 @@ <h2 class="text-2xl font-light text-gray-800 mb-2">${collection.title}</h2>
355355
// Create card with placeholder first
356356
artworkCard.innerHTML = `
357357
<div class="relative overflow-hidden">
358-
<div class="image-placeholder" id="placeholder-${index}">
358+
<div class="image-placeholder absolute inset-0 z-0" id="placeholder-${index}">
359359
<i class="fas fa-image text-gray-400 text-2xl"></i>
360360
</div>
361361
<img src="${artwork.primaryImageSmall}"
362362
alt="${altText}"
363-
class="artwork-image"
363+
class="artwork-image absolute inset-0 w-full h-64 object-cover z-10"
364364
loading="lazy"
365-
style="opacity: 0; position: absolute; top: 0; left: 0; transition: opacity 0.5s ease;"
366-
onload="this.style.opacity='1'; document.getElementById('placeholder-${index}').style.display='none';"
365+
style="opacity: 0; transition: opacity 0.5s ease;"
366+
onload="this.style.opacity='1'; document.getElementById('placeholder-${index}').style.opacity='0';"
367367
onerror="this.closest('.artwork-card').style.display='none';">
368-
<div class="absolute inset-0 bg-gradient-to-t from-black/20 to-transparent opacity-0 hover:opacity-100 transition-opacity duration-300"></div>
368+
<div class="absolute inset-0 bg-gradient-to-t from-black/20 to-transparent opacity-0 hover:opacity-100 transition-opacity duration-300 z-20"></div>
369369
</div>
370370
<div class="p-4">
371371
<h3 class="font-semibold text-gray-800 text-sm mb-1 line-clamp-2">${title}</h3>

0 commit comments

Comments
 (0)