- ✨ Gradient Header - Beautiful rainbow gradient background with sparkles
- 📊 Progress Bar - Animated progress indicator with percentage
- 🎯 Step Indicators - Visual step circles with checkmarks for completed steps
- 🎨 Glassmorphism - Backdrop blur effects throughout
- 🌈 Gradient Buttons - Eye-catching CTA buttons with hover effects
- 🔄 Persistent State - User preferences saved in Redux store
- 💾 API Integration - Automatically saves to
/api/user/profile - 🚫 Skip Logic - If user already completed onboarding, skips modal
- 🔄 State Sync - Redux state syncs with existing profile data
<div className="relative overflow-hidden rounded-t-lg bg-gradient-to-br from-[#FFA9AE] via-[#8D81FF] to-[#69E1FE] p-8">
<div className="absolute inset-0 bg-black/20" />
<div className="relative z-10">
<div className="mx-auto mb-4 inline-flex h-16 w-16 items-center justify-center rounded-full bg-white/20 backdrop-blur-sm">
<Sparkles className="h-8 w-8 text-white" />
</div>
</div>
</div>- Animated Progress Bar - Smooth width transitions
- Step Circles - Visual indicators with checkmarks
- Percentage Display - Real-time completion percentage
Each step has:
- 🎯 Icon - Unique gradient icon for each step
- 📝 Title - Clear, descriptive heading
- 💡 Description - Helpful context text
- 🎨 Modern Inputs - Styled form elements with hover effects
// src/lib/store.ts
export const store = configureStore({
reducer: {
user: userSlice,
},
});// src/lib/slices/userSlice.ts
interface UserState {
isAuthenticated: boolean;
profile: UserProfile | null;
isLoading: boolean;
hasCompletedOnboarding: boolean;
}setProfile()- Save user profile datasetOnboardingComplete()- Mark onboarding as doneupdateProfile()- Update specific profile fieldsclearUser()- Reset user state
- 🎯 Target Icon - Blue to purple gradient
- 📊 Enhanced Select - Color-coded options with descriptions
- 🟢 Beginner - Green dot, "New to prompt engineering"
- 🟡 Intermediate - Yellow dot, "Some experience with AI"
- 🔴 Advanced - Red dot, "Expert in AI tools"
- 🧠 Brain Icon - Purple to pink gradient
- 📝 Text Input - Placeholder with examples
- 💡 Smart Placeholder - "e.g., Software Development, Marketing, Data Science..."
- ⚡ Zap Icon - Green to teal gradient
- 🎨 Card Layout - Each option in a styled card
- 📋 Three Options:
- Visual - "I learn through diagrams, charts, and visual examples"
- Auditory - "I learn through listening and verbal explanations"
- Hands-on - "I learn by doing and practicing"
- ✅ CheckCircle Icon - Orange to red gradient
- ☑️ Multi-select - Checkbox cards for multiple goals
- 🎯 Four Goal Options:
- Improve writing skills
- Learn advanced techniques
- Increase efficiency
- Explore creative applications
<motion.div
key={currentStep}
initial={{ opacity: 0, x: 50 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -50 }}
transition={{ duration: 0.3 }}
><motion.div
className="h-2 rounded-full bg-gradient-to-r from-[#FFA9AE] via-[#8D81FF] to-[#69E1FE]"
initial={{ width: 0 }}
animate={{ width: `${((currentStep + 1) / steps.length) * 100}%` }}
transition={{ duration: 0.3 }}
/><motion.div
className={`flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all ${
index <= currentStep
? "border-[#8D81FF] bg-[#8D81FF] text-white"
: "border-gray-600 bg-gray-800 text-gray-400"
}`}
initial={{ scale: 0.8 }}
animate={{ scale: 1 }}
transition={{ delay: index * 0.1 }}
>- Check Redux store for existing profile
- If
hasCompletedOnboardingis true, skip modal - If profile exists, pre-populate form fields
- Save to Redux store with
setProfile() - Mark onboarding complete with
setOnboardingComplete() - Save to API with POST to
/api/user/profile - Close modal and proceed to dashboard
- Back Button - Disabled on first step
- Next Button - Disabled until current step is valid
- Final Button - "Start Your Journey" with sparkles icon
- Primary Gradient:
#FFA9AE→#8D81FF→#69E1FE - Background:
black/95with backdrop blur - Cards:
gray-900/50with bordergray-700 - Text: White primary, gray-400 secondary
- Hover: Scale up, shadow effects, border color changes
- Focus: Ring effects, background changes
- Disabled: Opacity reduction, cursor not-allowed
- Mobile: Full-width cards, stacked layout
- Desktop: Centered modal with max-width
- Tablet: Optimized spacing and sizing
- ✅ Lazy Loading - Redux state only loads when needed
- ✅ Memoization - Form state updates efficiently
- ✅ API Caching - Profile data cached in Redux
- ✅ Smooth Animations - GPU-accelerated transitions
- ✅ API Failures - Graceful degradation
- ✅ Validation - Real-time form validation
- ✅ State Recovery - Redux state persists across sessions
- Welcome - Beautiful gradient header with sparkles
- Progress - Clear visual progress tracking
- Guidance - Helpful descriptions for each step
- Validation - Real-time form validation
- Completion - Satisfying finish with animations
- Skip Logic - If already personalized, skip modal
- Data Persistence - Profile data loads from Redux
- Seamless Experience - No unnecessary re-onboarding
npm install @reduxjs/toolkit react-reduxsrc/lib/store.ts- Redux store configurationsrc/lib/slices/userSlice.ts- User state slicesrc/lib/hooks.ts- Typed Redux hookssrc/components/providers/ReduxProvider.tsx- Provider component
- Layout - ReduxProvider wraps entire app
- Modal - Uses Redux hooks for state management
- API - Syncs with existing profile endpoints
- Auth - Integrates with NextAuth session
The UserInputModal now features:
- ✨ Stunning modern design with gradients and animations
- 🔄 Full Redux integration for state management
- 💾 Persistent user preferences across sessions
- 🚫 Smart skip logic for returning users
- 📱 Responsive design for all devices
- 🎯 Enhanced UX with progress tracking and validation
All user personalization data is now properly managed with Redux and persists across sessions! 🎊