Fix Compilation on Ubuntu 18.04
[minix3.git] / minix / share / beaglebone / weather / index.html
blobc82e8fab65cf02387e6dd572077e37b4afdbb00d
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8" />
6 <title>Weather Station - Powered by Minix and BeagleBone</title>
8 <link rel="stylesheet" type="text/css" media="all" href="style.css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="processing.js"></script>
12 <script type="text/javascript" src="spin.js"></script>
14 <script type="text/javascript">
16 // Refresh weather data every 3 seconds.
17 var weather_fetch_interval = 3 * 1000;
19 // Location of the weather data.
20 var weather_json_url = 'weather.json';
22 // Loading animation while the initial fetch is being performed.
23 var spinner = new Spinner().spin();
25 // Callback for fetching weather reports.
26 function weather_cb_fetch() {
28 var now;
29 var url;
31 // Make the URL of every request unique to help ensure
32 // that the browser doesn't cache the JSON data.
33 now = new Date();
34 url = weather_json_url + '?timestamp=' + now.getTime();
36 $.getJSON(url, weather_cb_process);
39 // Callback for processing weather reports.
40 function weather_cb_process(data) {
42 set_lux(data.illuminance);
43 set_temp(data.temperature);
44 set_humidity(data.humidity);
45 set_pressure(data.pressure/100); // Pa to hPa
47 // hide the loading message once everything is loaded
48 $("#loading").fadeOut("slow", function(){
49 spinner.stop();
50 });
52 // weather station is initially hidden
53 // fade in after first paint.
54 $("#weatherstation").fadeIn("slow");
56 // Queue the next server request.
57 setTimeout(weather_cb_fetch, weather_fetch_interval);
60 function weather_init() {
62 // Start the loading animation spinning.
63 $("#loading").append(spinner.el);
65 // Fetch the initial weather report.
66 weather_cb_fetch();
69 // Start getting weather reports.
70 $(weather_init);
72 </script>
74 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
75 </head>
76 <body>
78 <!--
79 Page loading animation (spin.js).
80 Hidden after weather canvases are loaded.
81 -->
82 <div id="loading"> </div>
84 <!--
85 Thermometer, gauges, and light level dot.
86 Initially hidden while loading/painting.
87 -->
88 <div id="weatherstation">
89 <canvas id="barometerCanvas"></canvas>
90 <canvas id="thermometerCanvas"></canvas>
91 <canvas id="lightCanvas"></canvas>
92 </div>
94 <script type="text/javascript" src="weatherstation.js"></script>
96 </body>
97 </html>