Registration is disabled!

4in1 iWidget

Anything that you can not find on the repo
Post Reply
User avatar
rasputin007
Posts: 35
Joined: Mon Sep 28, 2015 6:27 pm

4in1 iWidget

Post by rasputin007 » Sat Apr 22, 2017 6:37 pm

Based on the experience I got with chart.js I was keen to add all those single iWidgets into one, hence the name "4in1".
It basically is an iWidget with 4 icons, which can be changed to fit your current theme, and a little window that displays the current condition.
It looks like this
Image

On double-tap on any of the 4 icons the display will change to the icon you double tapped. For example if you double-tap the first icon, temperature forecast for the next 12 hours, the iWidget will look like this
Image
Double tap the same icon again and it will change back to the current condition display, first screenshot.
Double tap any of the 3 other icons and the display will change again, lets say you double-tap on the third icon (rain cloud), then a display will show you the percentage of precipitation (green color) and the amount of rain (blue color). Looks like this
Image

This iWidget comes with a config.js file that has 3 settings in it.
1.) the number of minutes between auto refresh.
2.) A choice of "metric" (Celsius, km/h, mm, 24 hour time format) or "imperial (Fahrenheit, mph, inches, 12 hour AM/PM time format)
3.) Body color, meaning the text color of the current condition window. These color setting can be either in "rgba(255,255,255,1.0)", by color name -e.g "white", "aqua" or by hex code, e.g. #FFF (no " " for hex code!)
The color of the temperature is depending on its value, different temperature ranges -> different temperature color.
Language comes from the WW3-> WU settings, in the screenshots I had German as the language selection.
Needs WW3, an WeatherUnderground API key and "Write Raw Data" enabled in WW3 as it gets it data from the /var/mobile/Documents/raw-wu.json file.

Download

The "4in1" folder has to go into /var/mobile/Library/iWidget
Nothing is impossible, only miracles take a bit longer!

User avatar
rasputin007
Posts: 35
Joined: Mon Sep 28, 2015 6:27 pm

Re: 4in1 iWidget

Post by rasputin007 » Sat May 06, 2017 9:46 am

This is an update on the 12 hour temperature chart.
I have added another graph to the temperature and that is the "feelslike" temperature.
So there are now 2 lines, but most of the time they are identical, only sometimes it actually feels different then what the temperature is and that is now in the 12 hour temperature forecast included.
Same temperature font colors and range, only a bit more transparency.
Tope value is given temperature and bottom value is the "feelslike" temperature.
Attached is the new Temp.html to replace the "old & original" Temp.html in the 4in1 folder in /var/mobile/Library/iWidget.
This is a screenshot of it. I have changed the first 3 "feelslike" values to show the difference as currently the is not much difference here.
Image
Attachments
Temp.html.zip
(2.62 KiB) Downloaded 20 times
Nothing is impossible, only miracles take a bit longer!

User avatar
rasputin007
Posts: 35
Joined: Mon Sep 28, 2015 6:27 pm

Re: 4in1 iWidget

Post by rasputin007 » Sat May 06, 2017 6:31 pm

OK, I have now added a bit more and easier customisation for the end user in the config.js file.
Before it had
var Refresh =5;//Minutes for auto refresh
var units = "metric"; //"metric" or "imperial"
var colorBody = "rgba(0,255,187,0.8)";//Text color, cab be rgba value, name -e.g. "white", or hex code #0ff
But now it has this addition, which allows a much easier setup for the temperature ranges and font colors for these ranges, as everybody has their own personal ideas about this.
//Temperature ranges and colors, enter temperatures values according to your "units" choice, Celsius or Fahrenheit!
var color0 = "rgba(0,255,255,1.0)"; //the font color for the temperatures below temp1
var temp1 = 0; //the temperature value for temperatures below this
var color1 = "rgba(0,255,0,1.0)"; //the font color for the temperature range between temp1 and temp2
var temp2 = 8; //the temperature upper value for temperature range between temp1 and this one
var color2 = "rgba(255,255,0,1.0)"; //the font color for the temperature range between temp2 and temp3
var temp3 = 13; //the temperature upper value for temperature range between temp2 and this one
var color3 = "rgba(255,130,130,1.0)"; //the font color for the temperature range between temp3 and temp4
var temp4 = 23; //the temperature upper value for temperature range between temp3 and this one
var color4 = "rgba(255,130,0,1.0)"; //the font color for the temperature range between temp4 and temp5
var temp5 = 28; //the temperature upper value for temperature range between temp4 and this one
var color5 = "rgba(255,0,0,1.0)"; //the font color for the temperature range above temp5
So, now everybody can set their personal temperature ranges by setting the variables temp1 to temp5 according to what is right for them. This has to be in accordance with the "units" they have set before. That means if you selected "metric" as your "units" then you enter the temperature ranges in Celsius, as it has been done in the default setup of config.js. If you have set "units" to "imperial" then you enter the temperature range in Fahrenheit values.
This new version, called v. 1.1, is now on my repo (https://apt.rasputin007.com - it is https as my repo is on a secure server now!). It is in the iWidget section and is still called "4in1".
Nothing is impossible, only miracles take a bit longer!

User avatar
rasputin007
Posts: 35
Joined: Mon Sep 28, 2015 6:27 pm

Re: 4in1 iWidget

Post by rasputin007 » Mon May 08, 2017 10:12 pm

Version 1.2 is out on the repo.
Changes:
- dumped the fonts folder and used stock fonts
- colorBody no longer affects the time, which is kept white, and the weather condition, which is now dependent on the temperature and it's range color.
- all windows have a thin frame of the colorBody color.
No screenshot as I lost my JB.
Nothing is impossible, only miracles take a bit longer!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest