김용재

메인페이지 정리

<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;">
&nbsp &nbsp&nbsp&nbsp
<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
<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
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
......
......@@ -8,113 +8,19 @@ var template = require('./lib/template.js');
app.use(express.static('data'));
app.get('/', function(request, response) {
fs.readdir('./data', function(error, filelist){
fs.readFile('./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;">
&nbsp &nbsp&nbsp&nbsp
<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.readdir('./data', function(error, filelist){
fs.readFile('./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);
});
});
......