From 98cd2ca4097d2cb4c8610ffb46eddec39a44d70f Mon Sep 17 00:00:00 2001 From: MadhavDhatrak Date: Tue, 21 Jan 2025 14:11:51 +0000 Subject: [PATCH] Add hover and Read More to blog cards --- pages/blog/index.page.tsx | 128 ++++++++++++++++---------------------- styles/globals.css | 27 ++++++++ 2 files changed, 82 insertions(+), 73 deletions(-) diff --git a/pages/blog/index.page.tsx b/pages/blog/index.page.tsx index 5bd300de2..112e11951 100644 --- a/pages/blog/index.page.tsx +++ b/pages/blog/index.page.tsx @@ -245,82 +245,56 @@ export default function StaticMarkdownPage({ return (
-
+
-
-
+
+ {frontmatter.title} +
+
-
-
{ - e.preventDefault(); - e.stopPropagation(); - - if (frontmatter.type) { - setCurrentFilterTag(frontmatter.type); - history.replaceState( - null, - '', - `/blog?type=${frontmatter.type}`, - ); - } - }} - > - {frontmatter.type || 'Unknown Type'} -
+
+ {frontmatter.type || 'Unknown Type'}
-
+
{frontmatter.title}
-
-
- {(frontmatter.authors || []).map( - (author: Author, index: number) => ( -
2 - ? 'h-8 w-8' - : 'h-11 w-11' - }`} - style={{ - backgroundImage: `url(${author.photo})`, - zIndex: 10 - index, - }} - /> - ), - )} -
- -
+
+
+
+ {(frontmatter.authors || []).map( + (author: Author, index: number) => ( +
2 + ? 'h-8 w-8' + : 'h-11 w-11' + }`} + style={{ + backgroundImage: `url(${author.photo})`, + zIndex: 10 - index, + }} + /> + ), + )} +
{frontmatter.authors.length > 2 ? ( <> @@ -346,19 +320,27 @@ export default function StaticMarkdownPage({ ) )}
- -
- {frontmatter.date && ( - - {date.toLocaleDateString('en-us', { - year: 'numeric', - month: 'long', - day: 'numeric', - })} - - )}{' '} - · {timeToRead} min read -
+
+
+ + {timeToRead} min read + + + Read More + + + +
diff --git a/styles/globals.css b/styles/globals.css index cd327de8f..b7441a1f3 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -299,4 +299,31 @@ border-radius: 4px; */ } .scrollbar-hidden::-webkit-scrollbar { display: none; +} + +@keyframes shine { + from { + transform: translateX(-100%); + } + to { + transform: translateX(200%); + } +} + +.shine-animation { + animation: shine 2s infinite; +} + +/* Add smooth transitions for dark mode */ +.dark .group:hover { + background: rgba(255, 255, 255, 0.05); +} + +/* Enhance card interactions */ +.group { + transition: all 0.3s ease; +} + +.group:hover { + transform: translateY(-2px); } \ No newline at end of file