Skip to content

Commit 599c810

Browse files
committed
feat: animated blogpost cards.
1 parent bd3b1c3 commit 599c810

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/components/PostItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const PostItem = ({ slug, title, date, updatedDate, category, series, seriesInde
5757
return (
5858
<Link
5959
to={isSeries ? `/blog/${slug}` : `/blog/${slug}`}
60-
className={`block p-8 my-4 border border-gray-700/50 rounded-lg shadow-lg cursor-pointer transition-colors group ${postBackgroundColorClass} ${postHoverBackgroundColorClass}`}
60+
className={`block p-8 my-4 border border-gray-700/50 rounded-lg shadow-lg cursor-pointer transition-colors group relative overflow-hidden ${postBackgroundColorClass} ${postHoverBackgroundColorClass} animated-grid-bg`}
6161
>
6262
<article>
6363
<div className="flex items-center">

src/index.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,19 @@ input[type=number] {
151151
opacity: 0;
152152
}
153153
}
154+
155+
@keyframes grid-animation {
156+
0% {
157+
background-position: 0% 0%;
158+
}
159+
100% {
160+
background-position: 100% 100%;
161+
}
162+
}
163+
164+
.animated-grid-bg {
165+
background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
166+
linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
167+
background-size: 20px 20px;
168+
animation: grid-animation 30s linear infinite;
169+
}

0 commit comments

Comments
 (0)