diff --git a/next.config.ts b/next.config.ts index e9ffa30..398f0f4 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,17 @@ import type { NextConfig } from "next"; +import bundleAnalyzer from "@next/bundle-analyzer"; + +const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === "true" }); const nextConfig: NextConfig = { - /* config options here */ + reactStrictMode: true, + swcMinify: true, + experimental: { + optimizePackageImports: ["lucide-react", "@lottiefiles/dotlottie-react"], + }, + images: { + formats: ["image/avif", "image/webp"], + }, }; -export default nextConfig; +export default withBundleAnalyzer(nextConfig); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cbba1aa..9114c94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ }, "devDependencies": { "@eslint/eslintrc": "^3", + "@next/bundle-analyzer": "^15.5.4", "@tailwindcss/postcss": "^4.1.10", "@types/node": "^20", "@types/react": "^19", @@ -73,6 +74,16 @@ "node": ">=6.0.0" } }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@emnapi/core": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", @@ -857,6 +868,16 @@ "@tybys/wasm-util": "^0.9.0" } }, + "node_modules/@next/bundle-analyzer": { + "version": "15.5.4", + "resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-15.5.4.tgz", + "integrity": "sha512-wMtpIjEHi+B/wC34ZbEcacGIPgQTwTFjjp0+F742s9TxC6QwT0MwB/O0QEgalMe8s3SH/K09DO0gmTvUSJrLRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "webpack-bundle-analyzer": "4.10.1" + } + }, "node_modules/@next/env": { "version": "15.3.4", "resolved": "https://registry.npmjs.org/@next/env/-/env-15.3.4.tgz", @@ -1049,6 +1070,13 @@ "node": ">=12.4.0" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, "node_modules/@radix-ui/number": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz", @@ -3607,6 +3635,19 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4202,6 +4243,16 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4292,6 +4343,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "dev": true, + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", @@ -4405,6 +4463,13 @@ "node": ">= 0.4" } }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true, + "license": "MIT" + }, "node_modules/electron-to-chromium": { "version": "1.5.171", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.171.tgz", @@ -5465,6 +5530,22 @@ "integrity": "sha512-QL7MJ2WMjm1PHWsoFrAQH/J8wUeqZvMtHO58qdekHpCfhvhSL4gSiz6vJf5EeMP0LOn3ZCprL2ki/gjED8ghVw==", "license": "Standard 'no charge' license: https://gsap.com/standard-license." }, + "node_modules/gzip-size": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", + "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "duplexer": "^0.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -5556,6 +5637,13 @@ "node": ">= 0.4" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -5871,6 +5959,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -6645,6 +6743,16 @@ "integrity": "sha512-BuFTHINYmV07pdWs6lj6aI63vr2N4dg0vR+td0rtrdpWOhBzIkEklZyLcvKBoEtwSqx8Jg06vUB5RS0xDiUybw==", "license": "MIT" }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6921,6 +7029,16 @@ "integrity": "sha512-kUpC154AFfxi16pmZUK4jk3J+8zxwTWGPo03EoYA8QPbzikHoaC82n6pNTbd+oEaJonaE8aPWBlX7ad9zrqLsA==", "license": "Unlicense" }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "license": "(WTFPL OR MIT)", + "bin": { + "opener": "bin/opener-bin.js" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -7755,6 +7873,21 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/sirv": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -8081,6 +8214,16 @@ "node": ">=8.0" } }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -8393,6 +8536,56 @@ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, + "node_modules/webpack-bundle-analyzer": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz", + "integrity": "sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@discoveryjs/json-ext": "0.5.7", + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "commander": "^7.2.0", + "debounce": "^1.2.1", + "escape-string-regexp": "^4.0.0", + "gzip-size": "^6.0.0", + "html-escaper": "^2.0.2", + "is-plain-object": "^5.0.0", + "opener": "^1.5.2", + "picocolors": "^1.0.0", + "sirv": "^2.0.3", + "ws": "^7.3.1" + }, + "bin": { + "webpack-bundle-analyzer": "lib/bin/analyzer.js" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", diff --git a/package.json b/package.json index 9210969..9c468dc 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ }, "devDependencies": { "@eslint/eslintrc": "^3", + "@next/bundle-analyzer": "^15.5.4", "@tailwindcss/postcss": "^4.1.10", "@types/node": "^20", "@types/react": "^19", diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index ee7353e..6cca805 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -8,23 +8,10 @@ import { DotLottieReact } from '@lottiefiles/dotlottie-react'; const AcademicHub = () => { const [isMenuOpen, setIsMenuOpen] = useState(false); - const [isLoading, setIsLoading] = useState(true); - const [mounted, setMounted] = useState(false); + // const [isLoading, setIsLoading] = useState(true); + // const [mounted, setMounted] = useState(false); const router = useRouter(); - - useEffect(() => { - setMounted(true); - }, []); - - useEffect(() => { - if (!mounted) return; - const timer = setTimeout(() => { - setIsLoading(false); - }, 4000); - return () => clearTimeout(timer); - }, [mounted]); - - if (!mounted) return null; + const featuredProjects = [ { @@ -86,19 +73,7 @@ const AcademicHub = () => { return (
{/* Loading Screen */} - {isLoading && ( -
-
- -

Loading...

-
-
- )} -
+
{/* Hero Section */} diff --git a/src/app/page.tsx b/src/app/page.tsx index 3bb91ca..129bcc5 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -5,72 +5,89 @@ import { cn } from "@/lib/utils"; import Button2 from '@/components/button2'; import { User, FileText, UploadCloud, CreditCard, Github } from 'lucide-react'; import Upload from '@/components/upload'; -import Aurora from '@/components/Backgrounds/Aurora'; +// import Aurora from '@/components/Backgrounds/Aurora'; import { useRef } from 'react'; import { ContainerTextFlip } from "@/components/ui/container-text-flip"; -import { ContainerScroll } from "@/components/ui/container-scroll-animation"; +// import { ContainerScroll } from "@/components/ui/container-scroll-animation"; import TailwindConnectButton from "@/components/button"; import { useRouter } from "next/navigation"; -import TestimonialMarquee from "@/components/mwrap" -import { NavbarDemo } from "@/components/nav"; +// import TestimonialMarquee from "@/components/mwrap" +// import { NavbarDemo } from "@/components/nav"; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; +import dynamic from "next/dynamic"; +import Image from "next/image"; + +const Aurora = dynamic(() => import("@/components/Backgrounds/Aurora"), { ssr: false }); +const ContainerScroll = dynamic(() => import("@/components/ui/container-scroll-animation").then(m => m.ContainerScroll), +{ ssr: false }); +const NavbarDemo = dynamic(() => import("@/components/nav").then(m => m.NavbarDemo), { ssr: false }); +const TestimonialMarquee = dynamic(() => import("@/components/mwrap"), { ssr: false }); export default function BackgroundBoxesDemo() { const [scrollY, setScrollY] = useState(0); - const [isLoading, setIsLoading] = useState(true); - const [mounted, setMounted] = useState(false); + // const [isLoading, setIsLoading] = useState(true); + // const [mounted, setMounted] = useState(false); const router = useRouter(); + const [ready, setReady] = useState(false); + useEffect(() => { + const id = ('requestIdleCallback' in window) + ? (window as any).requestIdleCallback(() => setReady(true)) + : setTimeout(() => setReady(true), 150); + return () => (window as any).cancelIdleCallback ? (window as any).cancelIdleCallback(id) : clearTimeout(id); + }, []); - useEffect(() => { - setMounted(true); + // useEffect(() => { + // setMounted(true); - const handleScroll = () => setScrollY(window.scrollY); - window.addEventListener('scroll', handleScroll); - return () => window.removeEventListener('scroll', handleScroll); - }, []); + // const handleScroll = () => setScrollY(window.scrollY); + // window.addEventListener('scroll', handleScroll); + // return () => window.removeEventListener('scroll', handleScroll); + // }, []); - useEffect(() => { - if (!mounted) return; + // useEffect(() => { + // if (!mounted) return; - // Simulate loading time for components - const timer = setTimeout(() => { - setIsLoading(false); - }, 4000); // Show loader for 4 seconds to see the animation properly - - return () => clearTimeout(timer); - }, [mounted]); + // // Simulate loading time for components + // const timer = setTimeout(() => { + // setIsLoading(false); + // }, 4000); // Show loader for 4 seconds to see the animation properly + // return () => clearTimeout(timer); + // }, [mounted]); + + useEffect(() => { + let ticking = false; + const onScroll = () => { + if (!ticking) { + requestAnimationFrame(() => { + setScrollY(window.scrollY); + ticking = false; + }); + ticking = true; + } + }; + window.addEventListener('scroll', onScroll, { passive: true }); + return () => window.removeEventListener('scroll', onScroll); + }, []); // Hide main content after scrolling 100px const mainContentOpacity = scrollY > 100 ? 0 : 1; const mainContentTransform = scrollY > 100 ? 'translateY(-50px)' : 'translateY(0)'; // Don't render anything until mounted to prevent hydration mismatch - if (!mounted) { - return null; - } + // if (!mounted) { + // return null; + // } return (
{/* Loading Screen */} - {isLoading && ( -
-
- -

Loading...

-
-
- )} {/* Aurora as background */} -
+ {ready &&
+ } {/* Main content centered - positioned fixed to stay in center */} -
+ +
{/* Hero Section Layout Fix */}
{/* Button Row */} @@ -120,7 +134,7 @@ export default function BackgroundBoxesDemo() {
{/* ContainerScroll in normal document flow for scrolling */} -
+ {ready &&
@@ -133,17 +147,18 @@ export default function BackgroundBoxesDemo() { } > - hero -
+
} {/* 3 Steps Section */}
HOW IT WORKS
diff --git a/src/app/sign/page.tsx b/src/app/sign/page.tsx index b29ba3a..149e1db 100644 --- a/src/app/sign/page.tsx +++ b/src/app/sign/page.tsx @@ -26,23 +26,11 @@ export default function SignupPage() { return (
{/* Loading Screen */} - {isLoading && ( -
-
- -

Loading...

-
-
- )}
-
- {!isLoading && } +
+ {}
);