A modern, responsive electric vehicle official website built with Next.js 14, Tailwind CSS, and full internationalization support.
- 🚗 Home Page with multiple sections:
- Hero section with call-to-action buttons
- Car introduction with performance specs
- Appearance showcase with color options
- Store locator with showroom information
- Pricing section with buy buttons
- 🛠️ Configuration Page with interactive options:
- Model selection
- Color customization
- Battery and range options
- Interior choices
- Autopilot features
- Real-time price calculation
- 🌍 Full Internationalization:
- Support for English, Chinese (Simplified), and Japanese
- Global language state management
- Persistent language selection
- Complete UI translation coverage
- 📱 Responsive Design that works on all devices
- 🎨 Modern UI using Tailwind CSS and bits-ui
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- bits-ui - Modern React component library
- React Context API - Global state management
- localStorage - Client-side persistence
- 🇺🇸 English - Default language
- 🇨🇳 中文 - Simplified Chinese
- 🇯🇵 日本語 - Japanese
- 🔄 Instant Switching: Real-time language change across all components
- 💾 Persistent Selection: Language choice saved in localStorage
- 🌐 Complete Coverage: All UI elements fully translated
- 📱 Responsive: Language switcher works on all device sizes
- 🎯 Context Management: Global state using React Context API
- Custom
LanguageProviderwraps the entire application useTranslationhook provides translation function- Language switcher component in header
- Automatic page reload on language change for consistency
- Type-safe translation keys with TypeScript
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone https://github.com/imbinnng/ev-official.git
cd ev-official- Install dependencies:
npm install- Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
src/
├── app/
│ ├── layout.tsx # Root layout with LanguageProvider
│ ├── page.tsx # Home page
│ ├── globals.css # Global styles
│ └── configure/
│ └── page.tsx # Configuration page
├── components/
│ ├── ui/
│ │ ├── button.tsx # Button component
│ │ └── language-switcher.tsx # Language switcher
│ ├── layout/
│ │ ├── header.tsx # Header component
│ │ └── footer.tsx # Footer component
│ └── sections/
│ ├── hero-section.tsx
│ ├── car-intro-section.tsx
│ ├── appearance-section.tsx
│ ├── store-list-section.tsx
│ └── pricing-section.tsx
└── lib/
├── utils.ts # Utility functions
└── language-context.tsx # Internationalization system
-
Hero Section: Eye-catching landing with main call-to-actions
- Multilingual title and subtitle
- Localized navigation buttons
-
Car Introduction: Detailed vehicle specifications and features
- Performance metrics with translated labels
- Technology features in all languages
-
Appearance Showcase: Visual display of design options and colors
- Localized color names
- Translated feature descriptions
-
Store Locator: Interactive list of showroom locations
- Multilingual contact information
- Localized action buttons
-
Pricing Section: Tiered pricing models with configuration links
- Translated pricing tiers
- Localized financing options
Interactive vehicle builder with:
- Model selection with base prices and translated descriptions
- Color customization with localized color names
- Battery range options with multilingual labels
- Interior material choices with translated names
- Autopilot capabilities with localized descriptions
- Real-time price calculation with translated labels
- Order summary with fully localized interface
- Header Integration: Language switcher positioned in header navigation
- Dropdown Interface: Clean dropdown with flag icons and language names
- Visual Feedback: Selected language highlighted with checkmark
- Mobile Support: Responsive design works on mobile devices
- Instant Updates: Language change affects entire site immediately
- Mobile-first approach
- Adaptive layouts for tablets and desktops
- Optimized navigation with hamburger menu
- Touch-friendly language switcher
- Consistent experience across all device sizes
The website uses a consistent primary color scheme:
- Primary Color:
#6b21d9(Purple) - Variants: Full color palette from 50 to 900
- Application: Used throughout UI for consistency
- Accessibility: High contrast ratios maintained
- Add new language code to
LanguageCodetype inlanguage-context.tsx - Extend translation object with new language keys
- Update language switcher options in
language-switcher.tsx - Add flag emoji for new language
- Update vehicle specs in component files
- Modify color schemes using Tailwind CSS variables
- Add new models to the configuration page
- Extend store locations in the store section
- Customize pricing and options
All translations are centralized in src/lib/language-context.tsx:
- Organized by feature sections
- Consistent key naming convention
- Type-safe translation lookup
- Fallback to English for missing translations
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Test language switching functionality
- Submit a pull request
This project is licensed under the ISC License.
Built with ❤️ for the future of electric mobility and global accessibility.