Joung Jiwon

Merge branch 'cal' into 'master'

Cal



See merge request !11
...@@ -12,12 +12,18 @@ ...@@ -12,12 +12,18 @@
12 <link rel="stylesheet" href="magnific-popup/magnific-popup.css"> 12 <link rel="stylesheet" href="magnific-popup/magnific-popup.css">
13 <link rel="stylesheet" href="css/bootstrap.min.css" /> 13 <link rel="stylesheet" href="css/bootstrap.min.css" />
14 <link rel="stylesheet" href="css/templatemo-style.css" /> 14 <link rel="stylesheet" href="css/templatemo-style.css" />
15 - <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/moonspam/NanumBarunGothic@1.0/nanumbarungothicsubset.css"> 15 + <link rel="stylesheet" type="text/css"
16 + href="https://cdn.jsdelivr.net/gh/moonspam/NanumBarunGothic@1.0/nanumbarungothicsubset.css">
16 17
17 <script src="../../docs/js/jquery-1.9.1.js"></script> 18 <script src="../../docs/js/jquery-1.9.1.js"></script>
18 <script type="text/javascript" src="../../docs/js/examples-base.js"></script> 19 <script type="text/javascript" src="../../docs/js/examples-base.js"></script>
19 <script type="text/javascript" src="../../docs/js/highlight.min.js"></script> 20 <script type="text/javascript" src="../../docs/js/highlight.min.js"></script>
21 +<<<<<<< HEAD
22 + <script type="text/javascript"
23 + src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=rr4owjosjy&submodules=geocoder"></script>
24 +=======
20 <script type="text/javascript" src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=rr4owjosjy&submodules=geocoder"></script> 25 <script type="text/javascript" src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=rr4owjosjy&submodules=geocoder"></script>
26 +>>>>>>> 4c7fe1b45bf1746088a811e7fc1b8a9c7172f7cd
21 <link rel="stylesheet" type="text/css" href="../../docs/css/examples-base.css" /> 27 <link rel="stylesheet" type="text/css" href="../../docs/css/examples-base.css" />
22 28
23 <!-- 29 <!--
...@@ -27,7 +33,7 @@ ...@@ -27,7 +33,7 @@
27 33
28 34
29 35
30 - <script type= "text/css"> 36 + <script type="text/css">
31 window.onload = function(){ 37 window.onload = function(){
32 document.getElementById('btn').onclick = function(){ 38 document.getElementById('btn').onclick = function(){
33 document.getElementById('frm').submit(); 39 document.getElementById('frm').submit();
...@@ -81,13 +87,49 @@ ...@@ -81,13 +87,49 @@
81 <div class="question-field question-home">어디에 사나요?</div> 87 <div class="question-field question-home">어디에 사나요?</div>
82 <div class="input-field input-home"> 88 <div class="input-field input-home">
83 <label for="question-input-field"></label> 89 <label for="question-input-field"></label>
84 - <input type ="text" id="start"></div> 90 + <input type="text" id="start"></div>
85 <div class="question-field question-school">무슨 학교에 다니나요?</div> 91 <div class="question-field question-school">무슨 학교에 다니나요?</div>
86 <div class="input-school"> 92 <div class="input-school">
87 <label for="question-input-field"></label> 93 <label for="question-input-field"></label>
88 - <input type ="text" id="end"> 94 + <input type="text" id="end">
89 </div> 95 </div>
90 <div class="question-field question-grade">몇학년인가요?</div> 96 <div class="question-field question-grade">몇학년인가요?</div>
97 +<<<<<<< HEAD
98 + <div class="input-grade">
99 + <div class="custom-select" style="width:208px; margin-right:40px">
100 + <select id="semester">
101 + <option value="0">1학년 1학기</option>
102 + <option value="sem-1-1">1학년 1학기</option>
103 + <option value="sem-1-2">1학년 2학기</option>
104 + <option value="sem-2-1">2학년 1학기</option>
105 + <option value="sem-2-2">2학년 2학기</option>
106 + <option value="sem-3-1">3학년 1학기</option>
107 + <option value="sem-3-2">3학년 2학기</option>
108 + <option value="sem-4-1">4학년 1학기</option>
109 + <option value="sem-4-2">4학년 2학기</option>
110 + </select>
111 + </div>
112 + </div>
113 + </div>
114 + <a href="#result" class="text-center tm-down-arrow-link" onclick="semester();return false;">
115 + <i class="fas fa-3x fa-caret-down tm-down-arrow">계산해보기</i>
116 + </a>
117 + </div>
118 + </section>
119 +
120 +
121 + <section id="result">
122 + <div id="map" style="width:700px;height:300px;"></div>
123 + <div class="answer-field">한번 갈 때마다 ...<br>
124 + <span class="answer-highlight">n</span> 시간
125 + <span class="answer-highlight">n</span><br>
126 + </div>
127 + <div class="row">
128 + <div id="list-answer">
129 + <div class="answer-field" id="answer-how-many-hours">
130 + 지금까지 <span class="answer-highlight" id="since">?</span>시간을 길에서 보내셨군요<br>
131 + 졸업까지 앞으로 <span class="answer-highlight" id="until">?</span>시간은 더 길에서 보내시면 됩니다.<br>
132 +=======
91 <div class="input-grade"><div class="custom-select" style="width:208px; margin-right:40px"> 133 <div class="input-grade"><div class="custom-select" style="width:208px; margin-right:40px">
92 <select> 134 <select>
93 <option value="0">1학년 1학기</option> 135 <option value="0">1학년 1학기</option>
...@@ -140,6 +182,22 @@ ...@@ -140,6 +182,22 @@
140 <span id = "earth">?</span>바퀴나 돌아요<br><br><br> 182 <span id = "earth">?</span>바퀴나 돌아요<br><br><br>
141 </div> 183 </div>
142 </div> 184 </div>
185 +>>>>>>> 4c7fe1b45bf1746088a811e7fc1b8a9c7172f7cd
186 + </div>
187 + </div>
188 + </div>
189 + <div class="row">
190 + <div class="answer-detail-question">
191 + 이 시간에 알바를 했다면? <br>
192 + 교통비로 국밥 <br>
193 + 이 거리라면 에베레스트 등반을 <br>
194 + 지구를
195 + </div>
196 + <div class="answer-detail-answer">
197 + <span id="salary">?</span><br>
198 + <span id="dish">?</span>그릇<br>
199 + <span id="everest">?</span>번이나...<br>
200 + <span id="earth">?</span>바퀴나 돌아요<br><br><br>
143 </div> 201 </div>
144 </div> 202 </div>
145 <footer class="text-center small tm-footer"> 203 <footer class="text-center small tm-footer">
...@@ -179,7 +237,7 @@ ...@@ -179,7 +237,7 @@
179 create a new DIV that will act as an option item:*/ 237 create a new DIV that will act as an option item:*/
180 c = document.createElement("DIV"); 238 c = document.createElement("DIV");
181 c.innerHTML = selElmnt.options[j].innerHTML; 239 c.innerHTML = selElmnt.options[j].innerHTML;
182 - c.addEventListener("click", function(e) { 240 + c.addEventListener("click", function (e) {
183 /*when an item is clicked, update the original select box, 241 /*when an item is clicked, update the original select box,
184 and the selected item:*/ 242 and the selected item:*/
185 var y, i, k, s, h, sl, yl; 243 var y, i, k, s, h, sl, yl;
...@@ -204,7 +262,7 @@ ...@@ -204,7 +262,7 @@
204 b.appendChild(c); 262 b.appendChild(c);
205 } 263 }
206 x[i].appendChild(b); 264 x[i].appendChild(b);
207 - a.addEventListener("click", function(e) { 265 + a.addEventListener("click", function (e) {
208 /*when the select box is clicked, close any other select boxes, 266 /*when the select box is clicked, close any other select boxes,
209 and open/close the current select box:*/ 267 and open/close the current select box:*/
210 e.stopPropagation(); 268 e.stopPropagation();
...@@ -249,7 +307,7 @@ ...@@ -249,7 +307,7 @@
249 naver.maps.Service.geocode({ 307 naver.maps.Service.geocode({
250 address: start 308 address: start
251 309
252 - }, function(status, response) { 310 + }, function (status, response) {
253 if (status !== naver.maps.Service.Status.OK) { 311 if (status !== naver.maps.Service.Status.OK) {
254 return alert('Something wrong!'); 312 return alert('Something wrong!');
255 } 313 }
...@@ -261,7 +319,7 @@ ...@@ -261,7 +319,7 @@
261 naver.maps.Service.geocode({ 319 naver.maps.Service.geocode({
262 address: end 320 address: end
263 321
264 - }, function(status, response) { 322 + }, function (status, response) {
265 if (status !== naver.maps.Service.Status.OK) { 323 if (status !== naver.maps.Service.Status.OK) {
266 return alert('Something wrong!'); 324 return alert('Something wrong!');
267 } 325 }
...@@ -279,7 +337,7 @@ ...@@ -279,7 +337,7 @@
279 337
280 338
281 var mapOptions = { 339 var mapOptions = {
282 - center: new naver.maps.LatLng(start,end), 340 + center: new naver.maps.LatLng(start, end),
283 zoom: 10 341 zoom: 10
284 }; 342 };
285 343
...@@ -290,12 +348,12 @@ ...@@ -290,12 +348,12 @@
290 function searchPubTransPathAJAX() { 348 function searchPubTransPathAJAX() {
291 var xhr = new XMLHttpRequest(); 349 var xhr = new XMLHttpRequest();
292 //ODsay apiKey 입력 350 //ODsay apiKey 입력
293 - var url = "https://api.odsay.com/v1/api/searchPubTransPath?SX="+sx+"&SY="+sy+"&EX="+ex+"&EY="+ey+"&apiKey=nnsDQB1AWhpETO3HmMdDAw"; 351 + var url = "https://api.odsay.com/v1/api/searchPubTransPath?SX=" + sx + "&SY=" + sy + "&EX=" + ex + "&EY=" + ey + "&apiKey=nnsDQB1AWhpETO3HmMdDAw";
294 xhr.open("GET", url, true); 352 xhr.open("GET", url, true);
295 xhr.send(); 353 xhr.send();
296 - xhr.onreadystatechange = function() { 354 + xhr.onreadystatechange = function () {
297 if (xhr.readyState == 4 && xhr.status == 200) { 355 if (xhr.readyState == 4 && xhr.status == 200) {
298 - console.log( JSON.parse(xhr.responseText) ); // <- xhr.responseText 로 결과를 가져올 수 있음 356 + console.log(JSON.parse(xhr.responseText)); // <- xhr.responseText 로 결과를 가져올 수 있음
299 //노선그래픽 데이터 호출 357 //노선그래픽 데이터 호출
300 callMapObjApiAJAX((JSON.parse(xhr.responseText))["result"]["path"][0].info.mapObj); 358 callMapObjApiAJAX((JSON.parse(xhr.responseText))["result"]["path"][0].info.mapObj);
301 } 359 }
...@@ -305,20 +363,20 @@ ...@@ -305,20 +363,20 @@
305 //길찾기 API 호출 363 //길찾기 API 호출
306 searchPubTransPathAJAX(); 364 searchPubTransPathAJAX();
307 365
308 - function callMapObjApiAJAX(mabObj){ 366 + function callMapObjApiAJAX(mabObj) {
309 var xhr = new XMLHttpRequest(); 367 var xhr = new XMLHttpRequest();
310 //ODsay apiKey 입력 368 //ODsay apiKey 입력
311 - var url = "https://api.odsay.com/v1/api/loadLane?mapObject=0:0@"+mabObj+"&apiKey=nnsDQB1AWhpETO3HmMdDAw"; 369 + var url = "https://api.odsay.com/v1/api/loadLane?mapObject=0:0@" + mabObj + "&apiKey=nnsDQB1AWhpETO3HmMdDAw";
312 xhr.open("GET", url, true); 370 xhr.open("GET", url, true);
313 xhr.send(); 371 xhr.send();
314 - xhr.onreadystatechange = function() { 372 + xhr.onreadystatechange = function () {
315 if (xhr.readyState == 4 && xhr.status == 200) { 373 if (xhr.readyState == 4 && xhr.status == 200) {
316 var resultJsonData = JSON.parse(xhr.responseText); 374 var resultJsonData = JSON.parse(xhr.responseText);
317 - drawNaverMarker(sx,sy); // 출발지 마커 표시 375 + drawNaverMarker(sx, sy); // 출발지 마커 표시
318 - drawNaverMarker(ex,ey); // 도착지 마커 표시 376 + drawNaverMarker(ex, ey); // 도착지 마커 표시
319 drawNaverPolyLine(resultJsonData); // 노선그래픽데이터 지도위 표시 377 drawNaverPolyLine(resultJsonData); // 노선그래픽데이터 지도위 표시
320 // boundary 데이터가 있을경우, 해당 boundary로 지도이동 378 // boundary 데이터가 있을경우, 해당 boundary로 지도이동
321 - if(resultJsonData.result.boundary){ 379 + if (resultJsonData.result.boundary) {
322 var boundary = new naver.maps.LatLngBounds( 380 var boundary = new naver.maps.LatLngBounds(
323 new naver.maps.LatLng(resultJsonData.result.boundary.top, resultJsonData.result.boundary.left), 381 new naver.maps.LatLng(resultJsonData.result.boundary.top, resultJsonData.result.boundary.left),
324 new naver.maps.LatLng(resultJsonData.result.boundary.bottom, resultJsonData.result.boundary.right) 382 new naver.maps.LatLng(resultJsonData.result.boundary.bottom, resultJsonData.result.boundary.right)
...@@ -330,7 +388,7 @@ ...@@ -330,7 +388,7 @@
330 } 388 }
331 389
332 // 지도위 마커 표시해주는 함수 390 // 지도위 마커 표시해주는 함수
333 - function drawNaverMarker(x,y){ 391 + function drawNaverMarker(x, y) {
334 var marker = new naver.maps.Marker({ 392 var marker = new naver.maps.Marker({
335 position: new naver.maps.LatLng(y, x), 393 position: new naver.maps.LatLng(y, x),
336 map: map 394 map: map
...@@ -338,33 +396,33 @@ ...@@ -338,33 +396,33 @@
338 } 396 }
339 397
340 // 노선그래픽 데이터를 이용하여 지도위 폴리라인 그려주는 함수 398 // 노선그래픽 데이터를 이용하여 지도위 폴리라인 그려주는 함수
341 - function drawNaverPolyLine(data){ 399 + function drawNaverPolyLine(data) {
342 var lineArray; 400 var lineArray;
343 401
344 - for(var i = 0 ; i < data.result.lane.length; i++){ 402 + for (var i = 0; i < data.result.lane.length; i++) {
345 - for(var j=0 ; j <data.result.lane[i].section.length; j++){ 403 + for (var j = 0; j < data.result.lane[i].section.length; j++) {
346 lineArray = null; 404 lineArray = null;
347 lineArray = new Array(); 405 lineArray = new Array();
348 - for(var k=0 ; k < data.result.lane[i].section[j].graphPos.length; k++){ 406 + for (var k = 0; k < data.result.lane[i].section[j].graphPos.length; k++) {
349 lineArray.push(new naver.maps.LatLng(data.result.lane[i].section[j].graphPos[k].y, data.result.lane[i].section[j].graphPos[k].x)); 407 lineArray.push(new naver.maps.LatLng(data.result.lane[i].section[j].graphPos[k].y, data.result.lane[i].section[j].graphPos[k].x));
350 } 408 }
351 409
352 //지하철결과의 경우 노선에 따른 라인색상 지정하는 부분 (1,2호선의 경우만 예로 들음) 410 //지하철결과의 경우 노선에 따른 라인색상 지정하는 부분 (1,2호선의 경우만 예로 들음)
353 - if(data.result.lane[i].type == 1){ 411 + if (data.result.lane[i].type == 1) {
354 var polyline = new naver.maps.Polyline({ 412 var polyline = new naver.maps.Polyline({
355 map: map, 413 map: map,
356 path: lineArray, 414 path: lineArray,
357 strokeWeight: 3, 415 strokeWeight: 3,
358 strokeColor: '#003499' 416 strokeColor: '#003499'
359 }); 417 });
360 - }else if(data.result.lane[i].type == 2){ 418 + } else if (data.result.lane[i].type == 2) {
361 var polyline = new naver.maps.Polyline({ 419 var polyline = new naver.maps.Polyline({
362 map: map, 420 map: map,
363 path: lineArray, 421 path: lineArray,
364 strokeWeight: 3, 422 strokeWeight: 3,
365 strokeColor: '#37b42d' 423 strokeColor: '#37b42d'
366 }); 424 });
367 - }else{ 425 + } else {
368 var polyline = new naver.maps.Polyline({ 426 var polyline = new naver.maps.Polyline({
369 map: map, 427 map: map,
370 path: lineArray, 428 path: lineArray,
...@@ -392,15 +450,15 @@ ...@@ -392,15 +450,15 @@
392 // 임시값 지정 450 // 임시값 지정
393 var time = 2 451 var time = 2
394 var distance = 30000 452 var distance = 30000
395 - var costs = 100000 453 + var pay = 100000
396 454
397 function sum(sem) { 455 function sum(sem) {
398 since = sem * time * 150 456 since = sem * time * 150
399 until = (8 - sem) * time * 150 457 until = (8 - sem) * time * 150
400 salary = since * 8590 458 salary = since * 8590
401 - dish = Math.floor((costs * 150) / 6000) 459 + dish = Math.floor((sem * pay * 150) / 6000)
402 - everest = Math.floor((distance * 2) / 8846) 460 + everest = Math.floor((sem * distance * 2) / 8846)
403 - earth = ((distance * 2) / 40075000).toFixed(3) 461 + earth = ((sem * distance * 2) / 40075000).toFixed(3)
404 } 462 }
405 463
406 if (target == 'sem-1-1') { 464 if (target == 'sem-1-1') {
......