From 9d02c6229266515577cc99631f9eb680caf3e5be Mon Sep 17 00:00:00 2001 From: root Date: Sun, 15 Feb 2026 12:08:28 +0500 Subject: [PATCH] UI performance and Mobile responsiveness --- package-lock.json | 26 +++++ package.json | 1 + src/app/about/page.tsx | 10 +- src/app/layout.tsx | 9 +- src/app/page.tsx | 29 +++-- src/components/SmoothScroll.tsx | 32 +++++ src/components/landing/LandingFooter.tsx | 35 +++--- src/components/landing/LandingHero.tsx | 16 +-- src/components/landing/LandingNavbar.tsx | 4 +- src/components/landing/LandingSolutions.tsx | 2 +- .../landing/mobile/MobileFeatures.tsx | 109 ++++++++++++++++++ src/components/landing/mobile/MobileHero.tsx | 91 +++++++++++++++ src/hooks/useMediaQuery.ts | 19 +++ 13 files changed, 341 insertions(+), 42 deletions(-) create mode 100644 src/components/SmoothScroll.tsx create mode 100644 src/components/landing/mobile/MobileFeatures.tsx create mode 100644 src/components/landing/mobile/MobileHero.tsx create mode 100644 src/hooks/useMediaQuery.ts diff --git a/package-lock.json b/package-lock.json index 1553e30..a3567ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "date-fns": "^4.1.0", "dotenv": "^17.2.4", "framer-motion": "^12.33.0", + "lenis": "^1.3.17", "lucide-react": "^0.563.0", "mammoth": "^1.11.0", "next": "16.1.6", @@ -7328,6 +7329,31 @@ "node": ">=0.10" } }, + "node_modules/lenis": { + "version": "1.3.17", + "resolved": "https://registry.npmjs.org/lenis/-/lenis-1.3.17.tgz", + "integrity": "sha512-k9T9rgcxne49ggJOvXCraWn5dt7u2mO+BNkhyu6yxuEnm9c092kAW5Bus5SO211zUvx7aCCEtzy9UWr0RB+oJw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/darkroomengineering" + }, + "peerDependencies": { + "@nuxt/kit": ">=3.0.0", + "react": ">=17.0.0", + "vue": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@nuxt/kit": { + "optional": true + }, + "react": { + "optional": true + }, + "vue": { + "optional": true + } + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", diff --git a/package.json b/package.json index 0358b73..653f10d 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "date-fns": "^4.1.0", "dotenv": "^17.2.4", "framer-motion": "^12.33.0", + "lenis": "^1.3.17", "lucide-react": "^0.563.0", "mammoth": "^1.11.0", "next": "16.1.6", diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 445f502..91ff1b4 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -67,7 +67,7 @@ export default function AboutPage() { initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.2 }} - className="max-w-3xl mx-auto text-xl text-slate-400 font-medium leading-relaxed" + className="max-w-3xl mx-auto text-xl text-slate-300 font-medium leading-relaxed" > We started JUNOHUB with a simple belief: the global supply chain is broken, and technology is the only way to fix it. We're building the infrastructure for a @@ -87,7 +87,7 @@ export default function AboutPage() { transition={{ duration: 0.8 }} >

Our Vision

-
+

Every day, millions of dollars are lost due to inefficient communication, lost inventory data, and slow synchronization. @@ -115,7 +115,7 @@ export default function AboutPage() {

{item.value}
-
{item.label}
+
{item.label}
))} @@ -141,7 +141,7 @@ export default function AboutPage() {

{v.title}

-

{v.description}

+

{v.description}

))}
@@ -156,7 +156,7 @@ export default function AboutPage() { viewport={{ once: true }} >

Join the Movement

-

+

We're always looking for ambitious vendors and suppliers to join our expanding ecosystem. Let's build the future together.

diff --git a/src/app/layout.tsx b/src/app/layout.tsx index fbc6768..eb3f7f2 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -24,6 +24,7 @@ export const viewport = { import { Providers } from "@/components/providers"; import { ErrorBoundary } from "@/components/ErrorBoundary"; +import { SmoothScroll } from "@/components/SmoothScroll"; export default function RootLayout({ children, @@ -33,10 +34,14 @@ export default function RootLayout({ return ( - {children} + + + {children} + + diff --git a/src/app/page.tsx b/src/app/page.tsx index 8486fb7..0c556b1 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,21 +1,34 @@ -import { auth } from "@/auth" +"use client" + +import { useMediaQuery } from "@/hooks/useMediaQuery" import { LandingNavbar } from "@/components/landing/LandingNavbar" import { LandingHero } from "@/components/landing/LandingHero" import { LandingFeatures } from "@/components/landing/LandingFeatures" import { LandingSolutions } from "@/components/landing/LandingSolutions" import { LandingFooter } from "@/components/landing/LandingFooter" +import { MobileHero } from "@/components/landing/mobile/MobileHero" +import { MobileFeatures } from "@/components/landing/mobile/MobileFeatures" -export default async function HomePage() { - const session = await auth() - const isLoggedIn = !!session +export default function HomePage() { + const isMobile = useMediaQuery("(max-width: 768px)") return (
- +
- - - + {isMobile ? ( + <> + + + + + ) : ( + <> + + + + + )}
diff --git a/src/components/SmoothScroll.tsx b/src/components/SmoothScroll.tsx new file mode 100644 index 0000000..c1e103f --- /dev/null +++ b/src/components/SmoothScroll.tsx @@ -0,0 +1,32 @@ +"use client" + +import { useEffect } from 'react' +import Lenis from 'lenis' + +export function SmoothScroll({ children }: { children: React.ReactNode }) { + useEffect(() => { + const lenis = new Lenis({ + duration: 1.2, + easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), + orientation: 'vertical', + gestureOrientation: 'vertical', + smoothWheel: true, + wheelMultiplier: 1, + touchMultiplier: 2, + infinite: false, + }) + + function raf(time: number) { + lenis.raf(time) + requestAnimationFrame(raf) + } + + requestAnimationFrame(raf) + + return () => { + lenis.destroy() + } + }, []) + + return <>{children} +} diff --git a/src/components/landing/LandingFooter.tsx b/src/components/landing/LandingFooter.tsx index c4d23e8..8fd192a 100644 --- a/src/components/landing/LandingFooter.tsx +++ b/src/components/landing/LandingFooter.tsx @@ -8,7 +8,7 @@ export function LandingFooter() { return (