강희주

Update main.html

...@@ -21,8 +21,11 @@ ...@@ -21,8 +21,11 @@
21 //request는 string으로 받아오기 때문에 JSON형태로 바꿔준다. 21 //request는 string으로 받아오기 때문에 JSON형태로 바꿔준다.
22 //var jsonObject = JSON.parse(); 22 //var jsonObject = JSON.parse();
23 var LocationName = jsonObject.name; //지역 이름 23 var LocationName = jsonObject.name; //지역 이름
24 + document.getElementById("LocationName").innerHTML= LocationName;
24 var WeatherCondition = jsonObject.weather[0].main; //현재 날씨 25 var WeatherCondition = jsonObject.weather[0].main; //현재 날씨
26 + document.getElementById("WeatherCondition").innerHTML= WeatherCondition;
25 var Temp = jsonObject.main.temp; //현재 기온 27 var Temp = jsonObject.main.temp; //현재 기온
28 + document.getElementById("Temp").innerHTML= Temp;
26 //console.log(body); 29 //console.log(body);
27 console.log(LocationName); 30 console.log(LocationName);
28 console.log(WeatherCondition); 31 console.log(WeatherCondition);
...@@ -35,6 +38,7 @@ ...@@ -35,6 +38,7 @@
35 navigator.geolocation.getCurrentPosition(function(pos) { 38 navigator.geolocation.getCurrentPosition(function(pos) {
36 $('#latitude').html(pos.coords.latitude); 39 $('#latitude').html(pos.coords.latitude);
37 $('#longitude').html(pos.coords.longitude); 40 $('#longitude').html(pos.coords.longitude);
41 + // useGps(); // GPS 정보를 모두받아온 뒤에 코드를 실행함
38 useGps(); 42 useGps();
39 }); 43 });
40 } 44 }
...@@ -85,6 +89,7 @@ ...@@ -85,6 +89,7 @@
85 clock(); 89 clock();
86 setInterval(clock, 1000); // 1초마다 실행 90 setInterval(clock, 1000); // 1초마다 실행
87 </script> 91 </script>
92 +
88 </fieldset> 93 </fieldset>
89 94
90 <fieldset> 95 <fieldset>
...@@ -101,22 +106,9 @@ ...@@ -101,22 +106,9 @@
101 <fieldset> 106 <fieldset>
102 <legend>추천 음악 정보</legend> 107 <legend>추천 음악 정보</legend>
103 <div><input type="button" value="음악 추천 받기"></div><br> 108 <div><input type="button" value="음악 추천 받기"></div><br>
104 - <!-- <iframe id="video1" width="450" height="280" src="" frameborder="0" allowtransparency="true" allowfullscreen></iframe>
105 - <a href="#" id="playvideo">Play button</a>
106 - <script>
107 - var userLat = 37;
108 - var userLng = 127;
109 - fetch("http://localhost:3000/music")
110 - .then(res => res.json())
111 - .then(function(data) {
112 - $("#playvideo").click(function(){
113 - $("#video1")[0].src += data.link;
114 - });
115 - })
116 -
117 - </script> -->
118 109
119 <h4>추천 음악 1</h4> 110 <h4>추천 음악 1</h4>
111 + <div id="div1"></div>
120 <iframe width="942" height="530" src="https://www.youtube.com/embed/vnS_jn2uibs" title="YouTube video player" frameborder="0" 112 <iframe width="942" height="530" src="https://www.youtube.com/embed/vnS_jn2uibs" title="YouTube video player" frameborder="0"
121 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br> 113 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br>
122 <h4>추천 음악 2</h4> 114 <h4>추천 음악 2</h4>
......