Apply the public site UI checklist.

Align header, footer, brand, homepage course preview, faculty links, and the course catalog with the documented changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
smhk1376andCursor committed 2026-10-16 14:05:33 +03:30
1 parent 8886aa8640
commit de800d27b1
139 files changed
+3311 -1547

No files matched your search

+2 -1
View File
@@ -2,7 +2,8 @@ import Image from "next/image";
import Link from "next/link";
import { cn } from "@/lib/utils";
const LOGO_SRC = "/brand/amirkabir.png";
/** Faculty seal mark (transparent). Source: MST icon with side text removed. */
const LOGO_SRC = "/brand/mst-faculty.png";
type BrandLogoProps = {
href?: string;
+4 -4
View File
@@ -1,10 +1,10 @@
import { cn } from "@/lib/utils";
const levels = {
1: "text-3xl font-bold tracking-tight sm:text-4xl lg:text-5xl",
2: "text-2xl font-bold tracking-tight sm:text-3xl",
3: "text-lg font-semibold sm:text-xl",
4: "text-base font-semibold sm:text-lg",
1: "text-[1.65rem] font-bold leading-[1.45] tracking-tight text-pretty sm:text-4xl lg:text-[2.75rem] lg:leading-[1.4]",
2: "text-2xl font-bold leading-snug tracking-tight text-pretty sm:text-3xl lg:text-4xl",
3: "text-lg font-semibold leading-snug sm:text-xl",
4: "text-base font-semibold leading-snug sm:text-lg",
} as const;
type HeadingProps = React.ComponentProps<"h1"> & {
+197 -90
View File
@@ -1,73 +1,34 @@
"use client";
import { useEffect, useState } from "react";
import { useEffect, useMemo, useState } from "react";
import { cn } from "@/lib/utils";
type MetamorphFieldProps = {
className?: string;
/** `dark` = light strokes on navy/hero; `light` = ink strokes on sand/muted */
tone?: "dark" | "light";
/** Visual density of the constellation */
/** Visual density of the neural field */
density?: "sparse" | "normal";
};
type Node = { x: number; y: number; r?: number };
type Edge = [number, number];
type Point = { x: number; y: number };
/** Landscape constellation — matches typical flex section bands (≈ 2.5∶1) */
const NODES_NORMAL: Node[] = [
{ x: 40, y: 60, r: 2.1 },
{ x: 130, y: 36, r: 1.7 },
{ x: 220, y: 88, r: 2.4 },
{ x: 100, y: 140, r: 1.5 },
{ x: 190, y: 168, r: 2.0 },
{ x: 310, y: 110, r: 1.6 },
{ x: 400, y: 48, r: 2.2 },
{ x: 480, y: 130, r: 1.8 },
{ x: 560, y: 70, r: 2.5 },
{ x: 650, y: 150, r: 1.6 },
{ x: 740, y: 40, r: 1.9 },
{ x: 830, y: 120, r: 2.1 },
{ x: 920, y: 64, r: 1.7 },
{ x: 1010, y: 140, r: 2.0 },
{ x: 1100, y: 90, r: 1.5 },
{ x: 70, y: 240, r: 2.3 },
{ x: 170, y: 280, r: 1.6 },
{ x: 280, y: 230, r: 2.0 },
{ x: 370, y: 300, r: 1.8 },
{ x: 470, y: 250, r: 2.2 },
{ x: 570, y: 310, r: 1.7 },
{ x: 680, y: 260, r: 2.4 },
{ x: 780, y: 320, r: 1.6 },
{ x: 880, y: 270, r: 2.0 },
{ x: 980, y: 330, r: 1.8 },
{ x: 1080, y: 280, r: 2.1 },
{ x: 120, y: 380, r: 1.5 },
{ x: 250, y: 410, r: 2.2 },
{ x: 390, y: 390, r: 1.7 },
{ x: 530, y: 430, r: 2.0 },
{ x: 670, y: 400, r: 1.9 },
{ x: 810, y: 440, r: 1.6 },
{ x: 950, y: 410, r: 2.3 },
{ x: 1090, y: 450, r: 1.8 },
];
type Node = {
id: number;
x: number;
y: number;
r: number;
layer: number;
active: boolean;
};
const EDGES_NORMAL: Edge[] = [
[0, 1], [1, 2], [0, 3], [1, 3], [2, 4], [3, 4], [2, 5], [4, 5],
[5, 6], [5, 7], [6, 7], [6, 8], [7, 8], [8, 9], [7, 9],
[8, 10], [9, 11], [10, 11], [10, 12], [11, 12], [12, 13], [11, 13], [13, 14],
[3, 15], [4, 16], [5, 17], [7, 18], [8, 19], [9, 20], [11, 21], [12, 22], [13, 23], [14, 24],
[15, 16], [16, 17], [17, 18], [18, 19], [19, 20], [20, 21], [21, 22], [22, 23], [23, 24], [24, 25],
[15, 26], [16, 27], [18, 28], [19, 29], [21, 30], [22, 31], [24, 32], [25, 33],
[26, 27], [27, 28], [28, 29], [29, 30], [30, 31], [31, 32], [32, 33],
];
const NODES_SPARSE = NODES_NORMAL.filter((_, i) => i % 2 === 0);
const EDGES_SPARSE: Edge[] = [
[0, 1], [1, 2], [0, 3], [2, 4], [3, 4], [3, 5], [4, 6], [5, 6],
[5, 7], [6, 8], [7, 8], [7, 9], [8, 10], [9, 10], [9, 11], [10, 12],
[11, 12], [11, 13], [12, 14], [13, 14], [13, 15], [14, 16], [15, 16],
];
type Synapse = {
d: string;
from: number;
to: number;
active: boolean;
weight: number;
};
const VIEW_W = 1200;
const VIEW_H = 480;
@@ -75,9 +36,123 @@ const VIEW_H = 480;
const ENABLE_MQ =
"(min-width: 768px) and (prefers-reduced-motion: no-preference)";
/** Deterministic pseudo-random in [0, 1) from a seed */
function rand(seed: number) {
const x = Math.sin(seed * 12.9898 + 78.233) * 43758.5453;
return x - Math.floor(x);
}
/** Organic cubic link between two nodes (not a straight chord). */
function synapsePath(a: Point, b: Point, seed: number): string {
const dx = b.x - a.x;
const dy = b.y - a.y;
const dist = Math.hypot(dx, dy) || 1;
const nx = -dy / dist;
const ny = dx / dist;
const bulge = (rand(seed) - 0.5) * Math.min(90, dist * 0.45);
const c1x = a.x + dx * 0.35 + nx * bulge;
const c1y = a.y + dy * 0.35 + ny * bulge;
const c2x = a.x + dx * 0.7 - nx * bulge * 0.55;
const c2y = a.y + dy * 0.7 - ny * bulge * 0.55;
return `M ${a.x.toFixed(1)} ${a.y.toFixed(1)} C ${c1x.toFixed(1)} ${c1y.toFixed(1)}, ${c2x.toFixed(1)} ${c2y.toFixed(1)}, ${b.x.toFixed(1)} ${b.y.toFixed(1)}`;
}
/**
* Decorative constellation. Mounted only on desktop with motion allowed —
* SMIL/CSS motion was too expensive on phones.
* Soft layered neural net: nodes in columns, curved synapses between
* adjacent layers — reads as an AI network while staying organic.
*/
function buildNetwork(density: "sparse" | "normal"): {
nodes: Node[];
synapses: Synapse[];
} {
const layerCounts =
density === "sparse" ? [3, 4, 4, 3] : [4, 5, 6, 5, 3];
const layers = layerCounts.length;
const padX = density === "sparse" ? 110 : 80;
const padY = 48;
const nodes: Node[] = [];
let id = 0;
for (let L = 0; L < layers; L++) {
const count = layerCounts[L];
const x =
padX + (L / Math.max(1, layers - 1)) * (VIEW_W - padX * 2);
for (let i = 0; i < count; i++) {
const t = count === 1 ? 0.5 : i / (count - 1);
const y = padY + t * (VIEW_H - padY * 2);
const jitterX = (rand(id * 11 + 1) - 0.5) * 36;
const jitterY = (rand(id * 11 + 2) - 0.5) * 28;
const active = rand(id * 17) > 0.72;
nodes.push({
id,
x: x + jitterX,
y: y + jitterY,
r: active ? 7.5 : 5.2 + rand(id * 3) * 2,
layer: L,
active,
});
id += 1;
}
}
const byLayer = layerCounts.map((_, L) =>
nodes.filter((n) => n.layer === L),
);
const synapses: Synapse[] = [];
let synSeed = 0;
for (let L = 0; L < layers - 1; L++) {
const left = byLayer[L];
const right = byLayer[L + 1];
for (const a of left) {
// Each neuron fans out to 2–3 targets in the next layer
const fan = 2 + Math.floor(rand(a.id * 31) * 2);
const ranked = [...right].sort(
(p, q) =>
Math.abs(p.y - a.y) + rand(a.id + p.id) * 20 -
(Math.abs(q.y - a.y) + rand(a.id + q.id) * 20),
);
for (let k = 0; k < Math.min(fan, ranked.length); k++) {
const b = ranked[k];
const weight = 0.55 + rand(synSeed + 3) * 0.45;
const active =
(a.active || b.active) && rand(synSeed + 7) > 0.45;
synapses.push({
d: synapsePath(a, b, synSeed),
from: a.id,
to: b.id,
active,
weight,
});
synSeed += 1;
}
}
}
// A few skip connections (deeper net feel)
if (layers >= 4) {
const from = byLayer[0];
const to = byLayer[layers - 1];
for (let i = 0; i < Math.min(2, from.length, to.length); i++) {
const a = from[i];
const b = to[Math.min(to.length - 1, i + 1)];
synapses.push({
d: synapsePath(a, b, 900 + i),
from: a.id,
to: b.id,
active: true,
weight: 0.4,
});
}
}
return { nodes, synapses };
}
/**
* Decorative neural-network field — layered nodes + curved synapses.
* Evokes AI / learning systems without looking like a flowchart.
* Desktop + motion only (SVG density is heavy on phones).
*/
export function MetamorphField({
className,
@@ -85,6 +160,10 @@ export function MetamorphField({
density = "normal",
}: MetamorphFieldProps) {
const [enabled, setEnabled] = useState(false);
const { nodes, synapses } = useMemo(
() => buildNetwork(density),
[density],
);
useEffect(() => {
const mq = window.matchMedia(ENABLE_MQ);
@@ -96,19 +175,27 @@ export function MetamorphField({
if (!enabled) return null;
const nodes = density === "sparse" ? NODES_SPARSE : NODES_NORMAL;
const edges = density === "sparse" ? EDGES_SPARSE : EDGES_NORMAL;
const stroke =
tone === "dark" ? "color-mix(in oklab, white 55%, transparent)" : "var(--foreground)";
const fill =
tone === "dark" ? "color-mix(in oklab, white 70%, transparent)" : "var(--primary)";
const edge =
tone === "dark"
? "color-mix(in oklab, white 42%, transparent)"
: "color-mix(in oklab, var(--foreground) 36%, transparent)";
const edgeActive =
tone === "dark"
? "color-mix(in oklab, var(--accent) 70%, white)"
: "var(--primary)";
const soma =
tone === "dark"
? "color-mix(in oklab, white 82%, transparent)"
: "var(--foreground)";
const accent = tone === "dark" ? "var(--accent)" : "var(--primary)";
const core =
tone === "dark" ? "var(--chart-3)" : "var(--background)";
return (
<div
className={cn(
"pointer-events-none absolute inset-0 z-[1] overflow-hidden metamorph-field",
tone === "light" ? "opacity-[0.14]" : "opacity-[0.42]",
tone === "light" ? "opacity-[0.18]" : "opacity-[0.52]",
className,
)}
aria-hidden
@@ -120,35 +207,55 @@ export function MetamorphField({
preserveAspectRatio="xMidYMid slice"
focusable="false"
>
<g stroke={stroke} strokeWidth="0.9">
{edges.map(([a, b], i) => {
const n1 = nodes[a];
const n2 = nodes[b];
if (!n1 || !n2) return null;
return (
<line
key={`e-${i}`}
x1={n1.x}
y1={n1.y}
x2={n2.x}
y2={n2.y}
opacity="0.55"
{synapses.map((s, i) => (
<g key={`syn-${i}`}>
<path
d={s.d}
stroke={s.active ? edgeActive : edge}
strokeWidth={s.active ? 1.35 * s.weight : 1.05 * s.weight}
strokeLinecap="round"
opacity={s.active ? 0.55 : 0.28}
/>
{s.active ? (
<path
className="metamorph-pulse"
d={s.d}
stroke={accent}
strokeWidth={2}
strokeLinecap="round"
strokeDasharray="6 120"
opacity="0.85"
style={{ animationDelay: `${(i % 7) * 0.35}s` }}
/>
);
})}
</g>
<g>
{nodes.map((n, i) => (
) : null}
</g>
))}
{nodes.map((n) => (
<g key={`n-${n.id}`}>
<circle
key={`n-${i}`}
cx={n.x}
cy={n.y}
r={n.r ?? 2}
fill={i % 5 === 0 ? accent : fill}
opacity={i % 5 === 0 ? 0.85 : 0.7}
r={n.r + 10}
fill={n.active ? accent : soma}
opacity={n.active ? 0.16 : 0.08}
/>
))}
</g>
<circle
cx={n.x}
cy={n.y}
r={n.r}
fill={n.active ? accent : soma}
opacity={n.active ? 0.95 : 0.75}
/>
<circle
cx={n.x}
cy={n.y}
r={n.r * 0.38}
fill={core}
opacity="0.5"
/>
</g>
))}
</svg>
</div>
);
+3 -2
View File
@@ -1,12 +1,13 @@
import { cn } from "@/lib/utils";
type SectionProps = React.ComponentProps<"section"> & {
tone?: "default" | "muted" | "dark" | "accent";
tone?: "default" | "subtle" | "muted" | "dark" | "accent";
tight?: boolean;
};
const tones = {
default: "bg-background text-foreground",
subtle: "bg-gradient-to-b from-background to-muted/40 text-foreground",
muted: "bg-muted text-foreground",
dark: "bg-chart-3 text-background",
accent: "bg-primary text-primary-foreground",
@@ -23,7 +24,7 @@ export function Section({
data-tone={tone}
className={cn(
"motion-section relative min-w-0",
tight ? "py-8 sm:py-10" : "py-16 sm:py-24",
tight ? "py-10 sm:py-14" : "py-16 sm:py-24",
tones[tone],
className,
)}
+1 -33
View File
@@ -20,7 +20,7 @@ export function ProgramCard({
className?: string;
}) {
return (
<Card className={cn("group h-full gap-2 border-border/70 py-6 shadow-sm transition-[box-shadow,border-color] hover:border-primary/25 hover:shadow-lg", className)}>
<Card className={cn("group h-full gap-2 py-6 hover:shadow-md hover:ring-primary/25", className)}>
<CardHeader className="gap-1">
{program.tagline ? (
<p className="text-xs font-bold text-primary">{program.tagline}</p>
@@ -219,38 +219,6 @@ export function EventCard({
);
}
export function StatItem({ value, label }: { value: string; label: string }) {
return (
<div className="text-center">
<p className="text-4xl font-extrabold text-accent">{value}</p>
<p className="mt-2 text-sm text-background/70">{label}</p>
</div>
);
}
export function QuoteBlock({
quote,
name,
role,
courseTitle,
}: {
quote: string;
name: string;
role: string;
courseTitle: string;
}) {
return (
<blockquote className="flex h-full flex-col rounded-xl bg-background/5 p-7 ring-1 ring-background/10">
<p className="flex-1 text-sm leading-8 text-background/90">«{quote}»</p>
<footer className="mt-7">
<p className="font-bold text-background">{name}</p>
<p className="mt-0.5 text-sm text-background/55">{role}</p>
<p className="mt-2 text-xs font-semibold text-accent">{courseTitle}</p>
</footer>
</blockquote>
);
}
export function IntersectionCard({
title,
description,
+23
View File
@@ -0,0 +1,23 @@
import { Check } from "lucide-react";
import { cn } from "@/lib/utils";
export function CheckList({
items,
className,
}: {
items: string[];
className?: string;
}) {
return (
<ul className={cn("space-y-3", className)}>
{items.map((item) => (
<li key={item} className="flex items-start gap-3 text-base leading-8">
<span className="mt-1.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary">
<Check className="size-3" aria-hidden />
</span>
<span className="min-w-0 text-foreground/90">{item}</span>
</li>
))}
</ul>
);
}
@@ -0,0 +1,59 @@
import { Mail, MapPin, Phone } from "lucide-react";
import { Heading } from "@/components/atoms/Heading";
import { TextLink } from "@/components/atoms/TextLink";
import { siteAddress } from "@/lib/site-config";
const rowClass = "flex items-start gap-4";
const iconClass =
"flex size-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary";
export function ContactDetails() {
return (
<div className="min-w-0 space-y-8">
<Heading level={3} as="h2">
اطلاعات تماس
</Heading>
<ul className="space-y-6 text-sm leading-7">
<li className={rowClass}>
<span className={iconClass}>
<MapPin className="size-4" aria-hidden />
</span>
<div className="min-w-0">
<p className="font-semibold text-foreground">آدرس</p>
<p className="text-muted-foreground">{siteAddress.line}</p>
<a
href={siteAddress.mapUrl}
target="_blank"
rel="noreferrer"
className="mt-1 inline-block font-medium text-primary underline-offset-4 hover:underline"
>
مشاهده روی نقشه
</a>
</div>
</li>
<li className={rowClass}>
<span className={iconClass}>
<Phone className="size-4" aria-hidden />
</span>
<div className="min-w-0">
<p className="font-semibold text-foreground">تلفن</p>
<p className="text-muted-foreground">
<span dir="ltr">{siteAddress.phone}</span>
</p>
</div>
</li>
<li className={rowClass}>
<span className={iconClass}>
<Mail className="size-4" aria-hidden />
</span>
<div className="min-w-0">
<p className="font-semibold text-foreground">ایمیل</p>
<TextLink href={`mailto:${siteAddress.email}`} tone="accent">
{siteAddress.email}
</TextLink>
</div>
</li>
</ul>
</div>
);
}
+44
View File
@@ -0,0 +1,44 @@
import type { LucideIcon } from "lucide-react";
import { cn } from "@/lib/utils";
export type DetailItem = {
label: string;
value: React.ReactNode;
icon?: LucideIcon;
emphasis?: boolean;
};
/** Label/value rows for side panels and detail pages. */
export function DetailList({
items,
className,
}: {
items: DetailItem[];
className?: string;
}) {
return (
<dl className={cn("divide-y divide-border text-sm", className)}>
{items.map((item) => (
<div
key={item.label}
className="flex items-center justify-between gap-4 py-3 first:pt-0 last:pb-0"
>
<dt className="flex items-center gap-2 text-muted-foreground">
{item.icon ? (
<item.icon className="size-4 shrink-0 text-primary" aria-hidden />
) : null}
{item.label}
</dt>
<dd
className={cn(
"text-end font-semibold",
item.emphasis ? "text-primary" : "text-foreground",
)}
>
{item.value}
</dd>
</div>
))}
</dl>
);
}
+33
View File
@@ -0,0 +1,33 @@
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { cn } from "@/lib/utils";
/** Public-site form wrapper (contact, register, legal pages). */
export function FormCard({
title,
description,
children,
className,
}: {
title: string;
description?: string;
children: React.ReactNode;
className?: string;
}) {
return (
<Card className={cn("gap-0 py-0", className)}>
<CardHeader className="gap-2 p-6 pb-0 sm:p-8 sm:pb-0">
<CardTitle className="text-lg font-bold">{title}</CardTitle>
{description ? (
<CardDescription className="leading-7">{description}</CardDescription>
) : null}
</CardHeader>
<CardContent className="p-6 sm:p-8">{children}</CardContent>
</Card>
);
}
+30 -16
View File
@@ -1,6 +1,8 @@
import Link from "next/link";
import Image from "next/image";
import { ArrowLeft, GraduationCap } from "lucide-react";
import { Container } from "@/components/atoms/Container";
import { Heading } from "@/components/atoms/Heading";
import { MetamorphField } from "@/components/atoms/MetamorphField";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
@@ -17,41 +19,53 @@ export function HeroFeatured({
}) {
return (
<header className="home-hero relative isolate overflow-hidden bg-chart-3 text-background">
<MetamorphField
tone="dark"
density="sparse"
className="end-0 start-auto w-[min(55vw,36rem)] opacity-20"
/>
<div className="pointer-events-none absolute inset-0 z-[1]" aria-hidden>
<Image
src="/brand/amirkabir-arches.png"
alt=""
fill
priority
className="scale-125 object-cover object-[62%_55%] opacity-[0.28] mix-blend-screen sm:scale-110 sm:object-[58%_50%] sm:opacity-[0.32]"
sizes="100vw"
/>
{/* Unified navy wash — keeps text clear and softens the art */}
<div className="absolute inset-0 bg-chart-3/45" />
<div className="absolute inset-0 bg-gradient-to-l from-chart-3/90 via-chart-3/40 to-chart-3/25" />
<div className="absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-chart-3 to-transparent" />
<MetamorphField
tone="dark"
density="sparse"
className="opacity-[0.28]"
/>
</div>
<Container className="relative z-[2] flex min-h-[34rem] min-w-0 items-center py-16 sm:min-h-[36rem] sm:py-20">
<div className="home-hero__copy w-full min-w-0 max-w-4xl text-start">
<div className="home-hero__copy w-full min-w-0 max-w-2xl text-start lg:max-w-3xl">
<div className="inline-flex max-w-full items-start gap-2 text-sm font-medium text-background/60">
<GraduationCap className="mt-0.5 size-4 shrink-0" />
<span className="min-w-0 leading-7 text-pretty">
مرکز آموزش‌های آزاد دانشکده مدیریت، علم و فناوری دانشگاه{"\u00A0"}صنعتی{"\u00A0"}امیرکبیر
</span>
</div>
<h1 className="mt-6 max-w-4xl text-[1.65rem] font-black leading-[1.45] tracking-tight sm:text-4xl lg:text-[2.75rem] lg:leading-[1.4]">
<Heading as="h1" level={1} className="mt-6 max-w-4xl">
برای تصمیم‌هایی که{" "}
<span className="whitespace-nowrap">صنعت را پیش می‌برند</span>
</h1>
</Heading>
<p className="mt-6 max-w-2xl border-t border-accent/60 pt-5 text-base leading-8 text-pretty text-background/65 sm:text-lg sm:leading-8">
دانش امیرکبیر، پشتوانه رهبری نوآور در عصر داده و هوش{"\u00A0"}مصنوعی.
دانش دانشگاه صنعتی امیرکبیر، پشتوانه رهبری نوآور در عصر داده و هوش{"\u00A0"}مصنوعی.
</p>
<div className="mt-9 flex flex-wrap gap-3">
<Link
href="/programs"
className={cn(
buttonVariants({ size: "lg" }),
"bg-primary font-bold text-primary-foreground hover:bg-primary/85",
)}
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "font-bold")}
>
مشاهده دوره‌ها <ArrowLeft className="size-4" />
</Link>
<Link
href="/about"
className={cn(
buttonVariants({ variant: "outline", size: "lg" }),
"border-background/25 bg-transparent font-bold text-background hover:bg-background hover:text-foreground",
buttonVariants({ variant: "inverse", size: "lg" }),
"font-bold",
)}
>
درباره مرکز
+46 -34
View File
@@ -2,50 +2,63 @@ import Image from "next/image";
import { Container } from "@/components/atoms/Container";
import { Heading } from "@/components/atoms/Heading";
import { MetamorphField } from "@/components/atoms/MetamorphField";
import { cn } from "@/lib/utils";
export function PageHero({
title,
intro,
eyebrow,
imageUrl,
actions,
size = "default",
showField = true,
}: {
title: string;
intro?: string;
eyebrow?: string;
imageUrl?: string;
actions?: React.ReactNode;
size?: "default" | "lg";
/** Decorative line field; hide when a strong photo background is enough. */
showField?: boolean;
}) {
const hasPhoto = Boolean(imageUrl);
return (
<header className="page-hero relative isolate overflow-hidden bg-chart-3 py-16 text-background sm:py-24">
{imageUrl ? (
<>
<Image
src={imageUrl}
alt=""
fill
priority
className="object-cover opacity-25"
sizes="100vw"
/>
<div className="absolute inset-0 bg-gradient-to-l from-chart-3 via-chart-3/90 to-chart-3/60" />
</>
) : (
<>
<Image
src="/brand/campus-collaboration-v1.png"
alt=""
fill
priority
className="object-cover opacity-15 grayscale"
sizes="100vw"
/>
<div className="absolute inset-0 bg-gradient-to-l from-chart-3 via-chart-3/95 to-chart-3/75" />
</>
<header
className={cn(
"page-hero relative isolate flex items-center overflow-hidden bg-chart-3 text-background",
size === "lg"
? "min-h-[34rem] py-16 sm:min-h-[38rem] sm:py-20"
: "py-16 sm:py-24",
)}
<MetamorphField
tone="dark"
density="normal"
className="end-0 start-auto w-[min(75vw,42rem)] opacity-45"
>
<Image
src={imageUrl ?? "/brand/campus-collaboration-v1.png"}
alt=""
fill
priority
className={cn(
"object-cover",
hasPhoto ? "opacity-45" : "opacity-15 grayscale",
)}
sizes="100vw"
/>
<div
className={cn(
"absolute inset-0",
hasPhoto
? "bg-gradient-to-l from-chart-3 via-chart-3/85 to-chart-3/55"
: "bg-gradient-to-l from-chart-3 via-chart-3/90 to-chart-3/65",
)}
/>
{showField ? (
<MetamorphField
tone="dark"
density="normal"
className="end-0 start-auto w-[min(75vw,42rem)] opacity-40"
/>
) : null}
<div className="absolute end-0 top-0 h-px w-1/3 bg-gradient-to-l from-accent to-transparent" />
<Container className="relative z-[2] min-w-0">
<div className="page-hero__content w-full min-w-0 max-w-4xl text-start">
@@ -54,11 +67,7 @@ export function PageHero({
{eyebrow}
</p>
) : null}
<Heading
as="h1"
level={1}
className="max-w-4xl text-[1.65rem] leading-[1.45] text-pretty text-background sm:text-4xl lg:text-[2.75rem] lg:leading-[1.4]"
>
<Heading as="h1" level={1} className="max-w-4xl text-background">
{title}
</Heading>
{intro ? (
@@ -66,6 +75,9 @@ export function PageHero({
{intro}
</p>
) : null}
{actions ? (
<div className="mt-8 flex flex-wrap gap-3">{actions}</div>
) : null}
</div>
</Container>
</header>
@@ -0,0 +1,66 @@
import { Heading } from "@/components/atoms/Heading";
import { cn } from "@/lib/utils";
/**
* Eyebrow + title + description for every content section.
* `inverse` is for `Section` tones `dark` / `accent`.
*/
export function SectionHeader({
eyebrow,
title,
description,
inverse = false,
align = "start",
as = "h2",
className,
}: {
eyebrow?: string;
title: React.ReactNode;
description?: React.ReactNode;
inverse?: boolean;
align?: "start" | "center";
as?: "h1" | "h2";
className?: string;
}) {
return (
<div
className={cn(
"mb-10 max-w-3xl min-w-0 sm:mb-12",
align === "center" && "mx-auto text-center",
className,
)}
>
{eyebrow ? (
<p
className={cn(
"text-sm font-bold sm:text-base",
inverse ? "text-accent" : "text-primary",
)}
>
{eyebrow}
</p>
) : null}
<Heading
as={as}
level={2}
className={cn(
"break-words",
eyebrow && "mt-3",
inverse && "text-current",
)}
>
{title}
</Heading>
{description ? (
<p
className={cn(
"mt-4 text-base leading-8 sm:text-lg sm:leading-8",
inverse ? "opacity-75" : "text-muted-foreground",
)}
>
{description}
</p>
) : null}
</div>
);
}
+38
View File
@@ -0,0 +1,38 @@
import { AnimatedMetric } from "@/components/atoms/AnimatedMetric";
import type { SiteStat } from "@/lib/types";
import { cn } from "@/lib/utils";
export function StatGrid({
stats,
inverse = false,
className,
}: {
stats: SiteStat[];
inverse?: boolean;
className?: string;
}) {
return (
<div className={cn("grid min-w-0 gap-8 sm:grid-cols-3", className)}>
{stats.map((stat) => (
<div key={stat.id} className="min-w-0 text-center">
<p
className={cn(
"text-4xl font-extrabold tabular-nums sm:text-5xl",
inverse ? "text-accent" : "text-primary",
)}
>
<AnimatedMetric value={stat.value} />
</p>
<p
className={cn(
"mt-2 text-sm",
inverse ? "text-background/70" : "text-muted-foreground",
)}
>
{stat.label}
</p>
</div>
))}
</div>
);
}
+5 -1
View File
@@ -7,6 +7,8 @@ type SurfaceCardProps = {
id?: string;
padded?: boolean | "sm" | "md" | "lg";
as?: "article" | "div";
/** Hover feedback; only for cards that are (or contain) a primary link. */
interactive?: boolean;
};
const padClass = {
@@ -23,13 +25,15 @@ export function SurfaceCard({
children,
id,
as = "article",
interactive = false,
}: SurfaceCardProps) {
return (
<Card
id={id}
data-slot={as === "div" ? "surface-div" : "surface-article"}
className={cn(
"gap-0 border-border/70 bg-card py-0 shadow-sm transition-[box-shadow,border-color] hover:border-primary/20 hover:shadow-md",
"gap-0 bg-card py-0",
interactive && "hover:shadow-md hover:ring-primary/25",
padded !== false &&
padClass[padded === true ? "true" : (padded as "sm" | "md" | "lg")],
className,
@@ -1,9 +1,10 @@
"use client";
import { useDeferredValue, useMemo, useState } from "react";
import { useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { Search, X } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
@@ -19,11 +20,23 @@ import type { Course, TaxonomyRef } from "@/lib/types";
import {
courseCatalogHref,
courseCategoryHref,
courseFilterHref,
courseTagHref,
} from "@/lib/course-nav";
import { formatCoursePrice, formatLabel } from "@/lib/labels";
import { cn } from "@/lib/utils";
const categoryChipClass =
"h-9 shrink-0 rounded-full px-4 text-sm font-semibold whitespace-nowrap";
const categoryChipIdle =
"text-background/70 hover:bg-background/10 hover:text-background";
const tagChipClass =
"h-7 shrink-0 rounded-full border px-3 text-xs whitespace-nowrap";
const tagChipIdle =
"border-background/15 bg-transparent text-background/65 hover:border-background/35 hover:bg-transparent hover:text-background";
const tagChipActive =
"border-primary bg-primary/20 text-background hover:bg-primary/30";
export function CategoryCourseExplorer({
courses,
findLabel,
@@ -47,35 +60,50 @@ export function CategoryCourseExplorer({
}) {
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
const onCatalogPage = pathname.startsWith("/professional");
// URL is source of truth on the catalog page; home keeps local filter state.
const urlTag = searchParams.get("tag")?.trim() ?? "";
const urlCategory = searchParams.get("category")?.trim() ?? "";
const [query, setQuery] = useState("");
const [categorySlug, setCategorySlug] = useState(initialCategory);
const [tagSlug, setTagSlug] = useState(initialTag);
const [searchOpen, setSearchOpen] = useState(false);
const [localCategory, setLocalCategory] = useState(initialCategory);
const [localTag, setLocalTag] = useState(initialTag);
const deferredQuery = useDeferredValue(query);
const isStale = query !== deferredQuery;
const searchInputRef = useRef<HTMLInputElement>(null);
const syncUrl = (nextTag: string, nextCategory: string) => {
if (pathname !== "/professional" && !pathname.startsWith("/professional")) {
const categorySlug = onCatalogPage ? urlCategory : localCategory;
const tagSlug = onCatalogPage ? urlTag : localTag;
useEffect(() => {
if (searchOpen) {
searchInputRef.current?.focus();
}
}, [searchOpen]);
/** Navigate (catalog) or update local state (home). */
const applyFilters = (nextTag: string, nextCategory: string) => {
if (onCatalogPage) {
router.push(courseFilterHref({ tag: nextTag, category: nextCategory }), {
scroll: false,
});
return;
}
const params = new URLSearchParams();
if (nextTag) params.set("tag", nextTag);
if (nextCategory) params.set("category", nextCategory);
const qs = params.toString();
router.replace(qs ? `/professional?${qs}` : courseCatalogHref(), {
scroll: false,
});
setLocalTag(nextTag);
setLocalCategory(nextCategory);
};
const selectTag = (slug: string) => {
const next = tagSlug === slug ? "" : slug;
setTagSlug(next);
syncUrl(next, categorySlug);
applyFilters(next, categorySlug);
};
const selectCategory = (slug: string) => {
const next = categorySlug === slug ? "" : slug;
setCategorySlug(next);
syncUrl(tagSlug, next);
applyFilters(tagSlug, next);
};
const filtered = useMemo(() => {
@@ -93,188 +121,158 @@ export function CategoryCourseExplorer({
});
}, [courses, categorySlug, tagSlug, deferredQuery]);
const hasFilters = tagSlug !== "" || categorySlug !== "" || query !== "";
const resetFilters = () => {
setCategorySlug("");
setTagSlug("");
setQuery("");
syncUrl("", "");
setSearchOpen(false);
applyFilters("", "");
};
const activeCategory = filterCategories.find((c) => c.slug === categorySlug);
const activeTag = filterTags.find((t) => t.slug === tagSlug);
const closeSearch = () => {
setSearchOpen(false);
setQuery("");
};
return (
<div className="space-y-8">
<form
className="flex flex-col gap-3 sm:flex-row"
onSubmit={(e) => e.preventDefault()}
role="search"
>
<Label className="sr-only" htmlFor="course-search">
{findLabel}
</Label>
<Input
id="course-search"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder={findLabel}
className="h-11 flex-1 border-border bg-background text-foreground placeholder:text-muted-foreground"
/>
<Button type="submit" className="h-11">
جستجو
</Button>
</form>
{filterCategories.length > 0 ? (
<div className="space-y-3">
<span className="text-sm font-semibold text-background/80">
{categoriesLabel}
</span>
<div
className="flex flex-wrap gap-2"
role="tablist"
aria-label={categoriesLabel}
>
<Button
type="button"
role="tab"
size="sm"
variant={categorySlug === "" ? "default" : "ghost"}
aria-selected={categorySlug === ""}
onClick={() => {
setCategorySlug("");
syncUrl(tagSlug, "");
}}
className={cn(
categorySlug !== "" &&
"bg-background/10 text-background/85 hover:bg-background/20 hover:text-background",
)}
<div className="rounded-2xl bg-background/5 p-2 ring-1 ring-background/10">
<div className="flex h-11 items-center gap-2">
{searchOpen ? (
<form
className="animate-in fade-in slide-in-from-left-4 flex h-full min-w-0 flex-1 items-center gap-2 duration-200"
onSubmit={(e) => e.preventDefault()}
role="search"
>
همه
</Button>
{filterCategories.map((item) => (
<Label className="sr-only" htmlFor="course-search">
{findLabel}
</Label>
<div className="relative h-full min-w-0 flex-1">
<Search
className="pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-background/50"
aria-hidden
/>
<Input
ref={searchInputRef}
id="course-search"
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Escape") closeSearch();
}}
placeholder={findLabel}
className="h-full rounded-full border-0 bg-background/10 ps-10 pe-3 text-background placeholder:text-background/45 focus-visible:ring-1 focus-visible:ring-background/30"
/>
</div>
<Button
key={item.id}
type="button"
role="tab"
size="sm"
variant={categorySlug === item.slug ? "default" : "ghost"}
aria-selected={categorySlug === item.slug}
onClick={() => selectCategory(item.slug)}
className={cn(
categorySlug !== item.slug &&
"bg-background/10 text-background/85 hover:bg-background/20 hover:text-background",
)}
variant="ghost"
size="icon"
className="size-10 shrink-0 rounded-full text-background/70 hover:bg-background/10 hover:text-background"
aria-label="بستن جستجو"
onClick={closeSearch}
>
{item.label}
<X className="size-5" />
</Button>
))}
</div>
</div>
) : null}
{filterTags.length > 0 ? (
<div className="space-y-3">
<div className="flex flex-wrap items-center gap-2">
<span className="text-sm font-semibold text-background/80">
{tagsLabel}
</span>
<Button
type="button"
size="sm"
variant={tagSlug === "" ? "default" : "ghost"}
aria-selected={tagSlug === ""}
onClick={() => {
setTagSlug("");
syncUrl("", categorySlug);
}}
className={cn(
tagSlug !== "" &&
"bg-background/10 text-background/85 hover:bg-background/20 hover:text-background",
)}
>
همه
</Button>
{filterTags.map((item) => (
</form>
) : (
<div className="animate-in fade-in flex h-full min-w-0 flex-1 items-center gap-2 duration-200">
<Button
key={item.id}
type="button"
size="sm"
variant={tagSlug === item.slug ? "default" : "ghost"}
aria-selected={tagSlug === item.slug}
onClick={() => selectTag(item.slug)}
className={cn(
tagSlug !== item.slug &&
"bg-background/10 text-background/85 hover:bg-background/20 hover:text-background",
)}
variant="ghost"
size="icon"
className="size-10 shrink-0 rounded-full bg-background/10 text-background hover:bg-background/20 hover:text-background"
aria-label={findLabel}
onClick={() => setSearchOpen(true)}
>
{item.label}
<Search className="size-[1.125rem]" />
</Button>
))}
</div>
{filterCategories.length > 0 ? (
<>
<span
className="h-6 w-px shrink-0 bg-background/15"
aria-hidden
/>
<div
className="flex min-w-0 flex-1 items-center gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
role="tablist"
aria-label={categoriesLabel}
>
<Button
type="button"
role="tab"
variant={categorySlug === "" ? "default" : "ghost"}
aria-selected={categorySlug === ""}
onClick={() => applyFilters(tagSlug, "")}
className={cn(
categoryChipClass,
categorySlug !== "" && categoryChipIdle,
)}
>
همه دوره‌ها
</Button>
{filterCategories.map((item) => (
<Button
key={item.id}
type="button"
role="tab"
variant={categorySlug === item.slug ? "default" : "ghost"}
aria-selected={categorySlug === item.slug}
onClick={() => selectCategory(item.slug)}
className={cn(
categoryChipClass,
categorySlug !== item.slug && categoryChipIdle,
)}
>
{item.label}
</Button>
))}
</div>
</>
) : null}
</div>
)}
</div>
) : null}
{(tagSlug !== "" || categorySlug !== "") && (
<div className="flex flex-wrap items-center gap-2 text-xs text-background/60">
<span>فیلترهای فعال:</span>
{activeCategory ? (
<Badge variant="secondary" className="gap-1 py-0.5 pe-1">
{activeCategory.label}
{filterTags.length > 0 || hasFilters ? (
<div className="mt-2 flex flex-wrap items-center gap-1.5 border-t border-background/10 px-2 pt-2.5 pb-0.5">
{filterTags.length > 0 ? (
<>
<span className="me-1 text-xs text-background/45">
{tagsLabel}
</span>
{filterTags.map((item) => {
const active = tagSlug === item.slug;
return (
<Button
key={item.id}
type="button"
variant="outline"
aria-pressed={active}
onClick={() => selectTag(item.slug)}
className={cn(
tagChipClass,
active ? tagChipActive : tagChipIdle,
)}
>
{item.label}
</Button>
);
})}
</>
) : null}
{hasFilters ? (
<button
type="button"
onClick={() => {
setCategorySlug("");
syncUrl(tagSlug, "");
}}
className="rounded-full p-0.5 hover:bg-foreground/10"
aria-label="حذف فیلتر دسته"
onClick={resetFilters}
className="ms-auto text-xs text-background/55 underline-offset-4 transition-colors hover:text-background hover:underline"
>
×
پاک‌کردن فیلترها
</button>
</Badge>
) : null}
{activeTag ? (
<Badge variant="secondary" className="gap-1 py-0.5 pe-1">
{activeTag.label}
<button
type="button"
onClick={() => {
setTagSlug("");
syncUrl("", categorySlug);
}}
className="rounded-full p-0.5 hover:bg-foreground/10"
aria-label="حذف فیلتر تگ"
>
×
</button>
</Badge>
) : null}
<button
type="button"
onClick={resetFilters}
className="underline underline-offset-4 hover:text-background"
>
پاک‌کردن همه
</button>
{activeTag ? (
<Link
href={courseTagHref(activeTag.slug)}
className="sr-only"
>
{activeTag.label}
</Link>
) : null}
{activeCategory ? (
<Link
href={courseCategoryHref(activeCategory.slug)}
className="sr-only"
>
{activeCategory.label}
</Link>
) : null}
</div>
)}
) : null}
</div>
) : null}
</div>
{filtered.length === 0 ? (
<p className="py-10 text-center text-sm text-background/60">
@@ -292,51 +290,90 @@ export function CategoryCourseExplorer({
return (
<Card
key={course.id}
className="gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10"
className="group relative gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10 transition-colors hover:ring-background/30"
>
<div className="relative aspect-[16/10] overflow-hidden">
{/* Full-card hit target sits under content; badges use pointer-events-auto */}
<Link
href={course.registrationUrl}
className="absolute inset-0 z-0"
aria-label={course.title}
/>
<div className="pointer-events-none relative aspect-[16/10] overflow-hidden">
<Image
src={course.posterImageUrl}
alt={course.title}
alt=""
fill
className="object-cover"
className="object-cover transition-transform duration-300 group-hover:scale-[1.03]"
sizes="(max-width:768px) 100vw, 33vw"
/>
</div>
<CardHeader className="gap-1 px-4 pt-4">
<CardHeader className="pointer-events-none relative z-[1] gap-1 px-4 pt-4">
<CardTitle className="text-base text-background">
<Link
href={course.registrationUrl}
className="transition-opacity hover:opacity-90"
>
{course.title}
</Link>
{course.title}
</CardTitle>
</CardHeader>
<CardContent className="space-y-3 px-4 pb-4">
<CardContent className="pointer-events-none relative z-[1] space-y-3 px-4 pb-4">
<CardDescription className="line-clamp-3 text-background/70">
{course.summary}
</CardDescription>
{(course.categories.length > 0 || course.tags.length > 0) && (
<div className="flex flex-wrap gap-1.5">
{course.categories.map((c) => (
<Badge
key={`cat:${c.id}`}
variant="outline"
className="border-background/25 text-[10px] text-background/80"
>
{c.label}
</Badge>
))}
{course.tags.map((t) => (
<Badge
key={`tag:${t.id}`}
variant="outline"
className="border-background/25 text-[10px] text-background/80"
>
{t.label}
</Badge>
))}
<div className="pointer-events-auto flex flex-wrap gap-1.5">
{course.categories.map((c) => {
const href = onCatalogPage
? courseCategoryHref(
categorySlug === c.slug ? "" : c.slug,
tagSlug,
)
: courseCategoryHref(c.slug);
const active = categorySlug === c.slug;
return (
<Link
key={`cat:${c.id}`}
href={href || courseCatalogHref()}
className="relative z-[2]"
onClick={(e) => e.stopPropagation()}
aria-current={active ? "true" : undefined}
>
<Badge
variant="outline"
className={cn(
"cursor-pointer border-background/25 text-[11px] font-semibold text-background/90 hover:bg-background/15",
active && "border-accent bg-accent/20 text-background",
)}
>
{c.label}
</Badge>
</Link>
);
})}
{course.tags.map((t) => {
const href = onCatalogPage
? courseTagHref(
tagSlug === t.slug ? "" : t.slug,
categorySlug,
)
: courseTagHref(t.slug);
const active = tagSlug === t.slug;
return (
<Link
key={`tag:${t.id}`}
href={href || courseCatalogHref()}
className="relative z-[2]"
onClick={(e) => e.stopPropagation()}
aria-current={active ? "true" : undefined}
>
<Badge
variant="outline"
className={cn(
"cursor-pointer border-background/25 text-[10px] text-background/75 hover:bg-background/15",
active && "border-accent bg-accent/20 text-background",
)}
>
{t.label}
</Badge>
</Link>
);
})}
</div>
)}
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
@@ -351,12 +388,9 @@ export function CategoryCourseExplorer({
</span>
) : null}
</div>
<Link
href={course.registrationUrl}
className="inline-flex text-sm font-semibold text-background underline-offset-4 hover:underline"
>
<span className="inline-flex text-sm font-semibold text-background underline-offset-4 group-hover:underline">
جزئیات و ثبت‌نام
</Link>
</span>
</CardContent>
</Card>
);
@@ -54,7 +54,7 @@ export function ContactInterestForm({
if (sent) {
return (
<p className="rounded-lg border border-primary/25 bg-primary/5 p-4 text-sm text-chart-2">
<p className="rounded-xl border border-primary/25 bg-primary/5 p-4 text-sm leading-7 text-foreground">
{successLabel}
</p>
);
@@ -63,7 +63,7 @@ export function ContactInterestForm({
return (
<form className="space-y-4" onSubmit={handleSubmit}>
{error && (
<p className="rounded-lg bg-destructive/10 p-3 text-sm text-red-600" role="alert">
<p className="rounded-xl bg-destructive/10 p-3 text-sm text-destructive" role="alert">
{error}
</p>
)}
@@ -129,7 +129,7 @@ export function ContactInterestForm({
rows={4}
/>
</div>
<Button type="submit" disabled={loading}>
<Button type="submit" size="lg" className="w-full font-bold" disabled={loading}>
{loading ? "در حال ارسال..." : submitLabel}
</Button>
</form>
+33 -37
View File
@@ -34,45 +34,41 @@ export function CourseRegisterGate({
}: CourseRegisterGateProps) {
const [open, setOpen] = useState(false);
if (!open) {
return (
<div className="space-y-4 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border">
<div className="space-y-2">
<h2 className="text-lg font-bold tracking-tight">{formTitle}</h2>
<p className="text-sm leading-7 text-muted-foreground">{hint}</p>
</div>
<Button
type="button"
size="lg"
className="w-full font-bold"
onClick={() => setOpen(true)}
>
{ctaLabel}
</Button>
</div>
);
}
return (
<Card className="rounded-2xl border-border/70 shadow-lg" id="register-form">
<CardHeader className="space-y-1">
<CardTitle>{formTitle}</CardTitle>
<CardDescription>{formDescription}</CardDescription>
<Card id="register-form" className="gap-0 py-0">
<CardHeader className="gap-2 p-6 pb-0">
<CardTitle className="text-lg font-bold">{formTitle}</CardTitle>
<CardDescription className="leading-7">
{open ? formDescription : hint}
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<ContactInterestForm
courseSlug={courseSlug}
submitLabel={submitLabel}
successLabel={successLabel}
/>
<Button
type="button"
variant="ghost"
className="w-full"
onClick={() => setOpen(false)}
>
{cancelLabel}
</Button>
<CardContent className="space-y-3 p-6">
{open ? (
<>
<ContactInterestForm
courseSlug={courseSlug}
submitLabel={submitLabel}
successLabel={successLabel}
/>
<Button
type="button"
variant="ghost"
className="w-full"
onClick={() => setOpen(false)}
>
{cancelLabel}
</Button>
</>
) : (
<Button
type="button"
size="lg"
className="w-full font-bold"
onClick={() => setOpen(true)}
>
{ctaLabel}
</Button>
)}
</CardContent>
</Card>
);
+46
View File
@@ -0,0 +1,46 @@
"use client";
import { useEffect } from "react";
import Link from "next/link";
import { Container } from "@/components/atoms/Container";
import { Heading } from "@/components/atoms/Heading";
import { Button, buttonVariants } from "@/components/ui/button";
export function ErrorState({
error,
reset,
homeHref = "/",
}: {
error: Error & { digest?: string };
reset: () => void;
homeHref?: string;
}) {
useEffect(() => {
console.error(error);
}, [error]);
return (
<main id="main-content" className="bg-background">
<Container className="flex min-h-[60vh] flex-col items-start justify-center py-20">
<p className="text-sm font-bold text-primary sm:text-base">خطا</p>
<Heading as="h1" level={2} className="mt-3">
بارگذاری صفحه ناموفق بود
</Heading>
<p className="mt-4 max-w-md text-base leading-8 text-muted-foreground">
لطفاً دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
</p>
<div className="mt-8 flex flex-wrap gap-3">
<Button type="button" size="lg" className="font-bold" onClick={reset}>
تلاش مجدد
</Button>
<Link
href={homeHref}
className={buttonVariants({ variant: "outline", size: "lg" })}
>
بازگشت
</Link>
</div>
</Container>
</main>
);
}
+4 -2
View File
@@ -56,17 +56,19 @@ export function SiteFooter({
تماس
</p>
<div className="space-y-1.5 text-sm text-background/75">
<p dir="ltr">
<p>
<a
href={`tel:${siteAddress.phone}`}
dir="ltr"
className="transition-colors hover:text-background"
>
{siteAddress.phone}
</a>
</p>
<p dir="ltr">
<p>
<a
href={`mailto:${siteAddress.email}`}
dir="ltr"
className="transition-colors hover:text-background"
>
{siteAddress.email}
+35 -84
View File
@@ -1,6 +1,5 @@
"use client";
import dynamic from "next/dynamic";
import Link from "next/link";
import { ChevronDown, Menu, X } from "lucide-react";
import { useEffect, useState } from "react";
@@ -18,14 +17,6 @@ import { SearchOverlay } from "@/components/organisms/SearchOverlay";
import type { Course, NavItem, Program } from "@/lib/types";
import { cn } from "@/lib/utils";
const AcademicsOverlay = dynamic(
() =>
import("@/components/organisms/AcademicsOverlay").then(
(m) => m.AcademicsOverlay,
),
{ ssr: false },
);
function NavLink({
item,
isDark,
@@ -62,7 +53,7 @@ function NavDropdown({
<DropdownMenu>
<DropdownMenuTrigger
className={cn(
"inline-flex cursor-pointer items-center gap-1 rounded-lg px-2.5 py-2 text-sm font-semibold transition-colors outline-none",
"inline-flex cursor-pointer items-center gap-1 rounded-lg px-3 py-2 text-sm font-semibold transition-colors outline-none",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
@@ -73,13 +64,12 @@ function NavDropdown({
</DropdownMenuTrigger>
<DropdownMenuContent className="z-[60] w-56 p-1" align="start">
{children.map((child) => (
<DropdownMenuItem key={`nav:${child.href}:${child.label}`} className="p-0">
<Link
href={child.href}
className="w-full cursor-pointer px-1.5 py-1.5"
>
{child.label}
</Link>
<DropdownMenuItem
key={`nav:${child.href}:${child.label}`}
className="cursor-pointer"
render={<Link href={child.href} />}
>
{child.label}
</DropdownMenuItem>
))}
</DropdownMenuContent>
@@ -90,35 +80,26 @@ function NavDropdown({
export function SiteHeader({
items,
searchLabel,
contactLabel,
brandHref = "/",
brandTitle,
brandSubtitle,
academicsLabel,
programSelectorTitle,
executiveLabel,
exploreLabel,
variant = "home",
courses = [],
programs = [],
}: {
items: NavItem[];
searchLabel: string;
contactLabel: string;
brandHref?: string;
brandTitle: string;
brandSubtitle?: string;
academicsLabel: string;
programSelectorTitle: string;
executiveLabel: string;
exploreLabel: string;
variant?: "home" | "professional";
courses?: Course[];
programs?: Program[];
}) {
const [mobileOpen, setMobileOpen] = useState(false);
const [academicsOpen, setAcademicsOpen] = useState(false);
const isDark = variant === "professional";
const standardPrograms = programs.filter((p) => p.group === "standard");
const executivePrograms = programs.filter((p) => p.group === "executive");
useEffect(() => {
if (!mobileOpen) return;
@@ -139,7 +120,7 @@ export function SiteHeader({
: "border-b border-border bg-card/95 text-foreground",
)}
>
<Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-2 sm:h-20 sm:gap-5" dir="rtl">
<Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-3 sm:h-20 sm:gap-6" dir="rtl">
<BrandLogo
href={brandHref}
title={brandTitle}
@@ -149,7 +130,7 @@ export function SiteHeader({
/>
<nav
className="hidden min-w-0 flex-1 items-center justify-start gap-0.5 xl:flex"
className="hidden min-w-0 flex-1 items-center justify-start gap-2 xl:flex"
aria-label="منوی اصلی"
>
{items.map((item) => {
@@ -163,25 +144,13 @@ export function SiteHeader({
/>
);
}
return item.prominent ? (
return (
<NavLink
key={itemKey}
item={item}
isDark={isDark}
className={cn(
"ms-1 inline-flex items-center rounded-md border px-2.5 py-1 text-xs font-bold shadow-sm transition-all",
isDark
? "border-primary-foreground/30 bg-primary-foreground/10 text-primary-foreground hover:bg-primary-foreground hover:text-primary"
: "border-primary/30 bg-primary/10 text-primary hover:bg-primary hover:text-primary-foreground",
)}
/>
) : (
<NavLink
key={itemKey}
item={item}
isDark={isDark}
className={cn(
"rounded-lg px-2.5 py-2 text-sm font-semibold transition-colors",
"rounded-lg px-3 py-2 text-sm font-semibold transition-colors",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
@@ -189,26 +158,25 @@ export function SiteHeader({
/>
);
})}
<Button
variant="outline"
size="sm"
className={cn(
"ms-2 h-9 border-primary/20 font-bold text-primary hover:bg-primary hover:text-primary-foreground",
isDark &&
"border-background/50 bg-transparent text-background hover:bg-background hover:text-foreground",
)}
onClick={() => setAcademicsOpen(true)}
>
{academicsLabel}
</Button>
</nav>
<div
className={cn(
"ms-auto flex shrink-0 items-center gap-0.5 xl:ms-0",
"ms-auto flex shrink-0 items-center gap-2 xl:ms-0",
isDark && "text-background",
)}
>
<Link
href="/contact"
className={cn(
"hidden rounded-lg px-3 py-2 text-sm font-semibold transition-colors sm:inline-flex",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
)}
>
{contactLabel}
</Link>
<SearchOverlay
courses={courses}
programs={programs}
@@ -284,42 +252,25 @@ export function SiteHeader({
<NavLink
item={item}
isDark
className={cn(
"block py-3.5 text-lg font-bold transition-colors hover:text-background/70",
item.prominent &&
"inline-block text-primary underline underline-offset-4",
)}
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
onClick={() => setMobileOpen(false)}
/>
)}
</li>
))}
<li>
<Link
href="/contact"
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
onClick={() => setMobileOpen(false)}
>
{contactLabel}
</Link>
</li>
</ul>
<Button
variant="outline"
className="mt-8 w-full border-background/80 bg-transparent py-3.5 text-background hover:bg-background hover:text-foreground"
onClick={() => {
setMobileOpen(false);
setAcademicsOpen(true);
}}
>
{academicsLabel}
</Button>
</Container>
</div>
) : null}
{academicsOpen ? (
<AcademicsOverlay
open={academicsOpen}
onClose={() => setAcademicsOpen(false)}
title={programSelectorTitle}
executiveLabel={executiveLabel}
exploreLabel={exploreLabel}
standardPrograms={standardPrograms}
executivePrograms={executivePrograms}
/>
) : null}
</>
);
}
@@ -37,7 +37,7 @@ export function AdminShell({
<div className="flex min-w-0 items-center gap-2">
<span className="relative size-6 shrink-0 md:hidden">
<Image
src="/brand/amirkabir.png"
src="/brand/mst-faculty.png"
alt=""
fill
sizes="24px"
@@ -110,7 +110,7 @@ export function AdminSidebar({ userName }: { userName: string }) {
>
<span className="relative size-8 shrink-0">
<Image
src="/brand/amirkabir.png"
src="/brand/mst-faculty.png"
alt=""
fill
sizes="32px"
@@ -121,7 +121,7 @@ export function AdminSidebar({ userName }: { userName: string }) {
<div className="grid flex-1 text-start text-sm leading-tight">
<span className="truncate font-semibold">پنل مدیریت</span>
<span className="truncate text-xs text-muted-foreground">
آموزش آزاد امیرکبیر
آموزش آزاد دانشگاه صنعتی امیرکبیر
</span>
</div>
</SidebarMenuButton>
@@ -0,0 +1,78 @@
"use client";
import { useRouter } from "next/navigation";
import { useState, useTransition } from "react";
import { RefreshCw } from "lucide-react";
import { Button } from "@/components/ui/button";
type SyncPayload = {
ok?: boolean;
error?: string;
data?: {
total: number;
inserted: number;
updated: number;
imagesSaved: number;
};
};
export function FacultySyncButton() {
const router = useRouter();
const [pending, startTransition] = useTransition();
const [busy, setBusy] = useState(false);
const [message, setMessage] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
async function onSync() {
setBusy(true);
setMessage(null);
setError(null);
try {
const res = await fetch("/api/admin/faculty/sync", { method: "POST" });
const body = (await res.json()) as SyncPayload;
if (!res.ok || !body.ok || !body.data) {
setError(body.error ?? "همگام‌سازی ناموفق بود");
return;
}
const { total, inserted, updated, imagesSaved } = body.data;
setMessage(
`${total} استاد خوانده شد — ${inserted} جدید، ${updated} به‌روز` +
(imagesSaved > 0 ? `، ${imagesSaved} تصویر` : ""),
);
startTransition(() => {
router.refresh();
});
} catch {
setError("ارتباط با سرور برقرار نشد");
} finally {
setBusy(false);
}
}
const loading = busy || pending;
return (
<div className="flex flex-col items-stretch gap-1.5 sm:items-end">
<Button
type="button"
variant="outline"
onClick={onSync}
disabled={loading}
className="gap-2"
>
<RefreshCw className={loading ? "size-4 animate-spin" : "size-4"} />
{loading ? "در حال بروزرسانی…" : "بروزرسانی از شبکه اساتید"}
</Button>
{message ? (
<p className="max-w-xs text-xs text-muted-foreground" role="status">
{message}
</p>
) : null}
{error ? (
<p className="max-w-xs text-xs text-destructive" role="alert">
{error}
</p>
) : null}
</div>
);
}
+1 -1
View File
@@ -54,7 +54,7 @@ export function LeadsList({ leads }: { leads: LeadForDashboard[] }) {
return (
<div className="space-y-3">
{error && (
<p className="text-sm text-red-600" role="alert">
<p className="text-sm text-destructive" role="alert">
{error}
</p>
)}
@@ -22,12 +22,15 @@ import type { AdminCourseCategory, AdminCourseTag } from "@/lib/data/admin/taxon
import { AdminFormCard } from "@/components/organisms/admin/AdminPage";
import { ImageUploadField } from "@/components/organisms/admin/ImageUploadField";
type FacultyOption = { id: string; name: string; title: string };
type Payload = {
slug: string;
title: string;
summary: string;
categoryIds: string[];
tagIds: string[];
facultyIds: string[];
durationHours: number | null;
format: string;
price: number | null;
@@ -42,13 +45,19 @@ interface CourseFormProps {
initial?: AdminCourse;
categories: AdminCourseCategory[];
tags: AdminCourseTag[];
faculty: FacultyOption[];
}
function toggleId(ids: string[], id: string): string[] {
return ids.includes(id) ? ids.filter((x) => x !== id) : [...ids, id];
}
export function CourseForm({ initial, categories, tags }: CourseFormProps) {
export function CourseForm({
initial,
categories,
tags,
faculty,
}: CourseFormProps) {
const router = useRouter();
const isEdit = Boolean(initial);
const [form, setForm] = useState<Payload>({
@@ -57,6 +66,7 @@ export function CourseForm({ initial, categories, tags }: CourseFormProps) {
summary: initial?.summary ?? "",
categoryIds: initial?.categoryIds ?? [],
tagIds: initial?.tagIds ?? [],
facultyIds: initial?.facultyIds ?? [],
durationHours: initial?.durationHours ?? null,
format: initial?.format ?? "in-person",
price: initial?.price ?? null,
@@ -345,6 +355,62 @@ export function CourseForm({ initial, categories, tags }: CourseFormProps) {
</div>
) : null}
</div>
<div className="space-y-2">
<Label>اساتید (رفرنس دانشکده)</Label>
{faculty.length === 0 ? (
<p className="text-xs text-muted-foreground">
هنوز استادی تعریف نشده. از «اساتید» در ادمین اضافه کنید و لینک
صفحه دانشکده را وارد کنید.
</p>
) : (
<div className="flex flex-wrap gap-2">
{faculty.map((item) => {
const active = form.facultyIds.includes(item.id);
return (
<Button
key={item.id}
type="button"
size="sm"
variant={active ? "default" : "outline"}
aria-pressed={active}
onClick={() =>
set("facultyIds", toggleId(form.facultyIds, item.id))
}
className="h-8 px-3 text-xs"
>
{item.name}
</Button>
);
})}
</div>
)}
{form.facultyIds.length > 0 ? (
<div className="flex flex-wrap gap-1.5 pt-1">
{form.facultyIds.map((id) => {
const item = faculty.find((f) => f.id === id);
return (
<Badge key={id} variant="secondary" className="gap-1 py-1 pe-1">
{item?.name ?? id}
<button
type="button"
onClick={() =>
set(
"facultyIds",
form.facultyIds.filter((x) => x !== id),
)
}
className="rounded-full p-0.5 hover:bg-foreground/10"
aria-label="حذف استاد"
>
×
</button>
</Badge>
);
})}
</div>
) : null}
</div>
</section>
<Separator />
@@ -48,7 +48,7 @@ export function DeleteCourseDialog({ id, title }: { id: string; title: string })
دوره «{title}» برای همیشه حذف می‌شود. این عمل قابل بازگشت نیست.
</DialogDescription>
</DialogHeader>
{error && <p className="text-sm text-red-600">{error}</p>}
{error && <p className="text-sm text-destructive">{error}</p>}
<DialogFooter>
<Button type="button" variant="outline" onClick={() => setOpen(false)}>
انصراف
@@ -40,7 +40,7 @@ export function PublishToggle({ id, published }: { id: string; published: boolea
>
{loading ? "..." : published ? "منتشرشده" : "پیش‌نویس"}
</Button>
{error && <p className="mt-1 max-w-40 text-xs text-red-600">{error}</p>}
{error && <p className="mt-1 max-w-40 text-xs text-destructive">{error}</p>}
</div>
);
}
@@ -58,7 +58,7 @@ export function GenericDeleteDialog({
«{subject}» برای همیشه حذف می‌شود. این عمل قابل بازگشت نیست.
</DialogDescription>
</DialogHeader>
{error && <p className="text-sm text-red-600">{error}</p>}
{error && <p className="text-sm text-destructive">{error}</p>}
<DialogFooter>
<Button type="button" variant="outline" onClick={() => setOpen(false)}>
انصراف
@@ -48,7 +48,7 @@ export function PublishToggle({
>
{loading ? "..." : published ? "منتشرشده" : "پیش‌نویس"}
</Button>
{error && <p className="mt-1 max-w-40 text-xs text-red-600">{error}</p>}
{error && <p className="mt-1 max-w-40 text-xs text-destructive">{error}</p>}
</div>
);
}
+127
View File
@@ -0,0 +1,127 @@
import Link from "next/link";
import { ArrowUpLeft } from "lucide-react";
import { DotCta } from "@/components/atoms/DotCta";
import { Container } from "@/components/atoms/Container";
import { Heading } from "@/components/atoms/Heading";
import { Section } from "@/components/atoms/Section";
import { PageHero } from "@/components/molecules/PageHero";
import { SectionHeader } from "@/components/molecules/SectionHeader";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { buttonVariants } from "@/components/ui/button";
import { aboutContent, facultyNetworkUrl } from "@/lib/site-config";
import type { IntersectionTopic } from "@/lib/types";
import { cn } from "@/lib/utils";
function ProseBlock({ paragraphs }: { paragraphs: string[] }) {
return (
<div className="max-w-3xl space-y-4">
{paragraphs.map((paragraph, index) => (
<p
key={index}
className="text-base leading-8 text-muted-foreground sm:text-lg sm:leading-8"
>
{paragraph}
</p>
))}
</div>
);
}
export function AboutTemplate({ topics }: { topics: IntersectionTopic[] }) {
const { amirkabir, faculty, learning, topics: topicsCopy, audience } =
aboutContent;
return (
<>
<PageHero
eyebrow={aboutContent.eyebrow}
title={aboutContent.title}
intro={aboutContent.intro}
/>
<Section tone="subtle">
<Container>
<p className="max-w-3xl text-base leading-8 text-foreground sm:text-lg sm:leading-8">
{aboutContent.introFollowUp}
</p>
</Container>
</Section>
<Section>
<Container>
<SectionHeader title={amirkabir.title} />
<ProseBlock paragraphs={amirkabir.paragraphs} />
</Container>
</Section>
<Section tone="muted">
<Container>
<SectionHeader title={faculty.title} />
<ProseBlock paragraphs={faculty.paragraphs} />
<div className="mt-8">
<DotCta href={facultyNetworkUrl} external>
{faculty.ctaLabel}
</DotCta>
</div>
</Container>
</Section>
<Section>
<Container>
<SectionHeader title={learning.title} />
<ProseBlock paragraphs={learning.paragraphs} />
</Container>
</Section>
<Section tone="subtle">
<Container>
<SectionHeader
title={topicsCopy.title}
description={topicsCopy.description}
/>
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{topics.map((topic) => (
<Link
key={topic.id}
href={topic.href}
className="group block h-full"
>
<SurfaceCard padded interactive className="h-full">
<div className="flex items-start justify-between gap-3">
<Heading
as="h3"
level={4}
className="transition-colors group-hover:text-primary"
>
{topic.title}
</Heading>
<ArrowUpLeft className="mt-1 size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-primary" />
</div>
<p className="mt-2 text-sm leading-7 text-muted-foreground">
{topic.description}
</p>
</SurfaceCard>
</Link>
))}
</div>
<p className="mt-6 max-w-3xl text-sm leading-7 text-muted-foreground">
{topicsCopy.note}
</p>
<Link
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "mt-8 font-bold")}
>
مشاهده دوره‌ها
</Link>
</Container>
</Section>
<Section>
<Container>
<SectionHeader title={audience.title} />
<ProseBlock paragraphs={audience.paragraphs} />
</Container>
</Section>
</>
);
}
+110 -105
View File
@@ -1,12 +1,17 @@
import Image from "next/image";
import { Clock, Layers, Tag, Wallet } from "lucide-react";
import Link from "next/link";
import { ArrowUpLeft, Clock, Layers, Wallet } from "lucide-react";
import { Container } from "@/components/atoms/Container";
import { Heading } from "@/components/atoms/Heading";
import { Section } from "@/components/atoms/Section";
import { TextLink } from "@/components/atoms/TextLink";
import { DetailList, type DetailItem } from "@/components/molecules/DetailList";
import { PageHero } from "@/components/molecules/PageHero";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { CourseRegisterGate } from "@/components/organisms/CourseRegisterGate";
import { Separator } from "@/components/ui/separator";
import { Badge } from "@/components/ui/badge";
import type { Course } from "@/lib/types";
import { courseCategoryHref, courseTagHref } from "@/lib/course-nav";
import { formatCoursePrice, formatLabel } from "@/lib/labels";
import { JsonLd, courseJsonLd } from "@/lib/seo/json-ld";
@@ -36,19 +41,9 @@ export function CourseDetailTemplate({
labels: CourseDetailLabels;
}) {
const priceLabel = formatCoursePrice(course.price);
const categoryText =
course.categories.map((c) => c.label).join(" · ") || "—";
const specs = [
{
icon: Tag,
label: labels.category,
value: categoryText,
},
{
icon: Layers,
label: labels.format,
value: formatLabel(course.format),
},
const instructors = course.instructors ?? [];
const details: DetailItem[] = [
{ icon: Layers, label: labels.format, value: formatLabel(course.format) },
...(course.durationHours
? [
{
@@ -58,16 +53,14 @@ export function CourseDetailTemplate({
},
]
: []),
...(priceLabel
? [
{
icon: Wallet,
label: labels.price,
value: priceLabel,
},
]
: []),
{
icon: Wallet,
label: labels.price,
value: priceLabel ?? labels.priceUnset,
emphasis: Boolean(priceLabel),
},
];
const hasTaxonomy = course.categories.length > 0 || course.tags.length > 0;
return (
<main id="main-content">
@@ -75,99 +68,111 @@ export function CourseDetailTemplate({
<PageHero
title={course.title}
intro={course.summary}
eyebrow={
course.categories[0]?.label ??
course.tags[0]?.label ??
undefined
}
eyebrow={course.categories[0]?.label ?? course.tags[0]?.label}
imageUrl={course.posterImageUrl}
/>
<Section className="bg-gradient-to-b from-background to-muted/40">
<Container className="grid min-w-0 gap-10 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,22rem)] 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.brochureImageUrl}
alt={course.title}
fill
className="object-cover"
sizes="(max-width:1024px) 100vw, 60vw"
priority
/>
</div>
<Section tone="subtle">
<Container className="grid min-w-0 gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,22rem)] lg:items-start lg:gap-12">
<div className="min-w-0 space-y-10">
<div className="relative aspect-[16/9] overflow-hidden rounded-2xl bg-muted ring-1 ring-foreground/10">
<Image
src={course.brochureImageUrl}
alt={course.title}
fill
className="object-cover"
sizes="(max-width:1024px) 100vw, 60vw"
priority
/>
</div>
<section className="space-y-4">
<h2 className="text-xl font-bold tracking-tight">
<Heading level={3} as="h2">
{labels.aboutTitle}
</h2>
</Heading>
<p className="text-base leading-8 text-foreground/90">
{course.summary}
{course.seoDescription || 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>
{instructors.length > 0 ? (
<section className="space-y-4">
<Heading level={3} as="h2">
اساتید
</Heading>
<ul className="grid gap-3 sm:grid-cols-2">
{instructors.map((person) => {
const body = (
<>
<span className="block font-semibold text-foreground">
{person.name}
</span>
{person.title ? (
<span className="mt-1 block text-xs text-muted-foreground">
{person.title}
</span>
) : null}
</>
);
return (
<li key={person.id}>
{person.profileUrl ? (
<a
href={person.profileUrl}
target="_blank"
rel="noopener noreferrer"
className="group flex items-center justify-between gap-3 rounded-xl bg-card p-4 text-sm ring-1 ring-foreground/10 transition-shadow hover:shadow-md hover:ring-primary/25"
>
<span className="min-w-0">{body}</span>
<ArrowUpLeft className="size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-primary" />
</a>
) : (
<div className="rounded-xl bg-card p-4 text-sm ring-1 ring-foreground/10">
{body}
</div>
)}
</li>
);
})}
</ul>
</section>
) : null}
{hasTaxonomy ? (
<section className="space-y-4">
<Heading level={3} as="h2">
{labels.category}
</Heading>
<div className="flex flex-wrap gap-2">
{course.categories.map((c) => (
<Link key={c.id} href={courseCategoryHref(c.slug)}>
<Badge className="h-7 cursor-pointer px-3 text-sm font-semibold">
{c.label}
</Badge>
</Link>
))}
{course.tags.map((t) => (
<Link key={t.id} href={courseTagHref(t.slug)}>
<Badge
variant="outline"
className="h-7 cursor-pointer px-3 text-xs hover:bg-muted"
>
{t.label}
</Badge>
</Link>
))}
</div>
</section>
) : null}
</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">
{course.durationHours ? (
<li className="flex justify-between gap-3">
<span>{labels.duration}</span>
<span className="font-medium text-foreground">
{course.durationHours} ساعت
</span>
</li>
) : null}
<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>
<aside className="min-w-0 space-y-4 lg:sticky lg:top-28">
<SurfaceCard padded as="div">
<p className="mb-4 text-sm font-bold text-foreground">
{labels.detailsTitle}
</p>
<DetailList items={details} />
</SurfaceCard>
<CourseRegisterGate
courseSlug={course.slug}
@@ -180,7 +185,7 @@ export function CourseDetailTemplate({
cancelLabel={labels.cancel}
/>
<TextLink href="/professional" className="block text-sm">
<TextLink href="/professional" className="block px-1 text-sm">
{labels.backToCatalog}
</TextLink>
</aside>
+202 -142
View File
@@ -6,20 +6,27 @@ 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 {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { cn } from "@/lib/utils";
import { HeroFeatured } from "@/components/molecules/HeroFeatured";
import {
EventCard,
IntersectionCard,
} from "@/components/molecules/Cards";
import { ProgramCarousel } from "@/components/organisms/ProgramCarousel";
import type { Article, EventItem, IntersectionTopic, Program, SiteStat } from "@/lib/types";
import { IntersectionCard } from "@/components/molecules/Cards";
import { SectionHeader } from "@/components/molecules/SectionHeader";
import { StatGrid } from "@/components/molecules/StatGrid";
import type {
Article,
Course,
IntersectionTopic,
SiteStat,
} from "@/lib/types";
import { formatCoursePrice, formatLabel } from "@/lib/labels";
import { siteMission } from "@/lib/site-config";
import { AnimatedMetric } from "@/components/atoms/AnimatedMetric";
export type HomeLabels = {
executiveLabel: string;
@@ -39,8 +46,27 @@ export type HomeLabels = {
findUsTitle: string;
ideasEyebrow: string;
linksTitle: string;
exploreCourses?: string;
};
const ideas = [
{
icon: Compass,
title: "پشتوانه علمی دانشگاه صنعتی امیرکبیر",
text: "آموزش مدیریت در بستر دانشگاه صنعتی امیرکبیر، با تکیه بر دانش تخصصی، استدلال علمی و نگاه نقادانه.",
},
{
icon: Building2,
title: "پیوند مدیریت و فناوری",
text: "نگاهی میان‌رشته‌ای به داده و هوش مصنوعی؛ با توجه به تأثیر آن‌ها بر تصمیم‌های مدیریتی، مدل‌های کسب‌وکار و آینده صنعت.",
},
{
icon: Network,
title: "تمرکز بر مسائل صنعت",
text: "توسعه توانمندی مدیران با توجه به چالش‌های اجرای نوآوری، تغییر فرایندها و بهبود عملکرد سازمان.",
},
];
export function HomeHero({
featured,
eyebrow,
@@ -60,100 +86,162 @@ export function HomeHero({
export function HomeIdeas() {
return (
<>
<Section className="relative py-20 sm:py-28">
<Section>
<Container>
<div className="grid min-w-0 gap-10 lg:grid-cols-[minmax(0,.8fr)_minmax(0,1.2fr)] lg:items-start lg:gap-20">
<div className="min-w-0 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 break-words sm:text-4xl">
مدیریت با پشتوانه دانش مهندسی
</Heading>
<p className="mt-5 text-base leading-8 text-muted-foreground sm:text-lg">
هویت مهندسی و فناورانه دانشگاه صنعتی امیرکبیر به آموزش مدیریت در این دانشگاه جهت می‌دهد. در مرکز آموزش‌های آزاد دانشکده مدیریت، علم و فناوری، توسعه مدیران با شناخت فناوری و مسائل صنعت پیوند دارد.
</p>
<SectionHeader
className="mb-0 sm:mb-0"
eyebrow="چرا دانشگاه صنعتی امیرکبیر؟"
title="مدیریت با پشتوانه دانش مهندسی"
description="هویت مهندسی و فناورانه دانشگاه صنعتی امیرکبیر به آموزش مدیریت در این دانشگاه جهت می‌دهد. در مرکز آموزش‌های آزاد دانشکده مدیریت، علم و فناوری، توسعه مدیران با شناخت فناوری و مسائل صنعت پیوند دارد."
/>
</div>
<div className="grid min-w-0 gap-4 md: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="min-w-0 border-border/70 py-0 shadow-none transition-colors hover:border-primary/25">
<CardContent className="flex h-full min-w-0 flex-col gap-5 p-5 sm: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 className="min-w-0"><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 className="grid min-w-0 gap-8 md:grid-cols-3 lg:grid-cols-1 lg:gap-10">
{ideas.map((item) => (
<div
key={item.title}
className="flex min-w-0 flex-col gap-4 lg:flex-row lg:items-start lg:gap-5"
>
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">
<item.icon className="size-6" />
</div>
<div className="min-w-0">
<Heading as="h3" level={3}>
{item.title}
</Heading>
<p className="mt-2 text-sm leading-7 text-muted-foreground">
{item.text}
</p>
</div>
</div>
))}
</div>
</div>
</Container>
</Section>
<section className="overflow-hidden bg-chart-3 text-background">
<div className="grid min-w-0 lg:grid-cols-2">
<div className="relative z-[1] order-2 flex min-w-0 flex-col justify-center gap-4 px-5 py-8 sm:gap-5 sm:px-10 sm:py-10 lg:order-1 lg:min-h-[22rem] lg:px-14 lg:py-12">
<p className="text-xs font-bold text-background/55">
رویکرد آموزشی ما
</p>
<Heading
level={2}
className="text-2xl leading-snug break-words text-background sm:text-3xl lg:text-[2.125rem] lg:leading-snug"
>
دانش امیرکبیر، در خدمت تحول صنعت
</Heading>
<p className="max-w-xl text-sm leading-7 text-background/70 sm:text-base sm:leading-8">
امیرکبیر، دانش تخصصی و چارچوب‌های مدیریتی را برای مواجهه با چالش‌های صنعت در اختیار مدیران قرار می‌دهد؛ از شناخت ظرفیت‌های داده و هوش مصنوعی تا ارزیابی تصمیم‌ها و راهبری نوآوری در سازمان.
</p>
<Link
href="/about"
className={cn(
buttonVariants({ variant: "outline" }),
"mt-1 w-fit border-background/30 bg-transparent text-background hover:bg-background hover:text-foreground",
)}
>
آشنایی با رویکرد ما
</Link>
</div>
<div className="relative order-1 aspect-[16/10] min-h-0 lg:order-2 lg:aspect-auto lg:min-h-full lg:self-stretch">
<Image
src="/brand/campus-collaboration-v1.png"
alt="همکاری مدرسان و متخصصان در محیط دانشگاه"
fill
className="object-cover"
sizes="(max-width:1024px) 100vw, 50vw"
/>
</div>
</div>
</section>
</>
);
}
export function HomeEvents({
events,
title,
seeAllLabel,
export function HomeCourseSearch({
courses,
exploreLabel = "مشاهده دوره‌ها",
}: {
events: EventItem[];
title: string;
seeAllLabel: string;
courses: Course[];
exploreLabel?: string;
}) {
return (
<Section className="py-20 sm:py-24">
<Section tone="dark" className="overflow-hidden">
<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 min-w-0 gap-0 border-y border-border md:grid-cols-2 lg:grid-cols-4">
{events.map((event) => (
<EventCard key={event.id} {...event} variant="home" />
))}
</div>
<SectionHeader
inverse
eyebrow="دوره‌های کوتاه"
title="جدیدترین دوره‌ها"
/>
{courses.length === 0 ? (
<p className="py-10 text-center text-sm text-background/60">
در حال حاضر دوره‌ای برای نمایش نیست.
</p>
) : (
<div className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
{courses.map((course) => {
const priceLabel = formatCoursePrice(course.price);
return (
<Card
key={course.id}
className="group relative gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10 transition-colors hover:ring-background/30"
>
<Link
href={course.registrationUrl}
className="absolute inset-0 z-0"
aria-label={course.title}
/>
<div className="relative aspect-[16/10] overflow-hidden">
<Image
src={course.posterImageUrl}
alt={course.title}
fill
className="object-cover transition-transform duration-300 group-hover:scale-[1.03]"
sizes="(max-width:768px) 100vw, 33vw"
/>
</div>
<CardHeader className="relative z-[1] gap-1 px-4 pt-4">
<CardTitle className="text-base text-background">
{course.title}
</CardTitle>
</CardHeader>
<CardContent className="relative z-[1] space-y-3 px-4 pb-4">
<CardDescription className="line-clamp-2 text-background/70">
{course.summary}
</CardDescription>
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
<span>
{course.durationHours
? `${course.durationHours} ساعت · ${formatLabel(course.format)}`
: formatLabel(course.format)}
</span>
{priceLabel ? (
<span className="font-semibold text-background/90">
{priceLabel}
</span>
) : null}
</div>
</CardContent>
</Card>
);
})}
</div>
)}
<div className="mt-10 flex justify-center">
<DotCta href="/events">{seeAllLabel}</DotCta>
<Link
href="/professional"
className={cn(
buttonVariants({ variant: "inverse", size: "lg" }),
"font-bold",
)}
>
{exploreLabel}
</Link>
</div>
</Container>
</Section>
);
}
export function HomeApproach() {
return (
<Section>
<Container>
<div className="overflow-hidden rounded-2xl bg-chart-3 text-background">
<div className="grid min-w-0 lg:grid-cols-2">
<div className="relative z-[1] order-2 flex min-w-0 flex-col justify-center px-6 py-10 sm:px-10 lg:order-1 lg:min-h-[22rem] lg:px-12 lg:py-14">
<SectionHeader
inverse
className="mb-0 sm:mb-0"
eyebrow="رویکرد آموزشی ما"
title="دانش دانشگاه صنعتی امیرکبیر، در خدمت تحول صنعت"
description="دانشگاه صنعتی امیرکبیر، دانش تخصصی و چارچوب‌های مدیریتی را برای مواجهه با چالش‌های صنعت در اختیار مدیران قرار می‌دهد؛ از شناخت ظرفیت‌های داده و هوش مصنوعی تا ارزیابی تصمیم‌ها و راهبری نوآوری در سازمان."
/>
<Link
href="/about"
className={cn(
buttonVariants({ variant: "inverse", size: "lg" }),
"mt-8 w-fit font-bold",
)}
>
آشنایی با رویکرد ما
</Link>
</div>
<div className="relative order-1 aspect-[16/10] min-h-0 lg:order-2 lg:aspect-auto lg:min-h-full lg:self-stretch">
<Image
src="/brand/campus-collaboration-v1.png"
alt="همکاری مدرسان و متخصصان در محیط دانشگاه"
fill
className="object-cover"
sizes="(max-width:1024px) 100vw, 50vw"
/>
</div>
</div>
</div>
</Container>
</Section>
@@ -162,26 +250,22 @@ export function HomeEvents({
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">
<Section tone="muted">
<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>
<SectionHeader
eyebrow="حوزه‌های آموزشی"
title={labels.intersectionsTitle}
description={labels.intersectionsSubtitle}
/>
<div className="grid min-w-0 gap-4 sm:grid-cols-2 lg:grid-cols-4">
{intersections.map((topic) => (
<IntersectionCard key={topic.id} {...topic} />
@@ -190,38 +274,17 @@ export function HomeRest({
</Container>
</Section>
<Section className="relative overflow-hidden py-20 sm:py-24">
<MetamorphField tone="light" density="sparse" />
<Container className="relative z-[1] min-w-0">
<div className="mx-auto mb-10 max-w-2xl text-center">
<Heading level={2} className="break-words">{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
<Section tone="dark" className="overflow-hidden">
<MetamorphField tone="dark" density="sparse" className="opacity-40" />
<Container className="relative z-[1] grid min-w-0 gap-8 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end lg:gap-12">
<SectionHeader
inverse
className="mb-0 sm:mb-0"
eyebrow="همکاری با سازمان‌ها"
title={labels.hireTitle}
description={labels.hireBody}
/>
</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 min-w-0 gap-10 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end lg:gap-12">
<div className="min-w-0 max-w-3xl"><p className="text-xs font-bold text-background/60">همکاری با سازمان‌ها</p><Heading level={2} className="mt-3 break-words 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 className="shrink-0">
<div className="shrink-0">
<DotCta href="/professional" onDark>
{labels.registerCta}
</DotCta>
@@ -229,20 +292,17 @@ export function HomeRest({
</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-xl font-bold leading-relaxed break-words text-foreground sm:text-2xl md:text-3xl">
{siteMission}
</p>
<div className="mt-12 grid min-w-0 gap-6 border-t border-border pt-10 sm:grid-cols-3">
{stats.map((stat) => <div key={stat.id} className="min-w-0"><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>
<Section>
<Container className="max-w-4xl">
<SectionHeader
align="center"
eyebrow={labels.missionTitle}
title={siteMission}
/>
<StatGrid
stats={stats}
className="border-t border-border pt-10"
/>
</Container>
</Section>
</>
@@ -1,20 +1,33 @@
import Image from "next/image";
import { Suspense } from "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 { QuoteBlock } from "@/components/molecules/Cards";
import { PageHero } from "@/components/molecules/PageHero";
import { SectionHeader } from "@/components/molecules/SectionHeader";
import { StatGrid } from "@/components/molecules/StatGrid";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { CategoryCourseExplorer } from "@/components/organisms/CategoryCourseExplorer";
import type { Course, SiteStat, TaxonomyRef, Testimonial } from "@/lib/types";
import { AnimatedMetric } from "@/components/atoms/AnimatedMetric";
import type { Course, SiteStat, TaxonomyRef } from "@/lib/types";
const highlights = [
{
value: "#۱",
title: "از برترین دانشگاه‌های فنی کشور",
text: "دانشگاه صنعتی امیرکبیر",
},
{
value: "۶۰+",
title: "سال تجربه آموزش عالی",
text: "میراث علمی و صنعتی",
},
];
export function ProfessionalLandingTemplate({
labels,
courses,
stats,
testimonials,
filterCategories,
filterTags,
initialTag = "",
@@ -31,11 +44,9 @@ export function ProfessionalLandingTemplate({
dppBody: string;
statsTitle: string;
rankTitle: string;
testimonialsTitle: string;
};
courses: Course[];
stats: SiteStat[];
testimonials: Testimonial[];
filterCategories: TaxonomyRef[];
filterTags: TaxonomyRef[];
initialTag?: string;
@@ -43,140 +54,82 @@ export function ProfessionalLandingTemplate({
}) {
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] min-w-0 items-center py-12">
<Container>
<div className="w-full min-w-0 max-w-4xl text-start">
<div className="min-w-0">
<p className="text-sm font-semibold text-background/75">
{labels.offeredBy}
</p>
<Heading
as="h1"
level={1}
className="mt-4 max-w-4xl text-[1.65rem] leading-[1.45] text-pretty text-background sm:text-4xl lg:text-[2.75rem] lg:leading-[1.4]"
>
{labels.heroTitle}
</Heading>
<p className="mt-5 max-w-2xl border-t border-accent/60 pt-5 text-base leading-8 text-pretty text-background/70 sm:text-lg sm:leading-8">
{labels.heroBody}
</p>
<div className="mt-6">
<DotCta href="#programs" onDark>
{labels.exploreCourses}
</DotCta>
</div>
</div>
</div>
</Container>
</div>
</header>
<PageHero
size="lg"
showField={false}
eyebrow={labels.offeredBy}
title={labels.heroTitle}
intro={labels.heroBody}
imageUrl="/brand/seminar-room.jpg"
actions={
<DotCta href="#programs" onDark>
{labels.exploreCourses}
</DotCta>
}
/>
<Section
id="programs"
tone="dark"
className="relative scroll-mt-24 overflow-hidden py-20 sm:py-24"
className="scroll-mt-24 overflow-hidden border-t border-background/10"
>
<MetamorphField
tone="dark"
density="sparse"
className="opacity-[0.28]"
/>
<MetamorphField tone="dark" density="sparse" className="opacity-30" />
<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
key={`${initialTag}|${initialCategory}`}
courses={courses}
findLabel={labels.findProgram}
filterCategories={filterCategories}
filterTags={filterTags}
initialTag={initialTag}
initialCategory={initialCategory}
<SectionHeader
inverse
eyebrow="جستجوی دوره‌ها"
title={labels.pathways}
/>
<Suspense fallback={null}>
<CategoryCourseExplorer
courses={courses}
findLabel={labels.findProgram}
filterCategories={filterCategories}
filterTags={filterTags}
initialTag={initialTag}
initialCategory={initialCategory}
/>
</Suspense>
</Container>
</Section>
<Section id="digital" tone="accent" tight className="scroll-mt-24">
<Container>
<SectionHeader
inverse
className="mb-0 sm:mb-0"
title={labels.dppTitle}
description={labels.dppBody}
/>
</Container>
</Section>
<Section id="digital" tone="accent" className="scroll-mt-24 py-16 sm:py-20">
<Section tone="muted">
<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>
<SectionHeader align="center" title={labels.statsTitle} />
<StatGrid stats={stats} />
</Container>
</Section>
<Section tone="muted" className="py-20 sm:py-24">
<Section>
<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} />
<SectionHeader align="center" title={labels.rankTitle} />
<div className="mx-auto grid max-w-4xl gap-4 sm:grid-cols-2">
{highlights.map((item) => (
<SurfaceCard key={item.title} padded>
<p className="text-3xl font-extrabold text-primary">
{item.value}
</p>
<Heading as="h3" level={4} className="mt-3">
{item.title}
</Heading>
<p className="mt-1 text-sm text-muted-foreground">
{item.text}
</p>
</SurfaceCard>
))}
</div>
</Container>
+2
View File
@@ -17,6 +17,8 @@ const buttonVariants = cva(
destructive:
"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
link: "text-primary underline-offset-4 hover:underline",
inverse:
"border-background/30 bg-transparent text-background hover:border-background hover:bg-background hover:text-foreground",
},
size: {
default:
+1 -1
View File
@@ -11,7 +11,7 @@ function Card({
data-slot="card"
data-size={size}
className={cn(
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-2xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-sm ring-1 ring-foreground/10 transition-[box-shadow,ring-color] duration-300 [--card-spacing:--spacing(4)] hover:shadow-lg hover:ring-primary/20 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-2xl *:[img:last-child]:rounded-b-2xl",
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-2xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-sm ring-1 ring-foreground/10 transition-[box-shadow,ring-color] duration-300 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-2xl *:[img:last-child]:rounded-b-2xl",
className
)}
{...props}