A responsive, single-page web application that lets you explore detailed information and live weather for every country on Earth.
- Dual search bars β one in the sticky navbar and one in the hero section; both support the Enter key.
- Region filter buttons β instantly browse countries by region: Africa, Americas, Asia, Europe, Oceania, and Antarctic.
- Results are sorted alphabetically when browsing by region.
### πΊοΈ Country Cards
Each result card displays:
| Field | Details |
|---|---|
| Flag | Full-width SVG flag image |
| Name | Common name + official name |
| Region | Region Β· Subregion |
| Population | Formatted number |
| Capital | First listed capital |
| Area | In kmΒ² |
| Languages | Up to 3 spoken languages |
| Currency | Name and symbol |
Click Full Details & Weather on any card to open a scrollable modal with:
General Information
- Region, Subregion, Continent
- Capital, Population, Area, Landlocked status, Start of Week
- Languages, Currencies, Calling Code, Internet TLD
- Driving side, ISO codes (alpha-2 / alpha-3)
- Independent & UN Member status
Timezones β complete list of all timezones for the country.
Bordering Countries β ISO-3 badge list with count.
Maps β direct links to Google Maps and OpenStreetMap.
Live Weather (for the capital city):
- Condition with icon, Temperature (Β°C / Β°F), Feels Like (Β°C / Β°F)
- Humidity, Wind speed & direction, UV Index, Visibility, Pressure, Cloud Cover
- Animated hero section with gradient background.
- Hover-lift effect on country cards.
- Accessible loading spinners and error alerts.
- XSS-safe status messages using
textContent. - Fully responsive layout β works on mobile, tablet, and desktop.
/
βββ index.html # Page structure (navbar, hero, region filters, card grid, footer)
βββ script.js # Core logic: search, region filter, card rendering, detail modal
βββ weather_api.js # WeatherAPI integration (ES6 module export)
βββ css/
β βββ style.css # Custom styles (hero, cards, modal, weather box, responsive tweaks)
βββ LICENSE
βββ README.md
| Technology | Version | Purpose |
|---|---|---|
| HTML5 | β | Page structure |
| CSS3 | β | Custom styles |
| JavaScript | ES6 Modules | Dynamic behaviour |
| Bootstrap | 5.3.0 | Layout & UI components |
| Font Awesome | 6.4.0 | Icons |
| REST Countries API | v3.1 | Country data |
| WeatherAPI | current | Live weather data |
| API | Endpoint | Usage |
|---|---|---|
| REST Countries | https://restcountries.com/v3.1/name/{name} |
Search by country name |
| REST Countries | https://restcountries.com/v3.1/region/{region} |
Browse by region |
| WeatherAPI | https://api.weatherapi.com/v1/current.json |
Live weather for capital city |
- A modern web browser (Chrome, Firefox, Edge, Safari).
- An active internet connection (required for CDN libraries and APIs).
git clone https://github.com/neda420/Country-information-by-nadim.git
cd Country-information-by-nadimOpen index.html directly in your browser β no build step or server required.
Note:
script.jsuses ES6import/export(type="module"). Some browsers block module imports for localfile://URLs. If the page doesn't work, serve it with a simple local server:# Python 3 python -m http.server 8080 # Then open http://localhost:8080
Edit css/style.css to customise colours, spacing, or component appearance.
Key CSS sections: Base, Navbar, Hero, Region Buttons, Cards, Info Grid, Modal, Weather Box, Responsive tweaks.
script.jsβ add new card fields, change sorting, extend the detail modal, or add new API endpoints.
Always keeptype="module"on the<script>tag inindex.html.weather_api.jsβ update theWEATHER_API_KEYor swap in a different weather provider here.
- Add a
<button class="btn btn-outline-primary region-btn" data-region="YourRegion">inindex.html. - The existing event listener in
script.jswill pick it up automatically.
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>This project is licensed under the terms of the LICENSE file in this repository.
- Md Nadimul Islam β Creator and maintainer.
- Bootstrap β CSS & JS framework.
- Font Awesome β Icon library.
- REST Countries β Free country data API.
- WeatherAPI β Live weather data API.