This commit is contained in:
@@ -0,0 +1,165 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getPostBySlug, getFeaturedImageUrl, getRelatedPosts } from "@/lib/wp-api";
|
||||
import { formatDateShamsi } from "@/lib/format-date";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import type { CollapseBlockPayload, BlockquoteBlockPayload, TipBlockPayload } from "@/lib/blog-blocks";
|
||||
import { parseContentHeadings, getReadingTimeMinutes, formatAuthorName } from "@/lib/blog-utils";
|
||||
import { BlogToc } from "@/components/blog-toc";
|
||||
import { BlogPostMeta } from "@/components/blog-post-meta";
|
||||
import { BlogCollapseSection } from "@/components/blog-collapse-section";
|
||||
import { BlogBlockquote } from "@/components/blog-blockquote";
|
||||
import { BlogTip } from "@/components/blog-tip";
|
||||
import { BlogPullquote } from "@/components/blog-pullquote";
|
||||
import { ScrollToTop } from "@/components/scroll-to-top";
|
||||
import { BlogPostCard } from "@/components/blog-post-card";
|
||||
|
||||
interface BlogPostPageProps {
|
||||
params: Promise<{ slug: string }>;
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: BlogPostPageProps): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const post = await getPostBySlug(slug);
|
||||
if (!post) return { title: "پست یافت نشد" };
|
||||
const title = post.title?.rendered ?? "پست";
|
||||
const excerpt = post.excerpt?.rendered?.replace(/<[^>]*>/g, "").trim().slice(0, 160) ?? "";
|
||||
return {
|
||||
title,
|
||||
description: excerpt,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
const { slug } = await params;
|
||||
let post;
|
||||
try {
|
||||
post = await getPostBySlug(slug);
|
||||
} catch {
|
||||
notFound();
|
||||
}
|
||||
if (!post) notFound();
|
||||
|
||||
let relatedPosts: Awaited<ReturnType<typeof getRelatedPosts>> = [];
|
||||
try {
|
||||
relatedPosts = await getRelatedPosts(post.id, post.categories ?? [], 3);
|
||||
} catch {
|
||||
// show no related section on API error
|
||||
}
|
||||
|
||||
const date = post.date ? formatDateShamsi(post.date) : null;
|
||||
const modifiedDate = post.modified
|
||||
? formatDateShamsi(post.modified)
|
||||
: null;
|
||||
const authorName = formatAuthorName(post._embedded?.author?.[0]?.name);
|
||||
const thumbnailUrl = getFeaturedImageUrl(post, "full");
|
||||
const media = post._embedded?.["wp:featuredmedia"]?.[0];
|
||||
const altText = media?.alt_text || post.title?.rendered?.replace(/<[^>]*>/g, "") || "";
|
||||
|
||||
const { toc, segments } = parseContentHeadings(post.content.rendered);
|
||||
const readingTimeMinutes = getReadingTimeMinutes(post.content.rendered);
|
||||
const postTitle = post.title?.rendered?.replace(/<[^>]*>/g, "") ?? "";
|
||||
const postPath = `/blog/${slug}`;
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* تصویر شاخص تمامعرض بالای صفحه */}
|
||||
{thumbnailUrl && (
|
||||
<div className="pt-13 md:pt-24">
|
||||
<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
|
||||
src={thumbnailUrl}
|
||||
alt={altText}
|
||||
fill
|
||||
className="object-cover"
|
||||
quality={100}
|
||||
priority
|
||||
sizes="(max-width: 768px) 100vw, 1024px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<section className="bg-background pt-8 pb-20 md:pt-12 md:pb-28">
|
||||
<div className="mx-auto max-w-6xl px-6">
|
||||
{/* Single grid so sticky TOC stays for whole page scroll */}
|
||||
<div className="lg:grid lg:grid-cols-[16rem_1fr] lg:gap-10">
|
||||
<BlogToc items={toc} className="mb-6 lg:mb-0" />
|
||||
|
||||
<div className="min-w-0 space-y-0">
|
||||
<div className="pb-8 md:pb-12">
|
||||
<nav className="mb-6" aria-label="مسیر">
|
||||
<Link
|
||||
href="/blog"
|
||||
className="text-muted-foreground hover:text-foreground text-sm inline-flex items-center gap-1 transition-colors"
|
||||
>
|
||||
<ChevronRight className="size-4" aria-hidden />
|
||||
بلاگ
|
||||
</Link>
|
||||
</nav>
|
||||
<h1
|
||||
className="text-2xl font-bold md:text-3xl leading-tight tracking-normal"
|
||||
dangerouslySetInnerHTML={{ __html: post.title.rendered }}
|
||||
/>
|
||||
<BlogPostMeta
|
||||
url={postPath}
|
||||
title={postTitle}
|
||||
readingTimeMinutes={readingTimeMinutes}
|
||||
date={date}
|
||||
dateTime={post.date}
|
||||
modifiedDate={modifiedDate}
|
||||
authorName={authorName}
|
||||
className="mt-4"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<article className="blog-content text-justify space-y-6 text-foreground [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mt-8 [&_h2]:mb-4 [&_h3]:text-xl [&_h3]:font-bold [&_h3]:mt-6 [&_h3]:mb-3 [&_p]:leading-relaxed [&_p]:text-muted-foreground [&_a]:text-primary [&_a]:no-underline hover:[&_a]:underline [&_ul]:list-disc [&_ul]:pr-6 [&_ol]:list-decimal [&_ol]:pr-6 [&_li]:my-1 [&_h2]:scroll-mt-24 [&_h3]:scroll-mt-24 [&_h4]:scroll-mt-24">
|
||||
{segments.map((seg, i) =>
|
||||
seg.type === "html" ? (
|
||||
<div
|
||||
key={i}
|
||||
dangerouslySetInnerHTML={{ __html: seg.content }}
|
||||
/>
|
||||
) : seg.blockType === "collapse" ? (
|
||||
<BlogCollapseSection
|
||||
key={i}
|
||||
section={seg.payload as CollapseBlockPayload}
|
||||
idPrefix={`blog-${slug}-${i}`}
|
||||
/>
|
||||
) : seg.blockType === "blockquote" ? (
|
||||
<BlogBlockquote key={i} payload={seg.payload as BlockquoteBlockPayload} />
|
||||
) : seg.blockType === "tip" ? (
|
||||
<BlogTip key={i} payload={seg.payload as TipBlockPayload} />
|
||||
) : (
|
||||
null
|
||||
)
|
||||
)}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{relatedPosts.length > 0 && (
|
||||
<section className="bg-background border-t pb-16 md:pb-20">
|
||||
<div className="mx-auto max-w-6xl px-6 pt-10 md:pt-14">
|
||||
<h2 className="text-xl md:text-2xl text-center mb-8 md:mb-10">
|
||||
مقالات مرتبط
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 min-w-0">
|
||||
{relatedPosts.map((p) => (
|
||||
<BlogPostCard key={p.id} post={p} variant="related" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<ScrollToTop />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getPosts, getCategories } from "@/lib/wp-api";
|
||||
import { BlogPostCard } from "@/components/blog-post-card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ChevronRight, ChevronLeft, Search, X } from "lucide-react";
|
||||
|
||||
const PER_PAGE = 9;
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "بلاگ",
|
||||
description: "مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.",
|
||||
};
|
||||
|
||||
interface BlogPageProps {
|
||||
searchParams: Promise<{ search?: string; category?: string; page?: string }>;
|
||||
}
|
||||
|
||||
export default async function BlogPage({ searchParams }: BlogPageProps) {
|
||||
const params = await searchParams;
|
||||
const search = params.search ?? "";
|
||||
const categoryId = params.category ? parseInt(params.category, 10) : undefined;
|
||||
const page = Math.max(1, parseInt(params.page ?? "1", 10) || 1);
|
||||
|
||||
let postsResult;
|
||||
let categories: Awaited<ReturnType<typeof getCategories>> = [];
|
||||
|
||||
try {
|
||||
[postsResult, categories] = await Promise.all([
|
||||
getPosts({
|
||||
page,
|
||||
perPage: PER_PAGE,
|
||||
search: search || undefined,
|
||||
categoryId: Number.isFinite(categoryId) ? categoryId : undefined,
|
||||
}),
|
||||
getCategories(),
|
||||
]);
|
||||
} catch (e) {
|
||||
return (
|
||||
<section className="bg-background pt-32 pb-20 md:pt-40 md:pb-28">
|
||||
<div className="mx-auto max-w-4xl px-6 text-center">
|
||||
<h1 className="text-4xl font-bold md:text-5xl">بلاگ</h1>
|
||||
<p className="mt-4 text-muted-foreground">
|
||||
در حال حاضر امکان بارگذاری مطالب وجود ندارد. لطفاً بعداً تلاش کنید.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
const { posts, total, totalPages } = postsResult;
|
||||
const hasFilters = search || categoryId;
|
||||
|
||||
function buildQuery(updates: { search?: string; category?: string; page?: number }) {
|
||||
const q = new URLSearchParams();
|
||||
if (updates.search !== undefined && updates.search !== "") q.set("search", updates.search);
|
||||
if (updates.category !== undefined && updates.category !== "") q.set("category", updates.category);
|
||||
if (updates.page !== undefined && updates.page > 1) q.set("page", String(updates.page));
|
||||
const s = q.toString();
|
||||
return s ? `?${s}` : "";
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Hero + search & filters, compact */}
|
||||
<section className="bg-background pt-24 pb-6 md:pt-28 md:pb-8">
|
||||
<div className="mx-auto max-w-3xl px-4 sm:px-6">
|
||||
<div className="text-center space-y-5">
|
||||
<div className="space-y-1.5">
|
||||
<h1 className="text-3xl font-bold md:text-4xl tracking-tight">
|
||||
بلاگ
|
||||
</h1>
|
||||
<p className="text-sm md:text-base text-muted-foreground max-w-xl mx-auto">
|
||||
مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-4">
|
||||
<form
|
||||
method="get"
|
||||
action="/blog"
|
||||
className="flex gap-2 w-full"
|
||||
>
|
||||
<input type="hidden" name="category" value={categoryId ?? ""} />
|
||||
<div className="relative flex-1 flex items-center">
|
||||
<Search className="absolute right-3 size-4 text-muted-foreground pointer-events-none" aria-hidden />
|
||||
<Input
|
||||
type="search"
|
||||
name="search"
|
||||
placeholder="جستجو در مطالب..."
|
||||
defaultValue={search}
|
||||
className="w-full pr-10 pl-3 h-9 text-sm"
|
||||
aria-label="جستجو در مطالب"
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" className="shrink-0">
|
||||
جستجو
|
||||
</Button>
|
||||
</form>
|
||||
{hasFilters && (
|
||||
<Link
|
||||
href="/blog"
|
||||
className="inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
<X className="size-3.5" />
|
||||
پاک کردن فیلتر
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{categories.length > 0 && (
|
||||
<div className="flex flex-wrap items-center justify-center gap-1.5">
|
||||
<Link
|
||||
href="/blog"
|
||||
className={`text-xs rounded-full px-3 py-1.5 transition-colors ${!categoryId
|
||||
? "bg-primary text-primary-foreground shadow-sm"
|
||||
: "bg-muted/80 hover:bg-muted text-muted-foreground hover:text-foreground"
|
||||
}`}
|
||||
>
|
||||
همه
|
||||
</Link>
|
||||
{categories.map((cat) => (
|
||||
<Link
|
||||
key={cat.id}
|
||||
href={`/blog${buildQuery({ search, category: String(cat.id), page: 1 })}`}
|
||||
className={`text-xs rounded-full px-3 py-1.5 transition-colors ${categoryId === cat.id
|
||||
? "bg-primary text-primary-foreground shadow-sm"
|
||||
: "bg-muted/80 hover:bg-muted text-muted-foreground hover:text-foreground"
|
||||
}`}
|
||||
>
|
||||
{cat.name}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="bg-background pb-20 md:pb-28">
|
||||
<div className="mx-auto max-w-6xl px-6 pt-2">
|
||||
{posts.length === 0 ? (
|
||||
<div className="text-center py-16 text-muted-foreground">
|
||||
<p>مطلبی یافت نشد.</p>
|
||||
<Link href="/blog" className="mt-4 inline-block">
|
||||
<Button variant="outline" size="sm">
|
||||
نمایش همه مطالب
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<ul className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{posts.map((post) => (
|
||||
<li key={post.id}>
|
||||
<BlogPostCard post={post} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
{totalPages > 1 && (
|
||||
<nav
|
||||
className="mt-12 flex flex-wrap items-center justify-center gap-2"
|
||||
aria-label="صفحهبندی"
|
||||
>
|
||||
{page > 1 && (
|
||||
<Link
|
||||
href={`/blog${buildQuery({
|
||||
search,
|
||||
category: categoryId ? String(categoryId) : undefined,
|
||||
page: page - 1,
|
||||
})}`}
|
||||
>
|
||||
<Button variant="outline" size="icon" aria-label="صفحه قبل">
|
||||
<ChevronRight className="size-4" />
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
<span className="text-muted-foreground text-sm px-2">
|
||||
صفحه {page} از {totalPages} ({total} مطلب)
|
||||
</span>
|
||||
{page < totalPages && (
|
||||
<Link
|
||||
href={`/blog${buildQuery({
|
||||
search,
|
||||
category: categoryId ? String(categoryId) : undefined,
|
||||
page: page + 1,
|
||||
})}`}
|
||||
>
|
||||
<Button variant="outline" size="icon" aria-label="صفحه بعد">
|
||||
<ChevronLeft className="size-4" />
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
</nav>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 4.2 KiB |
+120
-52
@@ -122,74 +122,77 @@
|
||||
:root {
|
||||
--font-iran-sans: "IRANSansX", var(--font-geist-sans);
|
||||
--radius: 0.625rem;
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0 0);
|
||||
--primary: #001BB7;
|
||||
--card: oklch(1 0.006 175);
|
||||
--card-foreground: oklch(0.145 0.02 175);
|
||||
--popover: oklch(1 0.006 175);
|
||||
--popover-foreground: oklch(0.145 0.02 175);
|
||||
--primary: #01796F;
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: #0046FF;
|
||||
--secondary: #0D9488;
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.97 0.01 280);
|
||||
--muted-foreground: oklch(0.35 0.05 250);
|
||||
--muted: oklch(0.97 0.012 175);
|
||||
--muted-foreground: oklch(0.35 0.05 175);
|
||||
--accent: #FCC61D;
|
||||
--accent-foreground: oklch(0.25 0.05 50);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.9 0.01 280);
|
||||
--input: oklch(0.95 0.01 280);
|
||||
--ring: oklch(0.5 0.15 220);
|
||||
--chart-1: oklch(0.646 0.222 41.116);
|
||||
--chart-2: oklch(0.6 0.118 184.704);
|
||||
--chart-3: oklch(0.398 0.07 227.392);
|
||||
--chart-4: oklch(0.828 0.189 84.429);
|
||||
--chart-5: oklch(0.769 0.188 70.08);
|
||||
--sidebar: oklch(0.985 0 0);
|
||||
--sidebar-foreground: oklch(0.145 0 0);
|
||||
--sidebar-primary: oklch(0.205 0 0);
|
||||
--border: oklch(0.9 0.012 175);
|
||||
--input: oklch(0.95 0.01 175);
|
||||
--ring: oklch(0.45 0.1 175);
|
||||
--chart-1: oklch(0.45 0.1 175);
|
||||
--chart-2: oklch(0.6 0.12 162);
|
||||
--chart-3: oklch(0.55 0.08 175);
|
||||
--chart-4: oklch(0.7 0.1 170);
|
||||
--chart-5: oklch(0.5 0.09 180);
|
||||
--sidebar: oklch(0.985 0.008 175);
|
||||
--sidebar-foreground: oklch(0.145 0.02 175);
|
||||
--sidebar-primary: #01796F;
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--background: oklch(0.99 0.005 280);
|
||||
--foreground: oklch(0.25 0.05 250);
|
||||
--sidebar-accent: oklch(0.97 0.015 175);
|
||||
--sidebar-accent-foreground: oklch(0.205 0.02 175);
|
||||
--sidebar-border: oklch(0.922 0.01 175);
|
||||
--sidebar-ring: oklch(0.45 0.1 175);
|
||||
--background: oklch(0.99 0.008 175);
|
||||
--foreground: oklch(0.25 0.03 175);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.145 0.01 280);
|
||||
--background: oklch(0.145 0.02 175);
|
||||
--foreground: oklch(0.95 0.01 280);
|
||||
--card: oklch(0.22 0.02 280);
|
||||
--card: oklch(0.22 0.025 175);
|
||||
--card-foreground: oklch(0.95 0.01 280);
|
||||
--popover: oklch(0.22 0.02 280);
|
||||
--popover: oklch(0.22 0.025 175);
|
||||
--popover-foreground: oklch(0.95 0.01 280);
|
||||
--primary: #001BB7;
|
||||
--primary: #01796F;
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: #0046FF;
|
||||
--secondary-foreground: oklch(0.95 0.01 280);
|
||||
--muted: oklch(0.28 0.02 280);
|
||||
--muted-foreground: oklch(0.75 0.02 280);
|
||||
--secondary: #14B8A6;
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.28 0.025 175);
|
||||
--muted-foreground: oklch(0.75 0.02 175);
|
||||
--accent: #FCC61D;
|
||||
--accent-foreground: oklch(0.2 0.05 50);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(0.3 0.02 280);
|
||||
--input: oklch(0.3 0.02 280);
|
||||
--ring: oklch(0.5 0.15 220);
|
||||
--chart-1: oklch(0.488 0.243 264.376);
|
||||
--chart-2: oklch(0.696 0.17 162.48);
|
||||
--chart-3: oklch(0.769 0.188 70.08);
|
||||
--chart-4: oklch(0.627 0.265 303.9);
|
||||
--chart-5: oklch(0.645 0.246 16.439);
|
||||
--sidebar: oklch(0.22 0.02 280);
|
||||
--border: oklch(0.3 0.025 175);
|
||||
--input: oklch(0.3 0.025 175);
|
||||
--ring: oklch(0.5 0.12 175);
|
||||
--chart-1: oklch(0.5 0.12 175);
|
||||
--chart-2: oklch(0.6 0.14 162);
|
||||
--chart-3: oklch(0.55 0.1 175);
|
||||
--chart-4: oklch(0.65 0.11 170);
|
||||
--chart-5: oklch(0.45 0.09 180);
|
||||
--sidebar: oklch(0.22 0.025 175);
|
||||
--sidebar-foreground: oklch(0.95 0.01 280);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary: #01796F;
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.3 0.02 280);
|
||||
--sidebar-accent: oklch(0.3 0.03 175);
|
||||
--sidebar-accent-foreground: oklch(0.95 0.01 280);
|
||||
--sidebar-border: oklch(0.3 0.02 280);
|
||||
--sidebar-ring: oklch(0.5 0.15 220);
|
||||
--sidebar-border: oklch(0.3 0.025 175);
|
||||
--sidebar-ring: oklch(0.5 0.12 175);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
}
|
||||
@@ -199,17 +202,17 @@
|
||||
letter-spacing: normal;
|
||||
line-height: 1.6;
|
||||
background-image:
|
||||
radial-gradient(at 0% 0%, oklch(0.98 0.01 280 / 0.3) 0px, transparent 50%),
|
||||
radial-gradient(at 100% 100%, oklch(0.95 0.02 220 / 0.2) 0px, transparent 50%),
|
||||
radial-gradient(at 50% 50%, oklch(0.97 0.01 300 / 0.15) 0px, transparent 50%);
|
||||
radial-gradient(at 0% 0%, oklch(0.98 0.012 175 / 0.3) 0px, transparent 50%),
|
||||
radial-gradient(at 100% 100%, oklch(0.95 0.02 175 / 0.2) 0px, transparent 50%),
|
||||
radial-gradient(at 50% 50%, oklch(0.97 0.01 170 / 0.15) 0px, transparent 50%);
|
||||
background-attachment: fixed;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
.dark body {
|
||||
background-image:
|
||||
radial-gradient(at 0% 0%, oklch(0.2 0.02 280 / 0.3) 0px, transparent 50%),
|
||||
radial-gradient(at 100% 100%, oklch(0.18 0.02 220 / 0.2) 0px, transparent 50%),
|
||||
radial-gradient(at 50% 50%, oklch(0.22 0.02 300 / 0.15) 0px, transparent 50%);
|
||||
radial-gradient(at 0% 0%, oklch(0.2 0.025 175 / 0.3) 0px, transparent 50%),
|
||||
radial-gradient(at 100% 100%, oklch(0.18 0.02 175 / 0.2) 0px, transparent 50%),
|
||||
radial-gradient(at 50% 50%, oklch(0.22 0.025 170 / 0.15) 0px, transparent 50%);
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
letter-spacing: normal;
|
||||
@@ -228,3 +231,68 @@
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* WordPress table block (figure.wp-block-table > table) */
|
||||
.wp-block-table {
|
||||
margin: 1.5rem 0;
|
||||
overflow-x: auto;
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
.wp-block-table table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.9375rem;
|
||||
|
||||
}
|
||||
|
||||
.wp-block-table table.has-fixed-layout {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.wp-block-table th,
|
||||
.wp-block-table td {
|
||||
padding: 0.75rem 1rem;
|
||||
border: 1px solid var(--border);
|
||||
text-align: right;
|
||||
min-width: 850px;
|
||||
}
|
||||
|
||||
.wp-block-table tbody tr:first-child th,
|
||||
.wp-block-table tbody tr:first-child td {
|
||||
background: var(--muted);
|
||||
font-weight: 600;
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.wp-block-table tbody tr:not(:first-child):hover td {
|
||||
background: var(--muted);
|
||||
}
|
||||
|
||||
.wp-block-table thead th {
|
||||
background: var(--muted);
|
||||
font-weight: 600;
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
|
||||
.wp-block-button > .wp-element-button {
|
||||
@apply inline-flex bg-primary text-primary-foreground px-4 py-2 rounded-md hover:bg-primary/80 hover:text-primary-foreground/80 cursor-pointer no-underline;
|
||||
}
|
||||
|
||||
.wp-block-button {
|
||||
@apply inline-flex;
|
||||
}
|
||||
|
||||
.wp-block-button.is-style-outline > .wp-element-button {
|
||||
@apply bg-transparent text-foreground border border-2 border-primary hover:text-primary cursor-pointer no-underline;
|
||||
}
|
||||
|
||||
.cta-block {
|
||||
@apply flex flex-col gap-4 border rounded-md border-primary/50 p-4 items-center my-4 shadow-sm bg-primary/5 text-primary;
|
||||
}
|
||||
|
||||
.wp-block-image {
|
||||
@apply rounded-md overflow-hidden shadow-sm;
|
||||
}
|
||||
@@ -2,12 +2,16 @@ import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import { ConditionalLayout } from "@/components/conditional-layout";
|
||||
import { ThemeProvider } from "@/components/theme-provider";
|
||||
import { TopProgressBar } from "@/components/top-progress-bar";
|
||||
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "فیپ",
|
||||
description:
|
||||
"فیپ یک سامانه برای ایجاد و طراحی راهکارهای مناسب برای کسب و کار شما است.",
|
||||
icons: {
|
||||
icon: "/assets/feep-Logo.svg",
|
||||
},
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
@@ -21,6 +25,7 @@ export default function RootLayout({
|
||||
className={`antialiased`}
|
||||
>
|
||||
<ThemeProvider>
|
||||
<TopProgressBar />
|
||||
<ConditionalLayout>{children}</ConditionalLayout>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user