There was an error while loading. Please reload this page.
1 parent 0d2ae6f commit fa4e416Copy full SHA for fa4e416
1 file changed
src/lib/component/Post.svelte
@@ -1,11 +1,20 @@
1
<div class="card mb-3">
2
{#if post.thumbnailUrl}
3
<a href="/post/{post.url}">
4
- <img
5
- src={post.thumbnailUrl}
6
- class="card-img-top rounded-top"
7
- alt={post.title}
8
- title={post.title} />
+ <div
+ style="
+ aspect-ratio: 16 / 9;
+ width: 100%;
+ overflow: hidden;
9
+ "
10
+ >
11
+ <img
12
+ src={post.thumbnailUrl}
13
+ class="card-img-top rounded-top h-100 w-100"
14
+ style="object-fit: cover;"
15
+ alt={post.title}
16
+ title={post.title} />
17
+ </div>
18
</a>
19
{/if}
20
<div class="card-body">
0 commit comments