[FRONT] additional day/night styling, layout values as tables

This commit is contained in:
Jannik Beyerstedt 2017-08-23 14:11:54 +02:00
parent d29232cb3c
commit 153d48f8ef
3 changed files with 50 additions and 19 deletions

View file

@ -7,8 +7,11 @@
$config_filename = 'config_times.json';
$timeRegex = '/^((2[0-3]|1[0-9]|0[0-9]|[^0-9][0-9]):([0-5][0-9]|[0-9]))/';
$sun_zenith = 96; /* Civilian Twilight */
//$sun_zenith = 90+50/60; /* "true" sunrise/ sunset */
$sunsetTrue = 90+50/60; /* "true" sunrise/ sunset */
$sunsetCivilian = 96; /* Civilian Twilight */
$sunsetNautical = 102; /* Nauticla Twilight */
$sun_zenith = $sunsetCivilian;
$timezone = "Europe/Berlin";
class LightStatus {

View file

@ -69,30 +69,41 @@ if (isset($_GET['action'])) {
<link rel="stylesheet" href="style.css">
</head>
<body class="container">
<body class="container <?php echo ($light->isNight) ? 'dark' : 'light' ?>">
<h1>Garagenlicht</h1>
<?php if ($error_string != '') : ?>
<div class="alert alert-danger" role="alert"><?php echo $error_string ?></div>
<?php endif; ?>
<h2>Aktueller Status</h2>
<p>
<?php if ($light->state) : ?>
Licht: <span class="label label-success">AN</span><br>
<?php else : ?>
Licht: <span class="label label-default">AUS</span><br>
<?php endif; ?>
Zeit bis nächste Änderung: <span class="label label-default"><?php echo ($light->changeTime === 1) ? $light->changeTime." Minute" : $light->changeTime." Minuten" ?></span>
</p>
<a class="btn btn-success" href="index.php?action=enlighten">Licht temporär an (15 Min)</a>
<table class="big">
<tr>
<td>Licht:</td>
<td><?php echo ($light->state) ? '<span class="label label-success">EINGESCHALTET</span>'
: '<span class="label label-default">AUSGESCHALTET</span>';?></td>
</tr>
<tr>
<td>Änderung in:</td>
<td><span class="label label-primary"><?php echo ($light->changeTime === 1) ? $light->changeTime." Minute" : $light->changeTime." Minuten" ?></span></td>
</tr>
</table>
<a class="btn btn-primary" href="index.php?action=enlighten">Licht temporär an (15 Min)</a>
<h5>weitere Informationen:</h5>
<p>
Sonnenaufgang: <?php echo $light->sunrise ?><br>
Sonnenuntergang: <?php echo $light->sunset ?><br>
Aktuelle Zeit: <?php echo date("Y-m-d H:i",time()) ?><br>
</p>
<table>
<tr>
<td>Sonnenaufgang:</td><td><?php echo $light->sunrise ?></td>
</tr>
<tr>
<td>Sonnenuntergang:</td><td><?php echo $light->sunset ?></td>
</tr>
<tr>
<td>Aktuelle Zeit:</td><td><?php echo date("H:i, Y-m-d",time()) ?></td>
</tr>
<tr>
<td>Nacht (ja/nein):</td><td><?php echo ($light->isNight) ? "ja" : "nein" ?></td>
</tr>
</table>
<h2>Einstellungen</h2>
<form class="form-horizontal" action="index.php?action=update" method="post">
@ -117,7 +128,7 @@ if (isset($_GET['action'])) {
<input type="time" class="form-control" name="time3-stop" value="<?php echo $light->times['time3']['off'] ?>">
</div>
</div>
<button type="submit" class="btn btn-warning">Zeiten ändern</button>
<button type="submit" class="btn btn-primary">Zeiten ändern</button>
</form>
</body>

View file

@ -5,6 +5,23 @@
body {
max-width: 500px;
margin-bottom: 20px;
}
.big{
font-size: 1.25em;
}
table {
margin-top: 1em;
margin-bottom: 1em;
}
table tr>td:first-child {
padding-right: 0.75em;
text-align: right;
}
.dark {
background-color: #292929;
color: #efefef;
}
form div.form-group > div > input.form-control {