modified: static/css/sensor-2.css

modified:   static/css/sensor-3.css
	modified:   static/css/sensor-4.css
	modified:   static/js/sensor-1.js
	modified:   static/js/sensor-2.js
	modified:   static/js/sensor-3.js
	modified:   static/js/sensor-4.js
	modified:   templates/sensor-2.html
	modified:   templates/sensor-3.html
	modified:   templates/sensor-4.html
This commit is contained in:
IrisVega 2024-07-20 20:34:17 +08:00
parent 98e3ba4c8b
commit 87f47bb595
10 changed files with 70 additions and 10 deletions

View File

@ -42,3 +42,20 @@ body,html {
font-size:60px;
color:white;
}
/* Responsive design */
@media (max-width: 600px) {
.container-top {
font-size: 30px;
}
.container1 {
width: 90%;
height: 90%;
}
#temperature {
margin: 20px;
font-size: 40px;
}
}

View File

@ -42,3 +42,20 @@ body,html {
font-size:60px;
color:white;
}
/* Responsive design */
@media (max-width: 600px) {
.container-top {
font-size: 30px;
}
.container1 {
width: 90%;
height: 90%;
}
#temperature {
margin: 20px;
font-size: 40px;
}
}

View File

@ -42,3 +42,20 @@ body,html {
font-size:60px;
color:white;
}
/* Responsive design */
@media (max-width: 600px) {
.container-top {
font-size: 30px;
}
.container1 {
width: 90%;
height: 90%;
}
#temperature {
margin: 20px;
font-size: 40px;
}
}

View File

@ -8,8 +8,9 @@ document.addEventListener('DOMContentLoaded', function () {
fetch('http://111.230.197.156:8000/get_sensor_data')
.then(response => response.json())
.then(data => {
timestamps = data.timestamps.slice(-200); // 只保留最新的200个时间戳
temperatures = data.temperatures.slice(-200); // 只保留最新的200个温度数据
var maxDataPoints = window.innerWidth <= 768 ? 50 : 200; // 根据屏幕宽度决定数据量
timestamps = data.timestamps.slice(-maxDataPoints);
temperatures = data.temperatures.slice(-maxDataPoints);
updateChart();
});

View File

@ -86,8 +86,10 @@ document.addEventListener('DOMContentLoaded', function () {
fetch('http://111.230.197.156:8000/get_sensor_data')
.then(response => response.json())
.then(data => {
timestamps = data.timestamps.slice(-200); // 只保留最新的200个时间戳
humidities = data.humidities.slice(-200); // 只保留最新的200个湿度数据
var maxDataPoints = window.innerWidth <= 768 ? 50 : 200; // 根据屏幕宽度决定数据量
timestamps = data.timestamps.slice(-maxDataPoints);
humidities = data.humidities.slice(-maxDataPoints);
updateChart();
});

View File

@ -87,8 +87,10 @@ document.addEventListener('DOMContentLoaded', function () {
fetch('http://111.230.197.156:8000/get_sensor_data')
.then(response => response.json())
.then(data => {
timestamps = data.timestamps.slice(-200); // 只保留最新的200个时间戳
co2 = data.co2.slice(-200); // 只保留最新的200个CO2数据
var maxDataPoints = window.innerWidth <= 768 ? 50 : 200; // 根据屏幕宽度决定数据量
timestamps = data.timestamps.slice(-maxDataPoints);
co2 = data.co2.slice(-maxDataPoints);
updateChart();
});

View File

@ -88,8 +88,9 @@ document.addEventListener('DOMContentLoaded', function () {
fetch('http://111.230.197.156:8000/get_sensor_data')
.then(response => response.json())
.then(data => {
timestamps = data.timestamps.slice(-200); // 只保留最新的200个时间戳
pressure = data.pressure.slice(-200); // 只保留最新的200个压力数据
var maxDataPoints = window.innerWidth <= 768 ? 50 : 200; // 根据屏幕宽度决定数据量
timestamps = data.timestamps.slice(-maxDataPoints);
pressure = data.pressure.slice(-maxDataPoints);
updateChart();
});

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
<link rel="stylesheet" href="../static/css/sensor-2.css">
</head>

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
<link rel="stylesheet" href="../static/css/sensor-3.css">
</head>

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
<link rel="stylesheet" href="../static/css/sensor-4.css">
</head>