Building an India COVID-19 Tracker with HTML, CSS, JavaScript
In this post, we'll walk through the process of creating a responsive, interactive, and visually appealing COVID-19 tracker specifically for India using HTML, CSS, JavaScript
This project was built while vibing code with ChatGPT, which made the whole process a lot more fun and collaborative. ๐
๐ง Tools & Technologies
- HTML5 โ Structure of the site
- CSS3 โ Styling and responsive layout
- JavaScript โ Dynamic data fetching
- disease.sh API โ Free and public COVID-19 API
๐จ Features
- ๐ Dark Mode toggle with local storage persistence
- ๐ฑ Responsive Design for mobile devices
- ๐ Real-time Data pulled from the disease.sh API
๐ File Structure
1
2
3
4
covid-tracker/
โโโ index.html
โโโ style.css
โโโ script.js
๐ API Integration
We used the disease.sh API to get real-time COVID-19 data:
1
fetch('https://disease.sh/v3/covid-19/countries/India')
We extracted:
active
casesrecovered
casesdeaths
๐ก Dark Mode
Dark mode was implemented by toggling a class on the body
and saving user preference with localStorage
:
1
localStorage.setItem('theme', 'dark');
๐ฑ Responsive Design
With max-width containers and flexible layout using CSS, the site looks great on phones and desktops alike.
โ Final Touches
- Tooltip toggle icon for better UX
- Aesthetic improvements and color contrast for light/dark modes
- All functionality is fully client-side, no backend needed
๐ Live Preview & Source Code
Want to see it live or fork the project?
๐ Conclusion
Creating your own COVID-19 tracker helps you learn modern web technologies while building something practical. We combined real-time data, themes, and accessibility โ all in one clean project.
Whether youโre a student or a frontend enthusiast, this project is a great showcase for your portfolio.
Stay safe and keep coding! ๐ฎ๐ณ
Feel free to comment or share your version of the tracker!