Showing
14 changed files
with
158 additions
and
87 deletions
@@ -22,7 +22,7 @@ app.engine('.hbs', hbs({ | @@ -22,7 +22,7 @@ app.engine('.hbs', hbs({ | ||
22 | extname: '.hbs', | 22 | extname: '.hbs', |
23 | defaultLayout: 'layout', | 23 | defaultLayout: 'layout', |
24 | layoutsDir: doraemon, | 24 | layoutsDir: doraemon, |
25 | - partialsDir: ['./views/partial', `${doraemon}/partial`], | 25 | + partialsDir: [path.join(__dirname, 'views/partial'), `${doraemon}/partial`], |
26 | helpers: global.yoho.helpers | 26 | helpers: global.yoho.helpers |
27 | })); | 27 | })); |
28 | 28 |
apps/activity/views/partial/vip_day
deleted
100644 → 0
public/img/activity/vip_day/sprite1.png
0 → 100644
214 Bytes
public/img/activity/vip_day/sprite2.png
0 → 100644
3.41 KB
1 | -var Game = function(canvas, option) { | ||
2 | - canvas.style.backgroundColor = option.background; | ||
3 | - this.canvas = canvas; | ||
4 | - this.context = canvas.getContext('2d'); | ||
5 | - | ||
6 | - this.w = canvas.width = option.width; | ||
7 | - this.h = canvas.height = option.height; | ||
8 | - | ||
9 | - | ||
10 | - this.itemW = option.width / 3; | ||
11 | - this.itemH = option.height / 3; | ||
12 | -}; | ||
13 | - | ||
14 | -Game.prototype = { | ||
15 | - _supportTouch: function() { }, | ||
16 | - start: function() { }, | ||
17 | - pause: function() { }, | ||
18 | - addItem: function() {}, | ||
19 | - addEvent: function() { } | ||
20 | -}; | ||
21 | - | ||
22 | -Game.Button = function() { | ||
23 | -}; | ||
24 | - | ||
25 | -Game.Button.prototype = { | ||
26 | - addEventListener: function(type, handle) { | ||
27 | - | ||
28 | - } | ||
29 | -}; | ||
30 | - | ||
31 | -Game.Cursor = function() { | ||
32 | - | ||
33 | -}; | ||
34 | - | ||
35 | -document.addEventListener('DOMContentLoaded', function() { | ||
36 | - var canvas = document.querySelector('#stage'); | ||
37 | - var width = 500; | ||
38 | - var height = 400; | ||
39 | - var itemW = width / 3; | ||
40 | - var itemH = height / 3; | ||
41 | - | ||
42 | - var game = new Game(canvas, { | ||
43 | - width: width, | ||
44 | - height: height, | ||
45 | - background: '#32212c' | ||
46 | - }); | ||
47 | - var button = new Game.Button(); | ||
48 | - var cursor = new Game.Cursor(); | ||
49 | - var context = game.context; | ||
50 | - | ||
51 | - button.addEventListener('click', function() { | ||
52 | - | ||
53 | - }); | ||
54 | - | ||
55 | - | ||
56 | - | ||
57 | - function drawLine(c) { | ||
58 | - var i, j; | ||
59 | - var action = function(begin, end) { | ||
60 | - c.lineWidth = 1; | ||
61 | - c.strokeStyle = 'black'; | ||
62 | - c.beginPath(); | ||
63 | - c.moveTo(begin.x, begin.y); | ||
64 | - c.lineTo(end.x, end.y); | ||
65 | - c.stroke(); | ||
66 | - }; | ||
67 | - | ||
68 | - for (i = itemH; i < height; i = i + itemH) { | ||
69 | - action({ x: 0, y: i }, { x: width, y: i }); | ||
70 | - } | ||
71 | - | ||
72 | - for (j = itemW; j < width; j = j + itemW) { | ||
73 | - action({ x: j, y: 0 }, { x: j, y: height }); | ||
74 | - } | ||
75 | - } | ||
76 | - | ||
77 | - function drawStage(c) { | ||
78 | - drawLine(c); | ||
79 | - } | ||
80 | - | ||
81 | - drawStage(context); | ||
82 | - game.addItem(button); | ||
83 | - game.addItem(cursor); | ||
84 | - game.start(); | ||
85 | -}); | 1 | +// var Game = function(canvas, option) { |
2 | +// canvas.style.backgroundColor = option.background; | ||
3 | +// this.canvas = canvas; | ||
4 | +// this.context = canvas.getContext('2d'); | ||
5 | + | ||
6 | +// this.w = canvas.width = option.width; | ||
7 | +// this.h = canvas.height = option.height; | ||
8 | + | ||
9 | + | ||
10 | +// this.itemW = option.width / 3; | ||
11 | +// this.itemH = option.height / 3; | ||
12 | +// }; | ||
13 | + | ||
14 | +// Game.prototype = { | ||
15 | +// _supportTouch: function() { }, | ||
16 | +// start: function() { }, | ||
17 | +// pause: function() { }, | ||
18 | +// addItem: function() {}, | ||
19 | +// addEvent: function() { } | ||
20 | +// }; | ||
21 | + | ||
22 | +// Game.Button = function() { | ||
23 | +// }; | ||
24 | + | ||
25 | +// Game.Button.prototype = { | ||
26 | +// addEventListener: function(type, handle) { | ||
27 | + | ||
28 | +// } | ||
29 | +// }; | ||
30 | + | ||
31 | +// Game.Cursor = function() { | ||
32 | + | ||
33 | +// }; | ||
34 | + | ||
35 | +// document.addEventListener('DOMContentLoaded', function() { | ||
36 | +// var canvas = document.querySelector('#stage'); | ||
37 | +// var width = 500; | ||
38 | +// var height = 400; | ||
39 | +// var itemW = width / 3; | ||
40 | +// var itemH = height / 3; | ||
41 | + | ||
42 | +// var game = new Game(canvas, { | ||
43 | +// width: width, | ||
44 | +// height: height, | ||
45 | +// background: '#32212c' | ||
46 | +// }); | ||
47 | +// var button = new Game.Button(); | ||
48 | +// var cursor = new Game.Cursor(); | ||
49 | +// var context = game.context; | ||
50 | + | ||
51 | +// button.addEventListener('click', function() { | ||
52 | + | ||
53 | +// }); | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | +// function drawLine(c) { | ||
58 | +// var i, j; | ||
59 | +// var action = function(begin, end) { | ||
60 | +// c.lineWidth = 1; | ||
61 | +// c.strokeStyle = 'black'; | ||
62 | +// c.beginPath(); | ||
63 | +// c.moveTo(begin.x, begin.y); | ||
64 | +// c.lineTo(end.x, end.y); | ||
65 | +// c.stroke(); | ||
66 | +// }; | ||
67 | + | ||
68 | +// for (i = itemH; i < height; i = i + itemH) { | ||
69 | +// action({ x: 0, y: i }, { x: width, y: i }); | ||
70 | +// } | ||
71 | + | ||
72 | +// for (j = itemW; j < width; j = j + itemW) { | ||
73 | +// action({ x: j, y: 0 }, { x: j, y: height }); | ||
74 | +// } | ||
75 | +// } | ||
76 | + | ||
77 | +// function drawStage(c) { | ||
78 | +// drawLine(c); | ||
79 | +// } | ||
80 | + | ||
81 | +// drawStage(context); | ||
82 | +// game.addItem(button); | ||
83 | +// game.addItem(cursor); | ||
84 | +// game.start(); | ||
85 | +// }); | ||
86 | 86 | ||
87 | 87 |
public/scss/activity/vip_day/_game.css
0 → 100644
1 | +$color1: #c03729; | ||
2 | + | ||
3 | +.vipday-game { | ||
4 | + width: 750px; | ||
5 | + border-top: 1PX solid #27272b; | ||
6 | + | ||
7 | + .header { | ||
8 | + height: 142px; | ||
9 | + background-color: $color1; | ||
10 | + } | ||
11 | + | ||
12 | + .game { | ||
13 | + height: 536px; | ||
14 | + background: resolve('activity/vip_day/stage@2x.png'); | ||
15 | + background-size: 750px 536px; | ||
16 | + } | ||
17 | + | ||
18 | + .info { | ||
19 | + position: relative; | ||
20 | + padding-bottom: 40px; | ||
21 | + background-color: $color1; | ||
22 | + } | ||
23 | + | ||
24 | + .explain { | ||
25 | + width: 708px; | ||
26 | + margin-left: auto; | ||
27 | + margin-right: auto; | ||
28 | + | ||
29 | + &:before { | ||
30 | + display: block; | ||
31 | + content: ''; | ||
32 | + height: 40px; | ||
33 | + background: url('/activity/vip_day/sprite2.png'); | ||
34 | + background-size: contain; | ||
35 | + } | ||
36 | + | ||
37 | + &:after { | ||
38 | + | ||
39 | + } | ||
40 | + } | ||
41 | + | ||
42 | + .explain-txt { | ||
43 | + width: 680px; | ||
44 | + height: 297px; | ||
45 | + margin-left: auto; | ||
46 | + margin-right: auto; | ||
47 | + } | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | +} |
public/scss/activity/vip_day/_index.css
0 → 100644
1 | +@import "game"; |
@@ -52,6 +52,10 @@ a { | @@ -52,6 +52,10 @@ a { | ||
52 | width: 100%; | 52 | width: 100%; |
53 | } | 53 | } |
54 | 54 | ||
55 | +.width750 .main-wrap { | ||
56 | + max-width: 750px; | ||
57 | +} | ||
58 | + | ||
55 | @font-face { | 59 | @font-face { |
56 | font-family: "iconfont"; | 60 | font-family: "iconfont"; |
57 | src: resolve("iconfont.eot"); /* IE9 */ | 61 | src: resolve("iconfont.eot"); /* IE9 */ |
-
Please register or login to post a comment