Enhance Next.js configuration and dependencies for improved functionality and localization support. Added support for internationalization with next-intl, updated global styles, and integrated new fonts. Removed default home page and updated README with project details and setup instructions.

This commit is contained in:
smhk1376 committed 2026-09-24 14:53:01 +03:30
1 parent 2911dea00b
commit 44f4fa98e2
320 files changed
+31666 -220

No files matched your search

@@ -0,0 +1,179 @@
import Image from "next/image";
import { Clock, Layers, Tag, Wallet } from "lucide-react";
import { Container } from "@/components/atoms/Container";
import { Section } from "@/components/atoms/Section";
import { TextLink } from "@/components/atoms/TextLink";
import { PageHero } from "@/components/molecules/PageHero";
import { CourseRegisterGate } from "@/components/organisms/CourseRegisterGate";
import { Separator } from "@/components/ui/separator";
import type { Course } from "@/lib/types";
import {
categoryLabel,
formatCoursePrice,
formatLabel,
} from "@/lib/labels";
import { JsonLd, courseJsonLd } from "@/lib/seo/json-ld";
export type CourseDetailLabels = {
submit: string;
success: string;
cta: string;
formTitle: string;
formDescription: string;
hint: string;
cancel: string;
backToCatalog: string;
detailsTitle: string;
aboutTitle: string;
duration: string;
format: string;
category: string;
price: string;
priceUnset: string;
};
export function CourseDetailTemplate({
course,
labels,
}: {
course: Course;
labels: CourseDetailLabels;
}) {
const priceLabel = formatCoursePrice(course.price);
const specs = [
{
icon: Tag,
label: labels.category,
value: categoryLabel(course.category),
},
{
icon: Layers,
label: labels.format,
value: formatLabel(course.format),
},
{
icon: Clock,
label: labels.duration,
value: `${course.durationHours} ساعت`,
},
{
icon: Wallet,
label: labels.price,
value: priceLabel ?? labels.priceUnset,
},
];
return (
<main id="main-content">
<JsonLd data={courseJsonLd(course)} />
<PageHero
title={course.title}
intro={course.summary}
eyebrow={categoryLabel(course.category)}
imageUrl={course.imageUrl}
/>
<Section className="bg-gradient-to-b from-background to-muted/40">
<Container className="grid gap-10 lg:grid-cols-[minmax(0,1.4fr)_minmax(18rem,0.85fr)] lg:items-start lg:gap-12">
<div className="space-y-8">
<div className="overflow-hidden rounded-2xl ring-1 ring-border">
<div className="relative aspect-[16/9] bg-muted">
<Image
src={course.imageUrl}
alt={course.title}
fill
className="object-cover"
sizes="(max-width:1024px) 100vw, 60vw"
priority
/>
</div>
</div>
<section className="space-y-4">
<h2 className="text-xl font-bold tracking-tight">
{labels.aboutTitle}
</h2>
<p className="text-base leading-8 text-foreground/90">
{course.summary}
</p>
{course.seoDescription &&
course.seoDescription !== course.summary ? (
<p className="text-base leading-8 text-muted-foreground">
{course.seoDescription}
</p>
) : null}
</section>
<section className="space-y-4">
<h2 className="text-xl font-bold tracking-tight">
{labels.detailsTitle}
</h2>
<dl className="grid overflow-hidden rounded-2xl bg-card ring-1 ring-border sm:grid-cols-2 sm:divide-x sm:divide-x-reverse sm:divide-border">
{specs.map((item) => (
<div
key={item.label}
className="flex gap-3 border-b border-border p-5 last:border-b-0 sm:[&:nth-last-child(-n+2)]:border-b-0"
>
<div className="flex size-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">
<item.icon className="size-4" />
</div>
<div className="min-w-0">
<dt className="text-xs font-medium text-muted-foreground">
{item.label}
</dt>
<dd className="mt-1 text-sm font-semibold text-foreground">
{item.value}
</dd>
</div>
</div>
))}
</dl>
</section>
</div>
<aside className="space-y-6 lg:sticky lg:top-28">
<div className="rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border">
<p className="text-sm font-semibold text-foreground">{course.title}</p>
<Separator className="my-4" />
<ul className="space-y-3 text-sm text-muted-foreground">
<li className="flex justify-between gap-3">
<span>{labels.duration}</span>
<span className="font-medium text-foreground">
{course.durationHours} ساعت
</span>
</li>
<li className="flex justify-between gap-3">
<span>{labels.format}</span>
<span className="font-medium text-foreground text-end">
{formatLabel(course.format)}
</span>
</li>
{priceLabel ? (
<li className="flex justify-between gap-3">
<span>{labels.price}</span>
<span className="font-bold text-primary">{priceLabel}</span>
</li>
) : null}
</ul>
</div>
<CourseRegisterGate
courseSlug={course.slug}
submitLabel={labels.submit}
successLabel={labels.success}
ctaLabel={labels.cta}
formTitle={labels.formTitle}
formDescription={labels.formDescription}
hint={labels.hint}
cancelLabel={labels.cancel}
/>
<TextLink href="/professional" className="block text-sm">
{labels.backToCatalog}
</TextLink>
</aside>
</Container>
</Section>
</main>
);
}
+281
View File
@@ -0,0 +1,281 @@
import Link from "next/link";
import Image from "next/image";
import { ArrowLeft, Building2, Compass, Network } from "lucide-react";
import { Container } from "@/components/atoms/Container";
import { DotCta } from "@/components/atoms/DotCta";
import { Heading } from "@/components/atoms/Heading";
import { MetamorphField } from "@/components/atoms/MetamorphField";
import { Section } from "@/components/atoms/Section";
import { Separator } from "@/components/ui/separator";
import { Badge } from "@/components/ui/badge";
import { buttonVariants } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { cn } from "@/lib/utils";
import { HeroFeatured } from "@/components/molecules/HeroFeatured";
import {
ArticleCard,
EventCard,
IntersectionCard,
} from "@/components/molecules/Cards";
import { ProgramCarousel } from "@/components/organisms/ProgramCarousel";
import type { Article, EventItem, IntersectionTopic, Program, SiteStat } from "@/lib/types";
import { siteMission } from "@/lib/site-config";
import { AnimatedMetric } from "@/components/atoms/AnimatedMetric";
export type HomeLabels = {
executiveLabel: string;
exploreOurPrograms: string;
ideasTitle: string;
eventsTitle: string;
seeAllEvents: string;
intersectionsTitle: string;
intersectionsSubtitle: string;
moreThanDegree: string;
moreThanDegreeBody: string;
keepExploring: string;
hireTitle: string;
hireBody: string;
registerCta: string;
missionTitle: string;
findUsTitle: string;
ideasEyebrow: string;
linksTitle: string;
};
export function HomeHero({
featured,
eyebrow,
}: {
featured: Article;
eyebrow: string;
}) {
return (
<HeroFeatured
title={featured.title}
href={featured.href}
imageUrl={featured.imageUrl}
eyebrow={eyebrow}
/>
);
}
export function HomeIdeas({
articles,
title,
}: {
articles: Article[];
title: string;
}) {
const ideaCards = articles.filter((a) => !a.featured).slice(0, 3);
return (
<>
<Section className="relative py-20 sm:py-28">
<Container>
<div className="grid gap-10 lg:grid-cols-[.8fr_1.2fr] lg:items-start lg:gap-20">
<div className="lg:sticky lg:top-28">
<Badge variant="outline" className="border-primary/20 bg-primary/5 text-primary">چرا امیرکبیر؟</Badge>
<Heading level={2} className="mt-5 text-3xl leading-tight sm:text-4xl">
آموزش برای جهانِ در حال تغییر
</Heading>
<p className="mt-5 text-base leading-8 text-muted-foreground sm:text-lg">
اینجا آموزش، انتقال محتوا نیست؛ فضایی است برای دیدن مسئله از زاویه‌ای تازه، ساختن راه‌حل و اجرای آن در دنیای واقعی.
</p>
</div>
<div className="grid gap-4 sm:grid-cols-3 lg:grid-cols-1">
{[
{ icon: Compass, title: "تفکر راهبردی", text: "دیدن مسئله از زاویه‌های تازه و تبدیل پیچیدگی به تصمیم‌های بهتر." },
{ icon: Building2, title: "اثر سازمانی", text: "یادگیری مبتنی بر مسئله‌های واقعی کسب‌وکار و صنعت ایران." },
{ icon: Network, title: "شبکه‌ی حرفه‌ای", text: "پیوند با مدیران، متخصصان و پژوهشگران برای رشد ماندگار." },
].map((item, index) => (
<Card key={item.title} className="border-border/70 py-0 shadow-none transition-colors hover:border-primary/25">
<CardContent className="flex h-full flex-col gap-5 p-6 lg:flex-row lg:items-center lg:gap-6 lg:p-7">
<div className="flex size-12 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary"><item.icon className="size-6" /></div>
<div><p className="text-xs font-bold text-primary">۰{index + 1}</p><h3 className="mt-1 text-lg font-bold">{item.title}</h3><p className="mt-2 text-sm leading-7 text-muted-foreground">{item.text}</p></div>
</CardContent>
</Card>
))}
</div>
</div>
</Container>
</Section>
<Section className="overflow-hidden py-0">
<Container className="grid max-w-none px-0 lg:grid-cols-2">
<div className="relative min-h-80 lg:min-h-[32rem]">
<Image src="/brand/campus-collaboration-v1.png" alt="همکاری مدرسان و متخصصان در محیط دانشگاه" fill className="object-cover" sizes="(max-width:1024px) 100vw, 50vw" />
</div>
<div className="relative flex items-center overflow-hidden bg-chart-3 px-6 py-14 text-background sm:px-12 lg:px-16">
<MetamorphField tone="dark" density="sparse" className="opacity-20" />
<div className="relative z-[2] max-w-xl">
<p className="text-xs font-bold text-background/55">یادگیری در بستر مسئله‌های واقعی</p>
<Heading level={2} className="mt-3 text-3xl leading-tight text-background sm:text-4xl">جایی برای پیوند دانش دانشگاهی و تجربه‌ی صنعت</Heading>
<p className="mt-5 text-base leading-8 text-background/65">دوره‌ها با مشارکت مدرسان دانشگاه، مدیران و متخصصان طراحی می‌شوند تا آموخته‌ها از کلاس به تصمیم و اجرا برسند.</p>
<Link
href="/about"
className={cn(
buttonVariants({ variant: "outline" }),
"mt-7 border-background/25 bg-transparent text-background hover:bg-background hover:text-foreground",
)}
>
آشنایی با رویکرد ما
</Link>
</div>
</div>
</Container>
</Section>
<Section tone="muted" className="py-20 sm:py-24">
<Container>
<div className="mb-10 flex items-end justify-between gap-4">
<div>
<p className="text-xs font-bold text-primary">دانش برای عمل</p>
<Heading level={2} className="mt-2 text-3xl sm:text-4xl">
<Link href="/insights" className="hover:text-primary">
{title}
</Link>
</Heading>
</div>
<Link
href="/insights"
className={cn(
buttonVariants({ variant: "ghost" }),
"hidden gap-2 text-primary sm:inline-flex",
)}
>
همه بینش‌ها <ArrowLeft className="size-4" />
</Link>
</div>
<div className="grid gap-8 sm:grid-cols-2 lg:grid-cols-3 sm:gap-10">
{ideaCards.map((article) => (
<ArticleCard
key={article.id}
title={article.title}
category={article.category}
excerpt={article.excerpt}
imageUrl={article.imageUrl}
href={article.href}
/>
))}
</div>
</Container>
</Section>
</>
);
}
export function HomeEvents({
events,
title,
seeAllLabel,
}: {
events: EventItem[];
title: string;
seeAllLabel: string;
}) {
return (
<Section className="py-20 sm:py-24">
<Container>
<p className="text-center text-xs font-bold text-primary">در جریان یادگیری</p>
<Heading level={2} className="mt-2 text-center text-3xl sm:text-4xl">
{title}
</Heading>
<Separator className="mx-auto mt-5 max-w-16 bg-primary" />
<div className="mt-10 grid gap-0 border-y border-border sm:grid-cols-2 lg:grid-cols-4">
{events.map((event) => (
<EventCard key={event.id} {...event} variant="home" />
))}
</div>
<div className="mt-10 flex justify-center">
<DotCta href="/events">{seeAllLabel}</DotCta>
</div>
</Container>
</Section>
);
}
export function HomeRest({
labels,
carouselPrograms,
intersections,
stats,
}: {
labels: HomeLabels;
carouselPrograms: Program[];
intersections: IntersectionTopic[];
stats: SiteStat[];
}) {
return (
<>
<Section tone="muted" className="py-20 sm:py-24">
<Container>
<div className="mb-10 max-w-3xl">
<p className="text-xs font-bold text-primary">مرزهای تازه‌ی کسب‌وکار</p>
<Heading level={2} className="mt-2 text-3xl sm:text-4xl">{labels.intersectionsTitle}</Heading>
<p className="mt-3 text-lg font-semibold leading-relaxed text-primary sm:text-xl">
{labels.intersectionsSubtitle}
</p>
</div>
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{intersections.map((topic) => (
<IntersectionCard key={topic.id} {...topic} />
))}
</div>
</Container>
</Section>
<Section className="relative overflow-hidden py-20 sm:py-24">
<MetamorphField tone="light" density="sparse" />
<Container className="relative z-[1]">
<div className="mx-auto mb-10 max-w-2xl text-center">
<Heading level={2}>{labels.moreThanDegree}</Heading>
<p className="mt-4 text-base leading-relaxed text-muted-foreground sm:text-lg">
{labels.moreThanDegreeBody}
</p>
</div>
<ProgramCarousel
title=""
programs={carouselPrograms}
keepExploringLabel={labels.keepExploring}
hideTitle
/>
</Container>
</Section>
<Section tone="dark" className="relative overflow-hidden py-20 sm:py-28">
<MetamorphField
tone="dark"
density="sparse"
className="opacity-[0.4]"
/>
<Container className="relative z-[1] grid gap-12 lg:grid-cols-[1fr_auto] lg:items-end">
<div className="max-w-3xl"><p className="text-xs font-bold text-background/60">همکاری با سازمان‌ها</p><Heading level={2} className="mt-3 text-background sm:text-5xl">
{labels.hireTitle}
</Heading>
<p className="mt-5 max-w-2xl text-base leading-relaxed text-background/75 sm:text-lg">
{labels.hireBody}
</p>
</div><div>
<DotCta href="/professional" onDark>
{labels.registerCta}
</DotCta>
</div>
</Container>
</Section>
<Section className="py-20 sm:py-24">
<Container className="max-w-4xl text-center">
<Heading
level={2}
className="text-sm font-bold uppercase tracking-wider text-muted-foreground"
>
{labels.missionTitle}
</Heading>
<p className="mt-5 text-2xl font-bold leading-relaxed text-foreground sm:text-3xl">
{siteMission}
</p>
<div className="mt-12 grid gap-6 border-t border-border pt-10 sm:grid-cols-3">
{stats.map((stat) => <div key={stat.id}><p className="text-3xl font-black text-primary sm:text-4xl"><AnimatedMetric value={stat.value} /></p><p className="mt-2 text-sm text-muted-foreground">{stat.label}</p></div>)}
</div>
</Container>
</Section>
</>
);
}
@@ -0,0 +1,173 @@
import Image from "next/image";
import { Container } from "@/components/atoms/Container";
import { DotCta } from "@/components/atoms/DotCta";
import { Heading } from "@/components/atoms/Heading";
import { MetamorphField } from "@/components/atoms/MetamorphField";
import { Section } from "@/components/atoms/Section";
import { QuoteBlock } from "@/components/molecules/Cards";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { CategoryCourseExplorer } from "@/components/organisms/CategoryCourseExplorer";
import type { Course, SiteStat, Testimonial } from "@/lib/types";
import { AnimatedMetric } from "@/components/atoms/AnimatedMetric";
export function ProfessionalLandingTemplate({
labels,
courses,
stats,
testimonials,
}: {
labels: {
pathways: string;
exploreCourses: string;
heroTitle: string;
heroBody: string;
findProgram: string;
offeredBy: string;
dppTitle: string;
dppBody: string;
statsTitle: string;
rankTitle: string;
testimonialsTitle: string;
};
courses: Course[];
stats: SiteStat[];
testimonials: Testimonial[];
}) {
return (
<main id="main-content">
<header className="relative isolate min-h-[42rem] overflow-hidden bg-chart-3 text-background">
<div className="absolute inset-0">
<Image
src="https://images.unsplash.com/photo-1497366216548-37526070297c?w=1600&q=80"
alt="نمایی از پردیس دانشگاه"
fill
priority
className="object-cover opacity-35"
sizes="100vw"
/>
</div>
<div
className="absolute inset-0 bg-gradient-to-l from-chart-3 via-chart-3/85 to-chart-3/60"
aria-hidden
/>
<MetamorphField
tone="dark"
className="inset-y-0 end-0 start-auto w-[min(72vw,36rem)] opacity-[0.5]"
/>
<div className="relative z-[2] flex min-h-[inherit] items-center py-12">
<Container>
<div className="max-w-3xl text-start">
<div>
<p className="text-sm font-semibold text-background/75">
{labels.offeredBy}
</p>
<Heading
as="h1"
level={1}
className="mt-4 text-4xl leading-tight text-background sm:text-6xl"
>
{labels.heroTitle}
</Heading>
<p className="mt-5 max-w-xl border-s border-accent ps-5 text-base leading-8 text-background/70">
{labels.heroBody}
</p>
<div className="mt-6">
<DotCta href="#programs" onDark>
{labels.exploreCourses}
</DotCta>
</div>
</div>
</div>
</Container>
</div>
</header>
<Section
id="programs"
tone="dark"
className="relative scroll-mt-24 overflow-hidden py-20 sm:py-24"
>
<MetamorphField
tone="dark"
density="sparse"
className="opacity-[0.28]"
/>
<Container className="relative z-[1]">
<div id="courses" className="scroll-mt-24" />
<div id="certificates" className="scroll-mt-24" />
<div id="corporate" className="scroll-mt-24" />
<p className="mb-6 text-lg font-semibold text-background/80">
{labels.pathways}
</p>
<CategoryCourseExplorer
courses={courses}
findLabel={labels.findProgram}
/>
</Container>
</Section>
<Section id="digital" tone="accent" className="scroll-mt-24 py-16 sm:py-20">
<Container>
<Heading level={2} className="text-primary-foreground">
{labels.dppTitle}
</Heading>
<p className="mt-3 max-w-3xl text-primary-foreground/80">
{labels.dppBody}
</p>
</Container>
</Section>
<Section tone="muted" className="py-20 sm:py-24">
<Container>
<Heading level={2} className="mb-8 text-center">
{labels.statsTitle}
</Heading>
<div className="grid gap-6 sm:grid-cols-3 sm:gap-8">
{stats.map((stat) => (
<div key={stat.id} className="text-center">
<p className="text-4xl font-extrabold text-primary"><AnimatedMetric value={stat.value} /></p>
<p className="mt-2 text-sm text-muted-foreground">{stat.label}</p>
</div>
))}
</div>
</Container>
</Section>
<Section className="py-20 sm:py-24">
<Container className="text-center">
<Heading level={2}>{labels.rankTitle}</Heading>
<div className="mt-6 grid gap-4 sm:grid-cols-2">
<SurfaceCard padded="md" className="text-start">
<p className="text-3xl font-extrabold text-primary">#۱</p>
<p className="mt-2 font-bold">از برترین دانشگاه‌های فنی کشور</p>
<p className="mt-1 text-sm text-muted-foreground">
دانشگاه صنعتی امیرکبیر
</p>
</SurfaceCard>
<SurfaceCard padded="md" className="text-start">
<p className="text-3xl font-extrabold text-primary">۶۰+</p>
<p className="mt-2 font-bold">سال تجربه آموزش عالی</p>
<p className="mt-1 text-sm text-muted-foreground">
میراث علمی و صنعتی
</p>
</SurfaceCard>
</div>
</Container>
</Section>
<Section tone="dark" className="relative overflow-hidden py-20 sm:py-24">
<MetamorphField tone="dark" density="sparse" className="opacity-25" />
<Container className="relative z-[1]">
<Heading level={2} className="mb-6 text-background">
{labels.testimonialsTitle}
</Heading>
<div className="grid gap-4 md:grid-cols-3">
{testimonials.map((item) => (
<QuoteBlock key={item.id} {...item} />
))}
</div>
</Container>
</Section>
</main>
);
}