fix(mobile): resolve viewport zoom-out overflow in ArticlesSection and add global root containment
This commit is contained in:
parent
1a3604504a
commit
801b580bd5
6 changed files with 18 additions and 12 deletions
|
|
@ -4,12 +4,18 @@
|
|||
@layer base {
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
}
|
||||
body {
|
||||
background-color: #F8F9FB;
|
||||
color: #1E293B;
|
||||
font-family: 'Inter', sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ export default function RootLayout({
|
|||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<html lang="en" className="h-full">
|
||||
<body className="flex flex-col min-h-screen bg-[#F8F9FB] text-[#1E293B] font-sans antialiased">
|
||||
<html lang="en" className="h-full overflow-x-hidden">
|
||||
<body className="flex flex-col min-h-screen bg-[#F8F9FB] text-[#1E293B] font-sans antialiased overflow-x-hidden w-full max-w-full">
|
||||
<Suspense fallback={null}>
|
||||
<GoogleAnalytics />
|
||||
</Suspense>
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ export default async function Home() {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#F8F9FB] text-[#1E293B] flex flex-col font-sans">
|
||||
<div className="min-h-screen bg-[#F8F9FB] text-[#1E293B] flex flex-col font-sans overflow-x-hidden w-full max-w-full">
|
||||
<AnnouncementBar
|
||||
config={sectionsData.announcement_bar}
|
||||
isActive={show('announcement_bar')}
|
||||
|
|
@ -183,7 +183,7 @@ export default async function Home() {
|
|||
{/* After Header + Navbar so sticky chrome reserves full height */}
|
||||
<StickyHeaderSpacer />
|
||||
|
||||
<main className="flex-grow">
|
||||
<main className="flex-grow min-w-0 w-full max-w-full overflow-x-hidden">
|
||||
{orderedKeys.map((key) => sectionNodes[key] ?? null)}
|
||||
</main>
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export const MobileDrawer: React.FC<MobileDrawerProps> = ({ isOpen, onClose }) =
|
|||
animate={{ opacity: 0.5 }}
|
||||
exit={{ opacity: 0 }}
|
||||
onClick={onClose}
|
||||
className="fixed inset-0 bg-black z-50 xl:hidden"
|
||||
className="fixed inset-0 bg-black z-[115] xl:hidden"
|
||||
/>
|
||||
|
||||
{/* Drawer Panel */}
|
||||
|
|
@ -68,7 +68,7 @@ export const MobileDrawer: React.FC<MobileDrawerProps> = ({ isOpen, onClose }) =
|
|||
animate={{ x: 0 }}
|
||||
exit={{ x: '-100%' }}
|
||||
transition={{ type: 'tween', duration: 0.3 }}
|
||||
className="fixed top-0 left-0 bottom-0 w-[280px] max-w-[85vw] bg-white z-50 xl:hidden flex flex-col justify-between shadow-xl overflow-y-auto overscroll-contain"
|
||||
className="fixed top-0 left-0 bottom-0 w-[280px] max-w-[85vw] bg-white z-[120] xl:hidden flex flex-col justify-between shadow-xl overflow-y-auto overscroll-contain"
|
||||
>
|
||||
<div>
|
||||
{/* Header */}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ export const ArticlesSection: React.FC<ArticlesSectionProps> = ({ config }) => {
|
|||
1024: { slidesPerView: 3, spaceBetween: 22 },
|
||||
1280: { slidesPerView: 4, spaceBetween: 24 },
|
||||
}}
|
||||
className="!overflow-visible"
|
||||
className="overflow-hidden"
|
||||
>
|
||||
{articles.map((article) => (
|
||||
<SwiperSlide key={article.id} className="h-auto">
|
||||
|
|
|
|||
|
|
@ -161,20 +161,20 @@ export const HeroSection: React.FC<HeroSectionProps> = ({
|
|||
<div className="absolute -right-16 -top-20 w-72 h-72 rounded-full bg-primary/25 blur-3xl pointer-events-none z-[1]" />
|
||||
<div className="absolute right-1/4 bottom-0 w-56 h-56 rounded-full bg-cyan-400/10 blur-3xl pointer-events-none z-[1]" />
|
||||
|
||||
<div className="relative z-10 h-full flex flex-col md:flex-row items-center justify-between gap-6 px-8 sm:px-12 lg:px-14 py-10">
|
||||
<div className="relative z-10 h-full flex flex-col md:flex-row items-center justify-between gap-6 px-5 sm:px-12 lg:px-14 py-8 sm:py-10">
|
||||
<div className="text-left flex-1 max-w-xl text-white">
|
||||
{slide.badge ? (
|
||||
<span className="techshop-layer techshop-layer-1 inline-block bg-primary text-[11px] font-extrabold uppercase tracking-wider px-3.5 py-1.5 rounded-md mb-4 shadow-sm">
|
||||
<span className="techshop-layer techshop-layer-1 inline-block bg-primary text-[11px] font-extrabold uppercase tracking-wider px-3.5 py-1.5 rounded-md mb-3 sm:mb-4 shadow-sm">
|
||||
{slide.badge}
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
<h2 className="techshop-layer techshop-layer-2 text-3xl sm:text-4xl lg:text-[42px] font-extrabold tracking-tight leading-[1.08] whitespace-pre-line mb-4 font-outfit drop-shadow-md">
|
||||
<h2 className="techshop-layer techshop-layer-2 text-2xl sm:text-4xl lg:text-[42px] font-extrabold tracking-tight leading-[1.12] sm:leading-[1.08] whitespace-pre-line mb-3 sm:mb-4 font-outfit drop-shadow-md">
|
||||
{slide.title}
|
||||
</h2>
|
||||
|
||||
{slide.subtitle ? (
|
||||
<p className="techshop-layer techshop-layer-3 text-sm md:text-base text-blue-100/95 font-medium mb-7 max-w-lg">
|
||||
<p className="techshop-layer techshop-layer-3 text-xs sm:text-sm md:text-base text-blue-100/95 font-medium mb-5 sm:mb-7 max-w-lg">
|
||||
{slide.subtitle}
|
||||
</p>
|
||||
) : null}
|
||||
|
|
@ -183,7 +183,7 @@ export const HeroSection: React.FC<HeroSectionProps> = ({
|
|||
<div className="techshop-layer techshop-layer-4">
|
||||
<Link
|
||||
href={slide.buttonUrl || '/shop'}
|
||||
className="inline-flex bg-primary hover:bg-primary-hover text-white text-xs md:text-sm font-semibold px-8 py-3.5 rounded-lg items-center shadow-lg transition-colors"
|
||||
className="inline-flex bg-primary hover:bg-primary-hover text-white text-xs md:text-sm font-semibold px-6 sm:px-8 py-3 sm:py-3.5 rounded-lg items-center shadow-lg transition-colors"
|
||||
>
|
||||
{slide.buttonText}
|
||||
</Link>
|
||||
|
|
|
|||
Loading…
Reference in a new issue