-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from computebender/39-update-article-card-style
Refactor article card grid and article card components
- Loading branch information
Showing
4 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
src/app/component/article-card-grid/article-card-grid.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<div | ||
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-4 gap-y-8" | ||
class="grid auto-rows-auto grid-cols-1 gap-x-4 gap-y-8 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4" | ||
> | ||
@for (article of articles; track article.id) { | ||
<app-article-card [article]="article" /> | ||
} @empty { Empty list of users } | ||
<app-article-card [article]="article" /> | ||
} @empty { | ||
Empty list of users | ||
} | ||
</div> |
23 changes: 18 additions & 5 deletions
23
src/app/component/article-card/article-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
<div class="p-6 border border-solid border-slate-600"> | ||
<p class="font-bold font-sans">{{ article.title }}</p> | ||
<p>{{ article.summary }}</p> | ||
<p>{{ article.id }}</p> | ||
<a [routerLink]="['/blog', article.id, article.slug]">Article</a> | ||
<div | ||
class="flex h-full cursor-pointer flex-col overflow-hidden rounded-lg border border-solid border-slate-300 transition-all hover:bg-slate-50 hover:shadow-lg active:bg-slate-100 active:shadow-md" | ||
(click)="onCardClick()" | ||
> | ||
<!-- Image Section --> | ||
<div class="h-40 w-full shadow-md"> | ||
<img | ||
[src]="article.coverImage || 'https://picsum.photos/300/200'" | ||
alt="Article Image" | ||
class="h-full w-full object-cover" | ||
/> | ||
</div> | ||
|
||
<!-- Text Section --> | ||
<div class="grow px-4"> | ||
<h2 class="mb-2 truncate text-lg font-bold">{{ article.title }}</h2> | ||
<p class="line-clamp-3 text-gray-600">{{ article.summary }}</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters