Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/blogCarousel/blogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from "react";
import Link from "@docusaurus/Link";
import { getAuthorProfiles } from "../../utils/authors";
import { usePluginData } from "@docusaurus/useGlobalData";

Check warning on line 5 in src/components/blogCarousel/blogCard.tsx

View workflow job for this annotation

GitHub Actions / lint

'usePluginData' is defined but never used

interface BlogCardProps {
type: string;
Expand Down Expand Up @@ -50,7 +50,7 @@
type,
date,
title,
content,

Check warning on line 53 in src/components/blogCarousel/blogCard.tsx

View workflow job for this annotation

GitHub Actions / lint

'content' is defined but never used
imageUrl,
id,
authors,
Expand Down Expand Up @@ -80,7 +80,9 @@
<div className="article-card">
{/* Image */}
<div className="card-image">
<img src={imageUrl} alt={title} loading="lazy" />
<Link to={`/blog/${id}`} className="block" aria-label={`Read ${title}`}>
<img src={imageUrl} alt={title} loading="lazy" />
</Link>
</div>

{/* Content */}
Expand Down Expand Up @@ -202,4 +204,4 @@
);
};

export default BlogCard;
export default BlogCard;
11 changes: 11 additions & 0 deletions src/components/blogCarousel/blogCarousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
flex-shrink: 0;
}

.card-image a {
display: block;
width: 100%;
height: 100%;
}

.card-image::after {
content: "";
position: absolute;
Expand All @@ -112,13 +118,15 @@
opacity: 0;
transition: opacity 0.35s ease;
z-index: 1;
pointer-events: none;
}

.article-card:hover .card-image::after {
opacity: 1;
}

.card-image img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
Expand Down Expand Up @@ -157,6 +165,7 @@
transition: color 0.2s ease;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
Expand Down Expand Up @@ -195,6 +204,7 @@
margin: 0 0 16px 0;
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
flex: 1;
Expand Down Expand Up @@ -635,6 +645,7 @@
transform: translateY(-20px);
transition: opacity 0.4s ease-in, transform 0.4s ease-in;
}

/* ── Reading time ── */
.card-reading-time {
display: inline-flex;
Expand Down
Loading