feat: Add image descriptions to Slideshow and Public views
- Slideshow: Display imageDescription below image (centered overlay) - PublicGroupImagesPage: Show descriptions in single-image mode - ImageGalleryCard: Support description display in single-image mode Phase 5-6 complete: Slideshow + Public Display Integration
This commit is contained in:
parent
292d25f5b4
commit
8323cec156
|
|
@ -159,7 +159,7 @@ const ImageGalleryCard = ({
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Display-only mode: Show existing description */}
|
{/* Display-only mode: Show existing description */}
|
||||||
{!isEditMode && imageDescription && mode === 'preview' && (
|
{!isEditMode && imageDescription && (mode === 'preview' || mode === 'single-image') && (
|
||||||
<div className="image-description-display">
|
<div className="image-description-display">
|
||||||
<em>{imageDescription}</em>
|
<em>{imageDescription}</em>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ const PublicGroupImagesPage = () => {
|
||||||
|
|
||||||
<ImageGallery
|
<ImageGallery
|
||||||
items={group.images && group.images.length > 0 ? group.images.map(img => ({
|
items={group.images && group.images.length > 0 ? group.images.map(img => ({
|
||||||
...img, // Pass all image fields including previewPath
|
...img, // Pass all image fields including previewPath and imageDescription
|
||||||
remoteUrl: `/download/${img.fileName}`, // Keep for backward compatibility
|
remoteUrl: `/download/${img.fileName}`, // Keep for backward compatibility
|
||||||
originalName: img.originalName || img.fileName,
|
originalName: img.originalName || img.fileName,
|
||||||
id: img.id
|
id: img.id
|
||||||
|
|
@ -61,6 +61,13 @@ const PublicGroupImagesPage = () => {
|
||||||
enableReordering={false}
|
enableReordering={false}
|
||||||
mode="single-image"
|
mode="single-image"
|
||||||
emptyMessage="Keine Bilder in dieser Gruppe."
|
emptyMessage="Keine Bilder in dieser Gruppe."
|
||||||
|
imageDescriptions={group.images && group.images.length > 0 ?
|
||||||
|
group.images.reduce((acc, img) => {
|
||||||
|
if (img.imageDescription) {
|
||||||
|
acc[img.id] = img.imageDescription;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {}) : {}}
|
||||||
/>
|
/>
|
||||||
</Container>
|
</Container>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,28 @@ function SlideshowPage() {
|
||||||
transition: `opacity ${TRANSITION_TIME}ms ease-in-out`
|
transition: `opacity ${TRANSITION_TIME}ms ease-in-out`
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const imageDescriptionSx = {
|
||||||
|
position: 'fixed',
|
||||||
|
bottom: '140px',
|
||||||
|
left: '50%',
|
||||||
|
transform: 'translateX(-50%)',
|
||||||
|
backgroundColor: 'rgba(0,0,0,0.7)',
|
||||||
|
p: '15px 30px',
|
||||||
|
borderRadius: '8px',
|
||||||
|
maxWidth: '80%',
|
||||||
|
textAlign: 'center',
|
||||||
|
backdropFilter: 'blur(5px)',
|
||||||
|
zIndex: 10002
|
||||||
|
};
|
||||||
|
|
||||||
|
const imageDescriptionTextSx = {
|
||||||
|
color: 'white',
|
||||||
|
fontSize: '18px',
|
||||||
|
margin: 0,
|
||||||
|
lineHeight: 1.4,
|
||||||
|
fontFamily: 'roboto'
|
||||||
|
};
|
||||||
|
|
||||||
const descriptionContainerSx = {
|
const descriptionContainerSx = {
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
left: 40,
|
left: 40,
|
||||||
|
|
@ -231,6 +253,13 @@ function SlideshowPage() {
|
||||||
{/* Hauptbild */}
|
{/* Hauptbild */}
|
||||||
<Box component="img" src={getImageSrc(currentImage, false)} alt={currentImage.originalName} sx={{ ...slideshowImageSx, opacity: fadeOut ? 0 : 1 }} />
|
<Box component="img" src={getImageSrc(currentImage, false)} alt={currentImage.originalName} sx={{ ...slideshowImageSx, opacity: fadeOut ? 0 : 1 }} />
|
||||||
|
|
||||||
|
{/* Bildbeschreibung (wenn vorhanden) */}
|
||||||
|
{currentImage.imageDescription && (
|
||||||
|
<Box sx={imageDescriptionSx}>
|
||||||
|
<Typography sx={imageDescriptionTextSx}>{currentImage.imageDescription}</Typography>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Beschreibung */}
|
{/* Beschreibung */}
|
||||||
<Box sx={descriptionContainerSx}>
|
<Box sx={descriptionContainerSx}>
|
||||||
{/* Titel */}
|
{/* Titel */}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user