Post

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

Building an India COVID-19 Tracker with 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 cases
  • recovered cases
  • deaths

๐Ÿ’ก 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?

๐Ÿ”— GitHub Repository


๐Ÿ™Œ 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!

Issues in this post? Report them here.

This post is licensed under CC BY 4.0 by the author.