양효빈

info 페이지 구현, countKcal수정, template.js 디자인 수정

This diff is collapsed. Click to expand it.
...@@ -5,18 +5,15 @@ exports.foodInfo = function(request, response){ ...@@ -5,18 +5,15 @@ 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>
9 <h2>${title}</h2> 8 <h2>${title}</h2>
10 <p>${description}</p> 9 <p>${description}</p>
11 <form action="/foodInfo_search" method="post"> 10 <form action="/foodInfo_search" method="post">
12 <input type = 'text' name = 'search' placeholder = '검색어 입력' maxlength = 255 value = "" autocomplete = "off"> 11 <input type = 'text' name = 'search' placeholder = '검색어 입력' maxlength = 255 value = "" autocomplete = "off">
13 <button type = "submit" name = "click">검색</button> 12 <button type = "submit" name = "click">검색</button>
14 </form> 13 </form>
15 -
16 `); 14 `);
17 response.writeHead(200); 15 response.writeHead(200);
18 response.end(html); 16 response.end(html);
19 -
20 } 17 }
21 function foodTable(foodInfo, list, num){ 18 function foodTable(foodInfo, list, num){
22 var tag = ''; 19 var tag = '';
...@@ -61,7 +58,6 @@ function foodTable(foodInfo, list, num){ ...@@ -61,7 +58,6 @@ function foodTable(foodInfo, list, num){
61 `; 58 `;
62 return tag; 59 return tag;
63 } 60 }
64 -
65 exports.foodInfo_search = function(request, response){ 61 exports.foodInfo_search = function(request, response){
66 var body = ''; 62 var body = '';
67 request.on('data', function(data){ 63 request.on('data', function(data){
...@@ -85,7 +81,6 @@ exports.foodInfo_search = function(request, response){ ...@@ -85,7 +81,6 @@ exports.foodInfo_search = function(request, response){
85 } 81 }
86 } 82 }
87 var html = template.html(title,` 83 var html = template.html(title,`
88 - <br><br><br>
89 <h2>${title}</h2> 84 <h2>${title}</h2>
90 <p>${description}</p> 85 <p>${description}</p>
91 <form action="/foodInfo_search" method="post"> 86 <form action="/foodInfo_search" method="post">
......
...@@ -3,9 +3,6 @@ exports.home = function(request, response){ ...@@ -3,9 +3,6 @@ exports.home = function(request, response){
3 var title = 'HealthProtector란?'; 3 var title = 'HealthProtector란?';
4 var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고, 좋아하는 음식을 검색하면 영양정보를 알려주는 사이트 입니다.'; 4 var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고, 좋아하는 음식을 검색하면 영양정보를 알려주는 사이트 입니다.';
5 var html = template.html(title,` 5 var html = template.html(title,`
6 -
7 - <br><br><br>
8 -
9 <style> 6 <style>
10 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap'); 7 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
11 8
...@@ -14,7 +11,6 @@ exports.home = function(request, response){ ...@@ -14,7 +11,6 @@ exports.home = function(request, response){
14 11
15 <style type="text/css"> 12 <style type="text/css">
16 div{ 13 div{
17 - @import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR&display=swap');
18 text-align:center; 14 text-align:center;
19 border:0px solid none; 15 border:0px solid none;
20 margin:0px 0px 0px 0px; 16 margin:0px 0px 0px 0px;
...@@ -28,8 +24,6 @@ exports.home = function(request, response){ ...@@ -28,8 +24,6 @@ exports.home = function(request, response){
28 } 24 }
29 </div> 25 </div>
30 </style> 26 </style>
31 -
32 -
33 <div style= font-size:40px;background-image:url("https://source.unsplash.com/jFCViYFYcus");padding:50px;> 27 <div style= font-size:40px;background-image:url("https://source.unsplash.com/jFCViYFYcus");padding:50px;>
34 28
35 <h1 style=font-family: 'Do Hyeon', sans-serif;><a href="/"><font color="white">HealthProtector</font></a></h1> 29 <h1 style=font-family: 'Do Hyeon', sans-serif;><a href="/"><font color="white">HealthProtector</font></a></h1>
...@@ -38,9 +32,7 @@ exports.home = function(request, response){ ...@@ -38,9 +32,7 @@ exports.home = function(request, response){
38 <div style= font-size:20px;text-align:left;width: 100%;float:left:> 32 <div style= font-size:20px;text-align:left;width: 100%;float:left:>
39 <h2><font color="black">&nbsp &nbsp &nbspOur Services</font></h2> 33 <h2><font color="black">&nbsp &nbsp &nbspOur Services</font></h2>
40 </div> 34 </div>
41 -
42 35
43 -
44 <div style= width:30%;float:left;padding:5px;> 36 <div style= width:30%;float:left;padding:5px;>
45 <div style="color : gray";> 37 <div style="color : gray";>
46 <i class="fas fa-calculator fa-3x"></i> 38 <i class="fas fa-calculator fa-3x"></i>
......
1 +var template = require('./template.js');
2 +exports.info = function(request, response){
3 + var title = 'HealthProtector란?';
4 + var description = '개개인의 신체 정보에 따라 일일 권장 섭취량을 알려주고, 좋아하는 음식을 검색하면 영양정보를 알려주는 사이트 입니다.';
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 + a { text-decoration:none; }
17 + a:visited { text-decoration: none; }
18 + a:hover { text-decoration: none; }
19 + a:focus { text-decoration: none; }
20 + a:hover, a:active { text-decoration: none; }
21 + }
22 + </div>
23 + </style>
24 + <br><br><br>
25 + <div style= font-size:20px; "font-family: 'Do Hyeon', sans-serif;">
26 + <h2>${title}</h2>
27 + <h3>${description}</h3>
28 + </div>
29 +
30 +
31 +
32 + ` );
33 +
34 + response.writeHead(200);
35 + response.end(html);
36 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -7,9 +7,7 @@ exports.searchGym = function(request, response){ ...@@ -7,9 +7,7 @@ exports.searchGym = function(request, response){
7 <style> 7 <style>
8 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap'); 8 @import url('https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap');
9 </style> 9 </style>
10 - <br><br>
11 <div style= "font-size:25px; background-color:#ffffff"> 10 <div style= "font-size:25px; background-color:#ffffff">
12 -
13 <h2><font color="black">${title}<br><div style= "font-size:20px;font-family: 'Do Hyeon', sans-serif;">${description}</font></div></h2> 11 <h2><font color="black">${title}<br><div style= "font-size:20px;font-family: 'Do Hyeon', sans-serif;">${description}</font></div></h2>
14 </div> 12 </div>
15 <style> 13 <style>
......
...@@ -13,12 +13,13 @@ module.exports = { ...@@ -13,12 +13,13 @@ module.exports = {
13 src="https://code.jquery.com/jquery-3.5.1.js" 13 src="https://code.jquery.com/jquery-3.5.1.js"
14 integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" 14 integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
15 crossorigin="anonymous"></script> 15 crossorigin="anonymous"></script>
16 + <script src="https://use.fontawesome.com/releases/v5.2.0/js/all.js"></script>
17 +
16 </head> 18 </head>
17 <body> 19 <body>
18 20
19 <style type="text/css"> 21 <style type="text/css">
20 div{ 22 div{
21 -
22 text-align:center; 23 text-align:center;
23 border:1px solid none; 24 border:1px solid none;
24 margin:0px 0px 0px 0px; 25 margin:0px 0px 0px 0px;
...@@ -28,17 +29,17 @@ module.exports = { ...@@ -28,17 +29,17 @@ module.exports = {
28 } 29 }
29 </div> 30 </div>
30 </style> 31 </style>
31 -
32 <div style="font-family: 'Do Hyeon', sans-serif;";> 32 <div style="font-family: 'Do Hyeon', sans-serif;";>
33 33
34 <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>
35 <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>
36 <h3 style=width:120px;float:left;><a href="/searchGym"><font color="black">헬스장 찾기</a></h3> 36 <h3 style=width:120px;float:left;><a href="/searchGym"><font color="black">헬스장 찾기</a></h3>
37 <h3 style=width:120px;float:left;><a href="/foodInfo"><font color="black">식품 영양정보</font></a></h3> 37 <h3 style=width:120px;float:left;><a href="/foodInfo"><font color="black">식품 영양정보</font></a></h3>
38 - <h3 style=width:150px;float:right;><a href="/"><font color="black">About us</font></a></h3> 38 +
39 + <h3 style=width:150px;float:right;><i class="fas fa-info-circle fa-3x"style="font-size: 20px";></i><a href="/info"><font color="black">&nbsp;Info</font></a></h3>
39 40
40 </div> 41 </div>
41 - 42 + <hr width = "100%" color ="#213b19" style=margin:0px;>
42 ${body} 43 ${body}
43 <div style= width:100%;font-size:9px;position:fixed;bottom:0;float:left;padding:0px;background-color:#213b19;> 44 <div style= width:100%;font-size:9px;position:fixed;bottom:0;float:left;padding:0px;background-color:#213b19;>
44 <h5><font color="white" font size = 2px;>Copyright(C) HealThProtector 2020</font></h5> 45 <h5><font color="white" font size = 2px;>Copyright(C) HealThProtector 2020</font></h5>
......
...@@ -4,6 +4,8 @@ var home = require('./lib/home.js'); ...@@ -4,6 +4,8 @@ var home = require('./lib/home.js');
4 var searchGym = require('./lib/searchGym.js'); 4 var searchGym = require('./lib/searchGym.js');
5 var foodInfo = require('./lib/foodInfo.js'); 5 var foodInfo = require('./lib/foodInfo.js');
6 var countKcal = require('./lib/countKcal.js'); 6 var countKcal = require('./lib/countKcal.js');
7 +var info = require('./lib/info.js');
8 +
7 /* 9 /*
8 const style={ 10 const style={
9 backgrondColor = 'blue', 11 backgrondColor = 'blue',
...@@ -43,6 +45,9 @@ var app = http.createServer(function(request,response){ ...@@ -43,6 +45,9 @@ var app = http.createServer(function(request,response){
43 else if(pathname === '/countKcal_food_process'){ 45 else if(pathname === '/countKcal_food_process'){
44 countKcal.countKcal_food_process(request,response); 46 countKcal.countKcal_food_process(request,response);
45 } 47 }
48 + else if(pathname === '/info'){
49 + info.info(request,response);
50 + }
46 else{ 51 else{
47 response.writeHead(404); 52 response.writeHead(404);
48 response.end("Not found"); 53 response.end("Not found");
......