Compare commits

..

10 Commits

Author SHA1 Message Date
kudinDmitriyUp
ae40e9e616 feat: add smooth opening animation to navbar using CSS transitions 2026-05-08 10:36:35 +00:00
da4cfcc1ba Merge version_25_1778236015160 into main
Merge version_25_1778236015160 into main
2026-05-08 10:28:26 +00:00
kudinDmitriyUp
5141485438 feat: reduce navbar open blur strength 2026-05-08 10:27:54 +00:00
2fc38ce197 Merge version_23_1778235657685 into main
Merge version_23_1778235657685 into main
2026-05-08 10:22:09 +00:00
kudinDmitriyUp
a41574603f feat: decrease navbar blur strength 2026-05-08 10:21:36 +00:00
e1cb829536 Merge version_22_1778235448055 into main
Merge version_22_1778235448055 into main
2026-05-08 10:19:04 +00:00
kudinDmitriyUp
4ec9a6c452 feat: add background blur to open navbar 2026-05-08 10:18:32 +00:00
acb8bd1321 Merge version_21_1778234835630 into main
Merge version_21_1778234835630 into main
2026-05-08 10:09:52 +00:00
kudinDmitriyUp
40cad254a0 feat: remove solid background from navbar and add blur effect 2026-05-08 10:09:19 +00:00
c499eb3691 Merge version_20_1778234396806 into main
Merge version_20_1778234396806 into main
2026-05-08 10:01:13 +00:00
2 changed files with 50 additions and 48 deletions

View File

@@ -1,5 +1,6 @@
import { useState, useEffect, useRef } from "react";
import { Plus, ArrowRight } from "lucide-react";
import { Plus, ArrowRight } from "lucide-react";
import { cls } from "@/lib/utils";
import Button from "@/components/ui/Button";
@@ -52,7 +53,7 @@ const NavbarCentered = ({ logo, navItems, ctaButton }: NavbarCenteredProps) => {
<nav
className={cls(
"fixed z-1000 top-3 left-3 right-3 transition-all duration-500 ease-in-out",
isScrolled ? "h-15 bg-background/80 backdrop-blur-sm rounded-lg" : "h-20 bg-background/0 backdrop-blur-0"
isScrolled ? "h-15 bg-background/80 backdrop-blur-[2px] rounded-lg" : "h-20 bg-background/0 backdrop-blur-0"
)}
>
<div className="relative mx-auto flex items-center justify-between h-full w-content-width">
@@ -89,46 +90,46 @@ const NavbarCentered = ({ logo, navItems, ctaButton }: NavbarCenteredProps) => {
</div>
</nav>
{menuOpen && (
<div
ref={menuRef}
className="md:hidden fixed z-1000 top-3 left-3 right-3 p-6 rounded-lg bg-background/80 backdrop-blur-sm"
>
<div className="flex items-center justify-between mb-6">
<p className="text-xl text-foreground">Menu</p>
<button
className="flex items-center justify-center shrink-0 size-9 rounded cursor-pointer primary-button"
onClick={() => setMenuOpen(false)}
aria-label="Close menu"
>
<Plus className="w-1/2 h-1/2 text-primary-cta-text rotate-45" strokeWidth={1.5} />
</button>
</div>
<div className="flex flex-col gap-4">
{navItems.map((item, index) => (
<div key={item.name}>
<a
href={item.href}
onClick={(e) => handleNavClick(e, item.href, () => setMenuOpen(false))}
className="flex items-center justify-between py-2 text-base font-medium text-foreground"
>
{item.name}
<ArrowRight className="size-4 text-foreground" strokeWidth={1.5} />
</a>
{index < navItems.length - 1 && (
<div className="h-px bg-linear-to-r from-transparent via-foreground/20 to-transparent" />
)}
</div>
))}
</div>
<div className="mt-6">
<Button text={ctaButton.text} href={ctaButton.href} variant="primary" animate={false} className="w-full" />
</div>
</div>
<div
ref={menuRef}
className={cls(
"md:hidden fixed z-1000 top-3 left-3 right-3 p-6 rounded-lg bg-background/80 backdrop-blur-[2px] transition-all duration-300 ease-in-out",
menuOpen ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-4 pointer-events-none"
)}
>
<div className="flex items-center justify-between mb-6">
<p className="text-xl text-foreground">Menu</p>
<button
className="flex items-center justify-center shrink-0 size-9 rounded cursor-pointer primary-button"
onClick={() => setMenuOpen(false)}
aria-label="Close menu"
>
<Plus className="w-1/2 h-1/2 text-primary-cta-text rotate-45" strokeWidth={1.5} />
</button>
</div>
<div className="flex flex-col gap-4">
{navItems.map((item, index) => (
<div key={item.name}>
<a
href={item.href}
onClick={(e) => handleNavClick(e, item.href, () => setMenuOpen(false))}
className="flex items-center justify-between py-2 text-base font-medium text-foreground"
>
{item.name}
<ArrowRight className="size-4 text-foreground" strokeWidth={1.5} />
</a>
{index < navItems.length - 1 && (
<div className="h-px bg-linear-to-r from-transparent via-foreground/20 to-transparent" />
)}
</div>
))}
</div>
<div className="mt-6">
<Button text={ctaButton.text} href={ctaButton.href} variant="primary" animate={false} className="w-full" />
</div>
</div>
</>
);
};

View File

@@ -31,17 +31,18 @@ const NavbarFloating = ({ logo, navItems, ctaButton }: NavbarFloatingProps) => {
return (
<>
{menuOpen && (
<div
className="fixed inset-0 z-999 bg-foreground"
onClick={() => setMenuOpen(false)}
/>
)}
{menuOpen && (
<div
className="fixed inset-0 z-500 bg-black/20 backdrop-blur-md"
onClick={() => setMenuOpen(false)}
/>
)}
<nav className="fixed z-1000 top-5 left-1/2 -translate-x-1/2 w-content-width">
<div className="mx-auto w-full md:w-1/2 overflow-hidden rounded-theme-capped border border-white/10 bg-white/10 backdrop-blur-lg shadow-lg">
<div className={cls(
"mx-auto w-full md:w-1/2 overflow-hidden rounded-theme-capped border border-white/10 bg-white/10 shadow-lg backdrop-blur-lg"
)}>
<div className="relative z-10 flex items-center justify-between gap-3 xl:gap-4 2xl:gap-5 p-3 xl:p-4 2xl:p-5">
<a href="/" className="text-xl font-medium text-foreground">{logo}</a>