Showing
4 changed files
with
101 additions
and
118 deletions
contents/main
0 → 100644
1 | +<h1 style="width: 100%; text-align: center; font-size: 50px;">오늘은 얼마나 먹었어요?</h1> | ||
2 | + | ||
3 | + | ||
4 | + <br><br><br> | ||
5 | + | ||
6 | + <div id = "login-ing" style="width:100%; text-align: center; margin-top: 5ch"> | ||
7 | + <div class="form-inline"> | ||
8 | + <form action="/login" method="post"> | ||
9 | + <label>ID</label> | ||
10 | + <input type="text" name="name" class="form-control" placeholder="홍길동" style="width:200px;"> | ||
11 | +       | ||
12 | + | ||
13 | + <label>Password</label> | ||
14 | + <input type="password" name="birth" class="form-control" placeholder="*******" style="width:200px;"> | ||
15 | + <br><br><br> | ||
16 | + <input type="submit" value="Login" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;"> | ||
17 | + </form> | ||
18 | + <br><br> | ||
19 | + <form action="/signup" method="get"> | ||
20 | + <input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;"> | ||
21 | + </form> | ||
22 | + </div> | ||
23 | + | ||
24 | + </div> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
contents/signup
0 → 100644
1 | +<h1 style="width: 100%; text-align: center; font-size: 40px;">오늘은 얼마나 먹었어요?</h1> | ||
2 | + | ||
3 | + | ||
4 | + <br><br><br> | ||
5 | + | ||
6 | + <div id = "signup-ing" style="width:100%; text-align: center;"> | ||
7 | + <form action="/starting" method="post"> | ||
8 | + <div class="form-inline"> | ||
9 | + <div class="input-area"> | ||
10 | + <span class="input-label"> | ||
11 | + <label name="ID">ID</label> | ||
12 | + </span> | ||
13 | + <span class="input-box"> | ||
14 | + <input type="text" name="ID" > | ||
15 | + </span> | ||
16 | + </div> | ||
17 | + | ||
18 | + <div class="input-area"> | ||
19 | + <span class="input-label"> | ||
20 | + <label name="Password">Password</label> | ||
21 | + </span> | ||
22 | + <span class="input-box"> | ||
23 | + <input type="text" name="Password" > | ||
24 | + </span> | ||
25 | + </div> | ||
26 | + | ||
27 | + <div class="input-area"> | ||
28 | + <span class="input-label"> | ||
29 | + <label name="age">나이(세)</label> | ||
30 | + </span> | ||
31 | + <span class="input-box"> | ||
32 | + <input type="text" name="age" > | ||
33 | + </span> | ||
34 | + </div> | ||
35 | + | ||
36 | + <div class="input-area"> | ||
37 | + <span class="input-label"> | ||
38 | + <label name="male/female">성별</label> | ||
39 | + </span> | ||
40 | + <select id="male/female" style="width: 200px; "> | ||
41 | + <option>성별 선택</option> | ||
42 | + <option>남자</option> | ||
43 | + <option>여자</option> | ||
44 | + | ||
45 | + </select> | ||
46 | + </div> | ||
47 | + | ||
48 | + <div class="input-area"> | ||
49 | + <span class="input-label"> | ||
50 | + <label name="height">키(cm)</label> | ||
51 | + </span> | ||
52 | + <span class="input-box"> | ||
53 | + <input type="text" name="height" > | ||
54 | + </span> | ||
55 | + | ||
56 | + </div> | ||
57 | + | ||
58 | + <div class="input-area"> | ||
59 | + <span class="input-label"> | ||
60 | + <label name="weight">체중(kg)</label> | ||
61 | + </span> | ||
62 | + <span class="input-box"> | ||
63 | + <input type="text" name="weight" > | ||
64 | + </span> | ||
65 | + </div> | ||
66 | + | ||
67 | + <br><br><br> | ||
68 | + | ||
69 | + <input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;"> | ||
70 | + </div> | ||
71 | + </form> | ||
72 | + </div> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | module.exports = { | 1 | module.exports = { |
2 | - HTML:function(title,ch,line, list, body,control){ | 2 | + HTML:function(title,ch,line, body){ |
3 | return ` | 3 | return ` |
4 | <!DOCTYPE html> | 4 | <!DOCTYPE html> |
5 | <html lang="en"> | 5 | <html lang="en"> |
... | @@ -39,31 +39,12 @@ module.exports = { | ... | @@ -39,31 +39,12 @@ module.exports = { |
39 | <img src = "images/main_background.jpg" alt="" style="z-index:-1; min-width: 100%; height: 700px;"></img> | 39 | <img src = "images/main_background.jpg" alt="" style="z-index:-1; min-width: 100%; height: 700px;"></img> |
40 | <div id="banner"> | 40 | <div id="banner"> |
41 | ${body} | 41 | ${body} |
42 | - | ||
43 | - | ||
44 | - <br><br><br> | ||
45 | - | ||
46 | - | ||
47 | - | ||
48 | - ${control} | ||
49 | - | ||
50 | - | ||
51 | - | ||
52 | </div> | 42 | </div> |
53 | 43 | ||
54 | <div id="footer">오픈소스SW Project 2019-1 고다경 김용재 김태희</div> | 44 | <div id="footer">오픈소스SW Project 2019-1 고다경 김용재 김태희</div> |
55 | </body> | 45 | </body> |
56 | </html> | 46 | </html> |
57 | `; | 47 | `; |
58 | - },list:function(filelist){ | ||
59 | - var list = '<ul>'; | ||
60 | - var i = 0; | ||
61 | - while(i < filelist.length){ | ||
62 | - list = list + `<li><a href="/healthcare/${filelist[i]}">${filelist[i]}</a></li>`; | ||
63 | - i = i + 1; | ||
64 | - } | ||
65 | - list = list+'</ul>'; | ||
66 | - return list; | ||
67 | } | 48 | } |
68 | } | 49 | } |
69 | 50 | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -8,113 +8,19 @@ var template = require('./lib/template.js'); | ... | @@ -8,113 +8,19 @@ var template = require('./lib/template.js'); |
8 | 8 | ||
9 | app.use(express.static('data')); | 9 | app.use(express.static('data')); |
10 | app.get('/', function(request, response) { | 10 | app.get('/', function(request, response) { |
11 | - fs.readdir('./data', function(error, filelist){ | 11 | + fs.readFile('./contents/main', function(error, body){ |
12 | var title = 'Health Care'; | 12 | var title = 'Health Care'; |
13 | - var description = '오늘은 얼마나 먹었어요?'; | ||
14 | - var list = template.list(filelist); | ||
15 | var ch='15ch' | 13 | var ch='15ch' |
16 | - var html = template.HTML(title,ch,'', list, | 14 | + var html = template.HTML(title,ch,'',body); |
17 | - `<h1 style="font-size: 50px; text-align: center; ">${description}</h1>`, | ||
18 | - `<div id = "login-ing" style="width:100%; text-align: center; margin-top: 5ch"> | ||
19 | - <div class="form-inline"> | ||
20 | - <form action="/login" method="post"> | ||
21 | - <label>ID</label> | ||
22 | - <input type="text" name="name" class="form-control" placeholder="홍길동" style="width:200px;"> | ||
23 | -       | ||
24 | - | ||
25 | - <label>Password</label> | ||
26 | - <input type="password" name="birth" class="form-control" placeholder="*******" style="width:200px;"> | ||
27 | - <br><br><br> | ||
28 | - <input type="submit" value="Login" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;"> | ||
29 | - </form> | ||
30 | - <br><br> | ||
31 | - <form action="/signup" method="get"> | ||
32 | - <input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;"> | ||
33 | - </form> | ||
34 | - </div> | ||
35 | - | ||
36 | -</div>` | ||
37 | - ); | ||
38 | response.send(html); | 15 | response.send(html); |
39 | }); | 16 | }); |
40 | }); | 17 | }); |
41 | 18 | ||
42 | app.get('/signup', function(request, response) { | 19 | app.get('/signup', function(request, response) { |
43 | - fs.readdir('./data', function(error, filelist){ | 20 | + fs.readFile('./contents/signup', function(error, body){ |
44 | var title = 'Sign Up Page'; | 21 | var title = 'Sign Up Page'; |
45 | - var description = '오늘은 얼마나 먹었어요?'; | ||
46 | - var list = template.list(filelist); | ||
47 | var ch='5ch' | 22 | var ch='5ch' |
48 | - var html = template.HTML(title,ch,`<link rel="stylesheet" type="text/css" href="./a.css" />`, list, | 23 | + var html = template.HTML(title,ch,`<link rel="stylesheet" type="text/css" href="./a.css" />`,body); |
49 | - `<h1 style="width: 100%; text-align: center; font-size: 40px;">${description}</h1>`, | ||
50 | -`<div id = "signup-ing" style="width:100%; text-align: center;"> | ||
51 | -<form action="/starting" method="post"> | ||
52 | - <div class="form-inline"> | ||
53 | - <div class="input-area"> | ||
54 | - <span class="input-label"> | ||
55 | - <label name="ID">ID</label> | ||
56 | - </span> | ||
57 | - <span class="input-box"> | ||
58 | - <input type="text" name="ID" > | ||
59 | - </span> | ||
60 | - </div> | ||
61 | - | ||
62 | - <div class="input-area"> | ||
63 | - <span class="input-label"> | ||
64 | - <label name="Password">Password</label> | ||
65 | - </span> | ||
66 | - <span class="input-box"> | ||
67 | - <input type="text" name="Password" > | ||
68 | - </span> | ||
69 | - </div> | ||
70 | - | ||
71 | - <div class="input-area"> | ||
72 | - <span class="input-label"> | ||
73 | - <label name="age">나이(세)</label> | ||
74 | - </span> | ||
75 | - <span class="input-box"> | ||
76 | - <input type="text" name="age" > | ||
77 | - </span> | ||
78 | - </div> | ||
79 | - | ||
80 | - <div class="input-area"> | ||
81 | - <span class="input-label"> | ||
82 | - <label name="male/female">성별</label> | ||
83 | - </span> | ||
84 | - <select id="male/female" style="width: 200px; "> | ||
85 | - <option>성별 선택</option> | ||
86 | - <option>남자</option> | ||
87 | - <option>여자</option> | ||
88 | - | ||
89 | - </select> | ||
90 | - </div> | ||
91 | - | ||
92 | - <div class="input-area"> | ||
93 | - <span class="input-label"> | ||
94 | - <label name="height">키(cm)</label> | ||
95 | - </span> | ||
96 | - <span class="input-box"> | ||
97 | - <input type="text" name="height" > | ||
98 | - </span> | ||
99 | - | ||
100 | - </div> | ||
101 | - | ||
102 | - <div class="input-area"> | ||
103 | - <span class="input-label"> | ||
104 | - <label name="weight">체중(kg)</label> | ||
105 | - </span> | ||
106 | - <span class="input-box"> | ||
107 | - <input type="text" name="weight" > | ||
108 | - </span> | ||
109 | - </div> | ||
110 | - | ||
111 | - <br><br><br> | ||
112 | - | ||
113 | - <input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;"> | ||
114 | - </div> | ||
115 | -</form> | ||
116 | -</div>` | ||
117 | - ); | ||
118 | response.send(html); | 24 | response.send(html); |
119 | }); | 25 | }); |
120 | }); | 26 | }); | ... | ... |
-
Please register or login to post a comment