mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 23:24:22 +01:00
refactor: use neutral text color for 'started' reading progress state
This commit is contained in:
@@ -31,7 +31,7 @@ const BlogPostCard: React.FC<BlogPostCardProps> = ({ post, href, level, readingP
|
|||||||
if (readingProgress && readingProgress >= 0.95) {
|
if (readingProgress && readingProgress >= 0.95) {
|
||||||
progressColor = '#10b981' // Green (completed)
|
progressColor = '#10b981' // Green (completed)
|
||||||
} else if (readingProgress && readingProgress > 0 && readingProgress <= 0.10) {
|
} else if (readingProgress && readingProgress > 0 && readingProgress <= 0.10) {
|
||||||
progressColor = '#f59e0b' // Amber (started)
|
progressColor = 'var(--color-text)' // Neutral text color (started)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export const LargeView: React.FC<LargeViewProps> = ({
|
|||||||
if (readingProgress && readingProgress >= 0.95) {
|
if (readingProgress && readingProgress >= 0.95) {
|
||||||
progressColor = '#10b981' // Green (completed)
|
progressColor = '#10b981' // Green (completed)
|
||||||
} else if (readingProgress && readingProgress > 0 && readingProgress <= 0.10) {
|
} else if (readingProgress && readingProgress > 0 && readingProgress <= 0.10) {
|
||||||
progressColor = '#f59e0b' // Amber (started)
|
progressColor = 'var(--color-text)' // Neutral text color (started)
|
||||||
}
|
}
|
||||||
|
|
||||||
const triggerOpen = () => handleReadNow({ preventDefault: () => {} } as React.MouseEvent<HTMLButtonElement>)
|
const triggerOpen = () => handleReadNow({ preventDefault: () => {} } as React.MouseEvent<HTMLButtonElement>)
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ export const ReadingProgressIndicator: React.FC<ReadingProgressIndicatorProps> =
|
|||||||
barColorClass = 'bg-green-500'
|
barColorClass = 'bg-green-500'
|
||||||
barColorStyle = undefined
|
barColorStyle = undefined
|
||||||
} else if (isStarted) {
|
} else if (isStarted) {
|
||||||
barColorClass = 'bg-amber-500'
|
barColorStyle = 'var(--color-text)' // Neutral text color (matches card titles)
|
||||||
barColorStyle = undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate left and right offsets based on sidebar states (desktop only)
|
// Calculate left and right offsets based on sidebar states (desktop only)
|
||||||
@@ -71,9 +70,11 @@ export const ReadingProgressIndicator: React.FC<ReadingProgressIndicatorProps> =
|
|||||||
{showPercentage && (
|
{showPercentage && (
|
||||||
<div
|
<div
|
||||||
className={`text-[0.625rem] font-normal min-w-[32px] text-right tabular-nums ${
|
className={`text-[0.625rem] font-normal min-w-[32px] text-right tabular-nums ${
|
||||||
isComplete ? 'text-green-500' : isStarted ? 'text-amber-500' : ''
|
isComplete ? 'text-green-500' : ''
|
||||||
}`}
|
}`}
|
||||||
style={{ color: (isComplete || isStarted) ? undefined : 'var(--color-text-muted)' }}
|
style={{
|
||||||
|
color: isComplete ? undefined : isStarted ? 'var(--color-text)' : 'var(--color-text-muted)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{isComplete ? '✓' : `${clampedProgress}%`}
|
{isComplete ? '✓' : `${clampedProgress}%`}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user