-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (109 loc) · 3.62 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!doctype html>
<html>
<head>
<title>아쿠아포닉스</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #282c34; /* 다크 모드 배경색 */
color: #f8f8f2; /* 텍스트 색상 */
}
.container {
background-color: #333; /* 다크 모드 배경색 */
padding: 30px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.info {
display: flex;
flex-direction: column;
align-items: center;
}
.value {
font-size: 3em;
font-weight: bold;
margin-bottom: 10px;
color: #c792ea; /* 보라색 */
}
.unit {
font-size: 1.5em;
color: #c792ea; /* 보라색 */
}
.h1 {
font-size: 4em;
font-weight: bold;
margin-bottom: 10px;
color: #c792ea;
}
.container, .info, p, h1 { /* 추가된 스타일 */
color: #c792ea; /* 보라색 */
}
</style>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="/">메인 페이지</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/meal">식단표</a>
</li>
</ul>
</div>
</div>
</nav>
</head>
<body>
<div>
<h1>아쿠아포닉스 수온</h1>
<div class="container">
<div class="info">
<div>
<span class="value" id="huminity"></span>
<span class="unit">%</span>
</div>
<p>습도</p>
</div>
<div class="info">
<div>
<span class="value" id="temperature"></span>
<span class="unit">°C</span>
</div>
<p>온도</p>
</div>
</div>
<p>made by DIS</p>
</div>
<script>
function setWeatherData(data) {
document.getElementById("huminity").textContent = data.huminity;
document.getElementById("temperature").textContent = data.temperature;
}
function getWeahterData(){
$.ajax({
type : "GET",
url : "api/weather",
dataType : "json",
success : function(data){
setWeatherData(JSON.parse(data));
}
});
}
const a = setInterval(() => {
getWeahterData();
}, 1000);
window.onload = () => getWeahterData();
window.onbeforeunload = () => clearInterval(a);
</script>
</body>
</html>