A clean and elegant iOS weather widget built with Scriptable, fetching real-time data from the OpenWeather API. The widget adapts layout and font size based on weather conditions and city names for improved readability.
In the script file, replace this line:
const API_KEY = "YOUR_FREE_API_KEY";
With:
const API_KEY = "your_actual_key_here";
Weather Widget
.You can tweak the following parts of the script to personalize the widget:
Update this line to switch between preset themes:
createGradientBackground(widget, testGradientClr);
Other options include:
blackBlueGradientClr
lightDarkBlueGradientClr
Choose between Celsius and Fahrenheit:
const WEATHER_UNITS = "metric"; // or "imperial"
Location.current()
.The weather API uses your coordinates to return:
feels_like
temperaturedescription
city
nameThe widget parses this and smartly adjusts the text layout.
The widget is set to automatically refresh every 30 minutes:
widget.refreshAfterDate = new Date(Date.now() + 30 * 60 * 1000);
NOTE: The the values may differ bassed on your current location, the above are just some examples
Have questions or want to request a feature? DM me on Instagram or email: rushiofficial1205@gmail.com
This widget is a reflection of clean UI and practical design. If you’d like to expand it (e.g., 3-day forecasts, icon-based UI), feel free to fork it.
This project is licensed under the MIT License. Feel free to remix, reuse, and modify with attribution.
Stay informed, stay stylish – RP