diff --git a/app/globals.css b/app/globals.css index c9ceb44..7fad8dc 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,5 +1,4 @@ @import "tailwindcss"; -@custom-variant dark (&:is(.dark *)); @layer base { :root { @@ -79,33 +78,3 @@ ::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground)); } - -/* Hero Badge Shimmer */ -@keyframes badge-shimmer { - 0% { - background-position: -200% 0; - } - 100% { - background-position: 200% 0; - } -} - -.badge-shimmer { - background-image: linear-gradient( - 110deg, - transparent 25%, - rgba(59, 130, 246, 0.12) 37%, - transparent 50% - ); - background-size: 200% 100%; - animation: badge-shimmer 4s ease-in-out infinite; -} - -.dark .badge-shimmer { - background-image: linear-gradient( - 110deg, - transparent 25%, - rgba(96, 165, 250, 0.08) 37%, - transparent 50% - ); -} diff --git a/components/navbar.tsx b/components/navbar.tsx index da8ab58..faf5819 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -2,11 +2,11 @@ import Link from "next/link"; import Image from "next/image"; -import { useState, useEffect, useRef } from "react"; +import { useState, useEffect } from "react"; import { Menu, X, Sun, Moon } from "lucide-react"; import { motion, AnimatePresence } from "framer-motion"; import { useTheme } from "next-themes"; -import { useRouter, usePathname } from "next/navigation"; +import { useRouter } from "next/navigation"; const navLinks = [ { @@ -33,9 +33,6 @@ export default function Navbar() { const { theme, setTheme } = useTheme(); const [mounted, setMounted] = useState(false); const router = useRouter(); - const pathname = usePathname(); - const [activeSection, setActiveSection] = useState("/#Home"); - const isClickScrolling = useRef(false); useEffect(() => { const timer = setTimeout(() => { @@ -44,34 +41,9 @@ export default function Navbar() { const handleScroll = () => { setScrolled(window.scrollY > 20); - - if (!isClickScrolling.current) { - const sections = navLinks - .filter((link) => link.href.startsWith("/#")) - .map((link) => link.href.substring(2)); - - let current = ""; - for (const section of sections) { - const element = document.getElementById(section); - if (element) { - const rect = element.getBoundingClientRect(); - if (rect.top <= 120 && rect.bottom >= 120) { - current = section; - break; - } - } - } - - if (current) { - setActiveSection(`/#${current}`); - } else if (window.scrollY < 100) { - setActiveSection("/#Home"); - } - } }; window.addEventListener("scroll", handleScroll, { passive: true }); - handleScroll(); return () => { clearTimeout(timer); @@ -90,27 +62,16 @@ export default function Navbar() { const element = document.getElementById(targetId); if (element) { - isClickScrolling.current = true; - setActiveSection(href); element.scrollIntoView({ behavior: "smooth", block: "start" }); // Close mobile menu if open setIsOpen(false); - - setTimeout(() => { - isClickScrolling.current = false; - }, 800); } else { // If element not found, navigate to home and then scroll router.push("/"); setTimeout(() => { const el = document.getElementById(targetId); if (el) { - isClickScrolling.current = true; - setActiveSection(href); el.scrollIntoView({ behavior: "smooth", block: "start" }); - setTimeout(() => { - isClickScrolling.current = false; - }, 800); } }, 100); } @@ -119,72 +80,53 @@ export default function Navbar() { return (
-
+
{/* Logo */} -
+
Hyper Learning Official Logo
-
- +
+ Hyper Learning -

+ +

AI-Powered Learning Platform

{/* Desktop Navigation */} -