Refactor global styles and layout components for improved responsiveness and performance. Added viewport settings, adjusted overflow handling, and removed legacy animations for mobile optimization. Enhanced image handling and ensured consistent minimum width across various components.

This commit is contained in:
smhk1376 committed 2026-09-24 16:38:35 +03:30
1 parent fdb2023353
commit b6ff82fad9
22 files changed
+185 -243

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ export default async function MainLayout({
programs={programs} programs={programs}
/> />
<CampaignBanners banners={banners} /> <CampaignBanners banners={banners} />
<div className="flex-1">{children}</div> <div className="min-w-0 flex-1 overflow-x-clip">{children}</div>
<SiteFooter <SiteFooter
copyright={t("footer.copyright", { year })} copyright={t("footer.copyright", { year })}
linksTitle={t("footer.links")} linksTitle={t("footer.links")}
+2 -2
View File
@@ -54,13 +54,13 @@ function LoginForm() {
<div dir="rtl" className="flex min-h-svh items-center justify-center bg-muted/40 px-4 py-12"> <div dir="rtl" className="flex min-h-svh items-center justify-center bg-muted/40 px-4 py-12">
<Card className="w-full max-w-md shadow-sm"> <Card className="w-full max-w-md shadow-sm">
<CardHeader className="space-y-3 text-center"> <CardHeader className="space-y-3 text-center">
<div className="mx-auto relative size-14 overflow-hidden rounded-full bg-chart-3 ring-1 ring-border shadow-sm"> <div className="mx-auto relative size-14">
<Image <Image
src="/brand/amirkabir.png" src="/brand/amirkabir.png"
alt="دانشگاه صنعتی امیرکبیر" alt="دانشگاه صنعتی امیرکبیر"
fill fill
sizes="56px" sizes="56px"
className="object-contain p-[15%]" className="object-contain brightness-0"
priority priority
/> />
</div> </div>
+43 -71
View File
@@ -121,78 +121,49 @@
* { * {
@apply border-border outline-ring/50; @apply border-border outline-ring/50;
} }
html {
@apply font-sans scroll-smooth;
scroll-padding-top: 6rem;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
}
body { body {
@apply bg-background text-foreground antialiased; @apply bg-background text-foreground antialiased;
font-size: 16px; font-size: 16px;
line-height: 1.65; line-height: 1.65;
text-align: start; text-align: start;
} }
html { html,
@apply font-sans scroll-smooth; body {
scroll-padding-top: 6rem; width: 100%;
max-width: 100%;
overflow-x: clip;
}
/* Flex/grid children must be allowed to shrink below intrinsic content width */
#__next,
main,
[data-slot="page-shell"] {
min-width: 0;
max-width: 100%;
} }
a { a {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
img { img,
video,
canvas,
iframe {
max-width: 100%; max-width: 100%;
} }
} video,
iframe {
/* Metamorphism dots + lines — soft presence, not noise */ height: auto;
@keyframes metamorph-line-pulse {
0%,
100% {
opacity: 0.35;
}
50% {
opacity: 0.85;
} }
} }
@keyframes metamorph-dot-breathe { /* Metamorph field: static on purpose (animations removed for mobile perf).
0%, Legacy keyframes kept only so reduced-motion rules stay harmless. */
100% {
opacity: 0.55;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.35);
}
}
@keyframes metamorph-field-drift {
0%,
100% {
transform: translate3d(0, 0, 0);
}
50% {
transform: translate3d(1.2%, -0.8%, 0);
}
}
@keyframes metamorph-dash-flow {
from { stroke-dashoffset: 24; }
to { stroke-dashoffset: 0; }
}
@keyframes section-reveal {
from { opacity: 0; transform: translateY(2rem); }
to { opacity: 1; transform: translateY(0); }
}
.metamorph-field__mesh {
animation: metamorph-field-drift 18s ease-in-out infinite;
}
.metamorph-field__line {
stroke-dasharray: 4 8;
animation:
metamorph-line-pulse 7s ease-in-out infinite,
metamorph-dash-flow 8s linear infinite;
}
.page-hero::after, .page-hero::after,
.home-hero::after { .home-hero::after {
@@ -249,15 +220,23 @@
radial-gradient(circle at 90% 80%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 25%); radial-gradient(circle at 90% 80%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 25%);
} }
@supports (animation-timeline: view()) { /* Scroll-driven reveals: desktop only — expensive while scrolling on phones */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
@supports (animation-timeline: view()) {
@keyframes section-reveal {
from { opacity: 0; transform: translateY(1.25rem); }
to { opacity: 1; transform: translateY(0); }
}
.motion-section { .motion-section {
animation: section-reveal both cubic-bezier(0.22, 1, 0.36, 1); animation: section-reveal both cubic-bezier(0.22, 1, 0.36, 1);
animation-timeline: view(); animation-timeline: view();
animation-range: entry 5% cover 28%; animation-range: entry 8% cover 22%;
}
} }
} }
@media (hover: hover) { @media (hover: hover) and (prefers-reduced-motion: no-preference) {
[data-slot="card"] img { [data-slot="card"] img {
transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1); transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
} }
@@ -266,10 +245,11 @@
} }
} }
.metamorph-field__dot { @media (max-width: 767px) {
transform-box: fill-box; .motion-section[data-tone="muted"],
transform-origin: center; .motion-section[data-tone="dark"] {
animation: metamorph-dot-breathe 6s ease-in-out infinite; background-image: none;
}
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
@@ -283,14 +263,6 @@
animation-iteration-count: 1 !important; animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important; transition-duration: 0.01ms !important;
} }
.metamorph-field__mesh,
.metamorph-field__line,
.metamorph-field__dot {
animation: none !important;
}
.metamorph-field animate {
display: none;
}
.motion-section { .motion-section {
animation: none !important; animation: none !important;
} }
+10 -2
View File
@@ -1,10 +1,16 @@
import type { Metadata } from "next"; import type { Metadata, Viewport } from "next";
import localFont from "next/font/local"; import localFont from "next/font/local";
import { NextIntlClientProvider } from "next-intl"; import { NextIntlClientProvider } from "next-intl";
import { getLocale, getMessages, getTranslations } from "next-intl/server"; import { getLocale, getMessages, getTranslations } from "next-intl/server";
import { JsonLd, organizationJsonLd } from "@/lib/seo/json-ld"; import { JsonLd, organizationJsonLd } from "@/lib/seo/json-ld";
import "./globals.css"; import "./globals.css";
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
viewportFit: "cover",
};
const iranSans = localFont({ const iranSans = localFont({
src: [ src: [
{ {
@@ -93,7 +99,7 @@ export default async function RootLayout({
return ( return (
<html lang={locale} dir="rtl" className={`${iranSans.variable} h-full`}> <html lang={locale} dir="rtl" className={`${iranSans.variable} h-full`}>
<body className="flex min-h-full flex-col font-sans"> <body className="flex min-h-full min-w-0 flex-col font-sans">
<NextIntlClientProvider messages={messages}> <NextIntlClientProvider messages={messages}>
<a <a
href="#main-content" href="#main-content"
@@ -102,7 +108,9 @@ export default async function RootLayout({
{t("skipToContent")} {t("skipToContent")}
</a> </a>
<JsonLd data={organizationJsonLd()} /> <JsonLd data={organizationJsonLd()} />
<div data-slot="page-shell" className="flex min-h-full min-w-0 flex-1 flex-col">
{children} {children}
</div>
</NextIntlClientProvider> </NextIntlClientProvider>
</body> </body>
</html> </html>
+1 -1
View File
@@ -30,7 +30,7 @@ export default async function ProfessionalLayout({
courses={courses} courses={courses}
programs={programs} programs={programs}
/> />
<div className="flex-1">{children}</div> <div className="min-w-0 flex-1 overflow-x-clip">{children}</div>
<SiteFooter <SiteFooter
variant="professional" variant="professional"
copyright={t("footer.copyright", { year })} copyright={t("footer.copyright", { year })}
+30 -7
View File
@@ -3,25 +3,42 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
const PERSIAN_DIGITS = "۰۱۲۳۴۵۶۷۸۹"; const PERSIAN_DIGITS = "۰۱۲۳۴۵۶۷۸۹";
const toLatin = (value: string) => value.replace(/[۰-۹]/g, (digit) => String(PERSIAN_DIGITS.indexOf(digit))); const toLatin = (value: string) =>
value.replace(/[۰-۹]/g, (digit) => String(PERSIAN_DIGITS.indexOf(digit)));
export function AnimatedMetric({ value, className }: { value: string; className?: string }) { function shouldAnimate() {
if (typeof window === "undefined") return false;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return false;
// Skip count-up on phones — saves main-thread work while scrolling
if (window.matchMedia("(max-width: 767px)").matches) return false;
return true;
}
export function AnimatedMetric({
value,
className,
}: {
value: string;
className?: string;
}) {
const ref = useRef<HTMLSpanElement>(null); const ref = useRef<HTMLSpanElement>(null);
const [display, setDisplay] = useState(value); const [display, setDisplay] = useState(value);
useEffect(() => { useEffect(() => {
const element = ref.current; const element = ref.current;
if (!element || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return; if (!element || !shouldAnimate()) return;
const latin = toLatin(value).replaceAll("٬", ""); const latin = toLatin(value).replaceAll("٬", "");
const match = latin.match(/^(\D*)(\d+)(\D*)$/); const match = latin.match(/^(\D*)(\d+)(\D*)$/);
if (!match) return; if (!match) return;
const [, prefix, rawNumber, suffix] = match; const [, prefix, rawNumber, suffix] = match;
const target = Number(rawNumber); const target = Number(rawNumber);
const observer = new IntersectionObserver(([entry]) => { const observer = new IntersectionObserver(
([entry]) => {
if (!entry.isIntersecting) return; if (!entry.isIntersecting) return;
observer.disconnect(); observer.disconnect();
const startedAt = performance.now(); const startedAt = performance.now();
const duration = 1000; const duration = 900;
const tick = (now: number) => { const tick = (now: number) => {
const progress = Math.min((now - startedAt) / duration, 1); const progress = Math.min((now - startedAt) / duration, 1);
const eased = 1 - Math.pow(1 - progress, 3); const eased = 1 - Math.pow(1 - progress, 3);
@@ -30,10 +47,16 @@ export function AnimatedMetric({ value, className }: { value: string; className?
if (progress < 1) requestAnimationFrame(tick); if (progress < 1) requestAnimationFrame(tick);
}; };
requestAnimationFrame(tick); requestAnimationFrame(tick);
}, { threshold: 0.55 }); },
{ threshold: 0.55 },
);
observer.observe(element); observer.observe(element);
return () => observer.disconnect(); return () => observer.disconnect();
}, [value]); }, [value]);
return <span ref={ref} className={className}>{display}</span>; return (
<span ref={ref} className={className}>
{display}
</span>
);
} }
+8 -5
View File
@@ -13,7 +13,7 @@ type BrandLogoProps = {
compact?: boolean; compact?: boolean;
}; };
/** AUT seal — white mark on transparent; sits on brand disc. */ /** AUT seal — raw mark only (transparent), no disc/ring/background. */
export function BrandLogo({ export function BrandLogo({
href = "/", href = "/",
title, title,
@@ -33,8 +33,7 @@ export function BrandLogo({
> >
<span <span
className={cn( className={cn(
"relative shrink-0 overflow-hidden rounded-full bg-chart-3 shadow-sm ring-1", "relative shrink-0",
onDark ? "ring-background/25" : "ring-border",
compact ? "size-9" : "size-11 sm:size-12", compact ? "size-9" : "size-11 sm:size-12",
)} )}
> >
@@ -44,7 +43,11 @@ export function BrandLogo({
fill fill
priority priority
sizes="48px" sizes="48px"
className="object-contain p-[18%]" className={cn(
"object-contain",
// Asset is white-on-transparent; invert to dark ink on light surfaces
!onDark && "brightness-0",
)}
/> />
</span> </span>
<span className="min-w-0 text-start leading-tight"> <span className="min-w-0 text-start leading-tight">
@@ -60,7 +63,7 @@ export function BrandLogo({
{subtitle ? ( {subtitle ? (
<span <span
className={cn( className={cn(
"mt-0.5 block truncate text-[0.7rem] font-medium sm:text-xs", "mt-0.5 hidden truncate text-[0.7rem] font-medium min-[380px]:block sm:text-xs",
onDark ? "text-background/70" : "text-muted-foreground", onDark ? "text-background/70" : "text-muted-foreground",
)} )}
> >
+1 -1
View File
@@ -12,7 +12,7 @@ export function Container({
return ( return (
<div <div
className={cn( className={cn(
"mx-auto w-full px-5 sm:px-8 lg:px-12", "mx-auto w-full min-w-0 px-5 sm:px-8 lg:px-12",
narrow ? "max-w-3xl" : "max-w-7xl", narrow ? "max-w-3xl" : "max-w-7xl",
className, className,
)} )}
+24 -90
View File
@@ -1,3 +1,6 @@
"use client";
import { useEffect, useState } from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
type MetamorphFieldProps = { type MetamorphFieldProps = {
@@ -69,17 +72,30 @@ const EDGES_SPARSE: Edge[] = [
const VIEW_W = 1200; const VIEW_W = 1200;
const VIEW_H = 480; const VIEW_H = 480;
const ENABLE_MQ =
"(min-width: 768px) and (prefers-reduced-motion: no-preference)";
/** /**
* Decorative metamorphism field — dots joined by thin lines. * Decorative constellation. Mounted only on desktop with motion allowed —
* Place inside a `relative overflow-hidden` flex/grid surface. * SMIL/CSS motion was too expensive on phones.
* The outer wrapper fills the parent; the SVG covers with landscape slice
* so density stays proportional across wide hero/footer bands.
*/ */
export function MetamorphField({ export function MetamorphField({
className, className,
tone = "dark", tone = "dark",
density = "normal", density = "normal",
}: MetamorphFieldProps) { }: MetamorphFieldProps) {
const [enabled, setEnabled] = useState(false);
useEffect(() => {
const mq = window.matchMedia(ENABLE_MQ);
const sync = () => setEnabled(mq.matches);
sync();
mq.addEventListener("change", sync);
return () => mq.removeEventListener("change", sync);
}, []);
if (!enabled) return null;
const nodes = density === "sparse" ? NODES_SPARSE : NODES_NORMAL; const nodes = density === "sparse" ? NODES_SPARSE : NODES_NORMAL;
const edges = density === "sparse" ? EDGES_SPARSE : EDGES_NORMAL; const edges = density === "sparse" ? EDGES_SPARSE : EDGES_NORMAL;
const stroke = const stroke =
@@ -88,11 +104,6 @@ export function MetamorphField({
tone === "dark" ? "color-mix(in oklab, white 70%, transparent)" : "var(--primary)"; tone === "dark" ? "color-mix(in oklab, white 70%, transparent)" : "var(--primary)";
const accent = tone === "dark" ? "var(--accent)" : "var(--primary)"; const accent = tone === "dark" ? "var(--accent)" : "var(--primary)";
const targets = nodes.map((node, index) => ({
x: Math.max(24, Math.min(VIEW_W - 24, node.x + Math.sin(index * 1.7) * 28)),
y: Math.max(24, Math.min(VIEW_H - 24, node.y + Math.cos(index * 1.3) * 22)),
}));
return ( return (
<div <div
className={cn( className={cn(
@@ -109,7 +120,7 @@ export function MetamorphField({
preserveAspectRatio="xMidYMid slice" preserveAspectRatio="xMidYMid slice"
focusable="false" focusable="false"
> >
<g className="metamorph-field__mesh" stroke={stroke} strokeWidth="0.9"> <g stroke={stroke} strokeWidth="0.9">
{edges.map(([a, b], i) => { {edges.map(([a, b], i) => {
const n1 = nodes[a]; const n1 = nodes[a];
const n2 = nodes[b]; const n2 = nodes[b];
@@ -121,98 +132,21 @@ export function MetamorphField({
y1={n1.y} y1={n1.y}
x2={n2.x} x2={n2.x}
y2={n2.y} y2={n2.y}
className="metamorph-field__line" opacity="0.55"
style={{ animationDelay: `${(i % 8) * 0.35}s` }}
>
<animate
attributeName="x1"
values={`${n1.x};${targets[a].x};${n1.x}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/> />
<animate
attributeName="y1"
values={`${n1.y};${targets[a].y};${n1.y}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/>
<animate
attributeName="x2"
values={`${n2.x};${targets[b].x};${n2.x}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/>
<animate
attributeName="y2"
values={`${n2.y};${targets[b].y};${n2.y}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/>
</line>
); );
})} })}
</g> </g>
<g> <g>
{nodes.map((n, i) => ( {nodes.map((n, i) => (
<g key={`n-${i}`}>
{i % 5 === 0 ? (
<circle
cx={n.x}
cy={n.y}
r="8"
fill="none"
stroke={accent}
strokeWidth="0.7"
opacity="0.45"
>
<animate
attributeName="cx"
values={`${n.x};${targets[i].x};${n.x}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/>
<animate
attributeName="cy"
values={`${n.y};${targets[i].y};${n.y}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/>
<animate
attributeName="r"
values="5;11;5"
dur={`${8 + (i % 3)}s`}
repeatCount="indefinite"
/>
<animate
attributeName="opacity"
values="0.45;0;0.45"
dur={`${8 + (i % 3)}s`}
repeatCount="indefinite"
/>
</circle>
) : null}
<circle <circle
key={`n-${i}`}
cx={n.x} cx={n.x}
cy={n.y} cy={n.y}
r={n.r ?? 2} r={n.r ?? 2}
fill={i % 5 === 0 ? accent : fill} fill={i % 5 === 0 ? accent : fill}
className="metamorph-field__dot" opacity={i % 5 === 0 ? 0.85 : 0.7}
style={{ animationDelay: `${(i % 6) * 0.4}s` }}
>
<animate
attributeName="cx"
values={`${n.x};${targets[i].x};${n.x}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/> />
<animate
attributeName="cy"
values={`${n.y};${targets[i].y};${n.y}`}
dur={`${14 + (i % 4)}s`}
repeatCount="indefinite"
/>
</circle>
</g>
))} ))}
</g> </g>
</svg> </svg>
+1 -1
View File
@@ -22,7 +22,7 @@ export function Section({
<section <section
data-tone={tone} data-tone={tone}
className={cn( className={cn(
"motion-section relative", "motion-section relative min-w-0",
tight ? "py-8 sm:py-10" : "py-16 sm:py-24", tight ? "py-8 sm:py-10" : "py-16 sm:py-24",
tones[tone], tones[tone],
className, className,
+2 -2
View File
@@ -84,7 +84,7 @@ export function ArticleCard({
return ( return (
<article <article
className={cn( className={cn(
"group flex h-full flex-col", "group flex h-full min-w-0 flex-col",
featured && "lg:flex-row lg:gap-8", featured && "lg:flex-row lg:gap-8",
)} )}
> >
@@ -213,7 +213,7 @@ export function EventCard({
} }
return ( return (
<article className="flex flex-col gap-4 py-4 sm:border-e sm:border-border sm:px-5 sm:py-2 sm:last:border-e-0"> <article className="flex min-w-0 flex-col gap-4 border-b border-border px-0 py-5 last:border-b-0 md:border-b-0 md:border-e md:px-5 md:py-2 md:last:border-e-0">
{body} {body}
</article> </article>
); );
+8 -8
View File
@@ -9,13 +9,13 @@ export function HeroFeatured({ title, href, eyebrow }: { title: string; href: st
return ( return (
<header className="home-hero relative isolate overflow-hidden bg-chart-3 text-background"> <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" /> <MetamorphField tone="dark" density="sparse" className="end-0 start-auto w-[min(55vw,36rem)] opacity-20" />
<Container className="relative z-[2] flex min-h-[38rem] items-center py-20 sm:py-24"> <Container className="relative z-[2] flex min-h-[38rem] min-w-0 items-center py-20 sm:py-24">
<div className="home-hero__copy max-w-4xl"> <div className="home-hero__copy w-full min-w-0 max-w-4xl">
<div className="inline-flex items-center gap-2 text-sm font-medium text-background/60"> <div className="inline-flex max-w-full items-center gap-2 text-sm font-medium text-background/60">
<GraduationCap className="size-4" /> <GraduationCap className="size-4 shrink-0" />
مرکز آموزش‌های آزاد دانشگاه صنعتی امیرکبیر <span className="min-w-0 leading-6">مرکز آموزش‌های آزاد دانشگاه صنعتی امیرکبیر</span>
</div> </div>
<h1 className="mt-8 text-4xl font-black leading-[1.25] tracking-tight sm:text-6xl lg:text-7xl"> <h1 className="mt-8 text-4xl font-black leading-[1.25] tracking-tight break-words sm:text-6xl lg:text-7xl">
آموزش حرفه‌ای برای آموزش حرفه‌ای برای
<span className="mt-2 block text-background">مدیریت در دنیای متغیر</span> <span className="mt-2 block text-background">مدیریت در دنیای متغیر</span>
</h1> </h1>
@@ -43,9 +43,9 @@ export function HeroFeatured({ title, href, eyebrow }: { title: string; href: st
</Link> </Link>
</div> </div>
<div className="mt-12 border-t border-background/10 pt-6"> <div className="mt-12 border-t border-background/10 pt-6">
<Link href={href} className="group inline-flex max-w-2xl items-center gap-3 text-sm text-background/55 transition-colors hover:text-background"> <Link href={href} className="group inline-flex max-w-full items-center gap-3 text-sm text-background/55 transition-colors hover:text-background">
<span className="shrink-0 font-semibold text-background/80">{eyebrow}</span> <span className="shrink-0 font-semibold text-background/80">{eyebrow}</span>
<span className="truncate">{title}</span> <span className="min-w-0 truncate">{title}</span>
<ArrowLeft className="size-4 shrink-0 transition-transform group-hover:-translate-x-1" /> <ArrowLeft className="size-4 shrink-0 transition-transform group-hover:-translate-x-1" />
</Link> </Link>
</div> </div>
+3 -3
View File
@@ -11,10 +11,10 @@ export function PageHero({ title, intro, eyebrow, imageUrl }: { title: string; i
) : <><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" /></>} ) : <><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" /></>}
<MetamorphField tone="dark" density="normal" className="end-0 start-auto w-[min(75vw,42rem)] opacity-45" /> <MetamorphField tone="dark" density="normal" className="end-0 start-auto w-[min(75vw,42rem)] opacity-45" />
<div className="absolute end-0 top-0 h-px w-1/3 bg-gradient-to-l from-accent to-transparent" /> <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]"> <Container className="relative z-[2] min-w-0">
<div className="page-hero__content max-w-3xl text-start"> <div className="page-hero__content w-full min-w-0 max-w-3xl text-start">
{eyebrow ? <p className="mb-4 inline-flex rounded-full border border-background/15 bg-background/5 px-3 py-1.5 text-xs font-semibold text-accent backdrop-blur-sm">{eyebrow}</p> : null} {eyebrow ? <p className="mb-4 inline-flex rounded-full border border-background/15 bg-background/5 px-3 py-1.5 text-xs font-semibold text-accent backdrop-blur-sm">{eyebrow}</p> : null}
<Heading as="h1" level={1} className="text-4xl leading-tight text-background sm:text-6xl">{title}</Heading> <Heading as="h1" level={1} className="text-4xl leading-tight break-words text-background sm:text-6xl">{title}</Heading>
{intro ? <p className="mt-5 max-w-2xl border-s border-accent/70 ps-5 text-base leading-8 text-background/70 sm:text-lg">{intro}</p> : null} {intro ? <p className="mt-5 max-w-2xl border-s border-accent/70 ps-5 text-base leading-8 text-background/70 sm:text-lg">{intro}</p> : null}
</div> </div>
</Container> </Container>
@@ -54,11 +54,11 @@ export function AcademicsOverlay({
</Button> </Button>
</div> </div>
<h2 className="mb-10 max-w-3xl text-start text-3xl font-bold tracking-tight sm:text-4xl"> <h2 className="mb-10 max-w-3xl text-start text-3xl font-bold tracking-tight break-words sm:text-4xl">
{title} {title}
</h2> </h2>
<ul className="grid gap-x-10 gap-y-8 sm:grid-cols-2 lg:grid-cols-3"> <ul className="grid min-w-0 gap-x-10 gap-y-8 sm:grid-cols-2 lg:grid-cols-3">
{standardPrograms.map((program) => ( {standardPrograms.map((program) => (
<li key={program.id}> <li key={program.id}>
<Link <Link
+2 -2
View File
@@ -48,8 +48,8 @@ export function CampaignBanners({ banners }: { banners: CampaignBanner[] }) {
return ( return (
<div className="bg-chart-3 text-background"> <div className="bg-chart-3 text-background">
<Container className="flex items-center justify-between gap-4 py-3"> <Container className="flex min-w-0 items-center justify-between gap-3 py-3 sm:gap-4">
<p className="min-w-0 flex-1 text-sm leading-relaxed"> <p className="min-w-0 flex-1 text-sm leading-relaxed break-words">
<span className="text-background/90">{banner.text}</span>{" "} <span className="text-background/90">{banner.text}</span>{" "}
<Link <Link
href={banner.href} href={banner.href}
+8 -7
View File
@@ -23,22 +23,23 @@ export function ProgramCarousel({
align: "start", align: "start",
direction: "rtl", direction: "rtl",
loop: false, loop: false,
containScroll: "trimSnaps",
}); });
const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi]); const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi]);
const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi]); const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi]);
return ( return (
<div> <div className="min-w-0">
<div className="mb-5 flex items-end justify-between gap-4"> <div className="mb-5 flex min-w-0 items-end justify-between gap-4">
{!hideTitle && title ? ( {!hideTitle && title ? (
<h2 className="text-2xl font-bold tracking-tight sm:text-3xl"> <h2 className="min-w-0 text-2xl font-bold tracking-tight break-words sm:text-3xl">
{title} {title}
</h2> </h2>
) : ( ) : (
<span /> <span />
)} )}
<div className="flex gap-1"> <div className="flex shrink-0 gap-1">
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
@@ -59,12 +60,12 @@ export function ProgramCarousel({
</Button> </Button>
</div> </div>
</div> </div>
<div className="overflow-hidden" ref={emblaRef}> <div className="min-w-0 overflow-hidden" ref={emblaRef}>
<div className="flex gap-5"> <div className="flex gap-4 sm:gap-5">
{programs.map((program) => ( {programs.map((program) => (
<div <div
key={program.id} key={program.id}
className="min-w-0 shrink-0 basis-[88%] sm:basis-[42%] lg:basis-[30%]" className="min-w-0 shrink-0 grow-0 basis-[85%] sm:basis-[45%] lg:basis-[31%]"
> >
<ProgramCard program={program} /> <ProgramCard program={program} />
</div> </div>
+3 -2
View File
@@ -66,18 +66,19 @@ export function SiteHeader({
<> <>
<header <header
className={cn( className={cn(
"site-header sticky top-0 z-50 pt-[env(safe-area-inset-top)] shadow-sm backdrop-blur-xl", "site-header sticky top-0 z-50 pt-[env(safe-area-inset-top)] shadow-sm backdrop-blur-sm md:backdrop-blur-xl",
isDark isDark
? "border-b border-background/10 bg-chart-3/95 text-background" ? "border-b border-background/10 bg-chart-3/95 text-background"
: "border-b border-border bg-card/95 text-foreground", : "border-b border-border bg-card/95 text-foreground",
)} )}
> >
<Container className="flex h-[4.5rem] items-center justify-start gap-3 sm:h-20 sm:gap-5" dir="rtl"> <Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-2 sm:h-20 sm:gap-5" dir="rtl">
<BrandLogo <BrandLogo
href={brandHref} href={brandHref}
title={brandTitle} title={brandTitle}
subtitle={brandSubtitle} subtitle={brandSubtitle}
onDark={isDark} onDark={isDark}
className="max-w-[min(100%,14rem)] sm:max-w-[min(100%,20rem)]"
/> />
<nav <nav
@@ -35,13 +35,13 @@ export function AdminShell({
<Separator orientation="vertical" className="me-1 data-[orientation=vertical]:h-4" /> <Separator orientation="vertical" className="me-1 data-[orientation=vertical]:h-4" />
<div className="flex min-w-0 flex-1 items-center justify-between gap-3"> <div className="flex min-w-0 flex-1 items-center justify-between gap-3">
<div className="flex min-w-0 items-center gap-2"> <div className="flex min-w-0 items-center gap-2">
<span className="relative size-6 shrink-0 overflow-hidden rounded-full bg-chart-3 ring-1 ring-border md:hidden"> <span className="relative size-6 shrink-0 md:hidden">
<Image <Image
src="/brand/amirkabir.png" src="/brand/amirkabir.png"
alt="" alt=""
fill fill
sizes="24px" sizes="24px"
className="object-contain p-[15%]" className="object-contain brightness-0"
/> />
</span> </span>
<p className="truncate text-sm font-medium text-muted-foreground"> <p className="truncate text-sm font-medium text-muted-foreground">
@@ -95,13 +95,13 @@ export function AdminSidebar({ userName }: { userName: string }) {
render={<Link href="/admin" />} render={<Link href="/admin" />}
className="data-active:bg-sidebar-accent" className="data-active:bg-sidebar-accent"
> >
<span className="relative size-8 shrink-0 overflow-hidden rounded-lg bg-chart-3 ring-1 ring-sidebar-border"> <span className="relative size-8 shrink-0">
<Image <Image
src="/brand/amirkabir.png" src="/brand/amirkabir.png"
alt="" alt=""
fill fill
sizes="32px" sizes="32px"
className="object-contain p-[15%]" className="object-contain brightness-0"
priority priority
/> />
</span> </span>
@@ -74,7 +74,7 @@ export function CourseDetailTemplate({
/> />
<Section className="bg-gradient-to-b from-background to-muted/40"> <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"> <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="space-y-8">
<div className="overflow-hidden rounded-2xl ring-1 ring-border"> <div className="overflow-hidden rounded-2xl ring-1 ring-border">
<div className="relative aspect-[16/9] bg-muted"> <div className="relative aspect-[16/9] bg-muted">
+27 -27
View File
@@ -71,26 +71,26 @@ export function HomeIdeas({
<> <>
<Section className="relative py-20 sm:py-28"> <Section className="relative py-20 sm:py-28">
<Container> <Container>
<div className="grid gap-10 lg:grid-cols-[.8fr_1.2fr] lg:items-start lg:gap-20"> <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="lg:sticky lg:top-28"> <div className="min-w-0 lg:sticky lg:top-28">
<Badge variant="outline" className="border-primary/20 bg-primary/5 text-primary">چرا امیرکبیر؟</Badge> <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 level={2} className="mt-5 text-3xl leading-tight break-words sm:text-4xl">
آموزش برای جهانِ در حال تغییر آموزش برای جهانِ در حال تغییر
</Heading> </Heading>
<p className="mt-5 text-base leading-8 text-muted-foreground sm:text-lg"> <p className="mt-5 text-base leading-8 text-muted-foreground sm:text-lg">
اینجا آموزش، انتقال محتوا نیست؛ فضایی است برای دیدن مسئله از زاویه‌ای تازه، ساختن راه‌حل و اجرای آن در دنیای واقعی. اینجا آموزش، انتقال محتوا نیست؛ فضایی است برای دیدن مسئله از زاویه‌ای تازه، ساختن راه‌حل و اجرای آن در دنیای واقعی.
</p> </p>
</div> </div>
<div className="grid gap-4 sm:grid-cols-3 lg:grid-cols-1"> <div className="grid min-w-0 gap-4 md:grid-cols-3 lg:grid-cols-1">
{[ {[
{ icon: Compass, title: "تفکر راهبردی", text: "دیدن مسئله از زاویه‌های تازه و تبدیل پیچیدگی به تصمیم‌های بهتر." }, { icon: Compass, title: "تفکر راهبردی", text: "دیدن مسئله از زاویه‌های تازه و تبدیل پیچیدگی به تصمیم‌های بهتر." },
{ icon: Building2, title: "اثر سازمانی", text: "یادگیری مبتنی بر مسئله‌های واقعی کسب‌وکار و صنعت ایران." }, { icon: Building2, title: "اثر سازمانی", text: "یادگیری مبتنی بر مسئله‌های واقعی کسب‌وکار و صنعت ایران." },
{ icon: Network, title: "شبکه‌ی حرفه‌ای", text: "پیوند با مدیران، متخصصان و پژوهشگران برای رشد ماندگار." }, { icon: Network, title: "شبکه‌ی حرفه‌ای", text: "پیوند با مدیران، متخصصان و پژوهشگران برای رشد ماندگار." },
].map((item, index) => ( ].map((item, index) => (
<Card key={item.title} className="border-border/70 py-0 shadow-none transition-colors hover:border-primary/25"> <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 flex-col gap-5 p-6 lg:flex-row lg:items-center lg:gap-6 lg:p-7"> <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="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> <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> </CardContent>
</Card> </Card>
))} ))}
@@ -99,15 +99,15 @@ export function HomeIdeas({
</Container> </Container>
</Section> </Section>
<Section className="overflow-hidden py-0"> <Section className="overflow-hidden py-0">
<Container className="grid max-w-none px-0 lg:grid-cols-2"> <Container className="grid max-w-none min-w-0 px-0 lg:grid-cols-2">
<div className="relative min-h-80 lg:min-h-[32rem]"> <div className="relative min-h-64 sm: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" /> <Image src="/brand/campus-collaboration-v1.png" alt="همکاری مدرسان و متخصصان در محیط دانشگاه" fill className="object-cover" sizes="(max-width:1024px) 100vw, 50vw" />
</div> </div>
<div className="relative flex items-center overflow-hidden bg-chart-3 px-6 py-14 text-background sm:px-12 lg:px-16"> <div className="relative flex min-w-0 items-center overflow-hidden bg-chart-3 px-5 py-12 text-background sm:px-12 sm:py-14 lg:px-16">
<MetamorphField tone="dark" density="sparse" className="opacity-20" /> <MetamorphField tone="dark" density="sparse" className="opacity-20" />
<div className="relative z-[2] max-w-xl"> <div className="relative z-[2] w-full min-w-0 max-w-xl">
<p className="text-xs font-bold text-background/55">یادگیری در بستر مسئله‌های واقعی</p> <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> <Heading level={2} className="mt-3 text-3xl leading-tight break-words text-background sm:text-4xl">جایی برای پیوند دانش دانشگاهی و تجربه‌ی صنعت</Heading>
<p className="mt-5 text-base leading-8 text-background/65">دوره‌ها با مشارکت مدرسان دانشگاه، مدیران و متخصصان طراحی می‌شوند تا آموخته‌ها از کلاس به تصمیم و اجرا برسند.</p> <p className="mt-5 text-base leading-8 text-background/65">دوره‌ها با مشارکت مدرسان دانشگاه، مدیران و متخصصان طراحی می‌شوند تا آموخته‌ها از کلاس به تصمیم و اجرا برسند.</p>
<Link <Link
href="/about" href="/about"
@@ -124,10 +124,10 @@ export function HomeIdeas({
</Section> </Section>
<Section tone="muted" className="py-20 sm:py-24"> <Section tone="muted" className="py-20 sm:py-24">
<Container> <Container>
<div className="mb-10 flex items-end justify-between gap-4"> <div className="mb-10 flex min-w-0 items-end justify-between gap-4">
<div> <div className="min-w-0">
<p className="text-xs font-bold text-primary">دانش برای عمل</p> <p className="text-xs font-bold text-primary">دانش برای عمل</p>
<Heading level={2} className="mt-2 text-3xl sm:text-4xl"> <Heading level={2} className="mt-2 text-3xl break-words sm:text-4xl">
<Link href="/insights" className="hover:text-primary"> <Link href="/insights" className="hover:text-primary">
{title} {title}
</Link> </Link>
@@ -137,13 +137,13 @@ export function HomeIdeas({
href="/insights" href="/insights"
className={cn( className={cn(
buttonVariants({ variant: "ghost" }), buttonVariants({ variant: "ghost" }),
"hidden gap-2 text-primary sm:inline-flex", "hidden shrink-0 gap-2 text-primary sm:inline-flex",
)} )}
> >
همه بینش‌ها <ArrowLeft className="size-4" /> همه بینش‌ها <ArrowLeft className="size-4" />
</Link> </Link>
</div> </div>
<div className="grid gap-8 sm:grid-cols-2 lg:grid-cols-3 sm:gap-10"> <div className="grid min-w-0 gap-8 sm:grid-cols-2 lg:grid-cols-3 sm:gap-10">
{ideaCards.map((article) => ( {ideaCards.map((article) => (
<ArticleCard <ArticleCard
key={article.id} key={article.id}
@@ -178,7 +178,7 @@ export function HomeEvents({
{title} {title}
</Heading> </Heading>
<Separator className="mx-auto mt-5 max-w-16 bg-primary" /> <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"> <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) => ( {events.map((event) => (
<EventCard key={event.id} {...event} variant="home" /> <EventCard key={event.id} {...event} variant="home" />
))} ))}
@@ -213,7 +213,7 @@ export function HomeRest({
{labels.intersectionsSubtitle} {labels.intersectionsSubtitle}
</p> </p>
</div> </div>
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"> <div className="grid min-w-0 gap-4 sm:grid-cols-2 lg:grid-cols-4">
{intersections.map((topic) => ( {intersections.map((topic) => (
<IntersectionCard key={topic.id} {...topic} /> <IntersectionCard key={topic.id} {...topic} />
))} ))}
@@ -223,9 +223,9 @@ export function HomeRest({
<Section className="relative overflow-hidden py-20 sm:py-24"> <Section className="relative overflow-hidden py-20 sm:py-24">
<MetamorphField tone="light" density="sparse" /> <MetamorphField tone="light" density="sparse" />
<Container className="relative z-[1]"> <Container className="relative z-[1] min-w-0">
<div className="mx-auto mb-10 max-w-2xl text-center"> <div className="mx-auto mb-10 max-w-2xl text-center">
<Heading level={2}>{labels.moreThanDegree}</Heading> <Heading level={2} className="break-words">{labels.moreThanDegree}</Heading>
<p className="mt-4 text-base leading-relaxed text-muted-foreground sm:text-lg"> <p className="mt-4 text-base leading-relaxed text-muted-foreground sm:text-lg">
{labels.moreThanDegreeBody} {labels.moreThanDegreeBody}
</p> </p>
@@ -245,14 +245,14 @@ export function HomeRest({
density="sparse" density="sparse"
className="opacity-[0.4]" className="opacity-[0.4]"
/> />
<Container className="relative z-[1] grid gap-12 lg:grid-cols-[1fr_auto] lg:items-end"> <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="max-w-3xl"><p className="text-xs font-bold text-background/60">همکاری با سازمان‌ها</p><Heading level={2} className="mt-3 text-background sm:text-5xl"> <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} {labels.hireTitle}
</Heading> </Heading>
<p className="mt-5 max-w-2xl text-base leading-relaxed text-background/75 sm:text-lg"> <p className="mt-5 max-w-2xl text-base leading-relaxed text-background/75 sm:text-lg">
{labels.hireBody} {labels.hireBody}
</p> </p>
</div><div> </div><div className="shrink-0">
<DotCta href="/professional" onDark> <DotCta href="/professional" onDark>
{labels.registerCta} {labels.registerCta}
</DotCta> </DotCta>
@@ -268,11 +268,11 @@ export function HomeRest({
> >
{labels.missionTitle} {labels.missionTitle}
</Heading> </Heading>
<p className="mt-5 text-2xl font-bold leading-relaxed text-foreground sm:text-3xl"> <p className="mt-5 text-xl font-bold leading-relaxed break-words text-foreground sm:text-2xl md:text-3xl">
{siteMission} {siteMission}
</p> </p>
<div className="mt-12 grid gap-6 border-t border-border pt-10 sm:grid-cols-3"> <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}><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>)} {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> </div>
</Container> </Container>
</Section> </Section>
@@ -54,17 +54,17 @@ export function ProfessionalLandingTemplate({
tone="dark" tone="dark"
className="inset-y-0 end-0 start-auto w-[min(72vw,36rem)] opacity-[0.5]" 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"> <div className="relative z-[2] flex min-h-[inherit] min-w-0 items-center py-12">
<Container> <Container>
<div className="max-w-3xl text-start"> <div className="w-full min-w-0 max-w-3xl text-start">
<div> <div className="min-w-0">
<p className="text-sm font-semibold text-background/75"> <p className="text-sm font-semibold text-background/75">
{labels.offeredBy} {labels.offeredBy}
</p> </p>
<Heading <Heading
as="h1" as="h1"
level={1} level={1}
className="mt-4 text-4xl leading-tight text-background sm:text-6xl" className="mt-4 text-4xl leading-tight break-words text-background sm:text-6xl"
> >
{labels.heroTitle} {labels.heroTitle}
</Heading> </Heading>