DEV Community

Mamedul Islam
Mamedul Islam

Posted on

πŸš€ Unit Converter PWA – Vanilla JavaScript & Offline-Ready

Looking for a fast, modern, and offline-first unit converter? Meet Instant Unit Converter, a Progressive Web App (PWA) built entirely with Vanilla JavaScript (ES5)β€”no frameworks, no jQuery. Convert units instantly, anytime, anywhere.

Live Demo

Unit Converter Screenshot


✨ Features

  • Wide Range of Units: Length, Mass, Volume, Temperature, Time, Speed, Area, Data Storage, Currency, and more.
  • Real-Time Conversion: Results update instantly as you type.
  • Offline First: Fully functional without internet thanks to a Service Worker.
  • Live Currency Rates: Fetches and caches the latest exchange rates every hour.
  • Modern UI/UX:

    • Sleek, responsive design
    • Light & Dark themes with gradient backgrounds
    • Searchable dropdowns for units (powered by Choices.js)
    • Smooth animations for a user-friendly interface
  • Installable (PWA): Add it to your home screen for an app-like experience.

  • Zero Dependencies: Pure Vanilla JavaScript, lightweight and fast.


πŸ› οΈ Tech Stack

  • Frontend: HTML5, CSS3, Vanilla JavaScript (ES5)
  • UI Enhancements:

    • Choices.js for searchable select boxes
    • SweetAlert2 for beautiful alerts
  • PWA: Service Worker for offline caching, Web App Manifest

  • Fonts: Inter – modern and readable

  • API: exchangerate-api.com for live currency rates


πŸ“‚ Project Structure

/unit-converter/
β”œβ”€β”€ index.html
β”œβ”€β”€ manifest.json
β”œβ”€β”€ scripts.js
β”œβ”€β”€ styles.css
β”œβ”€β”€ favicon.ico
β”œβ”€β”€ README.md
└── icons/
Enter fullscreen mode Exit fullscreen mode

πŸš€ Getting Started

Since this is a PWA, opening index.html directly may not work due to Service Worker restrictions. Use a local server instead.

  1. Clone the repository:
git clone https://github.com/mamedul/unit-converter.git
cd unit-converter
Enter fullscreen mode Exit fullscreen mode
  1. Run a local server:
npm install -g http-server
http-server
Enter fullscreen mode Exit fullscreen mode
  1. Open your browser at http://localhost:8080.

πŸ‘¨β€πŸ’» About Me

Hi! I’m Mamedul Islam, a passionate web developer specializing in PWAs, WooCommerce, WordPress, PHP, MySQL, and modern web apps. I’ve been creating digital experiences since 2017.

πŸ“¬ Connect with me:

I’m open to freelance projects in PWA, E-commerce, Firebase, WebSocket, PHP/MySQL, and more.


πŸ“ License

This project is licensed under the MIT License β€” free to use, modify, and distribute.


If you enjoy this project, please consider giving it a ⭐ on GitHub! Your support helps keep it growing.

GitHub stars

Top comments (0)