A sleek, responsive web application for converting between different units of measurement with a modern UI and dark/light theme support.
-
Multiple Conversion Categories:
- Length (mm, cm, m, km, in, ft, yd, mi)
- Weight (mg, g, kg, oz, lb, t)
- Temperature (Celsius, Fahrenheit, Kelvin)
- Volume (ml, l, gal, pt, qt, fl oz, cup)
- Area (mm², cm², m², km², in², ft², acre, hectare)
- Time (ms, s, min, h, d, wk, mo, yr)
- Currency (USD, EUR, GBP, JPY, CNY, INR, AUD, CAD, EGP) with real-time exchange rates
-
User-Friendly Interface:
- Clean, modern design
- Responsive layout for all devices
- Intuitive unit selection
- One-click unit swapping
-
Advanced Features:
- Real-time conversion as you type
- Conversion formula display
- Conversion history (stores up to 10 recent conversions)
- Ability to reload previous conversions
- Dark/light theme toggle with preference saving
- Real-time currency exchange rates via Exchange Rates API (auto-updated every 24 hours)
- HTML5
- CSS3 (with CSS variables for theming)
- Vanilla JavaScript
- Service Workers (PWA support)
- Local Storage API for preferences/history
- Exchange Rates API (real-time currency data)
- Font Awesome icons
- Google Fonts (Poppins)
index.html
- Main application entry pointstyles.css
- Responsive styling with theme variablesscript.js
- Core functionality including:- Unit conversion algorithms
- Real-time currency exchange rates
- Theme management
- Conversion history
- PWA installation handling
sw.js
- Service Worker for offline functionalitymanifest.json
- PWA metadata (auto-generated)
- Select a conversion category (Length, Weight, Temperature, etc.)
- Enter a value in the input field
- Select the units you want to convert from and to
- View the result and the conversion formula
- Previous conversions are saved in the history section
- Toggle between dark and light themes using the sun/moon icon
- 📱 PWA Support - Installable web app with offline functionality
- 🌓 Theme Switching - Light/dark mode with system preference detection
- 🔄 Real-time Currency Rates - Auto-updating exchange rates via API
- 📚 6+ Measurement Categories - Length, weight, temperature, currency etc
- ⏳ Conversion History - Local storage of recent conversions
- 📱 Responsive Design - Optimized for mobile & desktop
- 🔄 Service Worker - Caches assets for fast reloads & offline use
- Clone the repository:
git clone https://github.com/unshreif/unit-converter.git
cd unit-converter
- Install dependencies:
npm install -g http-server
- Start development server:
npx http-server -o
The app will automatically:
- Register service worker for offline use
- Fetch latest currency exchange rates
- Apply your preferred theme settings
For production deployment, ensure HTTPS is enabled for full PWA functionality.
git clone https://github.com/unshreif/unit-convertor
cd unit-converter
Then open index.html
in your browser.
Feel free to use and modify this project for personal or commercial use.
Muhmd Samy © 2025