From ccfc9450ae93677dedddc2a81ad80f17623b015e Mon Sep 17 00:00:00 2001 From: Louis Bailleul Date: Mon, 23 Nov 2015 11:23:04 +0000 Subject: [PATCH] Add media query to cahnge the size of the thumbnails This prevent the scrollbar on graph.inc.php Tweaked the graphs sizing to fit better on the screen --- html/css/styles.css | 18 +----------------- html/pages/graphs.inc.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/html/css/styles.css b/html/css/styles.css index 3c2de2ca7..03ed6b3c6 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1776,30 +1776,14 @@ label { max-width: 45px; max-height: 50px; } - .device-header-table .device_icon img { - max-width: 20px; - max-height: 20px; - } - .device-header-table img { - max-width: 115px; - max-height: 40px; - } - .device-header-table {font-size : 8px;} - .device-header-table a {font-size : 11px;} } -@media only screen and (max-width: 768px) and (min-width: 481px) { +@media only screen and (max-width: 720px) and (min-width: 481px) { .thumbnail_graph_table b { font-size : 8px;} .thumbnail_graph_table img { max-width: 60px; max-height: 55px; } - .device-header-table img { - max-width: 150px; - max-height: 50px; - } - .device-header-table {font-size : 10px;} - .device-header-table a {font-size : 17px;} } diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index 075fd5968..bcb1c9243 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -112,11 +112,21 @@ else { $graph_array['width'] = $graph_width; if($_SESSION['screen_width']) { - $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/12)); + if($_SESSION['screen_width'] > 800) { + $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/10)); + } + else { + $graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/4)); + } } if($_SESSION['screen_height']) { - $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2)); + if($_SESSION['screen_height'] > 960 ) { + $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2)); + } + else { + $graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/1.5)); + } } echo("
");