Okay, I'll help you fix the button colors to properly match the UI. The goal is to make the buttons feel more integrated with the overall color scheme, particularly the prominent accent colors used in the heading and background glows.
Your current UI features these key accent colors:
Teal: (teal-400 in heading, teal-500 in radial glow)
Purple: (purple-400 in heading, purple-500 in radial glow and badge)
Fuchsia/Pink: (fuchsia-500 in heading, pink-500 in badge)
The main heading's gradient from-teal-400 via-purple-400 to-fuchsia-500 is a strong visual anchor. We can derive the button colors from this palette for maximum cohesion.
Here's the plan:
"Discover Solutions" Button: We'll shift this button to a teal-to-purple gradient, picking up the first two colors from the heading's gradient.
"Plan Your Event" Button: We'll adjust this button to a purple-to-fuchsia gradient, using the latter two colors from the heading's gradient. This also aligns well with the purple/pink badge.
These changes will make the buttons use colors that are central to your UI's theme.
Here are the specific changes to the button className attributes:
1. For the "Discover Solutions" button:
Current background: bg-gradient-to-r from-cyan-500 to-sky-600
Current hover: hover:from-cyan-600 hover:to-sky-700
// Determine which section is active using its bounding rectangle
const currentSection = navLinks.find(({ href }) => {
const section = document.querySelector(href);
if (!section) return false;
const { top, height } = section.getBoundingClientRect();
return top <= 80 && top + height > 80;
});
setActiveSection(currentSection ? currentSection.href : "");
}, 150);
window.addEventListener("scroll", handleScroll, { passive: true });
handleScroll();
return () => window.removeEventListener("scroll", handleScroll);
Assistant
Okay, let's enhance this navbar to better match the sophisticated and vibrant theme of your EventHeroSection!
Here's a plan for enhancement:
Color Palette Alignment:
Logo Accent: Change the #BD8C7D (brownish-orange) in "Events" to one of your theme colors (e.g., teal-400 or purple-400). Let's go with teal-400.
"Plan Your Event" Button: This button should use the same gradient style we established for the hero section buttons. The from-purple-500 to-fuchsia-500 would be a good fit.
Nav Link Active/Hover States: Replace the yellow (#FFF100) and red-pink (#FF6B6B) with theme-appropriate colors like teal or purple. Let's use teal for a consistent highlight.
Base Text Color: Use a slightly softer white like text-slate-200 or text-gray-300 for general text, and brighten to text-white or a theme color on hover/active.
Background Styling:
The current bg-[#0A2342]/90 (dark blue) is okay, but we can make it more cohesive with the hero's from-gray-950 to-gray-800. Let's use a dark slate or gray background with a good amount of transparency and blur, becoming slightly more opaque on scroll.
The light theme background bg-white/20 might not be necessary if the overall site aesthetic (judging by the hero) is dark. We can simplify the logic to assume a dark navbar that just changes opacity/shadow on scroll. The theme toggle can still affect other parts of the page.
Theme Toggle Button:
Style it to fit the dark, sleek aesthetic. Maybe a semi-transparent dark background.
Mobile Menu Animation:
Add a smoother transition for the mobile menu opening and closing.
Summary of changes in the Link components for the buttons:
For "Discover Solutions":
bg-gradient-to-r from-cyan-500 to-sky-600 changed to bg-gradient-to-r from-teal-400 to-purple-500
hover:from-cyan-600 hover:to-sky-700 changed to hover:from-teal-500 hover:to-purple-600
ring-cyan-400/40 changed to ring-teal-400/40
For "Plan Your Event":
bg-gradient-to-r from-purple-600 to-pink-600 changed to bg-gradient-to-r from-purple-500 to-fuchsia-500
hover:from-purple-700 hover:to-pink-700 changed to hover:from-purple-600 hover:to-fuchsia-600
ring-pink-400/40 changed to ring-purple-400/40
These adjustments should provide a more cohesive and thematically appropriate look for your buttons, directly tying them into the core color palette of your hero section.
}, []);
// Toggle function for dark theme
const toggleTheme = () => setIsDarkTheme((prev) => !prev);
// Common text color class
const textColor = "text-white";
PlanEventButton: Updated to match the hero button style (from-purple-500 to-fuchsia-500).
Nav Links:
Base color: text-slate-300.
Hover: text-white (or text-teal-300).
Active: text-teal-400 with a border-teal-400 style underline effect. The underline effect is implemented using ::after pseudo-element for a cleaner look.
ThemeToggleButton: Styled with semi-transparent background and theme-appropriate icon colors.
Navbar Background:
Starts bg-transparent and transitions to bg-slate-900/80 backdrop-blur-lg shadow-lg border-b border-slate-700/50 on scroll. This provides a nice "glassmorphism" effect that's modern and aligns with the hero's feel.
The container mx-auto is now outside the nav element but inside the header for full-width background.
Mobile Menu:
Animation: Uses max-h-0 to max-h-screen and opacity for a smoother slide-down/fade-in effect.
Background: The mobile menu background also adapts slightly based on scroll state to maintain consistency.
Button Placement: The "Plan Your Event" button is now also included in the mobile menu, typically at the bottom or top.
Accessibility: Added aria-expanded to the mobile toggle and aria-current="page" to active mobile links.
Active Section Highlighting:
The scroll logic for activeSection is slightly refined.
Desktop links get a more prominent active state with a teal underline.
Mobile links get a background highlight when active.
Theme Management:
Defaulted isDarkTheme to true to match the hero section's inherent dark theme.
Using a more specific localStorage key (eventMasterDarkTheme).
Ensuring <html> tag gets the dark class correctly.
Code Structure & Readability:
Used useCallback for toggle functions to prevent unnecessary re-renders if these were passed to memoized children.
Defined color variables (baseLinkTextColor, etc.) for easier management.
Improved spacing and class organization for desktop nav links.
This enhanced navbar should feel much more integrated with your hero section and provide a more polished user experience. Remember to install lucide-react if you haven't already (npm install lucide-react or yarn add lucide-react).