Added coin-viewer
This commit is contained in:
26
controllers/prototype/index.js
vendored
26
controllers/prototype/index.js
vendored
@@ -171,3 +171,29 @@ module.exports.clicker = function(req, res, next) {
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
module.exports.viewer = function(req, res, next) {
|
||||
|
||||
var scene = req.params.scene;
|
||||
|
||||
switch (scene) {
|
||||
|
||||
case 'peach': res.locals.scene = "L3D.initPeach"; break;
|
||||
case 'coolcoolmountain': res.locals.scene = "L3D.initMountain"; break;
|
||||
case 'whomp': res.locals.scene = "L3D.initWhomp"; break;
|
||||
case 'bobomb': res.locals.scene = "L3D.initBobomb"; break;
|
||||
default:
|
||||
// 404
|
||||
var err = new Error('Incorrect scene');
|
||||
err.status = 404;
|
||||
next(err);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
res.render('prototype_viewer.jade', res.locals, function(err, result) {
|
||||
res.send(result);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
3
controllers/prototype/urls.js
vendored
3
controllers/prototype/urls.js
vendored
@@ -8,5 +8,6 @@ module.exports = {
|
||||
'/prototype/replay_info/:id': 'replay_info',
|
||||
'/prototype/tutorial': 'tutorial',
|
||||
'/prototype/sponza': 'sponza',
|
||||
'/prototype/coin-creator/:scene': 'clicker'
|
||||
'/prototype/coin-creator/:scene': 'clicker',
|
||||
'/prototype/coin-viewer/:scene': 'viewer'
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@ block mainjs
|
||||
script initMainScene = #{scene};
|
||||
script Recommendation = L3D.ArrowRecommendation;
|
||||
|
||||
script(src="/static/js/filesaver.min.js")
|
||||
script(src="/static/js/coincreator.min.js")
|
||||
|
||||
block extrabutton
|
||||
|
||||
10
controllers/prototype/views/prototype_viewer.jade
Normal file
10
controllers/prototype/views/prototype_viewer.jade
Normal file
@@ -0,0 +1,10 @@
|
||||
extends ./prototype
|
||||
|
||||
block title
|
||||
title #{title} - Prototype
|
||||
|
||||
block mainjs
|
||||
script initMainScene = #{scene};
|
||||
script Recommendation = L3D.ArrowRecommendation;
|
||||
|
||||
script(src="/static/js/coinviewer.min.js")
|
||||
Reference in New Issue
Block a user