

View Details
ナビゲーション
オーバーレイナビゲーション
#ミニマル#フルワイド+1
ピル型の角丸フローティングバーで構成されたモダンなナビゲーション。背景ブラーと細いボーダーで浮遊感を演出
1"use client";23import { useState } from "react";4import Link from "next/link";56export function NavigationFloating001() {7 const [mobileMenuOpen, setMobileMenuOpen] = useState(false);89 const navLinks = [10 { label: "Services", href: "#" },11 { label: "Work", href: "#" },12 { label: "About", href: "#" },13 { label: "Journal", href: "#" },14 ];1516 return (17 <header className="w-full bg-background">18 <div className="mx-auto max-w-7xl px-4 py-4 sm:px-6 lg:px-8">19 <nav className="flex items-center justify-between rounded-full border border-border/60 bg-background/80 px-6 py-3 backdrop-blur-xl">20 {/* Logo */}21 <Link22 href="#"23 className="flex items-center gap-2.5"24 >25 <div className="flex h-7 w-7 items-center justify-center rounded-full border border-border bg-muted">26 <span className="text-xs font-medium text-foreground">A</span>27 </div>28 <span className="text-sm font-medium tracking-wide text-foreground">29 Atelier30 </span>31 </Link>3233 {/* Desktop Navigation */}34 <div className="hidden items-center gap-1 md:flex">35 {navLinks.map((link) => (36 <Link37 key={link.label}38 href={link.href}39 className="rounded-full px-4 py-1.5 text-sm tracking-wide text-muted-foreground transition-colors duration-200 hover:bg-muted hover:text-foreground"40 >41 {link.label}42 </Link>43 ))}44 </div>4546 {/* Desktop CTA */}47 <div className="hidden items-center gap-3 md:flex">48 <Link49 href="#"50 className="text-sm tracking-wide text-muted-foreground transition-colors duration-200 hover:text-foreground"51 >52 Sign in53 </Link>54 <Link55 href="#"56 className="rounded-full bg-foreground px-5 py-1.5 text-sm font-medium tracking-wide text-background transition-colors duration-200 hover:bg-foreground/90"57 >58 Contact59 </Link>60 </div>6162 {/* Mobile Menu Button */}63 <button64 className="rounded-full p-1.5 text-muted-foreground hover:text-foreground md:hidden"65 onClick={() => setMobileMenuOpen(!mobileMenuOpen)}66 >67 <svg68 className="h-5 w-5"69 fill="none"70 stroke="currentColor"71 viewBox="0 0 24 24"72 >73 {mobileMenuOpen ? (74 <path75 strokeLinecap="round"76 strokeLinejoin="round"77 strokeWidth={1.5}78 d="M6 18L18 6M6 6l12 12"79 />80 ) : (81 <path82 strokeLinecap="round"83 strokeLinejoin="round"84 strokeWidth={1.5}85 d="M4 6h16M4 12h16M4 18h16"86 />87 )}88 </svg>89 </button>90 </nav>9192 {/* Mobile Menu */}93 {mobileMenuOpen && (94 <div className="mt-2 rounded-2xl border border-border/60 bg-background/95 px-6 py-5 backdrop-blur-xl md:hidden">95 <div className="space-y-1">96 {navLinks.map((link) => (97 <Link98 key={link.label}99 href={link.href}100 className="block rounded-lg px-3 py-2.5 text-sm tracking-wide text-muted-foreground transition-colors duration-200 hover:bg-muted hover:text-foreground"101 >102 {link.label}103 </Link>104 ))}105 </div>106 <div className="mt-4 h-px bg-border/40" />107 <div className="mt-4 flex flex-col gap-2">108 <Link109 href="#"110 className="rounded-lg px-3 py-2.5 text-center text-sm tracking-wide text-muted-foreground transition-colors duration-200 hover:bg-muted"111 >112 Sign in113 </Link>114 <Link115 href="#"116 className="rounded-full bg-foreground px-4 py-2.5 text-center text-sm font-medium tracking-wide text-background"117 >118 Contact119 </Link>120 </div>121 </div>122 )}123 </div>124 </header>125 );126}