重构,每个panel使用一个文件

This commit is contained in:
ykrc17
2015-02-27 00:06:04 +08:00
parent ce55862259
commit 00ead1e08d
7 changed files with 59 additions and 50 deletions

View File

@@ -3,7 +3,7 @@ var router = express.Router();
/* GET home page. */
router.get('/', function(req, res) {
res.render('index', { title: 'SimpleChat' });
res.render('index');
});
module.exports = router;

View File

@@ -1,56 +1,15 @@
extends layout
block title
title 懒货竞技场 | Lazy Fighters
block script
script(src='/socket.io/socket.io.js')
script(src='/js/game.js')
block content
div.container
div(id='net-panel').panel.panel-default
div.panel-body
p
| ping:
span(id='ping')
p
| 在线人数:
span(id='online-number')
div(id='attr-panel').panel.panel-primary
div.panel-body
p
| hp:
span(id='hp')
| /
span(id='max-hp')
p
| ATK:
span(id='atk')
p
| SPD:
span(id='spd')
div(id='move-panel').panel.panel-primary
div.panel-body
p
| x:
span(id='x')
p
| y:
span(id='y')
p(id='move-status')
| 剩余进度:
span(id='move-process')
| %
div(id = 'move-panel')
| 移动:
button(id="move-left") 左
button(id="move-up") 上
button(id="move-down") 下
button(id="move-right") 右
div(id = 'target-panel')
| 选择:
button(id="target-left") 左
button(id="target-up") 上
button(id="target-down") 下
button(id="target-right") 右
div(id = 'action-panel')
| 行动:
button(id='action-attack') 攻击
include ./panels/net-panel
include ./panels/character-panel
include ./panels/position-panel
include ./panels/action-panel

View File

@@ -2,7 +2,7 @@ doctype html
html
head
meta(charset='utf-8')
title= title
block title
link(rel='stylesheet', href='/css/bootstrap.min.css')
link(rel='stylesheet', href='/css/style.css')
block stylesheet

View File

@@ -0,0 +1,17 @@
div(id = 'action-panel').panel.panel-primary
div.panel-body
div
| 移动:
button(id="move-left") 左
button(id="move-up") 上
button(id="move-down") 下
button(id="move-right") 右
div
| 选择:
button(id="target-left") 左
button(id="target-up") 上
button(id="target-down") 下
button(id="target-right") 右
div
| 行动:
button(id='action-attack') 攻击

View File

@@ -0,0 +1,13 @@
div(id='attr-panel').panel.panel-primary
div.panel-body
p
| hp:
span(id='hp')
| /
span(id='max-hp')
p
| ATK:
span(id='atk')
p
| SPD:
span(id='spd')

View File

@@ -0,0 +1,8 @@
div(id='net-panel').panel.panel-default
div.panel-body
p
| ping:
span(id='ping')
p
| 在线人数:
span(id='online-number')

View File

@@ -0,0 +1,12 @@
div(id='position-panel').panel.panel-primary
div.panel-body
p
| x:
span(id='x')
p
| y:
span(id='y')
p(id='move-status')
| 剩余进度:
span(id='move-process')
| %