分享页: 照片按时间倒序、统一间距、卡片右下角显示日期与城市

This commit is contained in:
gallery
2026-11-15 20:33:21 +08:00
parent 8c376575f5
commit 6bec039595
12 changed files with 213 additions and 8 deletions
@@ -9,7 +9,7 @@ const MediaContainer = styled.div`
flex-grow: 1;
flex-basis: 0;
height: 200px;
margin: 4px 2px;
margin: 2px;
background-color: #eee;
position: relative;
overflow: hidden;
@@ -136,9 +136,24 @@ const VideoThumbnailIcon = styled(VideoThumbnailIconSVG)`
top: calc(50% - 22px);
`
const Caption = styled.div`
position: absolute;
right: 6px;
bottom: 4px;
color: #ffd400;
font-size: 12px;
font-weight: 600;
line-height: 1.2;
white-space: nowrap;
pointer-events: none;
text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
1px 1px 0 #fff, 0 0 2px rgba(0, 0, 0, 0.35);
`
type MediaThumbnailProps = {
media: MediaGalleryFields
active: boolean
caption?: string | null
selectImage(): void
clickPresent(): void
clickFavorite(): void
@@ -147,6 +162,7 @@ type MediaThumbnailProps = {
export const MediaThumbnail = ({
media,
active,
caption,
selectImage,
clickPresent,
clickFavorite,
@@ -181,7 +197,7 @@ export const MediaThumbnail = ({
key={media.id}
style={{
cursor: 'pointer',
minWidth: `clamp(124px, ${minWidth}px, 100% - 8px)`,
minWidth: `clamp(124px, ${minWidth}px, 100% - 4px)`,
}}
onClick={() => {
clickPresent()
@@ -206,6 +222,7 @@ export const MediaThumbnail = ({
/>
{heartIcon}
</PhotoOverlay>
{caption && <Caption>{caption}</Caption>}
</MediaContainer>
)
}
@@ -214,7 +231,7 @@ export const MediaPlaceholder = styled.div`
flex-grow: 1;
height: 200px;
width: 300px;
margin: 4px 2px;
margin: 2px;
background-color: #eee;
position: relative;
`