%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/www/portfolio/portfolio-rezakurnia/src/components/sections/
Upload File :
Create Path :
Current File : /home2/rezakur1/www/portfolio/portfolio-rezakurnia/src/components/sections/ArticlePreview.astro

---
import Container from "../shared/Container.astro";
import { articlePosts } from "../../utils/articles";

const latestArticles = articlePosts.slice(0, 3);
---

<section id="articles">
  <Container className="space-y-8 md:space-y-10">
    <div
      class="flex flex-col gap-5 md:flex-row md:items-end md:justify-between">
      <div class="max-w-2xl space-y-3">
        <p
          class="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1 text-xs font-semibold tracking-wide text-primary">
          Artikel Terbaru
        </p>
        <h2 class="text-3xl/tight md:text-4xl/tight font-bold text-heading-1">
          Insight Pengembangan Produk & Teknologi
        </h2>
        <p class="text-heading-3 leading-relaxed">
          Pelajari strategi praktis, update tools, dan pengalaman real project
          untuk bantu Anda membangun produk lebih cepat.
        </p>
      </div>

      <a
        href="/artikel"
        class="inline-flex w-fit items-center gap-2 rounded-xl border border-primary/20 bg-primary/5 px-4 py-2.5 text-sm font-semibold text-primary transition-all duration-200 hover:-translate-y-0.5 hover:border-primary/40 hover:bg-primary hover:text-white">
        Lihat Semua Artikel
        <span aria-hidden="true">→</span>
      </a>
    </div>

    <div class="grid gap-5 md:grid-cols-2 xl:grid-cols-3 md:gap-6">
      {
        latestArticles.map((article) => (
          <article class="group relative flex h-full flex-col overflow-hidden rounded-2xl border border-box-border bg-box-bg shadow-sm shadow-box-shadow/40 transition-all duration-300 hover:-translate-y-1.5 hover:shadow-xl hover:shadow-primary/10">
            <div class="relative overflow-hidden">
              <img
                src={article.coverImage}
                alt={article.title}
                loading="lazy"
                class="h-44 w-full object-cover transition-transform duration-500 group-hover:scale-105"
              />
              <div class="absolute inset-0 bg-gradient-to-t from-slate-950/65 via-slate-950/20 to-transparent" />
              <span class="absolute left-4 top-4 inline-flex rounded-full bg-white/90 px-3 py-1 text-xs font-semibold text-primary shadow-sm">
                {article.category}
              </span>
            </div>

            <div class="flex h-full flex-col p-5 md:p-6">
              <p class="text-xs font-medium text-heading-3">
                {new Date(article.date).toLocaleDateString("id-ID", {
                  day: "2-digit",
                  month: "short",
                  year: "numeric",
                })}
              </p>

              <h3 class="mt-3 text-lg md:text-xl font-semibold text-heading-1 line-clamp-2">
                {article.title}
              </h3>
              <p class="mt-3 text-heading-3 leading-relaxed line-clamp-3">
                {article.excerpt}
              </p>

              <a
                href="/artikel"
                class="mt-6 inline-flex w-fit items-center gap-2 rounded-xl border border-primary/20 bg-primary/5 px-4 py-2 text-sm font-semibold text-primary transition-all duration-200 hover:border-primary/40 hover:bg-primary hover:text-white">
                Read More / Selengkapnya
                <span
                  aria-hidden="true"
                  class="transition-transform duration-200 group-hover:translate-x-1">
                  →
                </span>
              </a>
            </div>
          </article>
        ))
      }
    </div>
  </Container>
</section>

Zerion Mini Shell 1.0