A live bird collage card for your Home Assistant dashboard.
updates
mcguirepr897fa41cdc284a
diff --git a/homepage/images/menu.png b/homepage/images/menu.pngnew file mode 100644index 00000000..8c03aff9Binary files /dev/null and b/homepage/images/menu.png differdiff --git a/homepage/style.css b/homepage/style.cssindex e910191d..b0267bab 100644--- a/homepage/style.css+++ b/homepage/style.css@@ -2,6 +2,7 @@font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',' Calibri', 'Trebuchet MS', 'sans-serif';box-sizing: border-box;+ font-size: large;}.banner {@@ -11,6 +12,7 @@.banner h1 {float: top;+ font-size: x-large;}.banner audio {@@ -27,7 +29,7 @@}.topnav {- background-color: rgb(119, 196, 135);+ background-color: rgb( 159, 226, 155);display: block;}@@ -54,6 +56,28 @@display: none;}+.play table {+ width:50%;+ margin-right: auto;+ margin-left: auto;+}++.overview td {+ width:20%;+}++.overview table {+ width: 75%;+}++.stats table {+ width: 100%;+}++a {+ text-decoration: none;+}+h3 {text-align: center;}@@ -71,7 +95,6 @@ body {table {background-color: transparent;margin: 0 auto;- font-size: large;border-collapse: collapse;border-spacing: 0;width: 100%;@@ -79,6 +102,8 @@ table {}td {+ padding: 10px;+ vertical-align: top;background-color: rgb(219, 255, 235);font-weight: lighter;border: 2px solid black;@@ -100,20 +125,28 @@ audio, video{}.centered {+ text-align: center;display: block;width: auto;margin-left: auto;margin-right: auto;}+.full {+ width:100%;+}+button {- font-size: large;background-color: transparent;border: none;color: black;cursor: pointer;}+button:hover {+ color: blue;+}+.logbutton, .navbuttons {float: left;}@@ -140,15 +173,17 @@ body::-webkit-scrollbar {@media screen and (max-width: 1000px) {.topnav.responsive {position: relative;}.topnav.responsive button {- float: left;display: block;text-align: center;}}@media screen and (max-width: 600px) {- .top.nav button {- font-size: 16px;+ .play table,.overview table {+ width: 100%;+ }+ .topnav button {+ font-size: xx-large;}.topnav button {display: none;}/*.topnav button:not(:first-child) {display: none;}*/@@ -161,13 +196,14 @@ body::-webkit-scrollbar {}@media screen and (max-width: 600px) {+ .play table,.overview table {+ width: 100%;+ }.topnav button {- font-size: 16px;+ font-size: x-large;}.topnav.responsive {position: relative;}.topnav.responsive button {- float: left;display: block;text-align: center;- }-}+ }}diff --git a/homepage/views.php b/homepage/views.phpindex f7b1e0c5..05b34810 100644--- a/homepage/views.php+++ b/homepage/views.php@@ -26,7 +26,7 @@ if(isset($_POST['view'])){if($_POST['view'] == "Spectrogram"){include('spectrogram.php');}if($_POST['view'] == "Overview"){include('overview.php');}if($_POST['view'] == "Today's Detections"){include('viewdb.php');}- if($_POST['view'] == "Species Stats"){include('stats.php');}+ if($_POST['view'] == "Species Stats"){echo "<br><br>";include('stats.php');}if($_POST['view'] == "Daily Charts"){include('history.php');}if($_POST['view'] == "Tools"){if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {diff --git a/scripts/overview.php b/scripts/overview.phpindex 1c725575..b6b71b46 100644--- a/scripts/overview.php+++ b/scripts/overview.php@@ -68,8 +68,7 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC);</style></head><body>- <div>- </div>+<div class="overview"><table><tr><th>Total</th>@@ -88,9 +87,6 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC);</form></tr></table>-</div>- <div>-<table><tr><th>Most Recent Detection</th>@@ -112,7 +108,7 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC);<td><?php echo $mostrecent['Confidence'];?></td></tr></table>- </div>+</div><?phpif (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {echo "<img class=\"centered\" src=\"/Charts/$chart?nocache=time()\">";@@ -120,6 +116,6 @@ if (file_exists('/home/pi/BirdSongs/Extracted/Charts/'.$chart)) {echo "<p>No Detections For Today</p>";}?>- <h3>Currently Analyzing</h3>-<img class="centered" style="width:100%;" src='/spectrogram.png?nocache=<?php echo time();?>' >+ <h3 class="centered">Currently Analyzing</h3>+<img class="full" src='/spectrogram.png?nocache=<?php echo time();?>' ></html>diff --git a/scripts/play.css b/scripts/play.cssdeleted file mode 100644index 4d7828d9..00000000--- a/scripts/play.css+++ /dev/null@@ -1,99 +0,0 @@-/* style sheet */-* {- font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',- ' Calibri', 'Trebuchet MS', 'sans-serif';- box-sizing: border-box;-}--a {- text-decoration:none;-}--body {- background-color: rgb(119, 196, 135);-}--.column {- display:block;- width:33%;- margin-left:auto;- margin-right:auto;-}--.left {- float:left;-}--.right {- float:right;- width:66%;-}--table {- background-color: rgb(219, 255, 235);- margin: 0 auto;- font-size: large;- border-collapse: collapse;- border-spacing: 0;- width: 100%;- border: 1px solid black;-}--h1 {- text-align: center;- color: black;- font-size: xx-large;-}--h2 {- margin-left: -150px;- text-align: center;- color: black;- font-size: large;-}--h3 {- text-align: center;- color: black;- font-size: large;-}--td {- background-color: rgb(219, 255, 235);- font-weight: lighter;- border: 1px solid black;- padding: 10px;- text-align: center;-}--th {- background-color: rgb(219, 255, 235);- font-weight: bold;- border: 1px solid black;- padding: 10px;- text-align: center;-}--button {- background-color: transparent;- font-size: large;- border:none;- cursor:pointer;-}--@media screen and (max-width: 1000px) {- h2 {- margin-left: 0;- text-align: center;- color: black;- font-size: large;- }-- .column {- width: 80%;- }--}-body::-webkit-scrollbar {- display:none-}diff --git a/scripts/play.php b/scripts/play.phpindex 022f0db8..59be33d2 100644--- a/scripts/play.php+++ b/scripts/play.php@@ -56,6 +56,7 @@ if(isset($_POST['bydate'])){</style></head><body>+<div class="play"><table><?phpif(!isset($_POST['species'])){@@ -86,20 +87,20 @@ while($results=$result->fetchArray(SQLITE3_ASSOC))$comname = preg_replace('/\'/', '', $comname);$file = $results['File_Name'];$filename = "/By_Date/".$date."/".$comname."/".$results['File_Name'];- echo "<table>+ echo "<table ><tr>- <th>$name</th>- <th>Max Confidence: $maxconf</th>+ <th colspan=\"2\">$name</th>+ <th></th></tr><tr>- <th>Most confident recording: </th>- <td class=\"spectrogram\"><video controls poster=\"$filename.png\"><source src=\"$filename\"></video></td>+ <td class=\"spectrogram\">Best Recording<br>$maxconf<br><video controls poster=\"$filename.png\"><source src=\"$filename\"></video></td></tr></table>";};};?></td></form></tr></table>+</div><?phpif(isset($_POST['species'])){$name = $_POST['species'];@@ -109,7 +110,7 @@ while($results=$result->fetchArray(SQLITE3_ASSOC))header("refresh: 0;");}$result2 = $statement2->execute();- echo "<table>+ echo "<table ><tr><th>When</th><th>Listen</th>diff --git a/scripts/stats.php b/scripts/stats.phpindex bf131176..fbe1a9bb 100644--- a/scripts/stats.php+++ b/scripts/stats.php@@ -32,23 +32,24 @@ if(isset($_POST['species'])){<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>BirdNET-Pi DB</title>+ <link rel="stylesheet" href="../style.css">+<style>- </style>+</style>+</head><body>- <section>-<div class="row">- <div class="column first"><?php if(!isset($_POST['species'])){- echo "<p style=\"text-align:center\">Choose a species below to load images from Wikimedia Commons.</p>";+?><p class="centered">Choose a species below to load images from Wikimedia Commons.</p>+<?php};?><table><tr>- <th>Common Name</th>- <th>Occurrences</th>- <th>Max Confidence Score</th>- <th>Best Recording</th>+ <th>Common Name</th>+ <th>Occurrences</th>+ <th>Max Confidence Score</th>+ <th>Best Recording</th></tr><?phpwhile($results=$result->fetchArray(SQLITE3_ASSOC))@@ -65,17 +66,15 @@ $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];</form><td><?php echo $results['COUNT(*)'];?></td><td><?php echo $results['MAX(Confidence)'];?></td>- <td class="spectrogram"><video controls poster="<?php echo $filename.".png";?>"><source src="<?php echo $filename;?>" type="audio/mp3"></video></td>+ <td style="width:50%"><video controls poster="<?php echo $filename.".png";?>"><source src="<?php echo $filename;?>" type="audio/mp3"></video></td></tr><?php}?></table>- </div><?php if(isset($_POST['species'])){$species = $_POST['species'];- $str = "<div class=\"column second\">- <h3>$species</h3>+ $str = "<h3>$species</h3><table><tr><th>Scientific Name</th>@@ -123,7 +122,6 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){}}}?>-- </section>+</body></html>