This is a completed solution for the REST Countries API with color theme switcher challenge on Frontend Mentor.
Users should be able to:
- See all countries from the API on the homepage
- Search for a country using an
inputfield - Filter countries by region
- Click on a country to see more detailed information on a separate page
- Click through to the border countries on the detail page
- Toggle the color scheme between light and dark mode
- β View all countries - Browse through all countries from the REST Countries API
- β Search functionality - Search for countries by name or capital city
- β Region filtering - Filter countries by region (Africa, Americas, Asia, Europe, Oceania)
- β Country details - Click on any country to view detailed information in a modal
- β Border navigation - Click on border countries to navigate between them
- β Theme switcher - Toggle between light and dark modes with persistence
- β Responsive design - Optimized for mobile (375px) and desktop (1440px)
- β API integration - Uses REST Countries API with automatic fallback to local data
- HTML5 - Semantic markup
- CSS3 - Custom properties, Grid, Flexbox
- Vanilla JavaScript - ES6+ features, Fetch API
- Font Awesome - Icons for UI elements
- Nunito Sans - Google Fonts typography
- REST Countries API - Live country data
βββ index.html # Main application page
βββ styles.css # Complete styling with theme system
βββ script.js # Application functionality
βββ data.json # Fallback country data
βββ test.html # Testing page for functionality
βββ PROJECT_README.md # Detailed technical documentation
βββ design/ # Original design files
- Mobile & Desktop layouts - Responsive design that adapts to all screen sizes
- Light & Dark themes - Complete theme system with smooth transitions
- Typography - Nunito Sans font with correct weights (300, 600, 800)
- Color scheme - Exact colors from the style guide
- Spacing & Layout - Carefully matched to design specifications
- Open the application: Simply open
index.htmlin any modern web browser - Browse countries: Scroll through the responsive grid of country cards
- Search: Use the search bar to find countries by name or capital
- Filter: Select a region from the dropdown to filter countries
- View details: Click any country card to see detailed information
- Navigate borders: Click border country buttons to explore neighboring countries
- Toggle theme: Click the theme button in the header to switch between light/dark modes
- No build process - Pure HTML, CSS, and JavaScript
- Progressive enhancement - Works without JavaScript for basic functionality
- API resilience - Automatic fallback to local data when API is unavailable
- Performance optimized - Lazy loading images, efficient filtering
- Accessibility focused - Keyboard navigation, ARIA labels, high contrast
- Cross-browser compatible - Works in all modern browsers
The application uses the REST Countries API to fetch country data. If the API is unavailable, it automatically falls back to the local data.json file.
Each country object includes:
- Basic info: name, capital, population, region, subregion
- Geographic: borders, area, coordinates
- Cultural: languages, currencies, native name
- Visual: flag images
- Administrative: top-level domains, calling codes
- Modern browsers with ES6+ support
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
A test page (test.html) is included to verify:
- API connectivity
- Local data fallback
- Theme functionality
- Browser feature support
- Mobile: 375px and up
- Tablet: 768px and up
- Desktop: 1440px and up
This project can be easily deployed to any static hosting service:
- GitHub Pages - Push to GitHub and enable Pages
- Vercel - Drag and drop deployment
- Netlify - Connect your repository for automatic deployments
- Local Server - Use any local server (Python, Node.js, etc.)
- Frontend Mentor - @Ayokanmi-Adejola
