feat: overlay title and metadata on hero images

- Position title and metadata absolutely over hero images
- Add gradient background for text readability (dark at bottom)
- Use backdrop-filter blur for metadata badges
- White text with shadow for better contrast
- Maintain original layout when no image present
- Creates more immersive reading experience
This commit is contained in:
Gigi
2025-10-08 12:30:00 +01:00
parent 270ea94c70
commit 1609c6e580
2 changed files with 64 additions and 5 deletions

View File

@@ -17,13 +17,35 @@ const ReaderHeader: React.FC<ReaderHeaderProps> = ({
hasHighlights,
highlightCount
}) => {
if (image) {
return (
<>
{image && (
<div className="reader-hero-image">
<img src={image} alt={title || 'Article image'} />
{title && (
<div className="reader-header-overlay">
<h2 className="reader-title">{title}</h2>
<div className="reader-meta">
{readingTimeText && (
<div className="reading-time">
<FontAwesomeIcon icon={faClock} />
<span>{readingTimeText}</span>
</div>
)}
{hasHighlights && (
<div className="highlight-indicator">
<FontAwesomeIcon icon={faHighlighter} />
<span>{highlightCount} highlight{highlightCount !== 1 ? 's' : ''}</span>
</div>
)}
</div>
</div>
)}
</div>
)
}
return (
<>
{title && (
<div className="reader-header">
<h2 className="reader-title">{title}</h2>

View File

@@ -1071,6 +1071,8 @@ body {
margin: 0 0 2rem 0;
border-radius: 8px;
overflow: hidden;
position: relative;
min-height: 300px;
}
.reader-hero-image img {
@@ -1081,6 +1083,41 @@ body {
display: block;
}
.reader-header-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 2rem 2rem 1.5rem;
background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0) 100%);
}
.reader-header-overlay .reader-title {
color: #fff;
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
margin-bottom: 0.75rem;
}
.reader-header-overlay .reader-meta {
display: flex;
align-items: center;
gap: 0.75rem;
flex-wrap: wrap;
}
.reader-header-overlay .reading-time,
.reader-header-overlay .highlight-indicator {
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(8px);
border: 1px solid rgba(255, 255, 255, 0.25);
color: #fff;
}
.reader-header-overlay .highlight-indicator {
background: rgba(100, 108, 255, 0.25);
border: 1px solid rgba(100, 108, 255, 0.4);
}
/* Private Bookmark Styles */
.private-bookmark {
background: #2a2a2a;