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:
1 parent
fdb2023353
commit
b6ff82fad9
22 files changed
+207
-265
No files matched your search
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user