Course: Web Dev II (Advanced JS & React)
Author: Harsh Dev Jha - 2501010168
This is a simple Vanilla JavaScript web application that fetches and displays real-time weather data for any city in the world. It was designed strictly following the layout constraints and reference materials, built with HTML5, CSS3, and JavaScript—without the use of any external UI frameworks like Bootstrap or Tailwind.
The project relies on the free Open-Meteo API to gather coordinates, temperature, humidity, and wind-speed data using native browser fetch().
- City Search: Users can enter a city name to get the current temperature, weather conditions, humidity, and wind speed.
- Asynchronous Data Handling: Uses
async/awaitandtry...catchblocks to make network requests without freezing the webpage. - Visual Console (Event Loop): A built-in terminal UI at the bottom of the screen visually logs the exact execution order of the asynchronous functions in real-time, demonstrating the Call Stack, Microtask queue, and Macrotask queue parsing!
- Local Storage Integration: Every successful search is permanently saved into the browser's
localStorageand mapped dynamically to history tags under the search bar. Clicking these orange tags re-triggers an instant fetch.
As required by the assignment constraints, I have built a visual "Console - Event Loop" window directly into the UI.
When you search for a city, watch the bottom console fill up dynamically:
▶ Sync Startfires instantly.- The code schedules a
setTimeout(Macrotask) and aPromise.then(Microtask). ▶ Sync Endfires, proving synchronous code resolves first.▶ Promise.then (Microtask)triggers beforesetTimeout, proving the JS Microtask queue has higher priority than the Macrotask queue.- The
asyncfunction continues fetching and awaits the Web API ([ASYNC]tags) before resolving with the payload.
- Download this folder.
- Open
index.htmlin any modern web browser. - Search for a city like "Delhi" or "London".
- Watch the Event Loop render directly in the UI!