The user wants an interactive navigation menu with hover effects and dropdown options. Let me create something visually striking and modern, avoiding generic AI landing page aesthetics.
Let me plan:
-
Design Direction: I'll go for a sophisticated, editorial/technical aesthetic
- Font: Something distinctive like "Space Grotesk" or "Syne" for headlines, "DM Sans" for body
- Color scheme: Dark mode with a sharp accent color (maybe electric cyan or lime green)
- Background: Subtle gradient with noise texture or geometric patterns
-
Navigation Structure:
- Logo on left
- Main nav items in center with dropdown menus
- CTA button on right
- Mobile hamburger menu
-
Interactions:
- Smooth dropdown animations on hover
- Hover underline effects on nav items
- Button hover states
- Mobile menu slide-in animation
- Focus states for accessibility
- Keyboard navigation support
-
Technical Implementation:
- CSS-first animations with JS only for toggle states
- IntersectionObserver for scroll effects
- Proper ARIA attributes
- Respect prefers-reduced-motion
Let me build this with a distinctive, high-end feel.
Interactive Navigation Menu
I'll create a sophisticated, editorial-style navigation with smooth dropdown animations, distinctive typography, and meaningful interactions.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Navigation Menu</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0a0b;
--bg-elevated: #141416;
--fg: #fafafa;
--muted: #71717a;
--accent: #00ffa3;
--accent-dim: rgba(0, 255, 163, 0.15);
--border: #27272a;
--card: #18181b;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--fg);
}
.font-display {
font-family: 'Syne', sans-serif;
}
/* Background pattern */
.bg-pattern {
background-image:
radial-gradient(circle at 20% 50%, rgba(0, 255, 163, 0.03) 0%, transparent 50%),
radial-gradient(circle at 80% 80%, rgba(0, 255, 163, 0.02) 0%, transparent 40%),
linear-gradient(180deg, var(--bg) 0%, #0d0d0f 100%);
background-attachment: fixed;
}
/* Grid overlay */
.grid-overlay {
background-image:
linear-gradient(var(--border) 1px, transparent 1px),
linear-gradient(90deg, var(--border) 1px, transparent 1px);
background-size: 60px 60px;
opacity: 0.3;
pointer-events: none;
}
/* Nav styles */
.nav-container {
background: rgba(10, 10, 11, 0.8);
backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
}
.nav-link {
position: relative;
color: var(--muted);
transition: color 0.3s ease;
}
.nav-link::after {
content: '';
position: absolute;
bottom: -4px;
left: 0;
width: 0;
height: 2px;
background: var(--accent);
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover,
.nav-link:focus-visible {
color: var(--fg);
}
.nav-link:hover::after,
.nav-link:focus-visible::after {
width: 100%;
}
/* Dropdown */
.dropdown {
position: relative;
}
.dropdown-trigger {
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
}
.dropdown-trigger svg {
transition: transform 0.3s ease;
}
.dropdown:hover .dropdown-trigger svg,
.dropdown:focus-within .dropdown-trigger svg {
transform: rotate(180deg);
}
.dropdown-menu {
position: absolute;
top: calc(100% + 16px);
left: 50%;
transform: translateX(-50%) translateY(10px);
min-width: 240px;
background: var(--card);
border: 1px solid var(--border);
border-radius: 12px;
padding: 8px;
opacity: 0;
visibility: hidden;
transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.dropdown-menu::before {
content: '';
position: absolute;
top: -8px;
left: 50%;
transform: translateX(-50%);
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid var(--border);
}
.dropdown-menu::after {
content: '';
position: absolute;
top: -6px;
left: 50%;
transform: translateX(-50%);
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid var(--card);
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
opacity: 1;
visibility: visible;
transform: translateX(-50%) translateY(0);
}
.dropdown-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border-radius: 8px;
color: var(--muted);
text-decoration: none;
transition: all 0.2s ease;
}
.dropdown-item:hover,
.dropdown-item:focus-visible {
background: var(--accent-dim);
color: var(--fg);
}
.dropdown-item:hover .item-icon,
.dropdown-item:focus-visible .item-icon {
color: var(--accent);
}
.item-icon {
width: 20px;
height: 20px;
color: var(--muted);
transition: color 0.2s ease;
}
/* CTA Button */
.cta-btn {
position: relative;
background: var(--accent);
color: var(--bg);
font-weight: 600;
padding: 10px 24px;
border-radius: 8px;
overflow: hidden;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-btn::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
opacity: 0;
transition: opacity 0.3s ease;
}
.cta-btn:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 255, 163, 0.3);
}
.cta-btn:hover::before {
opacity: 1;
}
.cta-btn:active {
transform: translateY(0);
}
.cta-btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Mobile menu */
.mobile-menu-btn {
display: flex;
flex-direction: column;
justify-content: center;
gap: 5px;
width: 32px;
height: 32px;
background: none;
border: none;
cursor: pointer;
}
.mobile-menu-btn span {
display: block;
width: 24px;
height: 2px;
background: var(--fg);
transition: all 0.3s ease;
transform-origin: center;
}
.mobile-menu-btn.active span:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
transform: rotate(-45deg) translate(5px, -5px);
}
.mobile-nav {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: var(--bg);
z-index: 40;
padding: 100px 24px 24px;
transform: translateX(-100%);
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-nav.open {
transform: translateX(0);
}
.mobile-nav-item {
display: block;
padding: 16px 0;
font-size: 1.5rem;
font-weight: 600;
color: var(--muted);
text-decoration: none;
border-bottom: 1px solid var(--border);
transition: color 0.2s ease, padding-left 0.2s ease;
}
.mobile-nav-item:hover {
color: var(--fg);
padding-left: 12px;
}
.mobile-dropdown-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
}
.mobile-dropdown-content.open {
max-height: 400px;
}
.mobile-dropdown-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
color: var(--muted);
text-decoration: none;
transition: color 0.2s ease;
}
.mobile-dropdown-item:hover {
color: var(--accent);
}
/* Scroll state */
.nav-scrolled {
background: rgba(10, 10, 11, 0.95);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
/* Animations */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in-up {
animation: fadeInUp 0.6s ease forwards;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
/* Focus visible */
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Responsive */
@media (max-width: 768px) {
.desktop-nav {
display: none;
}
.mobile-trigger {
display: flex;
}
}
@media (min-width: 769px) {
.mobile-trigger {
display: none;
}
.mobile-nav {
display: none;
}
}
</style>
</head>
<body class="bg-pattern min-h-screen">
<!-- Grid overlay -->
<div class="grid-overlay fixed inset-0 z-0"></div>
<!-- Navigation -->
<nav class="nav-container fixed top-0 left-0 right-0 z-50 transition-all duration-300" id="mainNav">
<div class="max-w-7xl mx-auto px-6 py-4">
<div class="flex items-center justify-between">
<!-- Logo -->
<a href="#" class="font-display font-bold text-2xl tracking-tight flex items-center gap-2">
<svg width="32" height="32" viewBox="0 0 32 32" fill="none">
<rect width="32" height="32" rx="8" fill="var(--accent)"/>
<path d="M10 22V10L16 16L22 10V22" stroke="var(--bg)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>Nexus</span>
</a>
<!-- Desktop Navigation -->
<div class="desktop-nav flex items-center gap-8">
<a href="#" class="nav-link text-sm font-medium">Home</a>
<!-- Products Dropdown -->
<div class="dropdown">
<button class="dropdown-trigger nav-link text-sm font-medium" aria-expanded="false" aria-haspopup="true">
Products
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 4.5L6 7.5L9 4.5"/>
</svg>
</button>
<div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item" role="menuitem">
<svg class="item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2"/>
<path d="M9 9h6v6H9z"/>
</svg>
<div>
<div class="font-medium text-white">Analytics Suite</div>
<div class="text-xs mt-0.5">Real-time data insights</div>
</div>
</a>
<a href="#" class="dropdown-item" role="menuitem">
<svg class="item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="9"/>
<path d="M12 3v18M3 12h18"/>
</svg>
<div>
<div class="font-medium text-white">Cloud Platform</div>
<div class="text-xs mt-0.5">Scalable infrastructure</div>
</div>
</a>
<a href="#" class="dropdown-item" role="menuitem">
<svg class="item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
<path d="M2 17l10 5 10-5"/>
<path d="M2 12l10 5 10-5"/>
</svg>
<div>
<div class="font-medium text-white">API Gateway</div>
<div class="text-xs mt-0.5">Developer tools</div>
</div>
</a>
</div>
</div>
<!-- Solutions Dropdown -->
<div class="dropdown">
<button class="dropdown-trigger nav-link text-sm font-medium" aria-expanded="false" aria-haspopup="true">
Solutions
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 4.5L6 7.5L9 4.5"/>
</svg>
</button>
<div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item" role="menuitem">
<svg class="item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
<circle cx="9" cy="7" r="4"/>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
</svg>
<div>
<div class="font-medium text-white">Enterprise</div>
<div class="text-xs mt-0.5">For large organizations</div>
</div>
</a>
<a href="#" class="dropdown-item" role="menuitem">
<svg class="item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
<path d="M2 17l10 5 10-5"/>
</svg>
<div>
<div class="font-medium text-white">Startups</div>
<div class="text-xs mt-0.5">Growth-focused plans</div>
</div>
</a>
<a href="#" class="dropdown-item" role="menuitem">
<svg class="item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>
</svg>
<div>
<div class="font-medium text-white">Education</div>
<div class="text-xs mt-0.5">Academic programs</div>
</div>
</a>
</div>
</div>
<a href="#" class="nav-link text-sm font-medium">Pricing</a>
<a href="#" class="nav-link text-sm font-medium">Resources</a>
</div>
<!-- CTA & Mobile Toggle -->
<div class="flex items-center gap-4">
<a href="#" class="cta-btn text-sm hidden sm:block">Get Started</a>
<!-- Mobile Menu Button -->
<button class="mobile-trigger mobile-menu-btn" id="mobileMenuBtn" aria-label="Toggle menu" aria-expanded="false">
<span></span>
<span></span>
<span></span>
</button>
</div>
</div>
</div>
</nav>
<!-- Mobile Navigation -->
<div class="mobile-nav" id="mobileNav" aria-hidden="true">
<a href="#" class="mobile-nav-item font-display">Home</a>
<div class="mobile-dropdown">
<button class="mobile-nav-item font-display w-full text-left flex justify-between items-center" onclick="toggleMobileDropdown(this)">
Products
<svg width="16" height="16" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="2" class="transition-transform">
<path d="M3 4.5L6 7.5L9 4.5"/>
</svg>
</button>
<div class="mobile-dropdown-content">
<a href="#" class="mobile-dropdown-item">Analytics Suite</a>
<a href="#" class="mobile-dropdown-item">Cloud Platform</a>
<a href="#" class="mobile-dropdown-item">API Gateway</a>
</div>
</div>
<div class="mobile-dropdown">
<button class="mobile-nav-item font-display w-full text-left flex justify-between items-center" onclick="toggleMobileDropdown(this)">
Solutions
<svg width="16" height="16" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="2" class="transition-transform">
<path d="M3 4.5L6 7.5L9 4.5"/>
</svg>
</button>
<div class="mobile-dropdown-content">
<a href="#" class="mobile-dropdown-item">Enterprise</a>
<a href="#" class="mobile-dropdown-item">Startups</a>
<a href="#" class="mobile-dropdown-item">Education</a>
</div>
</div>
<a href="#" class="mobile-nav-item font-display">Pricing</a>
<a href="#" class="mobile-nav-item font-display">Resources</a>
<div class="mt-8">
<a href="#" class="cta-btn inline-block text-center w-full">Get Started</a>
</div>
</div>
<!-- Main Content -->
<main class="relative z-10 pt-32 px-6">
<div class="max-w-4xl mx-auto text-center">
<div class="opacity-0 animate-fade-in-up">
<span class="inline-block px-4 py-2 rounded-full text-xs font-medium tracking-wider uppercase" style="background: var(--accent-dim); color: var(--accent);">
Navigation Demo
</span>
</div>
<h1 class="font-display font-extrabold text-5xl sm:text-7xl lg:text-8xl mt-6 opacity-0 animate-fade-in-up animate-delay-1" style="line-height: 1.05;">
Interactive<br>
<span style="color: var(--accent);">Navigation</span>
</h1>
<p class="mt-6 text-lg sm:text-xl max-w-2xl mx-auto opacity-0 animate-fade-in-up animate-delay-2" style="color: var(--muted);">
A sophisticated navigation system with smooth dropdown animations, hover effects, and full mobile responsiveness. Try interacting with the menu above.
</p>
<div class="mt-10 flex flex-wrap justify-center gap-4 opacity-0 animate-fade-in-up animate-delay-3">
<div class="px-6 py-3 rounded-lg text-sm font-medium" style="background: var(--card); border: 1px solid var(--border);">
Hover for Dropdowns
</div>
<div class="px-6 py-3 rounded-lg text-sm font-medium" style="background: var(--card); border: 1px solid var(--border);">
Keyboard Accessible
</div>
<div class="px-6 py-3 rounded-lg text-sm font-medium" style="background: var(--card); border: 1px solid var(--border);">
Mobile Responsive
</div>
</div>
</div>
</main>
<script>
// Initialize elements
const mainNav = document.getElementById('mainNav');
const mobileMenuBtn = document.getElementById('mobileMenuBtn');
const mobileNav = document.getElementById('mobileNav');
// Scroll handler for nav background
let lastScroll = 0;
function handleScroll() {
const currentScroll = window.pageYOffset;
if (currentScroll > 50) {
mainNav.classList.add('nav-scrolled');
} else {
mainNav.classList.remove('nav-scrolled');
}
lastScroll = currentScroll;
}
window.addEventListener('scroll', handleScroll, { passive: true });
// Mobile menu toggle
function toggleMobileMenu() {
const isOpen = mobileNav.classList.contains('open');
mobileNav.classList.toggle('open');
mobileMenuBtn.classList.toggle('active');
mobileMenuBtn.setAttribute('aria-expanded', !isOpen);
mobileNav.setAttribute('aria-hidden', isOpen);
// Prevent body scroll when menu is open
document.body.style.overflow = isOpen ? '' : 'hidden';
}
mobileMenuBtn.addEventListener('click', toggleMobileMenu);
// Mobile dropdown toggle
function toggleMobileDropdown(button) {
const content = button.nextElementSibling;
const icon = button.querySelector('svg');
const isOpen = content.classList.contains('open');
// Close all other dropdowns
document.querySelectorAll('.mobile-dropdown-content.open').forEach(el => {
el.classList.remove('open');
el.previousElementSibling.querySelector('svg').style.transform = '';
});
if (!isOpen) {
content.classList.add('open');
icon.style.transform = 'rotate(180deg)';
}
}
// Close mobile menu when clicking links
mobileNav.querySelectorAll('a').forEach(link => {
link.addEventListener('click', () => {
mobileNav.classList.remove('open');
mobileMenuBtn.classList.remove('active');
document.body.style.overflow = '';
});
});
// Keyboard navigation for dropdowns
document.querySelectorAll('.dropdown').forEach(dropdown => {
const trigger = dropdown.querySelector('.dropdown-trigger');
const menu = dropdown.querySelector('.dropdown-menu');
const items = menu.querySelectorAll('.dropdown-item');
// Open on Enter/Space
trigger.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
trigger.setAttribute('aria-expanded', 'true');
items[0].focus();
}
});
// Navigate items with arrow keys
items.forEach((item, index) => {
item.addEventListener('keydown', (e) => {
if (e.key === 'ArrowDown') {
e.preventDefault();
const next = items[index + 1] || items[0];
next.focus();
} else if (e.key === 'ArrowUp') {
e.preventDefault();
const prev = items[index - 1] || items[items.length - 1];
prev.focus();
} else if (e.key === 'Escape') {
trigger.setAttribute('aria-expanded', 'false');
trigger.focus();
}
});
});
});
// Close dropdowns when clicking outside
document.addEventListener('click', (e) => {
if (!e.target.closest('.dropdown')) {
document.querySelectorAll('.dropdown-trigger').forEach(trigger => {
trigger.setAttribute('aria-expanded', 'false');
});
}
});
// Handle escape key for mobile menu
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && mobileNav.classList.contains('open')) {
toggleMobileMenu();
}
});
</script>
</body>
</html>
Key Features
Design
- Editorial aesthetic with Syne display font and DM Sans body font
- Dark theme with electric mint accent (
#00ffa3)
- Layered background with gradient glows and subtle grid overlay
- Glass morphism navigation bar with backdrop blur
Interactions
- Hover underline animation - Nav links have a smooth expanding underline on hover
- Dropdown menus - Animated slide-in with arrow rotation and caret
- CTA button - Lift effect with glow shadow on hover
- Mobile hamburger - Transforms to X with animated bars
- Mobile dropdowns - Accordion-style with smooth height transitions
- Scroll effect - Navigation becomes more opaque when scrolling
Accessibility
- Full keyboard navigation (Tab, Arrow keys, Enter, Escape)
- ARIA attributes for expanded/hover states
- Focus-visible outlines
- prefers-reduced-motion support
- Semantic HTML structure
Responsive
- Desktop dropdowns on hover (768px+)
- Slide-in mobile menu with accordion dropdowns (<768px)
- Body scroll lock when mobile menu is open