Overview
This section features:- Answer display card with animated states
- Quick question buttons for common queries
- Custom input form for free-text questions
- Groq API integration for AI-powered responses
- Rate limiting and error handling
- Conversation history management
File Location
Architecture
The chatbot integrates profile data and API configuration:Structure
Components
1. Answer Card
Displays AI responses with different states:- Idle - Default state with info icon
- Loading - Spinner animation while processing
- Answered - Checkmark icon with response text
- Error - X icon with error message
2. Quick Questions
Pre-defined questions for common queries:3. Input Form
Custom question input with submit button:Groq API Integration
Configuration
System Prompt
The AI is instructed to act as the CV owner:API Request
llama-3.3-70b-versatileMax tokens: 500
Temperature: 0.7 (balanced creativity)
JavaScript Features
State Management
Loading State
Rate Limiting
2-second cooldown between requests:Error Handling
Event Listeners
Form submission:Styling
Answer Card States
Loading state:Animated Gradient Border
Spinner Animation
Profile Data Source
The chatbot uses structured data fromsrc/data/nico-profile.json:
src/data/nico-profile.json:1
Environment Variables
Required environment variable:.env file. Get an API key from Groq.
Accessibility
- Semantic HTML with proper ARIA labels
- Keyboard navigation for all interactive elements
- Disabled states during loading
- Focus management for input field
- Reduced motion support:
Mobile Responsiveness
On mobile devices:- Quick question grid adjusts to 2 columns
- Button text hides, showing only icons
- Answer card padding reduces
- Icon sizes scale down appropriately
Related Sections
- Contact Section - Alternative contact methods
- History Section - Information the AI references
- Works Section - Experience details