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
@@ -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")}
|
||||
|
||||
@@ -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
@@ -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
@@ -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>
|
||||
|
||||
@@ -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 })}
|
||||
|
||||
Reference in new issue
Block a user