diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-06-09 17:41:00 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-06-09 17:41:00 -0400 |
| commit | b4fd7ddd7cf6fb2a68613bc0257a650055360ea7 (patch) | |
| tree | bf4117322c8682fea24e2be169bd901bd1e978c5 | |
| parent | 50046f0197c5ef3d997dd06e95f3dcd008a654f6 (diff) | |
environment working again
20 files changed, 141 insertions, 41 deletions
diff --git a/public/assets/javascripts/app.js b/public/assets/javascripts/app.js index 310dc69..3c0fbe5 100644 --- a/public/assets/javascripts/app.js +++ b/public/assets/javascripts/app.js @@ -17,6 +17,8 @@ var viewHeight = window.viewHeight || 150 var app = new function(){} +app.mode = { editor: false, builder: false } + app.init = function () { app.tube = new Tube () app.router = new Router () diff --git a/public/assets/javascripts/rectangles/engine/map/ui.js b/public/assets/javascripts/rectangles/engine/map/ui.js index 2e40cad..6e9a5ab 100644 --- a/public/assets/javascripts/rectangles/engine/map/ui.js +++ b/public/assets/javascripts/rectangles/engine/map/ui.js @@ -2,8 +2,6 @@ map.ui = new function(){ var base = this - - if (! base.el) return base.creating = base.dragging = base.resizing = false diff --git a/public/assets/javascripts/ui/DocumentModal.js b/public/assets/javascripts/ui/DocumentModal.js index f821d07..d9901bd 100644 --- a/public/assets/javascripts/ui/DocumentModal.js +++ b/public/assets/javascripts/ui/DocumentModal.js @@ -1,5 +1,4 @@ - var DocumentModal = ModalFormView.extend({ el: ".mediaDrawer.editDocument", createAction: "/api/docs/new", diff --git a/public/assets/javascripts/ui/Router.js b/public/assets/javascripts/ui/Router.js index fea3698..a7aa566 100644 --- a/public/assets/javascripts/ui/Router.js +++ b/public/assets/javascripts/ui/Router.js @@ -19,7 +19,8 @@ var Router = View.extend({ "/profile/edit": 'editProfile', "/about/:name/edit": 'editDocument', "/about/new": 'newDocument', - "/app": 'launch', + "/editor": 'launchEditor', + "/builder": 'launchBuilder', }, initialize: function(){ @@ -33,13 +34,11 @@ var Router = View.extend({ this.originalPath = window.location.pathname var path = window.location.pathname.split("/") - console.log(path) + // console.log(path) for (var route in this.routes) { var routePath = route.split("/") if (routePath[1] == path[1]) { if (routePath[2] && routePath[2].indexOf(":") !== -1 && path[2] && (path[3] === routePath[3]) ) { - console.log("GOT :") - console.log(routePath) this[this.routes[route]](null, path[2]) break; } @@ -57,7 +56,13 @@ var Router = View.extend({ $("body").removeClass("loading") }, - launch: function(){ + launchBuilder: function(){ + app.mode.builder = true + app.launch() + }, + + launchEditor: function(){ + app.mode.editor = true app.launch() }, diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index e3f4de5..7335dc8 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -519,6 +519,38 @@ h5{ -ms-backface-visibility: visible; backface-visibility: visible; } +#hud { + position: absolute; + top:0;left:0; + z-index: 10; +} +.face { + background-color: #fff; + transition: 0.1s background-color ease; +} +.front { background-color: #fff; } +.back { background-color: #fff; } +.left { background-color: #fff; } +.right { background-color: #fff; } +.floor { background-color: #eee; } +.ceiling { background-color: rgba(230,230,255,0.3); } + +.active.floor { background-color: #ffe; } +.active.ceiling { background-color: rgba(230,230,255,0.3); } + +.dragging .mx-object3d.image { + pointer-events: none; +} + +.dot { + background:white; + border-radius:20px; + border: 1px solid black; +} + +.image { + background-size: 100% 100%; +} diff --git a/server/index.js b/server/index.js index f418c42..6a377c9 100644 --- a/server/index.js +++ b/server/index.js @@ -77,6 +77,7 @@ app.get('/auth/facebook', auth.login('facebook')); app.get('/auth/facebook/callback', auth.loggedIn('facebook')); app.get('/profile', views.profile) app.get('/profile/edit', views.profile) +app.get('/profile/:name', views.profile) app.get('/api/profile', middleware.ensureAuthenticated, api.profile.show) app.put('/api/profile', middleware.ensureAuthenticated, api.profile.update) @@ -90,8 +91,9 @@ app.get('/api/docs', middleware.ensureAuthenticated, middleware.ensureIsStaff, a app.post('/api/docs/new', middleware.ensureAuthenticated, middleware.ensureIsStaff, api.docs.create) app.post('/api/docs/edit', middleware.ensureAuthenticated, middleware.ensureIsStaff, api.docs.update) -app.get(/^\/([-_a-zA-Z0-9]+)\/?$/, views.profile) - +app.use('/builder', middleware.ensureAuthenticated) +app.get('/builder', views.builder) +app.get('/builder/:name', views.builder) /* auth.initSockets(io) diff --git a/server/lib/views.js b/server/lib/views.js index 94774cb..bb9e5ae 100644 --- a/server/lib/views.js +++ b/server/lib/views.js @@ -18,6 +18,15 @@ marked.setOptions({ var views = {} +views.editor = function (req, res) { + res.render('editor') +} + +views.builder = function (req, res) { + res.render('builder') +} + + views.modal = function (req, res) { res.render('modal', { }); diff --git a/views/app.ejs b/views/app.ejs deleted file mode 100755 index 4a10915..0000000 --- a/views/app.ejs +++ /dev/null @@ -1,29 +0,0 @@ -<!doctype html> -<html> -<head> - <title>vvalls</title> - [[ include partials/meta ]] -</head> -<body class="editing loading"> - -<div id="scene"></div> - -<div class="rapper"> - <a href="/" class="logo"><img src="/assets/img/logo4.svg"></a> - <a href="/profile.html"><span class="icon-ios7-person-outline profile"></span></a> - - [[ include controls/toolbar ]] - [[ include controls/video-toolbar ]] - [[ include controls/media-drawer ]] - [[ include controls/wallpaper ]] - [[ include controls/light-control ]] - [[ include controls/settings ]] - - <div id="minimap" class="vvbox"> - <span class="el"></span> - </div> -</div> - -</body> -[[ include partials/scripts ]] -</html> diff --git a/views/builder.ejs b/views/builder.ejs new file mode 100644 index 0000000..50b2a5b --- /dev/null +++ b/views/builder.ejs @@ -0,0 +1,43 @@ +<!doctype html> +<html> +<head> + <title>vvalls</title> + [[ include partials/meta ]] +</head> +<body class="editing loading"> + +<div id="scene"></div> + +<div class="rapper"> + [[ include partials/header ]] + [[ include controls/builder/toolbar ]] + +<!-- + <div id="minimap" class="vvbox"> + <span class="el"></span> + </div> +--> + + <div id="hud"> + <div id="map" style="display: block"> + </div> + + <div id="info"> + <select id="palette"> + <option>colors</option> + <option>redblue</option> + <option>gray</option> + <option selected>bone</option> + <option>alpha</option> + <option>white</option> + <option>black</option> + </select> + <div id="intersects"></div> + </div> + </div> + +</div> + +</body> +[[ include partials/scripts ]] +</html> diff --git a/views/controls/toolbar.ejs b/views/controls/builder/toolbar.ejs index 1bf87eb..1bf87eb 100644 --- a/views/controls/toolbar.ejs +++ b/views/controls/builder/toolbar.ejs diff --git a/views/controls/light-control.ejs b/views/controls/editor/light-control.ejs index 782c400..782c400 100644 --- a/views/controls/light-control.ejs +++ b/views/controls/editor/light-control.ejs diff --git a/views/controls/media-drawer.ejs b/views/controls/editor/media-drawer.ejs index af9ea71..af9ea71 100644 --- a/views/controls/media-drawer.ejs +++ b/views/controls/editor/media-drawer.ejs diff --git a/views/controls/settings.ejs b/views/controls/editor/settings.ejs index f92d1c7..f92d1c7 100644 --- a/views/controls/settings.ejs +++ b/views/controls/editor/settings.ejs diff --git a/views/controls/signed-out.ejs b/views/controls/editor/signed-out.ejs index 20e3715..20e3715 100644 --- a/views/controls/signed-out.ejs +++ b/views/controls/editor/signed-out.ejs diff --git a/views/controls/editor/toolbar.ejs b/views/controls/editor/toolbar.ejs new file mode 100644 index 0000000..1bf87eb --- /dev/null +++ b/views/controls/editor/toolbar.ejs @@ -0,0 +1,9 @@ +<div class="edit menu vvbox"> + <span class="icon-ios7-photos-outline addMedia" data-info="add media"></span> + <span class="icon-arrow-resize" data-info="resize media"></span> + <span class="icon-ios7-keypad-outline" data-info="add wallpaper"></span> + <span class="icon-ios7-sunny-outline" data-info="light control"></span> + <span class="icon-ios7-trash-outline delete-image-toggle" data-info="delete images"></span> + <span class="icon-ios7-compose-outline edit-text-toggle" data-info="edit wall text"></span> + <span class="icon-key" data-info="room settings"></span> +</div> diff --git a/views/controls/video-toolbar.ejs b/views/controls/editor/video-toolbar.ejs index d4364a2..d4364a2 100644 --- a/views/controls/video-toolbar.ejs +++ b/views/controls/editor/video-toolbar.ejs diff --git a/views/controls/wallpaper.ejs b/views/controls/editor/wallpaper.ejs index 82460b7..82460b7 100644 --- a/views/controls/wallpaper.ejs +++ b/views/controls/editor/wallpaper.ejs diff --git a/views/editor.ejs b/views/editor.ejs new file mode 100755 index 0000000..889200c --- /dev/null +++ b/views/editor.ejs @@ -0,0 +1,28 @@ +<!doctype html> +<html> +<head> + <title>vvalls</title> + [[ include partials/meta ]] +</head> +<body class="editing loading"> + +<div id="scene"></div> + +<div class="rapper"> + [[ include partials/header ]] + + [[ include controls/editor/toolbar ]] + [[ include controls/editor/video-toolbar ]] + [[ include controls/editor/media-drawer ]] + [[ include controls/editor/wallpaper ]] + [[ include controls/editor/light-control ]] + [[ include controls/editor/settings ]] + + <div id="minimap" class="vvbox"> + <span class="el"></span> + </div> +</div> + +</body> +[[ include partials/scripts ]] +</html> diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index 1df179a..703dab4 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -12,7 +12,7 @@ <span> you are signed in as → - <a href="/[[- user.name ]]">[[- user.displayName ]]</a> + <a href="/profile/[[- user.username ]]">[[- user.displayName ]]</a> <a href="/logout" class="topLink">Sign Out?</a> </span> [[ } ]] diff --git a/views/staff.ejs b/views/staff.ejs index f099edb..bc07bc2 100644 --- a/views/staff.ejs +++ b/views/staff.ejs @@ -8,7 +8,9 @@ <div class="rapper page"> [[ include partials/header ]] - [[ include staff/edit-docs ]] + - recent users + - rooms list + - projects list [[ include partials/footer ]] </div> |
