From 06e38245987304ef6bddb1f9c3e6cad16a215209 Mon Sep 17 00:00:00 2001 From: ryderr Date: Tue, 7 Oct 2014 16:12:09 -0400 Subject: new font --- views/controls/editor/wallpaper.ejs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'views/controls/editor/wallpaper.ejs') diff --git a/views/controls/editor/wallpaper.ejs b/views/controls/editor/wallpaper.ejs index 95cf827..01cf771 100644 --- a/views/controls/editor/wallpaper.ejs +++ b/views/controls/editor/wallpaper.ejs @@ -3,12 +3,12 @@ Add custom wallpaper to walls. Begin by uploading a pattern. Or try this one -> -
+
- +
@@ -17,9 +17,14 @@ -->
- +
+ +
+ + +
-- cgit v1.2.3-70-g09d2 From 49ce8683ce072d8ae24176aff7fadbf5195f5922 Mon Sep 17 00:00:00 2001 From: ryderr Date: Tue, 7 Oct 2014 16:48:11 -0400 Subject: wallpaper buttons --- public/assets/stylesheets/app.css | 12 +++++++----- views/controls/editor/wallpaper.ejs | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'views/controls/editor/wallpaper.ejs') diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 6a034ea..943fc8e 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -1332,7 +1332,7 @@ iframe.embed { padding-bottom: 6px; } -.wallpaperUpload, .wallpaperRemove { +.toolButton { border: 1px solid; display: inline-block; width: 100%; @@ -1341,9 +1341,9 @@ iframe.embed { font-weight: 300; } -.wallpaper label { +.toolButton label { position: relative; - top: -6px; + vertical-align: middle; float: none; } .wallpaper form { @@ -1357,8 +1357,10 @@ iframe.embed { color:white; cursor:pointer; } -.wallpaper .ion-ios7-upload-outline { - font-size: 26px; +.toolButton > span, .toolButton form > span{ + font-size: 26px; + margin: 0 7px; + vertical-align: middle; } .wallpaper .wallpaperRemove { cursor: pointer; diff --git a/views/controls/editor/wallpaper.ejs b/views/controls/editor/wallpaper.ejs index 01cf771..97a9232 100644 --- a/views/controls/editor/wallpaper.ejs +++ b/views/controls/editor/wallpaper.ejs @@ -5,7 +5,7 @@ -
+
@@ -16,13 +16,13 @@ -->
-
+
-
- +
+
-- cgit v1.2.3-70-g09d2 From e9c849ff9d69ceeafa0a98b22040d027f82d7dc3 Mon Sep 17 00:00:00 2001 From: ryderr Date: Tue, 7 Oct 2014 18:51:50 -0400 Subject: wallpaper --- views/controls/editor/wallpaper.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views/controls/editor/wallpaper.ejs') diff --git a/views/controls/editor/wallpaper.ejs b/views/controls/editor/wallpaper.ejs index 97a9232..3c621b1 100644 --- a/views/controls/editor/wallpaper.ejs +++ b/views/controls/editor/wallpaper.ejs @@ -1,7 +1,7 @@

Add Wallpaper

- Add custom wallpaper to walls. Begin by uploading a pattern. Or try this one -> + Add custom wallpaper to walls. Begin by uploading a pattern. Or try one of these -> -- cgit v1.2.3-70-g09d2 From a980ce6da41d8358c8fa973bf83809e80325ccd5 Mon Sep 17 00:00:00 2001 From: ryderr Date: Tue, 7 Oct 2014 18:54:16 -0400 Subject: start of default wallpaper --- views/controls/editor/wallpaper.ejs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'views/controls/editor/wallpaper.ejs') diff --git a/views/controls/editor/wallpaper.ejs b/views/controls/editor/wallpaper.ejs index 3c621b1..2d47e04 100644 --- a/views/controls/editor/wallpaper.ejs +++ b/views/controls/editor/wallpaper.ejs @@ -1,9 +1,14 @@

Add Wallpaper

- Add custom wallpaper to walls. Begin by uploading a pattern. Or try one of these -> + Add custom wallpaper to walls. Begin by uploading a pattern. Or try one of these -> - + + + + + +
-- cgit v1.2.3-70-g09d2 From 8ae73f097e27cd54f685c562081f3a1bc7c9b13d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 7 Oct 2014 18:59:04 -0400 Subject: resize/scale wallpaper --- public/assets/javascripts/ui/editor/EditorView.js | 1 + .../javascripts/ui/editor/WallpaperPicker.js | 57 +++++++++++++++++++++- public/assets/stylesheets/app.css | 12 +++++ public/assets/test/bg.html | 2 +- views/controls/editor/wallpaper.ejs | 6 +++ 5 files changed, 76 insertions(+), 2 deletions(-) (limited to 'views/controls/editor/wallpaper.ejs') diff --git a/public/assets/javascripts/ui/editor/EditorView.js b/public/assets/javascripts/ui/editor/EditorView.js index f95d909..f60b149 100644 --- a/public/assets/javascripts/ui/editor/EditorView.js +++ b/public/assets/javascripts/ui/editor/EditorView.js @@ -54,6 +54,7 @@ var EditorView = View.extend({ pickWall: function(wall, pos){ this.hideExtras() + this.wallpaperPicker.pickWall(wall) }, hideExtras: function(){ diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js index 7f9b8f7..3694095 100644 --- a/public/assets/javascripts/ui/editor/WallpaperPicker.js +++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js @@ -6,8 +6,11 @@ var WallpaperPicker = UploadView.extend({ uploadAction: "/api/media/upload", events: { + "mousedown": 'stopPropagation', "click .swatch": 'pick', "click .wallpaperRemove": 'remove', + "input [data-role='wallpaper-scale']": 'updateScale', + }, initialize: function(){ @@ -15,6 +18,11 @@ var WallpaperPicker = UploadView.extend({ this.$swatches = this.$(".swatches") this.$remove = this.$(".wallpaperRemove") this.$remove.hide() + + this.$position = this.$("[data-role='wallpaper-position']") + this.$scale = this.$("[data-role='wallpaper-scale']") + + this.initializePositionCursor() }, loaded: false, @@ -122,5 +130,52 @@ var WallpaperPicker = UploadView.extend({ _followCursor(e); }) }, - + + wall: null, + pickWall: function(wall){ + if (wall.background.src == "none") { + return; + } + console.log(wall) + this.wall = wall + }, + + updateScale: function(){ + if (! this.wall) return; + s = parseFloat(this.$scale.val()) + this.wall.wallpaperPosition({ scale: s }) + }, + + initializePositionCursor: function(){ + var base = this + var dx = 0, dy = 0, dragging = false + var x = 0, y = 0, s = 1 + var mymouse = new mouse({ + el: this.$position[0], + down: function(e, cursor){ + if (! base.wall) return + s = parseFloat( base.$scale.val() ) + x = base.wall.background.x + y = base.wall.background.y + dragging = true + }, + drag: function(e, cursor){ + if (! dragging) return + delta = cursor.delta() + delta.a = - delta.a + dx = delta.a*s + dy = delta.b*s + base.wall.wallpaperPosition({ + scale: s, + x: x+dx, + y: y+dy, + }) + }, + up: function(e, cursor, new_cursor){ + delta.zero() + dragging = false + }, + }) + }, + }) diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index f770637..6e23962 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -1487,6 +1487,18 @@ input[type="range"]::-webkit-slider-thumb { border:3px solid #000; } +.wallpaperResizeControls input[type=range] { + width: 130px; + position: relative; + top: -10px; +} +.wallpaperResizeControls { + font-size: 30px; +} +.wallpaperResizeControls span { + cursor: pointer; +} + #color-picker { position: relative; } diff --git a/public/assets/test/bg.html b/public/assets/test/bg.html index cd7eaa8..fecf811 100644 --- a/public/assets/test/bg.html +++ b/public/assets/test/bg.html @@ -88,7 +88,7 @@ var x0 = 0, y0 = 0 var mymouse = new mouse({ el: cursor, down: function(e, cursor){ - console.log(cursor.x.a, cursor.y.a) + console.log(cursor.x.a, cursor.y.a) dragging = true }, drag: function(e, cursor){ diff --git a/views/controls/editor/wallpaper.ejs b/views/controls/editor/wallpaper.ejs index 97a9232..719c8ff 100644 --- a/views/controls/editor/wallpaper.ejs +++ b/views/controls/editor/wallpaper.ejs @@ -25,6 +25,12 @@
+ +
+ + +
+
-- cgit v1.2.3-70-g09d2