Changing the city
The city is set as theq query parameter in the API URL inside script.js:
jaipur with any city name supported by OpenWeatherMap. Multi-word city names with spaces work fine (e.g., new york, los angeles), or you can URL-encode the spaces as + (e.g., new+york).
Changing temperature units
By default,script.js receives the temperature in Kelvin and converts it manually:
units parameter to the API so OpenWeatherMap returns the value in your preferred unit directly, removing the need for manual conversion.
- Metric (Celsius)
- Imperial (Fahrenheit)
Add Also update the degree label in
&units=metric to the URL and remove the Kelvin offset:index.html from C to match:Changing the background color
The background color is set in two places instyle.css: the body rule and the .weather-card rule. Both use #343434 (dark grey) by default.
Changing the card size
The card dimensions are controlled bywidth and max-width in the .weather-card rule in style.css:
width: 80vwmakes the card responsive on small screens.max-widthcaps the width on larger screens. Decrease it for a narrower card, increase it for a wider one.
Changing the font
The font is loaded from Google Fonts inindex.html:
style.css:
Poppins / poppins with any font available on Google Fonts. Make sure the name in the <link> tag and the font-family value match (Google Fonts names are case-sensitive in the URL but CSS font-family is not).