Keep It Simple St*p*d - discussion and download

So did I (see here) but then it doesn’t look so good on my very old tablet. So I have a separate simple2.php with no top margin or background image for the tablet.

Colour transparency is different too: 0.3 with image, 0.6 without.

Haven’t got round to the beta, yet :slight_smile:

It looks fine :smiley:
After all, it’s a matter of taste.
I used a color picker and made my own color as in the dark part of the sky.

https://inaogmogens.dk/weather/simple.php

Mogens

A great addition, Wim. Thank you.

This is also much easier to read if you view the site on a mobile phone.

However then, to my eyes at least, the font size is if anything too large. I wonder if it will be possible eventually to adapt the size of the font to the viewport.

Richard

It was meant to be viewed from a distance.
And yes, on a mobile phone which is used on a close distance, everything should shrink.

It will be possible in a new version using more CSS, or maybe another coder can adjust the current version.

Wim

Hello
the refresh doesn’t work for me.
what can that be.

@ALL I forgot to count how many times I asked to add a link (URL) to your site.
As I need to find possible errors, it took me another 15 minutes to find the site. Waste of time.
And only two minutes to find the cause of this problem
=> “invalid / unknown formatted” clientraw.txt
==> causing a javascript error when processing the data.

These errors one can find by running the simple.php script => right-click and select “inspect” in Chrome or FF.

[color=red]Uncaught SyntaxError: Invalid or unexpected token at execute_data (simple.php:235) at :1:1[/color]
That line checks the returned ajax data
   eval (wsRequest.responseText);  // alert ("252"+wsRequest.responseText);  // alert ("242 " + ajaxVars["ajaxdate"]);   // eval the string 

Checking the contents of that response-text, a line which is not correct .js, it has a NL/CR character inside the value.

ajaxVars["solar"] = "38";
ajaxVars["swversion"] = "Clientraw 
";
ajaxVars["temp"] = "10.2";

Solution to test:
Change the last lines of _data.php from

foreach ($weather as $key => $value)
     {  if ($value === 'n/a') { continue; }
        $string .= 'ajaxVars["'.$key.'"] = "'.$value.'";'."\n";}
echo $string;

to

foreach ($weather as $key => $value)
     {  if ($value === 'n/a') { continue; }
        $value  = trim($value);
        $string .= 'ajaxVars["'.$key.'"] = "'.$value.'";'."\n";}
echo $string;

The added line will remove the new-line/CR which seems to be inserted in $weather[“swversion”]
Your clientraw.txt has a “new-line/CR” character where normally the clientraw-version is contained.

Hope this helps,
Wim

Thanks very much
now it works.

My buddy is in love with simple.php . The backgound pic on his website is the view from his river house in the summer.

https://pws.relianceweather.com/simple.php

Thank you Wim!

BUMP

@ALL This optional script is available for download here.
It will not be included in the standard update.

Hi!

@ALL This optional script is available for download here. It will not be included in the standard update.
Isn't there a link missing at "here"? Or do you mean the linked script in [post #1](http://discourse.weather-watch.com/p/555770)? What's wrong with putting the script in the standard repository? I think that would be helpful.

Oliver

Sorry copy/paste error

What's wrong with putting the script in the standard repository? I think that would be helpful. Oliver
I want to slim down the PWS-dashboard "repository" not extend with all possible additional scripts. As soon as i include those scripts I have to maintain them also.

I just hope that other authors can pick the add-ons and enhance them.
Or develop other enhancements based on the current add-ons

Wim

hi everyone,
so, where I can change or add the background picture ?

Thanks

sorry, nevermind.

:smiley:

This is exactly what I want to achieve but I cant seem to get the background image to load (also not sure how to centre the tiles like this.)

If anyone can assist that would be great.

Here is as far as I have got: Lower Sheering WX

Note: I dont want the image on the primary dash, only the simple one.

Any help greatly appreciated :+1:

I don’t have a dashboard image so I just defined one in _data.php, round about line 60:

ob_end_clean(); 
#
$body_image  = '../out1.jpg';   # comment this line if no background image required 
#   
if (isset ($body_image) && $body_image <> '' && file_exists($body_image) )

Then I altered line 162 in simple.php to move the tiles down:

        body {  margin: 0 auto; 
                padding: 80px;   /* was 0 - alter this to move template up/down ###### */ 
                font-size: 14px;  
                line-height: 1.2;} 

See Swanston Grove simply

I assume this is wrong because it hasn’t loaded the image?

#
$body_image  = 'https://pws.lowersheering.com/pwsWD/header01.jpg';   # comment this line if no background image required
#

Mine is in a different directory, so you could try

$body_image = 'header01.jpg';

Awesome!

Thanks for your help!

I’m 50/50 on putting the blocks in the middle, maybe when I change the photo

Thanks again!

bump

6 posts were merged into an existing topic: PWS gets stuck over reading clientraw.txt - screen turns white"