Toggle navigation
Toggle navigation
This project
Loading...
Sign in
고다경
/
Open_Source_project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김용재
2019-06-05 12:17:38 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
563c7cb9218a99961de54d5f980439f26784f99f
563c7cb9
1 parent
ce7fb93a
메인페이지 정리
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
118 deletions
contents/main
contents/signup
lib/template.js
main.js
contents/main
0 → 100644
View file @
563c7cb
<h1 style="width: 100%; text-align: center; font-size: 50px;">오늘은 얼마나 먹었어요?</h1>
<br><br><br>
<div id = "login-ing" style="width:100%; text-align: center; margin-top: 5ch">
<div class="form-inline">
<form action="/login" method="post">
<label>ID</label>
<input type="text" name="name" class="form-control" placeholder="홍길동" style="width:200px;">
     
<label>Password</label>
<input type="password" name="birth" class="form-control" placeholder="*******" style="width:200px;">
<br><br><br>
<input type="submit" value="Login" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
</form>
<br><br>
<form action="/signup" method="get">
<input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
</form>
</div>
</div>
\ No newline at end of file
contents/signup
0 → 100644
View file @
563c7cb
<h1 style="width: 100%; text-align: center; font-size: 40px;">오늘은 얼마나 먹었어요?</h1>
<br><br><br>
<div id = "signup-ing" style="width:100%; text-align: center;">
<form action="/starting" method="post">
<div class="form-inline">
<div class="input-area">
<span class="input-label">
<label name="ID">ID</label>
</span>
<span class="input-box">
<input type="text" name="ID" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="Password">Password</label>
</span>
<span class="input-box">
<input type="text" name="Password" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="age">나이(세)</label>
</span>
<span class="input-box">
<input type="text" name="age" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="male/female">성별</label>
</span>
<select id="male/female" style="width: 200px; ">
<option>성별 선택</option>
<option>남자</option>
<option>여자</option>
</select>
</div>
<div class="input-area">
<span class="input-label">
<label name="height">키(cm)</label>
</span>
<span class="input-box">
<input type="text" name="height" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="weight">체중(kg)</label>
</span>
<span class="input-box">
<input type="text" name="weight" >
</span>
</div>
<br><br><br>
<input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
</div>
</form>
</div>
\ No newline at end of file
lib/template.js
View file @
563c7cb
module
.
exports
=
{
HTML
:
function
(
title
,
ch
,
line
,
list
,
body
,
control
){
HTML
:
function
(
title
,
ch
,
line
,
body
){
return
`
<!DOCTYPE html>
<html lang="en">
...
...
@@ -39,31 +39,12 @@ module.exports = {
<img src = "images/main_background.jpg" alt="" style="z-index:-1; min-width: 100%; height: 700px;"></img>
<div id="banner">
${
body
}
<br><br><br>
${
control
}
</div>
<div id="footer">오픈소스SW Project 2019-1 고다경 김용재 김태희</div>
</body>
</html>
`
;
},
list
:
function
(
filelist
){
var
list
=
'<ul>'
;
var
i
=
0
;
while
(
i
<
filelist
.
length
){
list
=
list
+
`<li><a href="/healthcare/
${
filelist
[
i
]}
">
${
filelist
[
i
]}
</a></li>`
;
i
=
i
+
1
;
}
list
=
list
+
'</ul>'
;
return
list
;
}
}
\ No newline at end of file
...
...
main.js
View file @
563c7cb
...
...
@@ -8,113 +8,19 @@ var template = require('./lib/template.js');
app
.
use
(
express
.
static
(
'data'
));
app
.
get
(
'/'
,
function
(
request
,
response
)
{
fs
.
read
dir
(
'./data'
,
function
(
error
,
filelist
){
fs
.
read
File
(
'./contents/main'
,
function
(
error
,
body
){
var
title
=
'Health Care'
;
var
description
=
'오늘은 얼마나 먹었어요?'
;
var
list
=
template
.
list
(
filelist
);
var
ch
=
'15ch'
var
html
=
template
.
HTML
(
title
,
ch
,
''
,
list
,
`<h1 style="font-size: 50px; text-align: center; ">
${
description
}
</h1>`
,
`<div id = "login-ing" style="width:100%; text-align: center; margin-top: 5ch">
<div class="form-inline">
<form action="/login" method="post">
<label>ID</label>
<input type="text" name="name" class="form-control" placeholder="홍길동" style="width:200px;">
     
<label>Password</label>
<input type="password" name="birth" class="form-control" placeholder="*******" style="width:200px;">
<br><br><br>
<input type="submit" value="Login" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
</form>
<br><br>
<form action="/signup" method="get">
<input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
</form>
</div>
</div>`
);
var
html
=
template
.
HTML
(
title
,
ch
,
''
,
body
);
response
.
send
(
html
);
});
});
app
.
get
(
'/signup'
,
function
(
request
,
response
)
{
fs
.
read
dir
(
'./data'
,
function
(
error
,
filelist
){
fs
.
read
File
(
'./contents/signup'
,
function
(
error
,
body
){
var
title
=
'Sign Up Page'
;
var
description
=
'오늘은 얼마나 먹었어요?'
;
var
list
=
template
.
list
(
filelist
);
var
ch
=
'5ch'
var
html
=
template
.
HTML
(
title
,
ch
,
`<link rel="stylesheet" type="text/css" href="./a.css" />`
,
list
,
`<h1 style="width: 100%; text-align: center; font-size: 40px;">
${
description
}
</h1>`
,
`<div id = "signup-ing" style="width:100%; text-align: center;">
<form action="/starting" method="post">
<div class="form-inline">
<div class="input-area">
<span class="input-label">
<label name="ID">ID</label>
</span>
<span class="input-box">
<input type="text" name="ID" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="Password">Password</label>
</span>
<span class="input-box">
<input type="text" name="Password" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="age">나이(세)</label>
</span>
<span class="input-box">
<input type="text" name="age" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="male/female">성별</label>
</span>
<select id="male/female" style="width: 200px; ">
<option>성별 선택</option>
<option>남자</option>
<option>여자</option>
</select>
</div>
<div class="input-area">
<span class="input-label">
<label name="height">키(cm)</label>
</span>
<span class="input-box">
<input type="text" name="height" >
</span>
</div>
<div class="input-area">
<span class="input-label">
<label name="weight">체중(kg)</label>
</span>
<span class="input-box">
<input type="text" name="weight" >
</span>
</div>
<br><br><br>
<input type="submit" value="Sign Up" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
</div>
</form>
</div>`
);
var
html
=
template
.
HTML
(
title
,
ch
,
`<link rel="stylesheet" type="text/css" href="./a.css" />`
,
body
);
response
.
send
(
html
);
});
});
...
...
Please
register
or
login
to post a comment