양효빈

코드 최적화, 폰트 수정, 전체적인 디자인 수정

...@@ -4,7 +4,7 @@ var db = require('./db.js'); ...@@ -4,7 +4,7 @@ var db = require('./db.js');
4 const { type } = require('jquery'); 4 const { type } = require('jquery');
5 exports.countKcal = function(request, response){ 5 exports.countKcal = function(request, response){
6 var title = '칼로리 계산'; 6 var title = '칼로리 계산';
7 - var description = '맞춤 권장 칼로리와 섭취 음식 칼로리 중 하나를 선택해 주세요.'; 7 + var description = '맞춤 권장 칼로리 계산과 섭취 음식 칼로리 계산 중 하나를 선택해 주세요.';
8 var url = "./" 8 var url = "./"
9 var html = template.html(title,` 9 var html = template.html(title,`
10 <head> 10 <head>
...@@ -65,33 +65,36 @@ exports.countKcal = function(request, response){ ...@@ -65,33 +65,36 @@ exports.countKcal = function(request, response){
65 } 65 }
66 exports.countKcal_body = function(request, response){ 66 exports.countKcal_body = function(request, response){
67 var title = '맞춤 권장 칼로리 계산'; 67 var title = '맞춤 권장 칼로리 계산';
68 - var description = '개인의 신체 정보에 맞는 일일 권장 섭취량(kcal)를 알려드립니다!'; 68 + var description = '개인의 신체 정보와 목표에 맞는 일일 권장 섭취량(kcal)를 알려드립니다!';
69 var html = template.html(title,` 69 var html = template.html(title,`
70 +
70 <div style= "font-size:20px;"> 71 <div style= "font-size:20px;">
71 72
72 <h2><font color="black">${title}<br><div style= "font-size:20px;"><br>${description}</font></div></h2> 73 <h2><font color="black">${title}<br><div style= "font-size:20px;"><br>${description}</font></div></h2>
73 <form action="/countKcal_body_process" method="post" > 74 <form action="/countKcal_body_process" method="post" >
74 - 성별 :<br /> 75 + <h3 id="info">
75 - <select name="gender"> 76 + 성별 :<br />
76 - <option value="man">남자</option> 77 + <select name="gender">
77 - <option value="woman">여자</option></select 78 + <option value="man">남자</option>
78 - ><br /> 79 + <option value="woman">여자</option></select
79 - 나이(세) : <br /> 80 + ><br />
80 - <input type="text" name="age"placeholder="현재 나이를 입력하세요." /><br /> 81 + 나이(세) : <br />
81 - 키(cm) : <br /> 82 + <input type="text" name="age"placeholder="현재 나이를 입력하세요." /><br />
82 - <input type="text" name="height" placeholder="현재 키(cm)를 입력하세요."/><br /> 83 + 키(cm) : <br />
83 - 몸무게(kg) : <br /><input type="text" name="weight" placeholder="현재 몸무게를 입력하세요." /><br /> 84 + <input type="text" name="height" placeholder="현재 키(cm)를 입력하세요."/><br />
84 - 목표체중(kg) : <br /><input type="text" name="targetWeight" placeholder="목표 체중(kg)을 입력하세요." /><br /> 85 + 몸무게(kg) : <br /><input type="text" name="weight" placeholder="현재 몸무게를 입력하세요." /><br />
85 - 목표기간(일) : <br /><input type="text" name="targetDay" placeholder="목표 기간을 입력하세요."/><br /> 86 + 목표체중(kg) : <br /><input type="text" name="targetWeight" placeholder="목표 체중(kg)을 입력하세요." /><br />
86 - 활동량 :<br /> 87 + 목표기간(일) : <br /><input type="text" name="targetDay" placeholder="목표 기간을 입력하세요."/><br />
87 - <select name="activity"> 88 + 활동량 :<br />
88 - <option value="low">앉아 있거나 가벼운 활동(운동을 거의 또는 전혀하지 않음)</option> 89 + <select name="activity">
89 - <option value="mid">활동적 또는 보통 활동(건설노동자 또는 매일 1시간씩 달림)</option> 90 + <option value="low">앉아 있거나 가벼운 활동(운동을 거의 또는 전혀하지 않음)</option>
90 - <option value="high">많은 활동(농업노동자 또는 매일 2시간동안 수영을 함)</option> 91 + <option value="mid">활동적 또는 보통 활동(건설노동자 또는 매일 1시간씩 달림)</option>
91 - </select 92 + <option value="high">많은 활동(농업노동자 또는 매일 2시간동안 수영을 함)</option>
92 - ><br /><br> 93 + </select
93 - <input type="submit" value="계산하기" style="font-size:20px;" /> 94 + ><br /><br>
94 - </div> 95 + <input type="submit" value="계산하기" style="font-size:20px;" />
96 + </div>
97 + </h3>
95 <br><br><br><br> 98 <br><br><br><br>
96 </form>` ); 99 </form>` );
97 response.writeHead(200); 100 response.writeHead(200);
...@@ -104,8 +107,8 @@ exports.countKcal_body_process = function(request, response){ ...@@ -104,8 +107,8 @@ exports.countKcal_body_process = function(request, response){
104 }); 107 });
105 request.on('end', function(){ 108 request.on('end', function(){
106 var post = qs.parse(body); 109 var post = qs.parse(body);
107 - var title = '바디 칼로리 계산'; 110 + var title = '맞춤 권장 칼로리 계산 결과';
108 - var description = '성별, 키, 몸무게, 활동량을 입력하시면 표준체중, 현재 체중을 유지하는데 필요한 열량, 다이어트 열량을 알려드립니다!'; 111 + var description = '개인의 신체 정보와 목표를 바탕으로 계산한 표준체중, 현재 체중을 유지하는데 필요한 열량, 다이어트 열량 입니다.';
109 var gender = post.gender; //성별 112 var gender = post.gender; //성별
110 var age = post.age; //나이 113 var age = post.age; //나이
111 var height = post.height; //키 114 var height = post.height; //키
...@@ -262,11 +265,13 @@ exports.countKcal_body_process = function(request, response){ ...@@ -262,11 +265,13 @@ exports.countKcal_body_process = function(request, response){
262 } 265 }
263 exports.countKcal_food = function(request,response){ 266 exports.countKcal_food = function(request,response){
264 var title = '음식 칼로리 계산'; 267 var title = '음식 칼로리 계산';
265 - var description = '오늘 먹은 음식의 총 칼로리를 계산해드립니다!'; 268 + var description = ' - 오늘 먹은 음식의 총 칼로리를 계산해드립니다!';
266 var html = template.html(title,` 269 var html = template.html(title,`
267 - <h2>${title}</h2> 270 + <br>
268 - <p>${description}</p> 271 + <h2>&nbsp;&nbsp;${title}</h2>
272 + <p>&nbsp;&nbsp;${description}</p>
269 <form action="/countKcal_food_process" method="post"> 273 <form action="/countKcal_food_process" method="post">
274 + &nbsp;&nbsp;
270 <input type = 'text' name = 'search' placeholder = '검색어 입력' maxlength = 255 value = "" autocomplete = "off"> 275 <input type = 'text' name = 'search' placeholder = '검색어 입력' maxlength = 255 value = "" autocomplete = "off">
271 <button type = "submit" name = "click">검색</button> 276 <button type = "submit" name = "click">검색</button>
272 </form> 277 </form>
......
...@@ -2,12 +2,14 @@ var template = require('./template.js'); ...@@ -2,12 +2,14 @@ var template = require('./template.js');
2 var qs = require('querystring'); 2 var qs = require('querystring');
3 var db = require('./db.js'); 3 var db = require('./db.js');
4 exports.foodInfo = function(request, response){ 4 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 - <h2>${title}</h2> 8 + <br><br>
9 - <p>${description}</p> 9 + <h2>&nbsp;&nbsp;${title}</h2>
10 + <p>&nbsp;&nbsp;&nbsp;&nbsp;${description}</p>
10 <form action="/foodInfo_search" method="post"> 11 <form action="/foodInfo_search" method="post">
12 + &nbsp;&nbsp;
11 <input type = 'text' name = 'search' placeholder = '검색어 입력' maxlength = 255 value = "" autocomplete = "off"> 13 <input type = 'text' name = 'search' placeholder = '검색어 입력' maxlength = 255 value = "" autocomplete = "off">
12 <button type = "submit" name = "click">검색</button> 14 <button type = "submit" name = "click">검색</button>
13 </form> 15 </form>
...@@ -66,8 +68,8 @@ exports.foodInfo_search = function(request, response){ ...@@ -66,8 +68,8 @@ exports.foodInfo_search = function(request, response){
66 request.on('end', function(){ 68 request.on('end', function(){
67 var post = qs.parse(body); 69 var post = qs.parse(body);
68 db.query(`SELECT * FROM fooddb`, function (error, foodInfo) { 70 db.query(`SELECT * FROM fooddb`, function (error, foodInfo) {
69 - var title = '음식 영양정보'; 71 + var title = '식품 영양정보';
70 - var description = '음식을 검색하면 음식의 칼로리, 탄수화물, 단백질, 지방, 나트륨의 정보를 알려드립니다!'; 72 + var description = '- 입력한 음식의 영양 정보(칼로리, 단백질, 지방, 탄수화물, 나트륨)를 알려드립니다!';
71 var search = post.search; // 검색어 73 var search = post.search; // 검색어
72 var num = 0; // 검색된 개수 74 var num = 0; // 검색된 개수
73 var foodName = ''; 75 var foodName = '';
...@@ -81,6 +83,7 @@ exports.foodInfo_search = function(request, response){ ...@@ -81,6 +83,7 @@ exports.foodInfo_search = function(request, response){
81 } 83 }
82 } 84 }
83 var html = template.html(title,` 85 var html = template.html(title,`
86 + <br><br>
84 <h2>${title}</h2> 87 <h2>${title}</h2>
85 <p>${description}</p> 88 <p>${description}</p>
86 <form action="/foodInfo_search" method="post"> 89 <form action="/foodInfo_search" method="post">
......
1 var template = require('./template.js'); 1 var template = require('./template.js');
2 exports.home = function(request, response){ 2 exports.home = function(request, response){
3 - var title = 'HealthProtector란?'; 3 + var title = 'home';
4 var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고, 좋아하는 음식을 검색하면 영양정보를 알려주는 사이트 입니다.'; 4 var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고, 좋아하는 음식을 검색하면 영양정보를 알려주는 사이트 입니다.';
5 var html = template.html(title,` 5 var html = template.html(title,`
6 - <style>
7 - @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
8 -
9 - </style>
10 - <script src="https://use.fontawesome.com/releases/v5.2.0/js/all.js"></script>
11 -
12 - <style type="text/css">
13 - div{
14 - text-align:center;
15 - border:0px solid none;
16 - margin:0px 0px 0px 0px;
17 -
18 - }
19 - a { text-decoration:none; }
20 - a:visited { text-decoration: none; }
21 - a:hover { text-decoration: none; }
22 - a:focus { text-decoration: none; }
23 - a:hover, a:active { text-decoration: none; }
24 - }
25 - </div>
26 - </style>
27 <div style= font-size:40px;background-image:url("https://source.unsplash.com/jFCViYFYcus");padding:50px;> 6 <div style= font-size:40px;background-image:url("https://source.unsplash.com/jFCViYFYcus");padding:50px;>
28 7
29 - <h1 style=font-family: 'Do Hyeon', sans-serif;><a href="/"><font color="white">HealthProtector</font></a></h1> 8 + <h1 style="font-family: 'Trade Winds', cursive;"><a href="/"><font color="white">Health Protector</font></a></h1>
30 9
31 </div> 10 </div>
32 <div style= font-size:20px;text-align:left;width: 100%;float:left:> 11 <div style= font-size:20px;text-align:left;width: 100%;float:left:>
...@@ -37,24 +16,24 @@ exports.home = function(request, response){ ...@@ -37,24 +16,24 @@ exports.home = function(request, response){
37 <div style="color : gray";> 16 <div style="color : gray";>
38 <i class="fas fa-calculator fa-3x"></i> 17 <i class="fas fa-calculator fa-3x"></i>
39 </div> 18 </div>
40 - <h2 style=font-family: 'Do Hyeon', sans-serif;><a href="/countKcal"><font color="black">칼로리 계산</font></a></h2> 19 + <h2><a href="/countKcal"><font color="black">칼로리 계산</font></a></h2>
41 - <h4 style=font-family: 'Do Hyeon', sans-serif;><font color="gray">나에게 맞는 일일 권장 섭취량(kcal)을 계산해보세요!</font></h4> 20 + <h4><font color="gray">나에게 맞는 일일 권장 섭취량(kcal)을 계산해보세요!</font></h4>
42 -
43 </div> 21 </div>
44 22
45 <div style= width:33%;float:right;padding:5px;> 23 <div style= width:33%;float:right;padding:5px;>
46 <div style="color : gray";> 24 <div style="color : gray";>
47 <i class="fas fa-book fa-3x"></i> 25 <i class="fas fa-book fa-3x"></i>
48 </div> 26 </div>
49 - <h2 style=font-family: 'Do Hyeon', sans-serif;><a href="/foodInfo"><font color="black">음식별 영양정보</font></a></h2> 27 + <h2><a href="/foodInfo"><font color="black">음식별 영양정보</font></a></h2>
50 - <h4 style=font-family: 'Do Hyeon', sans-serif;><font color="gray">음식별 식품 영양정보에 대해 알려드립니다!</font></h4> 28 + <h4><font color="gray">음식별 식품 영양정보에 대해 알려드립니다!</font></h4>
51 </div> 29 </div>
30 +
52 <div style= width:33%;float:right;padding:5px;> 31 <div style= width:33%;float:right;padding:5px;>
53 <div style="color : gray";> 32 <div style="color : gray";>
54 <i class="fas fa-location-arrow fa-3x"></i> 33 <i class="fas fa-location-arrow fa-3x"></i>
55 </div> 34 </div>
56 - <h2 style=font-family: 'Do Hyeon', sans-serif;><a href="/searchGym"><font color="black">헬스장 찾기</font></a></h2> 35 + <h2><a href="/searchGym"><font color="black">헬스장 찾기</font></a></h2>
57 - <h4 style=font-family: 'Do Hyeon', sans-serif;><font color="gray">위치를 입력하면 그 주위의 헬스장을 찾아드립니다!</font></h4> 36 + <h4><font color="gray">위치를 입력하면 그 주위의 헬스장을 찾아드립니다!</font></h4>
58 </div> 37 </div>
59 <br><br><br><br><br><br><br><br> 38 <br><br><br><br><br><br><br><br>
60 ` ); 39 ` );
......
1 var template = require('./template.js'); 1 var template = require('./template.js');
2 exports.info = function(request, response){ 2 exports.info = function(request, response){
3 - var title = 'HealthProtector'; 3 + var title = 'Health Protector';
4 var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고,<br> 좋아하는 음식을 검색하면 영양정보를 알려주는 등 <br> 사용자의 건강을 지켜주는 사이트 입니다.'; 4 var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고,<br> 좋아하는 음식을 검색하면 영양정보를 알려주는 등 <br> 사용자의 건강을 지켜주는 사이트 입니다.';
5 var html = template.html(title,` 5 var html = template.html(title,`
6 - <style>
7 - @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
8 - </style>
9 - <style type="text/css">
10 - div{
11 - text-align:center;
12 - border:0px solid none;
13 - margin:0px 0px 0px 0px;
14 -
15 - }
16 - #info{
17 - font-family: 'Do Hyeon', sans-serif;
18 - }
19 - </style>
20 <br><br><br> 6 <br><br><br>
21 - <div style= font-size:20px; "font-family: 'Do Hyeon', sans-serif;"> 7 + <div style= "font-family: 'Trade Winds', cursive;">
22 <h1>${title}</h1> 8 <h1>${title}</h1>
9 + </div>
10 +
11 + <div id="info" style= font-size:20px;>
23 <hr style= "width : 200px;height:2px;background-color:black"> 12 <hr style= "width : 200px;height:2px;background-color:black">
24 <h3>${description}</h3> 13 <h3>${description}</h3>
25 </div> 14 </div>
26 <br> 15 <br>
27 16
28 -
29 <div id= "info" > 17 <div id= "info" >
30 <h1>Contact</h1> 18 <h1>Contact</h1>
31 <hr style= "width : 145px;height:2px;background-color:black"> 19 <hr style= "width : 145px;height:2px;background-color:black">
...@@ -34,15 +22,6 @@ exports.info = function(request, response){ ...@@ -34,15 +22,6 @@ exports.info = function(request, response){
34 <h2 style="marin:0px;margin-top: 0px;margin-bottom: 0px;">김동진 &emsp;&emsp;&emsp; &emsp;&emsp;&emsp; &nbsp; 양효빈</h2> 22 <h2 style="marin:0px;margin-top: 0px;margin-bottom: 0px;">김동진 &emsp;&emsp;&emsp; &emsp;&emsp;&emsp; &nbsp; 양효빈</h2>
35 <h3 style= "margin-top: 0px;margin-bottom: 0px;">&nbsp;rlaehdwls310@khu.ac.kr&emsp;&emsp;&emsp;&emsp;qls0786@khu.ac.kr&emsp;</h3> 23 <h3 style= "margin-top: 0px;margin-bottom: 0px;">&nbsp;rlaehdwls310@khu.ac.kr&emsp;&emsp;&emsp;&emsp;qls0786@khu.ac.kr&emsp;</h3>
36 </div> 24 </div>
37 -
38 -
39 -
40 -
41 -
42 -
43 -
44 -
45 -
46 ` ); 25 ` );
47 26
48 response.writeHead(200); 27 response.writeHead(200);
......
...@@ -2,13 +2,11 @@ var template = require('./template.js'); ...@@ -2,13 +2,11 @@ var template = require('./template.js');
2 var key = require('./appkey.js'); 2 var key = require('./appkey.js');
3 exports.searchGym = function(request, response){ 3 exports.searchGym = function(request, response){
4 var title = '헬스장 찾기'; 4 var title = '헬스장 찾기';
5 - var description = '위치를 입력하면 그 주위의 헬스장을 찾아드립니다!'; 5 + var description = '원하는 장소를 입력하면 그 주변의 헬스장 위치 정보를 알려드립니다!';
6 var html = template.html(title,` 6 var html = template.html(title,`
7 - <style> 7 +
8 - @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
9 - </style>
10 <div style= "font-size:25px; background-color:#ffffff"> 8 <div style= "font-size:25px; background-color:#ffffff">
11 - <h2><font color="black">${title}<br><div style= "font-size:20px;font-family: 'Do Hyeon', sans-serif;">${description}</font></div></h2> 9 + <h2><font color="black">${title}<br><div style= "font-size:20px;">${description}</font></div></h2>
12 </div> 10 </div>
13 <style> 11 <style>
14 .map_wrap, .map_wrap * {margin:0;padding:0;font-family:'Malgun Gothic',dotum,'돋움',sans-serif;font-size:12px;} 12 .map_wrap, .map_wrap * {margin:0;padding:0;font-family:'Malgun Gothic',dotum,'돋움',sans-serif;font-size:12px;}
......
...@@ -4,20 +4,20 @@ module.exports = { ...@@ -4,20 +4,20 @@ module.exports = {
4 <!DOCTYPE html> 4 <!DOCTYPE html>
5 <html> 5 <html>
6 <head> 6 <head>
7 - <title>HelP - ${title}</title> 7 + <title>HealthProtector - ${title}</title>
8 <meta charset="utf-8" /> 8 <meta charset="utf-8" />
9 <style> 9 <style>
10 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap'); 10 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
11 + @import url('https://fonts.googleapis.com/css2?family=Trade+Winds&display=swap');
12 + </head>
11 </style> 13 </style>
12 <script 14 <script
13 src="https://code.jquery.com/jquery-3.5.1.js" 15 src="https://code.jquery.com/jquery-3.5.1.js"
14 integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" 16 integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
15 crossorigin="anonymous"></script> 17 crossorigin="anonymous"></script>
16 <script src="https://use.fontawesome.com/releases/v5.2.0/js/all.js"></script> 18 <script src="https://use.fontawesome.com/releases/v5.2.0/js/all.js"></script>
17 -
18 </head> 19 </head>
19 <body> 20 <body>
20 -
21 <style type="text/css"> 21 <style type="text/css">
22 div{ 22 div{
23 text-align:center; 23 text-align:center;
...@@ -27,26 +27,32 @@ module.exports = { ...@@ -27,26 +27,32 @@ module.exports = {
27 } 27 }
28 a { text-decoration:none } 28 a { text-decoration:none }
29 } 29 }
30 - </div> 30 + #help{
31 + font-family: 'Trade Winds', cursive;
32 + }
33 + #info{
34 + font-family: 'Do Hyeon', sans-serif;
35 + }
36 +
31 </style> 37 </style>
32 - <div style="font-family: 'Do Hyeon', sans-serif;"> 38 + <div style="font-family: 'Trade Winds', cursive;">
33 - 39 + <h3 id ="helP" style=width:180px;float:left;><a href="/"><font color="#213b19">Health Protector</font></a></h3>
34 - <h3 style=width:180px;float:left;><a href="/"><font color="#213b19">HealthProtector</font></a></h3> 40 + </div>
35 - <h3 style=width:120px;float:left;><a href="/countKcal"><font color="#213b19">칼로리 계산</font></a></h3> 41 +
42 + <div id="info">
43 + <h3 style=width:130px;float:left;><a href="/countKcal"><font color="#213b19">칼로리 계산</font></a></h3>
36 <h3 style=width:120px;float:left;><a href="/searchGym"><font color="#213b19">헬스장 찾기</font></a></h3> 44 <h3 style=width:120px;float:left;><a href="/searchGym"><font color="#213b19">헬스장 찾기</font></a></h3>
37 <h3 style=width:120px;float:left;><a href="/foodInfo"><font color="#213b19">식품 영양정보</font></a></h3> 45 <h3 style=width:120px;float:left;><a href="/foodInfo"><font color="#213b19">식품 영양정보</font></a></h3>
38 -
39 <div style="color :#213b19";> 46 <div style="color :#213b19";>
40 <h3 style=width:160px;float:right;> 47 <h3 style=width:160px;float:right;>
41 <i class="fas fa-info-circle fa-3x"style="font-size: 20px;"></i><a href="/info"><font color="#213b19">&nbsp;Info</font></a></h3> 48 <i class="fas fa-info-circle fa-3x"style="font-size: 20px;"></i><a href="/info"><font color="#213b19">&nbsp;Info</font></a></h3>
42 </div> 49 </div>
43 </div> 50 </div>
44 51
45 -
46 <hr width = "100%" color ="#213b19" style=margin:0px;> 52 <hr width = "100%" color ="#213b19" style=margin:0px;>
47 ${body} 53 ${body}
48 <div style= width:100%;font-size:9px;position:fixed;bottom:0;float:left;padding:0px;background-color:#213b19;> 54 <div style= width:100%;font-size:9px;position:fixed;bottom:0;float:left;padding:0px;background-color:#213b19;>
49 - <h5><font color="white" font size = 2px;>Copyright(C) HealThProtector 2020</font></h5> 55 + <h5><font color="white" font size = 2px;>Copyright(C) HealthProtector 2020</font></h5>
50 </div> 56 </div>
51 </body> 57 </body>
52 </html> 58 </html>
......