양효빈

Kcalmsg 알고리즘 수정, 모든 세부 페이지 css 1차 구현, api이미지 삽입!

...@@ -3,28 +3,72 @@ var template = require('./template.js'); ...@@ -3,28 +3,72 @@ var template = require('./template.js');
3 var db = require('./db.js'); 3 var db = require('./db.js');
4 exports.countKcal = function(request, response){ 4 exports.countKcal = function(request, response){
5 var title = '칼로리 계산'; 5 var title = '칼로리 계산';
6 - var description = '바디 칼로리와 음식 칼로리가 있습니다.'; 6 + var description = '맞춤 권장 칼로리와 섭취 음식 칼로리 중 하나를 선택해 주세요.';
7 + var url = "./"
8 +
7 var html = template.html(title,` 9 var html = template.html(title,`
8 - <h2>${title}</h2> 10 +
9 - <p>${description}</p> 11 + <head>
10 - <a href="/countKcal_body">바디 칼로리 계산</a><br> 12 + <style type="text/css">
11 - <a href="/countKcal_food">음식 칼로리 계산</a> 13 + a:link {color: black; text-decoration: none;}
14 + a:visited { color: black; text-decoration: none;}
15 + a:hover { color: black;text-decoration: none;}
16 + </style>
17 + </head>
18 +
19 +
20 +
21 + <br><br><br><br><br>
22 +
23 + <style type="text/css">
24 + div{
25 +
26 + text-align:center;
27 + border:1px solid none;
28 + margin:0px 0px 0px 0px;
29 + padding:0px;
30 +
31 + }
32 +
33 +
34 + a { text-decoration:none }
35 + }
36 +
37 + </style>
38 +
39 +
40 + <div style= "font-size:25px;">
41 +
42 + <h2><font color="black">${title}<div style= "font-size:10px;"><br></div><div style= "font-size:20px;">${description}</font></div></h2>
43 + </div>
44 + <div style=border-radius: 30px;>
45 + <a href="/countKcal_body">
46 + <img src="https://source.unsplash.com/mQVWb7kUoOE" style="border-radius:20%" alt="no image..." width="300" height="300">
47 + </a>
48 + &emsp;&emsp;&emsp;&emsp;
49 + <a href="/countKcal_food">
50 + <img src="https://source.unsplash.com/HlNcigvUi4Q" style="border-radius:20%" alt="My Image" width="300" height="300">
51 + </a>
52 + </div>
53 + <br>
54 + <div style= "font-size:22px">
55 + <a href="/countKcal_body" text-decoration:none>맞춤 권장 칼로리 계산</a>
56 + &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
57 + <a href="/countKcal_food">섭취 음식 칼로리 계산</a>
58 + </div>
12 ` ); 59 ` );
13 response.writeHead(200); 60 response.writeHead(200);
14 response.end(html); 61 response.end(html);
15 } 62 }
16 exports.countKcal_body = function(request, response){ 63 exports.countKcal_body = function(request, response){
17 var title = '칼로리 계산'; 64 var title = '칼로리 계산';
18 - var description = '성별, 나이, 키, 몸무게, 활동량을 입력하시면 일일 권장 섭취량(kcal)를 알려드립니다!'; 65 + var description = '개인의 신체 정보에 맞는 일일 권장 섭취량(kcal)를 알려드립니다!';
19 var html = template.html(title,` 66 var html = template.html(title,`
20 - <style>
21 - @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
22 - </style>
23 67
24 <br><br><br> 68 <br><br><br>
25 - <div style= "font-family: 'Do Hyeon', sans-serif;"> 69 + <div style= "font-size:20px;">
26 - <h2>${title}</h2> 70 +
27 - <p>${description}</p> 71 + <h2><font color="black">${title}<br><div style= "font-size:20px;"><br>${description}</font></div></h2>
28 <form action="/countKcal_body_process" method="post" > 72 <form action="/countKcal_body_process" method="post" >
29 성별 :<br /> 73 성별 :<br />
30 <select name="gender"> 74 <select name="gender">
...@@ -45,7 +89,7 @@ exports.countKcal_body = function(request, response){ ...@@ -45,7 +89,7 @@ exports.countKcal_body = function(request, response){
45 <option value="high">많은 활동(매일 2시간동안 수영을 함)</option> 89 <option value="high">많은 활동(매일 2시간동안 수영을 함)</option>
46 </select 90 </select
47 ><br /><br> 91 ><br /><br>
48 - <input type="submit" value="계산하기" /> 92 + <input type="submit" value="계산하기" style="font-size:20px;" />
49 </div> 93 </div>
50 <br><br><br><br> 94 <br><br><br><br>
51 </form>` ); 95 </form>` );
...@@ -154,6 +198,10 @@ exports.countKcal_body_process = function(request, response){ ...@@ -154,6 +198,10 @@ exports.countKcal_body_process = function(request, response){
154 foodKcal = (totalKcal/targetDay).toFixed(1); 198 foodKcal = (totalKcal/targetDay).toFixed(1);
155 kcalMsg += `다이어트 칼로리 : ${(TDEE - foodKcal).toFixed(1)}kcal`; 199 kcalMsg += `다이어트 칼로리 : ${(TDEE - foodKcal).toFixed(1)}kcal`;
156 } 200 }
201 + else if(weight == targetWeight) {
202 +
203 + kcalMsg ="";
204 + }
157 else if(weight < targetWeight) { 205 else if(weight < targetWeight) {
158 totalKcal = (targetWeight-weight)*7700; //쩌야할 총 칼로리/벌크업 206 totalKcal = (targetWeight-weight)*7700; //쩌야할 총 칼로리/벌크업
159 foodKcal = (totalKcal/targetDay).toFixed(1); 207 foodKcal = (totalKcal/targetDay).toFixed(1);
......
...@@ -5,6 +5,7 @@ exports.foodInfo = function(request, response){ ...@@ -5,6 +5,7 @@ exports.foodInfo = function(request, response){
5 var title = '음식 영양정보'; 5 var title = '음식 영양정보';
6 var description = '음식을 검색하면 음식의 칼로리, 탄수화물, 단백질, 지방, 나트륨의 정보를 알려드립니다!'; 6 var description = '음식을 검색하면 음식의 칼로리, 탄수화물, 단백질, 지방, 나트륨의 정보를 알려드립니다!';
7 var html = template.html(title,` 7 var html = template.html(title,`
8 + <br><br><br>
8 <h2>${title}</h2> 9 <h2>${title}</h2>
9 <p>${description}</p> 10 <p>${description}</p>
10 <form action="/foodInfo_search" method="post"> 11 <form action="/foodInfo_search" method="post">
...@@ -40,6 +41,7 @@ exports.foodInfo_search = function(request, response){ ...@@ -40,6 +41,7 @@ exports.foodInfo_search = function(request, response){
40 } 41 }
41 } 42 }
42 var html = template.html(title,` 43 var html = template.html(title,`
44 + <br><br><br>
43 <h2>${title}</h2> 45 <h2>${title}</h2>
44 <p>${description}</p> 46 <p>${description}</p>
45 <form action="/foodInfo_search" method="post"> 47 <form action="/foodInfo_search" method="post">
......
...@@ -34,7 +34,7 @@ exports.home = function(request, response){ ...@@ -34,7 +34,7 @@ exports.home = function(request, response){
34 </div> 34 </div>
35 35
36 </style> 36 </style>
37 - <div style= font-size:40px;background-image:url("https://source.unsplash.com/featured/?food,health");padding:50px;> 37 + <div style= font-size:40px;background-image:url("https://source.unsplash.com/jFCViYFYcus");padding:50px;>
38 38
39 <h1 style=font-family: 'Do Hyeon', sans-serif;><a href="/"><font color="white">HealthProtector</font></a></h1> 39 <h1 style=font-family: 'Do Hyeon', sans-serif;><a href="/"><font color="white">HealthProtector</font></a></h1>
40 40
......
...@@ -10,12 +10,12 @@ exports.searchGym = function(request, response){ ...@@ -10,12 +10,12 @@ exports.searchGym = function(request, response){
10 <style> 10 <style>
11 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap'); 11 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
12 </style> 12 </style>
13 - 13 + <br><br>
14 - <br><br><br><br> 14 + <div style= "font-size:25px; background-color:#ffffff">
15 - <div style= "font-size:15px;font-family: 'Do Hyeon', sans-serif;"> 15 +
16 - <h2>${title}</h2> 16 + <h2><font color="black">${title}<br><div style= "font-size:20px;font-family: 'Do Hyeon', sans-serif;">${description}</font></div></h2>
17 - <p>${description}</p>
18 </div> 17 </div>
18 +
19 <style> 19 <style>
20 .map_wrap, .map_wrap * {margin:0;padding:0;font-family:'Malgun Gothic',dotum,'돋움',sans-serif;font-size:12px;} 20 .map_wrap, .map_wrap * {margin:0;padding:0;font-family:'Malgun Gothic',dotum,'돋움',sans-serif;font-size:12px;}
21 .map_wrap a, .map_wrap a:hover, .map_wrap a:active{color:#000;text-decoration: none;} 21 .map_wrap a, .map_wrap a:hover, .map_wrap a:active{color:#000;text-decoration: none;}
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
31 <br><br><br><br> 31 <br><br><br><br>
32 ${body} 32 ${body}
33 33
34 - <div style= width:100%;font-size:9px;position:fixed;bottom:0;float:left;padding:0px;background-color:#cffdcf;> 34 + <div style= width:100%;font-size:9px;position:fixed;bottom:0;float:left;padding:0px;background-color:#ffffff;>
35 <h4><font color="white">Copyright(C) HealThProtector 2020</h4> 35 <h4><font color="white">Copyright(C) HealThProtector 2020</h4>
36 </div> 36 </div>
37 </body> 37 </body>
......
...@@ -29,6 +29,7 @@ module.exports = { ...@@ -29,6 +29,7 @@ module.exports = {
29 </div> 29 </div>
30 30
31 </style> 31 </style>
32 +
32 <div style="font-family: 'Do Hyeon', sans-serif;";> 33 <div style="font-family: 'Do Hyeon', sans-serif;";>
33 <h3 style=width:180px;float:left;><a href="/"><font color="black">HealthProtector</font></a></h3> 34 <h3 style=width:180px;float:left;><a href="/"><font color="black">HealthProtector</font></a></h3>
34 <h3 style=width:120px;float:left;><a href="/countKcal"><font color="black">칼로리 계산</font></a></h3> 35 <h3 style=width:120px;float:left;><a href="/countKcal"><font color="black">칼로리 계산</font></a></h3>
......