Skip to content
Snippets Groups Projects
Commit a69dba19 authored by Mitchell Pomery's avatar Mitchell Pomery
Browse files

Main page now looks nicer

parent 8e85fc32
Branches
No related merge requests found
<?php <?php
$camera = 'nocamera'; $camera = 'nocamera';
if (isset($_GET['camera'])) if (isset($_GET['camera']))
$camera=$_GET['camera']; $camera=$_GET['camera'];
$imagelocation="../"; $imagelocation="../../";
$file = $imagelocation.strtolower($camera).".jpg"; $file = $imagelocation.strtolower($camera).".jpg";
//echo $file;
header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT"); header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");
if (!is_readable($file)) if (!is_readable($file)) {
$file="nocamera.jpg"; $file="nocamera.jpg";
}
header("Content-Type: image/jpeg"); header("Content-Type: image/jpeg");
header("Content-Length: ".filesize($file)); header("Content-Length: ".filesize($file));
header("Last-Modified: ".gmdate("D, d M Y H:i:s", filectime($file))." GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s", filectime($file))." GMT");
......
...@@ -23,15 +23,19 @@ ...@@ -23,15 +23,19 @@
} }
.camSection { .camSection {
margin-left:auto; margin-left:auto;
margin-right:auto; margin-right:auto;
text-align: center; text-align: center;
} }
body { body {
padding-bottom: 4.5em; padding-bottom: 4.5em;
} }
.offline {
opacity: 0.1;
}
/* Haven't touched anything below this */ /* Haven't touched anything below this */
/*the navigation stuff for the archives page*/ /*the navigation stuff for the archives page*/
......
...@@ -8,7 +8,7 @@ function updateWebcam (webcamid, webcamurl) ...@@ -8,7 +8,7 @@ function updateWebcam (webcamid, webcamurl)
{ {
var date = new Date (); var date = new Date ();
var fullwebcamurl = webcamurl + "&t" + date.getTime (); var fullwebcamurl = webcamurl + "&t" + date.getTime ();
var img = document.getElementById (webcamid); var img = document.getElementById(webcamid);
// get an XML HTTP Request object // get an XML HTTP Request object
var req = false; var req = false;
...@@ -40,27 +40,11 @@ function updateWebcam (webcamid, webcamurl) ...@@ -40,27 +40,11 @@ function updateWebcam (webcamid, webcamurl)
if (Math.abs (imgdate.getTime () - servdate.getTime ()) > 1000 * 60 * 2) if (Math.abs (imgdate.getTime () - servdate.getTime ()) > 1000 * 60 * 2)
{ {
// this image is out of date // this image is out of date
img.style.opacity = 0.75; img.classList.add('offline');
if (iambob)
{
img.style.border = "0px solid red";
}
else
{
img.style.border = "4px solid red";
}
} }
else else
{ {
img.style.opacity = 1.0; img.classList.remove('offline');
if (iambob)
{
img.style.border = "0px solid transparent";
}
else
{
img.style.border = "4px solid transparent";
}
} }
} }
} }
...@@ -84,4 +68,4 @@ function updateTime() ...@@ -84,4 +68,4 @@ function updateTime()
updateWebcam ("ipcamera4", "camera.php?camera=ipcamera4"); updateWebcam ("ipcamera4", "camera.php?camera=ipcamera4");
updateWebcam ("ipcamera5", "camera.php?camera=ipcamera5"); updateWebcam ("ipcamera5", "camera.php?camera=ipcamera5");
updateWebcam ("ipcamera6", "camera.php?camera=ipcamera6"); updateWebcam ("ipcamera6", "camera.php?camera=ipcamera6");
} }
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment