Подогнал размеры карточек на главной странице

This commit is contained in:
Иван Кузьменко 2025-10-22 08:44:35 +03:00
parent b275856aae
commit f7e93d4806
2 changed files with 4 additions and 2 deletions

View file

@ -17,6 +17,7 @@
export let post: App.BlogPost; export let post: App.BlogPost;
export let size: BlogCardSize = BlogCardSize.Both; export let size: BlogCardSize = BlogCardSize.Both;
export let fullHeight = false;
const type: App.BlogPostType = post.type ?? 'article'; const type: App.BlogPostType = post.type ?? 'article';
const dateNow = new Date().valueOf(); const dateNow = new Date().valueOf();
@ -60,6 +61,7 @@
<a <a
href="/blog/{post.slug}" href="/blog/{post.slug}"
class="blog-card class="blog-card
{fullHeight ? 'min-h-full' : ''}
{isPostUpdated ? 'updated' : isPostNew ? 'new' : ''} {isPostUpdated ? 'updated' : isPostNew ? 'new' : ''}
{shortClass('flex-col justify-baseline')} {shortClass('flex-col justify-baseline')}
{fullClass('flex-row justify-stretch', 'sm:flex-row sm:justify-stretch')}" {fullClass('flex-row justify-stretch', 'sm:flex-row sm:justify-stretch')}"
@ -103,7 +105,7 @@
{/if} {/if}
<div class="flex items-center gap-2 p-1 text-lg font-bold"> <div class="flex items-center gap-2 p-1 text-lg font-bold">
<Icon icon={blogPostTypeToIcon(type)} width={28} height={28} /> <Icon icon={blogPostTypeToIcon(type)} width={28} height={28} />
<span> <span class={shortClass('hidden', 'not-md:hidden')}>
{blogPostTypeToString(type)} {blogPostTypeToString(type)}
</span> </span>
</div> </div>

View file

@ -89,7 +89,7 @@
<div class="flex flex-row items-stretch justify-evenly gap-4 overflow-x-auto p-4"> <div class="flex flex-row items-stretch justify-evenly gap-4 overflow-x-auto p-4">
{#each page.data.posts as post, i} {#each page.data.posts as post, i}
<div class="aspect-3/2 w-80 shrink-0"> <div class="aspect-3/2 w-80 shrink-0">
<BlogCard {post} size={BlogCardSize.Short} /> <BlogCard {post} size={BlogCardSize.Short} fullHeight />
</div> </div>
{/each} {/each}
</div> </div>