A sleek, responsive, and functional currency converter built with vanilla JavaScript. This application fetches real-time exchange rates from a live API to provide accurate financial conversions.
- Real-Time Data: Fetches the latest exchange rates using the
Open Exchange Rates API. - Smart Conversions: Utilizes base-rate logic to convert between any two supported currencies (e.g., EUR to DKK).
- Professional UI: Styled with CSS Root variables for high maintainability and a modern aesthetic.
- Validation: Built-in error handling for invalid or negative inputs.
As a developer, I focused on several key programming principles for this project:
I used the fetch API combined with async/await to ensure a smooth user experience while retrieving data from an external server.
The application parses a complex JSON object from the API. I used Object.keys() to dynamically populate the dropdown menus, ensuring the UI stays updated if the API adds new currencies.
Since the API provides rates relative to USD, I implemented the following cross-conversion logic:
- Frontend: HTML5, CSS3 (Flexbox, CSS Variables)
- Logic: JavaScript (ES6+, Fetch API, DOM Manipulation)
- API: Open Exchange Rates API
- Clone the repository:
git clone [https://github.com/your-username/your-repo-name.git](https://github.com/your-username/your-repo-name.git)