AfterLogin_Outputpage.html
3.94 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Input Page</title>
<script src="jquery.js"></script>
<script>
//openWeatherapi
var apiURI = "http://api.openweathermap.org/data/2.5/weather?q=Seoul&appid=afea3779ccf698668f89764635ac580f";
$.ajax({
url: apiURI,
dataType: "json",
type: "GET",
async: "false",
success: function(resp) {
console.log(resp);
console.log("현재온도 : "+ (resp.main.temp- 273.15) );
$("#w3").append( (resp.main.temp- 273.15) + " ℃" );
console.log("현재습도 : "+ resp.main.humidity);
console.log("날씨 : "+ resp.weather[0].main );
$("#w2").append( resp.weather[0].main );
console.log("상세날씨설명 : "+ resp.weather[0].description );
$("#w4").append( resp.weather[0].description );
//console.log("날씨 이미지 : "+ resp.weather[0].icon );
console.log("바람 : "+ resp.wind.speed + "m/s");
$("#w5").append( resp.wind.speed + "m/s" );
console.log("나라 : "+ resp.sys.country );
console.log("도시이름 : "+ resp.name );
$("#w1").append( resp.name );
console.log("구름 : "+ (resp.clouds.all) +"%" );
$("#w6").append( (resp.clouds.all) +"%" );
}
})
</script>
<style>
#banner {
position: absolute;
top: 0;
width: 100%;
margin-top: 5ch;
color: white;
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 50px;
text-align: center;
color: white;
}
#logout{
position:absolute;
right: 20ch;
}
#section{
position: absolute;
margin-left:5%;
float:left;
width: 40%;
height: 90%;
}
#container1{
float: left;
border: 1px solid white;
width: 100%;
height: 120%;
}
#container2{
float: left;
border: 1px solid white;
background-color: rgb(102, 219, 180);
font-weight: bold;
width: 100%;
height: 120%;
}
#container3{
float: right;
border: 1px solid white;
margin-right:5%;
width: 40%;
height: 200%;
}
</style>
</head>
<body>
<img src = "images\main_background.jpg" alt="" style="z-index:-1; min-width: 100%; height: 700px;"></img>
<div id="banner">
<h1 style="width: 100%; text-align: center; font-size: 40px;">오늘은 얼마나 먹었어요?</h1>
<input id ="logout" type="submit" value="Logout" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
<br><br><br>
<div id="section">
<div id="container1">container1</div>
<br><br><br>
<div id="container2" >
<p style="margin-left: 10%">"Weather NOW"</p>
<p id="w1" style="margin-left: 10%">도시 = </p>
<p id="w3" style="margin-left: 10%">현재온도 = </p>
<span id="w2" style="margin-left: 10%">현재날씨 = </span>
<span id="w4" style="margin-left: 10%">날씨상세 = </span>
<br><br>
<span id="w5" style="margin-left: 10%">바람 = </span>
<span id="w6" style="margin-left: 10%">구름 = </span>
</div>
</div>
<div id="container3">container3</div>
</div>
<div id="footer">오픈소스SW Project 2019-1 고다경 김용재 김태희</div>
</body>
</html>