summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/javascripts/mx/primitives/mx.video.js2
-rw-r--r--public/assets/javascripts/mx/primitives/mx.vimeo.js10
-rw-r--r--public/assets/javascripts/mx/primitives/mx.youtube.js2
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/builder.js4
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/clipper.js7
-rw-r--r--public/assets/javascripts/rectangles/engine/scenery/types/video.js3
-rw-r--r--public/assets/javascripts/ui/_router.js1
-rw-r--r--public/assets/javascripts/ui/reader/ReaderView.js3
-rw-r--r--public/assets/javascripts/ui/site/LayoutsModal.js7
-rwxr-xr-xpublic/assets/stylesheets/app.css25
-rw-r--r--views/builder.ejs3
-rw-r--r--views/controls/builder/info.ejs35
-rw-r--r--views/controls/editor/media-editor.ejs4
-rw-r--r--views/partials/sign-in.ejs4
-rw-r--r--views/projects/layouts-modal.ejs8
-rw-r--r--views/projects/list-projects.ejs2
16 files changed, 105 insertions, 15 deletions
diff --git a/public/assets/javascripts/mx/primitives/mx.video.js b/public/assets/javascripts/mx/primitives/mx.video.js
index 7f91e34..b28204d 100644
--- a/public/assets/javascripts/mx/primitives/mx.video.js
+++ b/public/assets/javascripts/mx/primitives/mx.video.js
@@ -20,7 +20,7 @@ MX.Video = MX.Object3D.extend({
this.backface && this.el.classList.add("backface-visible")
this.el.classList.add("video")
this.paused = !! this.media.autoplay
- this.muted = !! this.media.mute
+ this.muted = app.muted || !! this.media.mute
this.load()
},
diff --git a/public/assets/javascripts/mx/primitives/mx.vimeo.js b/public/assets/javascripts/mx/primitives/mx.vimeo.js
index 0301e64..7a5327e 100644
--- a/public/assets/javascripts/mx/primitives/mx.vimeo.js
+++ b/public/assets/javascripts/mx/primitives/mx.vimeo.js
@@ -20,7 +20,7 @@ MX.Vimeo = MX.Object3D.extend({
this.backface && this.el.classList.add("backface-visible")
this.el.classList.add("video")
this.paused = !! this.media.autoplay
- this.muted = !! this.media.mute
+ this.muted = app.muted || !! this.media.mute
this.load()
},
@@ -82,6 +82,14 @@ MX.Vimeo = MX.Object3D.extend({
},
seek: function(n){
+ // defer seek until we have duration
+ if (! this.duration()) {
+ setTimeout(function(){
+ this.seek(n)
+ }.bind(this), 300)
+ return
+ }
+
if (n < 1) {
n = n * this.duration()
}
diff --git a/public/assets/javascripts/mx/primitives/mx.youtube.js b/public/assets/javascripts/mx/primitives/mx.youtube.js
index 8c11da6..47d5507 100644
--- a/public/assets/javascripts/mx/primitives/mx.youtube.js
+++ b/public/assets/javascripts/mx/primitives/mx.youtube.js
@@ -20,7 +20,7 @@ MX.Youtube = MX.Object3D.extend({
this.backface && this.el.classList.add("backface-visible")
this.el.classList.add("video")
this.paused = !! this.media.autoplay
- this.muted = !! this.media.mute
+ this.muted = app.muted || !! this.media.mute
this.load()
},
diff --git a/public/assets/javascripts/rectangles/engine/rooms/builder.js b/public/assets/javascripts/rectangles/engine/rooms/builder.js
index e6625ec..49e55dc 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/builder.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/builder.js
@@ -20,8 +20,8 @@ Rooms.builder = new function(){
}
}
function build (){
- Rooms.regions.forEach(function(room){
- build_walls(room).forEach(function(el){
+ Rooms.regions.forEach(function(region){
+ build_walls(region).forEach(function(el){
els.push(el)
scene.add(el)
})
diff --git a/public/assets/javascripts/rectangles/engine/rooms/clipper.js b/public/assets/javascripts/rectangles/engine/rooms/clipper.js
index eb467cd..e2bb894 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/clipper.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/clipper.js
@@ -20,12 +20,15 @@ Rooms.clipper = new function(){
// Given a set of overlapping rooms, clip any intersections, then cull any duplicate polygons
base.solve_rects = function(){
- if (Rooms.count() == 0) return
+ if (Rooms.count() == 0) {
+ Rooms.regions = regions = []
+ return
+ }
base.reset_rects()
base.clip_rects()
base.cull_rects()
-
+
Rooms.regions = sort_rects_by_position(regions)
}
diff --git a/public/assets/javascripts/rectangles/engine/scenery/types/video.js b/public/assets/javascripts/rectangles/engine/scenery/types/video.js
index 8cd5e6b..d3e2e76 100644
--- a/public/assets/javascripts/rectangles/engine/scenery/types/video.js
+++ b/public/assets/javascripts/rectangles/engine/scenery/types/video.js
@@ -25,6 +25,9 @@ Scenery.types.video = Scenery.types.base.extend(function(base){
this.mxType = MX.Youtube
break
}
+ if (app.muted) {
+ this.media.mute = true
+ }
this.mx = new this.mxType({
media: this.media,
scale: this.scale,
diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js
index b59d838..d070d55 100644
--- a/public/assets/javascripts/ui/_router.js
+++ b/public/assets/javascripts/ui/_router.js
@@ -160,7 +160,6 @@ var SiteRouter = Router.extend({
profile: function(e){
this.profileView.load()
},
-
editProfile: function(e){
e && e.preventDefault()
window.history.pushState(null, document.title, "/profile/edit")
diff --git a/public/assets/javascripts/ui/reader/ReaderView.js b/public/assets/javascripts/ui/reader/ReaderView.js
index a2c2983..9d38daa 100644
--- a/public/assets/javascripts/ui/reader/ReaderView.js
+++ b/public/assets/javascripts/ui/reader/ReaderView.js
@@ -15,6 +15,9 @@ var ReaderView = View.extend({
if (window.location.search.indexOf("noui") !== -1) {
$(".logo,.topLinks,#editorView").hide()
}
+ if (window.location.search.indexOf("mute") !== -1) {
+ app.muted = true
+ }
name = sanitize(name)
$.get(this.projectAction + name, this.ready.bind(this))
},
diff --git a/public/assets/javascripts/ui/site/LayoutsModal.js b/public/assets/javascripts/ui/site/LayoutsModal.js
index 3b9e6cd..4948b0e 100644
--- a/public/assets/javascripts/ui/site/LayoutsModal.js
+++ b/public/assets/javascripts/ui/site/LayoutsModal.js
@@ -3,6 +3,8 @@ var LayoutsIndex = View.extend({
initialize: function(){
this.$templates = this.$(".templates")
+ this.$noTemplates = this.$(".no-templates")
+ this.$form = this.$("form")
},
load: function(type){
@@ -12,6 +14,11 @@ var LayoutsIndex = View.extend({
},
populate: function(data){
+ if (! data.length) {
+ this.$templates.hide()
+ this.$form.hide()
+ this.$noTemplates.show()
+ }
data.forEach(function(room){
var $span = $("<span>")
// $span.html(JSON.stringify(room))
diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css
index 2583284..2e3358a 100755
--- a/public/assets/stylesheets/app.css
+++ b/public/assets/stylesheets/app.css
@@ -469,6 +469,9 @@ iframe.embed {
.templates {
}
+.no-templates {
+ display: none;
+}
.templates span{
background-position: center;
@@ -1130,6 +1133,11 @@ input[type="range"]::-webkit-slider-thumb {
cursor:pointer;
}
+.settings.info {
+ right: auto;
+ left: 10px;
+}
+
.settings {
padding: 20px;
bottom: 20px;
@@ -1228,8 +1236,23 @@ input[type="range"]::-webkit-slider-thumb {
}
.setting label {
+ font-size: 12px;
+ font-weight: 300;
padding-right: 5px;
}
+.setting.number label {
+ width: 50px;
+ display: inline-block;
+ float: left;
+ position: relative;
+ top: 5px;
+}
+.setting.number input[type=text] {
+ width: 150px;
+}
+.setting.number.twoline label {
+ top: 0px;
+}
.playButton,.muteButton {
color: white;
@@ -1485,7 +1508,7 @@ form li textarea {
background:lightgreen;
}
*/
-.box b.info {
+.box b.signin-tagline {
display: inline-block;
width: 100%;
margin-bottom: 18px;
diff --git a/views/builder.ejs b/views/builder.ejs
index 61e84c3..afb8c66 100644
--- a/views/builder.ejs
+++ b/views/builder.ejs
@@ -12,6 +12,7 @@
[[ include partials/header ]]
<div id="builderView">
+ [[ include controls/builder/info ]]
[[ include controls/builder/toolbar ]]
[[ include controls/builder/settings ]]
</div>
@@ -20,7 +21,6 @@
<div id="minimap" class="vvbox">
<span class="el"></span>
</div>
- -->
<select id="palette">
<option>colors</option>
@@ -31,6 +31,7 @@
<option>white</option>
<option>black</option>
</select>
+ -->
<div id="hud">
<div id="map" style="display: block">
diff --git a/views/controls/builder/info.ejs b/views/controls/builder/info.ejs
new file mode 100644
index 0000000..af0a76d
--- /dev/null
+++ b/views/controls/builder/info.ejs
@@ -0,0 +1,35 @@
+<div class="vvbox active settings info active" id="builderInfo">
+ <div class="setting number">
+ <label for="room-width">width</label>
+ <input type="text" name="width" id="room-width">
+ </div>
+ <div class="setting number">
+ <label for="room-depth">depth</label>
+ <input type="text" name="depth" id="room-depth">
+ </div>
+ <div class="setting number twoline">
+ <label for="room-height">ceiling height</label>
+ <input type="text" name="height" id="room-height">
+ </div>
+
+ <div class="setting number twoline">
+ <label for="builder-units">units</label>
+ <select id="builder-units" name="units">
+ <option value="px">pixels</option>
+ <option value="foot">foot</option>
+ <option value="meter">meter</option>
+ </select>
+ </div>
+
+ <div class="setting number">
+ <label for="builder-resolution">px/<span class="unitName"></span></label>
+ <input type="text" name="resolution" id="builder-resolution">
+ </div>
+
+ <div class="setting number twoline">
+ <label for="camera-height">camera height</label>
+ <input type="text" name="camera-height" id="camera-height">
+ <span class="unitName"></span>
+ </div>
+
+</div>
diff --git a/views/controls/editor/media-editor.ejs b/views/controls/editor/media-editor.ejs
index 65db3ce..5db1fb2 100644
--- a/views/controls/editor/media-editor.ejs
+++ b/views/controls/editor/media-editor.ejs
@@ -29,9 +29,9 @@
<label for="video_mute">Mute</label>
</div>
<div class="video setting">
- Initial Still
+ <label for="video-keyframe">Initial Still</label>
<br>
- <input type="range" min="0" max="1" value="0" step="0.01" name="keyframe">
+ <input type="range" min="0" max="1" value="0" step="0.01" name="keyframe" id="video-keyframe">
</div>
<div class="image setting">
diff --git a/views/partials/sign-in.ejs b/views/partials/sign-in.ejs
index 3f05fff..8268b2a 100644
--- a/views/partials/sign-in.ejs
+++ b/views/partials/sign-in.ejs
@@ -6,7 +6,7 @@
<form id="signIn" method="post">
<input type="hidden" name="_csrf" value="[[- token ]]">
<a href="/auth/facebook" class="facebook"><b class="icon-social-facebook"></b><span>Sign in with Facebook</span></a>
- <b class="info">– or the ol' fashion way –</b>
+ <b class="signin-tagline">– or the ol' fashion way –</b>
<li>
<label class="description" for="usernameInput">Username:</label>
<div>
@@ -39,7 +39,7 @@
<form id="signUp" method="post">
<input type="hidden" name="_csrf" value="[[- token ]]">
<a href="/auth/facebook" class="facebook"><b class="icon-social-facebook"></b><span>Sign up with Facebook</span></a>
- <b class="info">– or the ol' fashion way –</b>
+ <b class="signin-tagline">– or the ol' fashion way –</b>
<li>
<label class="description" for="usernameInput">Username:</label>
<div>
diff --git a/views/projects/layouts-modal.ejs b/views/projects/layouts-modal.ejs
index 75b2641..97f1e61 100644
--- a/views/projects/layouts-modal.ejs
+++ b/views/projects/layouts-modal.ejs
@@ -5,6 +5,9 @@
<div class="templates">
<h1>Edit Room Layouts</h1>
</div>
+ <div class="no-templates">
+ There are no room layouts available. Please <a href="/layout/new">create a new one.</a>
+ </div>
<form>
<input data-role="create-new-layout" class="button_text" type="submit" value="New Layout">
</form>
@@ -18,6 +21,8 @@
<div class="templates">
<h1>Your Projects</h1>
</div>
+ <div class="no-templates">
+ </div>
<form>
<input class="button_text" type="submit" value="New Project">
</form>
@@ -31,6 +36,9 @@
<div class="templates">
<h1>Choose Room Template</h1>
</div>
+ <div class="no-templates">
+ There are no room layouts available. Please <a href="/layout/new">create a new one.</a>
+ </div>
<form>
<input class="button_text" type="submit" value="Create Project">
</form>
diff --git a/views/projects/list-projects.ejs b/views/projects/list-projects.ejs
index 42387ba..2c12af0 100644
--- a/views/projects/list-projects.ejs
+++ b/views/projects/list-projects.ejs
@@ -6,7 +6,7 @@
[[ projects.forEach(function(project, i) { ]]
<td class="border room1">
- <iframe src="/project/[[- project.slug ]]/view?noui=1" class="embed"></iframe>
+ <iframe src="/project/[[- project.slug ]]/view?noui=1&mute=1" class="embed"></iframe>
[[ if (profile._id == project.user_id) { ]]
<div class="editBtn">edit</div>
[[ } ]]