@@ -7,11 +7,11 @@ interface Props {
77 tags? : string [];
88 href: string ;
99 locale? : " zh" | " en" ;
10- featured? : boolean ;
1110}
1211
13- const { type, title, date, summary, tags = [], href, locale = " zh" , featured = false } = Astro .props ;
12+ const { type, title, date, summary, tags = [], href, locale = " zh" } = Astro .props ;
1413import { t } from " ../i18n/utils.ts" ;
14+
1515const badgeMap: Record <string , string > = {
1616 daily: t (" badge.daily" , locale ),
1717 weekly: t (" badge.weekly" , locale ),
@@ -24,27 +24,24 @@ const badgeColorMap = {
2424};
2525const badgeText = badgeMap [type ];
2626const badgeClass = badgeColorMap [type ];
27- const sizeClass = featured
28- ? " p-5 sm:p-7 border-2 border-accent/30"
29- : " p-4 sm:p-6" ;
3027---
3128
3229<a href ={ href }
33- class ={ ` block bg-bg-card rounded-xl sm:rounded-2xl hover:bg-bg-hover hover:border-accent hover:-translate-y-0.5 transition-all duration-250 shadow-[0_8px_30px_rgba(99,102,241,0)] hover:shadow-[0_8px_30px_rgba(99,102,241,0.08)] no-underline animate-fade-in border border-border ${ sizeClass } ` } >
30+ class =" block bg-bg-card rounded-xl sm:rounded-2xl p-4 sm:p-6 hover:bg-bg-hover hover:border-accent hover:-translate-y-0.5 transition-all duration-250 shadow-[0_8px_30px_rgba(99,102,241,0)] hover:shadow-[0_8px_30px_rgba(99,102,241,0.08)] no-underline animate-fade-in border border-border" >
3431 <div class =" flex items-center gap-2 sm:gap-3 mb-2 sm:mb-3" >
3532 <span class ={ ` text-xs font-semibold px-2.5 py-1 rounded-full ${badgeClass } ` } >
3633 { badgeText }
3734 </span >
3835 <span class =" text-text-muted text-xs sm:text-sm" >{ date } </span >
3936 </div >
40- <h2 class ={ ` font-semibold mb-1.5 sm:mb-2 ${ featured ? " text-lg sm:text-xl " : " text-base sm:text-lg " } line-clamp-2 ` } >{ title } </h2 >
37+ <h2 class =" text-base sm:text-lg font-semibold mb-1.5 sm:mb-2 line-clamp-2" >{ title } </h2 >
4138 { summary && (
4239 <p class = " text-text-dim text-xs sm:text-sm line-clamp-2" >{ summary } </p >
4340 )}
4441 { tags .length > 0 && (
45- <div class = " flex gap-1.5 sm:gap-2 mt-2.5 sm:mt-3.5 flex-wrap " >
42+ <div class = " flex gap-1.5 sm:gap-2 mt-2.5 sm:mt-3.5 overflow-hidden " >
4643 { tags .map (tag => (
47- <span class = " text-[11px] sm:text-xs text-text-muted bg-white/[0.04] px-2 sm:px-2.5 py-1 rounded-full" >{ tag } </span >
44+ <span class = " whitespace-nowrap flex-shrink-0 text-[11px] sm:text-xs text-text-muted bg-white/[0.04] px-2 sm:px-2.5 py-1 rounded-full" >{ tag } </span >
4845 ))}
4946 </div >
5047 )}
0 commit comments