fix: update blog post thumbnail and hero section layout
- Adjusted the maximum width of the blog post thumbnail container. - Changed the thumbnail image size to 'full' for better quality. - Enhanced the hero section layout by modifying padding and aspect ratio for improved responsiveness. - Updated image properties to ensure consistent quality and priority loading.
This commit is contained in:
@@ -69,13 +69,13 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
|||||||
{/* تصویر شاخص تمامعرض بالای صفحه */}
|
{/* تصویر شاخص تمامعرض بالای صفحه */}
|
||||||
{thumbnailUrl && (
|
{thumbnailUrl && (
|
||||||
<div className="pt-13 md:pt-24">
|
<div className="pt-13 md:pt-24">
|
||||||
<div className="relative container mx-auto max-w-6xl md:rounded-xl overflow-hidden shadow-sm w-full aspect-[5/2] min-h-[10rem] md:min-h-[10rem] bg-muted">
|
<div className="relative container mx-auto max-w-5xl md:rounded-xl overflow-hidden shadow-sm w-full aspect-[5/2] min-h-[10rem] md:min-h-[10rem] bg-muted">
|
||||||
<Image
|
<Image
|
||||||
src={thumbnailUrl}
|
src={thumbnailUrl}
|
||||||
alt={altText}
|
alt={altText}
|
||||||
fill
|
fill
|
||||||
className="object-cover"
|
className="object-cover"
|
||||||
sizes="100vw"
|
quality={100}
|
||||||
priority
|
priority
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -21,7 +21,7 @@ export function BlogPostCard({
|
|||||||
const excerpt = stripHtml(post.excerpt.rendered) || stripHtml(post.content.rendered).slice(0, 160);
|
const excerpt = stripHtml(post.excerpt.rendered) || stripHtml(post.content.rendered).slice(0, 160);
|
||||||
const modifiedDate = post.modified ? formatDateShamsi(post.modified) : null;
|
const modifiedDate = post.modified ? formatDateShamsi(post.modified) : null;
|
||||||
const authorName = post._embedded?.author?.[0]?.name ?? null;
|
const authorName = post._embedded?.author?.[0]?.name ?? null;
|
||||||
const thumbnailUrl = getFeaturedImageUrl(post, "medium");
|
const thumbnailUrl = getFeaturedImageUrl(post, "full");
|
||||||
|
|
||||||
if (variant === "tiny") {
|
if (variant === "tiny") {
|
||||||
return (
|
return (
|
||||||
@@ -80,7 +80,9 @@ export function BlogPostCard({
|
|||||||
alt=""
|
alt=""
|
||||||
fill
|
fill
|
||||||
className="object-cover"
|
className="object-cover"
|
||||||
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
quality={100}
|
||||||
|
priority
|
||||||
|
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 350px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -168,14 +168,13 @@ export default function HeroSection() {
|
|||||||
...transitionVariants,
|
...transitionVariants,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="relative -mr-56 mt-8 overflow-hidden px-2 sm:mr-0 sm:mt-12 md:mt-20">
|
<div className="relative mt-8 overflow-hidden px-2 sm:mt-12 md:mt-20 p-2">
|
||||||
<div className="ring-background bg-background relative mx-auto max-w-6xl overflow-hidden rounded-2xl border ring-1 shadow-[0_20px_50px_rgba(59,130,246,0.4)]">
|
<div className="ring-background bg-background relative max-w-5xl mx-auto overflow-hidden rounded-2xl border ring-1 aspect-[3/2]">
|
||||||
<Image
|
<Image
|
||||||
className="bg-background relative w-full h-full rounded-2xl object-contain object-center"
|
|
||||||
src="/assets/main-pic/Untitled-1 copy-min.jpg"
|
src="/assets/main-pic/Untitled-1 copy-min.jpg"
|
||||||
alt="یکپارچهسازی سیستمها و شبکه دیجیتال"
|
alt="یکپارچهسازی سیستمها و شبکه دیجیتال"
|
||||||
width={1150}
|
fill
|
||||||
height={613}
|
className="object-cover rounded-2xl inline-block my-0"
|
||||||
quality={100}
|
quality={100}
|
||||||
priority
|
priority
|
||||||
/>
|
/>
|
||||||
@@ -233,13 +232,13 @@ export default function HeroSection() {
|
|||||||
alt="Microsoft Windows Logo"
|
alt="Microsoft Windows Logo"
|
||||||
size="md"
|
size="md"
|
||||||
className="translate-x-2"
|
className="translate-x-2"
|
||||||
/>
|
/>
|
||||||
<LogoItem
|
<LogoItem
|
||||||
icon="skill-icons:github-dark"
|
icon="skill-icons:github-dark"
|
||||||
alt="github Logo"
|
alt="github Logo"
|
||||||
size="md"
|
size="md"
|
||||||
className="translate-x-4"
|
className="translate-x-4"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user