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
+207 -265

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ export default async function MainLayout({
programs={programs}
/>
<CampaignBanners banners={banners} />
<div className="flex-1">{children}</div>
<div className="min-w-0 flex-1 overflow-x-clip">{children}</div>
<SiteFooter
copyright={t("footer.copyright", { year })}
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">
<Card className="w-full max-w-md shadow-sm">
<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
src="/brand/amirkabir.png"
alt="دانشگاه صنعتی امیرکبیر"
fill
sizes="56px"
className="object-contain p-[15%]"
className="object-contain brightness-0"
priority
/>
</div>
+46 -74
View File
@@ -121,78 +121,49 @@
* {
@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 {
@apply bg-background text-foreground antialiased;
font-size: 16px;
line-height: 1.65;
text-align: start;
}
html {
@apply font-sans scroll-smooth;
scroll-padding-top: 6rem;
html,
body {
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 {
color: inherit;
text-decoration: none;
}
img {
img,
video,
canvas,
iframe {
max-width: 100%;
}
}
/* Metamorphism dots + lines — soft presence, not noise */
@keyframes metamorph-line-pulse {
0%,
100% {
opacity: 0.35;
}
50% {
opacity: 0.85;
video,
iframe {
height: auto;
}
}
@keyframes metamorph-dot-breathe {
0%,
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;
}
/* Metamorph field: static on purpose (animations removed for mobile perf).
Legacy keyframes kept only so reduced-motion rules stay harmless. */
.page-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%);
}
@supports (animation-timeline: view()) {
.motion-section {
animation: section-reveal both cubic-bezier(0.22, 1, 0.36, 1);
animation-timeline: view();
animation-range: entry 5% cover 28%;
/* 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 {
animation: section-reveal both cubic-bezier(0.22, 1, 0.36, 1);
animation-timeline: view();
animation-range: entry 8% cover 22%;
}
}
}
@media (hover: hover) {
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
[data-slot="card"] img {
transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
@@ -266,10 +245,11 @@
}
}
.metamorph-field__dot {
transform-box: fill-box;
transform-origin: center;
animation: metamorph-dot-breathe 6s ease-in-out infinite;
@media (max-width: 767px) {
.motion-section[data-tone="muted"],
.motion-section[data-tone="dark"] {
background-image: none;
}
}
@media (prefers-reduced-motion: reduce) {
@@ -283,14 +263,6 @@
animation-iteration-count: 1 !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 {
animation: none !important;
}
+11 -3
View File
@@ -1,10 +1,16 @@
import type { Metadata } from "next";
import type { Metadata, Viewport } from "next";
import localFont from "next/font/local";
import { NextIntlClientProvider } from "next-intl";
import { getLocale, getMessages, getTranslations } from "next-intl/server";
import { JsonLd, organizationJsonLd } from "@/lib/seo/json-ld";
import "./globals.css";
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
viewportFit: "cover",
};
const iranSans = localFont({
src: [
{
@@ -93,7 +99,7 @@ export default async function RootLayout({
return (
<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}>
<a
href="#main-content"
@@ -102,7 +108,9 @@ export default async function RootLayout({
{t("skipToContent")}
</a>
<JsonLd data={organizationJsonLd()} />
{children}
<div data-slot="page-shell" className="flex min-h-full min-w-0 flex-1 flex-col">
{children}
</div>
</NextIntlClientProvider>
</body>
</html>
+1 -1
View File
@@ -30,7 +30,7 @@ export default async function ProfessionalLayout({
courses={courses}
programs={programs}
/>
<div className="flex-1">{children}</div>
<div className="min-w-0 flex-1 overflow-x-clip">{children}</div>
<SiteFooter
variant="professional"
copyright={t("footer.copyright", { year })}
+41 -18
View File
@@ -3,37 +3,60 @@
import { useEffect, useRef, useState } from "react";
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 [display, setDisplay] = useState(value);
useEffect(() => {
const element = ref.current;
if (!element || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
if (!element || !shouldAnimate()) return;
const latin = toLatin(value).replaceAll("٬", "");
const match = latin.match(/^(\D*)(\d+)(\D*)$/);
if (!match) return;
const [, prefix, rawNumber, suffix] = match;
const target = Number(rawNumber);
const observer = new IntersectionObserver(([entry]) => {
if (!entry.isIntersecting) return;
observer.disconnect();
const startedAt = performance.now();
const duration = 1000;
const tick = (now: number) => {
const progress = Math.min((now - startedAt) / duration, 1);
const eased = 1 - Math.pow(1 - progress, 3);
const current = Math.round(target * eased).toLocaleString("fa-IR");
setDisplay(`${prefix}${current}${suffix}`);
if (progress < 1) requestAnimationFrame(tick);
};
requestAnimationFrame(tick);
}, { threshold: 0.55 });
const observer = new IntersectionObserver(
([entry]) => {
if (!entry.isIntersecting) return;
observer.disconnect();
const startedAt = performance.now();
const duration = 900;
const tick = (now: number) => {
const progress = Math.min((now - startedAt) / duration, 1);
const eased = 1 - Math.pow(1 - progress, 3);
const current = Math.round(target * eased).toLocaleString("fa-IR");
setDisplay(`${prefix}${current}${suffix}`);
if (progress < 1) requestAnimationFrame(tick);
};
requestAnimationFrame(tick);
},
{ threshold: 0.55 },
);
observer.observe(element);
return () => observer.disconnect();
}, [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;
};
/** AUT seal — white mark on transparent; sits on brand disc. */
/** AUT seal — raw mark only (transparent), no disc/ring/background. */
export function BrandLogo({
href = "/",
title,
@@ -33,8 +33,7 @@ export function BrandLogo({
>
<span
className={cn(
"relative shrink-0 overflow-hidden rounded-full bg-chart-3 shadow-sm ring-1",
onDark ? "ring-background/25" : "ring-border",
"relative shrink-0",
compact ? "size-9" : "size-11 sm:size-12",
)}
>
@@ -44,7 +43,11 @@ export function BrandLogo({
fill
priority
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 className="min-w-0 text-start leading-tight">
@@ -60,7 +63,7 @@ export function BrandLogo({
{subtitle ? (
<span
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",
)}
>
+1 -1
View File
@@ -12,7 +12,7 @@ export function Container({
return (
<div
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",
className,
)}
+31 -97
View File
@@ -1,3 +1,6 @@
"use client";
import { useEffect, useState } from "react";
import { cn } from "@/lib/utils";
type MetamorphFieldProps = {
@@ -69,17 +72,30 @@ const EDGES_SPARSE: Edge[] = [
const VIEW_W = 1200;
const VIEW_H = 480;
const ENABLE_MQ =
"(min-width: 768px) and (prefers-reduced-motion: no-preference)";
/**
* Decorative metamorphism field — dots joined by thin lines.
* Place inside a `relative overflow-hidden` flex/grid surface.
* The outer wrapper fills the parent; the SVG covers with landscape slice
* so density stays proportional across wide hero/footer bands.
* Decorative constellation. Mounted only on desktop with motion allowed —
* SMIL/CSS motion was too expensive on phones.
*/
export function MetamorphField({
className,
tone = "dark",
density = "normal",
}: 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 edges = density === "sparse" ? EDGES_SPARSE : EDGES_NORMAL;
const stroke =
@@ -88,11 +104,6 @@ export function MetamorphField({
tone === "dark" ? "color-mix(in oklab, white 70%, transparent)" : "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 (
<div
className={cn(
@@ -109,7 +120,7 @@ export function MetamorphField({
preserveAspectRatio="xMidYMid slice"
focusable="false"
>
<g className="metamorph-field__mesh" stroke={stroke} strokeWidth="0.9">
<g stroke={stroke} strokeWidth="0.9">
{edges.map(([a, b], i) => {
const n1 = nodes[a];
const n2 = nodes[b];
@@ -121,98 +132,21 @@ export function MetamorphField({
y1={n1.y}
x2={n2.x}
y2={n2.y}
className="metamorph-field__line"
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>
opacity="0.55"
/>
);
})}
</g>
<g>
{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
cx={n.x}
cy={n.y}
r={n.r ?? 2}
fill={i % 5 === 0 ? accent : fill}
className="metamorph-field__dot"
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>
<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}
/>
))}
</g>
</svg>
+1 -1
View File
@@ -22,7 +22,7 @@ export function Section({
<section
data-tone={tone}
className={cn(
"motion-section relative",
"motion-section relative min-w-0",
tight ? "py-8 sm:py-10" : "py-16 sm:py-24",
tones[tone],
className,
+2 -2
View File
@@ -84,7 +84,7 @@ export function ArticleCard({
return (
<article
className={cn(
"group flex h-full flex-col",
"group flex h-full min-w-0 flex-col",
featured && "lg:flex-row lg:gap-8",
)}
>
@@ -213,7 +213,7 @@ export function EventCard({
}
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}
</article>
);
+8 -8
View File
@@ -9,13 +9,13 @@ export function HeroFeatured({ title, href, eyebrow }: { title: string; href: st
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" />
<Container className="relative z-[2] flex min-h-[38rem] items-center py-20 sm:py-24">
<div className="home-hero__copy max-w-4xl">
<div className="inline-flex items-center gap-2 text-sm font-medium text-background/60">
<GraduationCap className="size-4" />
مرکز آموزش‌های آزاد دانشگاه صنعتی امیرکبیر
<Container className="relative z-[2] flex min-h-[38rem] min-w-0 items-center py-20 sm:py-24">
<div className="home-hero__copy w-full min-w-0 max-w-4xl">
<div className="inline-flex max-w-full items-center gap-2 text-sm font-medium text-background/60">
<GraduationCap className="size-4 shrink-0" />
<span className="min-w-0 leading-6">مرکز آموزش‌های آزاد دانشگاه صنعتی امیرکبیر</span>
</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>
</h1>
@@ -43,9 +43,9 @@ export function HeroFeatured({ title, href, eyebrow }: { title: string; href: st
</Link>
</div>
<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="truncate">{title}</span>
<span className="min-w-0 truncate">{title}</span>
<ArrowLeft className="size-4 shrink-0 transition-transform group-hover:-translate-x-1" />
</Link>
</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" /></>}
<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" />
<Container className="relative z-[2]">
<div className="page-hero__content max-w-3xl text-start">
<Container className="relative z-[2] min-w-0">
<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}
<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}
</div>
</Container>
@@ -54,11 +54,11 @@ export function AcademicsOverlay({
</Button>
</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}
</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) => (
<li key={program.id}>
<Link
+2 -2
View File
@@ -48,8 +48,8 @@ export function CampaignBanners({ banners }: { banners: CampaignBanner[] }) {
return (
<div className="bg-chart-3 text-background">
<Container className="flex items-center justify-between gap-4 py-3">
<p className="min-w-0 flex-1 text-sm leading-relaxed">
<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 break-words">
<span className="text-background/90">{banner.text}</span>{" "}
<Link
href={banner.href}
+8 -7
View File
@@ -23,22 +23,23 @@ export function ProgramCarousel({
align: "start",
direction: "rtl",
loop: false,
containScroll: "trimSnaps",
});
const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi]);
const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi]);
return (
<div>
<div className="mb-5 flex items-end justify-between gap-4">
<div className="min-w-0">
<div className="mb-5 flex min-w-0 items-end justify-between gap-4">
{!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}
</h2>
) : (
<span />
)}
<div className="flex gap-1">
<div className="flex shrink-0 gap-1">
<Button
type="button"
variant="outline"
@@ -59,12 +60,12 @@ export function ProgramCarousel({
</Button>
</div>
</div>
<div className="overflow-hidden" ref={emblaRef}>
<div className="flex gap-5">
<div className="min-w-0 overflow-hidden" ref={emblaRef}>
<div className="flex gap-4 sm:gap-5">
{programs.map((program) => (
<div
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} />
</div>
+3 -2
View File
@@ -66,18 +66,19 @@ export function SiteHeader({
<>
<header
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
? "border-b border-background/10 bg-chart-3/95 text-background"
: "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
href={brandHref}
title={brandTitle}
subtitle={brandSubtitle}
onDark={isDark}
className="max-w-[min(100%,14rem)] sm:max-w-[min(100%,20rem)]"
/>
<nav
@@ -35,13 +35,13 @@ export function AdminShell({
<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 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
src="/brand/amirkabir.png"
alt=""
fill
sizes="24px"
className="object-contain p-[15%]"
className="object-contain brightness-0"
/>
</span>
<p className="truncate text-sm font-medium text-muted-foreground">
@@ -95,13 +95,13 @@ export function AdminSidebar({ userName }: { userName: string }) {
render={<Link href="/admin" />}
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
src="/brand/amirkabir.png"
alt=""
fill
sizes="32px"
className="object-contain p-[15%]"
className="object-contain brightness-0"
priority
/>
</span>
@@ -74,7 +74,7 @@ export function CourseDetailTemplate({
/>
<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="overflow-hidden rounded-2xl ring-1 ring-border">
<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">
<Container>
<div className="grid gap-10 lg:grid-cols-[.8fr_1.2fr] lg:items-start lg:gap-20">
<div className="lg:sticky lg:top-28">
<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 sm:text-4xl">
<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>
</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: Building2, title: "اثر سازمانی", text: "یادگیری مبتنی بر مسئله‌های واقعی کسب‌وکار و صنعت ایران." },
{ icon: Network, title: "شبکه‌ی حرفه‌ای", text: "پیوند با مدیران، متخصصان و پژوهشگران برای رشد ماندگار." },
].map((item, index) => (
<Card key={item.title} className="border-border/70 py-0 shadow-none transition-colors hover:border-primary/25">
<CardContent className="flex h-full flex-col gap-5 p-6 lg:flex-row lg:items-center lg:gap-6 lg:p-7">
<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><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>
</Card>
))}
@@ -99,15 +99,15 @@ export function HomeIdeas({
</Container>
</Section>
<Section className="overflow-hidden py-0">
<Container className="grid max-w-none px-0 lg:grid-cols-2">
<div className="relative min-h-80 lg:min-h-[32rem]">
<Container className="grid max-w-none min-w-0 px-0 lg:grid-cols-2">
<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" />
</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" />
<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>
<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>
<Link
href="/about"
@@ -124,10 +124,10 @@ export function HomeIdeas({
</Section>
<Section tone="muted" className="py-20 sm:py-24">
<Container>
<div className="mb-10 flex items-end justify-between gap-4">
<div>
<div className="mb-10 flex min-w-0 items-end justify-between gap-4">
<div className="min-w-0">
<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">
{title}
</Link>
@@ -137,13 +137,13 @@ export function HomeIdeas({
href="/insights"
className={cn(
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" />
</Link>
</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) => (
<ArticleCard
key={article.id}
@@ -178,7 +178,7 @@ export function HomeEvents({
{title}
</Heading>
<Separator className="mx-auto mt-5 max-w-16 bg-primary" />
<div className="mt-10 grid gap-0 border-y border-border sm:grid-cols-2 lg:grid-cols-4">
<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" />
))}
@@ -213,7 +213,7 @@ export function HomeRest({
{labels.intersectionsSubtitle}
</p>
</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) => (
<IntersectionCard key={topic.id} {...topic} />
))}
@@ -223,9 +223,9 @@ export function HomeRest({
<Section className="relative overflow-hidden py-20 sm:py-24">
<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">
<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">
{labels.moreThanDegreeBody}
</p>
@@ -245,14 +245,14 @@ export function HomeRest({
density="sparse"
className="opacity-[0.4]"
/>
<Container className="relative z-[1] grid gap-12 lg:grid-cols-[1fr_auto] lg:items-end">
<div className="max-w-3xl"><p className="text-xs font-bold text-background/60">همکاری با سازمان‌ها</p><Heading level={2} className="mt-3 text-background sm:text-5xl">
<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>
</div><div className="shrink-0">
<DotCta href="/professional" onDark>
{labels.registerCta}
</DotCta>
@@ -268,11 +268,11 @@ export function HomeRest({
>
{labels.missionTitle}
</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}
</p>
<div className="mt-12 grid gap-6 border-t border-border pt-10 sm:grid-cols-3">
{stats.map((stat) => <div key={stat.id}><p className="text-3xl font-black text-primary sm:text-4xl"><AnimatedMetric value={stat.value} /></p><p className="mt-2 text-sm text-muted-foreground">{stat.label}</p></div>)}
<div 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>
</Container>
</Section>
@@ -54,17 +54,17 @@ export function ProfessionalLandingTemplate({
tone="dark"
className="inset-y-0 end-0 start-auto w-[min(72vw,36rem)] opacity-[0.5]"
/>
<div className="relative z-[2] flex min-h-[inherit] items-center py-12">
<div className="relative z-[2] flex min-h-[inherit] min-w-0 items-center py-12">
<Container>
<div className="max-w-3xl text-start">
<div>
<div className="w-full min-w-0 max-w-3xl 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 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}
</Heading>