diff --git a/app/assets/javascripts/app/pages/profile.js b/app/assets/javascripts/app/pages/profile.js index 923859737..38b80d473 100644 --- a/app/assets/javascripts/app/pages/profile.js +++ b/app/assets/javascripts/app/pages/profile.js @@ -2,6 +2,8 @@ app.pages.Profile = app.views.Base.extend({ + className : "container", + templateName : "profile", subviews : { diff --git a/app/assets/javascripts/app/views/canvas_view.js b/app/assets/javascripts/app/views/canvas_view.js index 006dd68f4..1ca7ad340 100644 --- a/app/assets/javascripts/app/views/canvas_view.js +++ b/app/assets/javascripts/app/views/canvas_view.js @@ -8,12 +8,12 @@ app.views.Canvas = app.views.Base.extend(_.extend(app.views.infiniteScrollMixin, renderTemplate : function() { this.postRenderTemplate(); -// setTimeout(_.bind(this.mason, this), 1000) + setTimeout(_.bind(this.mason, this), 1000) }, -// -// mason : function() { -// this.$el.isotope({ -// itemSelector : '.canvas-frame' -// }) -// } + + mason : function() { + this.$el.isotope({ + itemSelector : '.canvas-frame' + }) + } })) diff --git a/app/assets/javascripts/app/views/small_frame.js b/app/assets/javascripts/app/views/small_frame.js index b2102b5a3..f112eebf0 100644 --- a/app/assets/javascripts/app/views/small_frame.js +++ b/app/assets/javascripts/app/views/small_frame.js @@ -1,5 +1,42 @@ app.views.SmallFrame = app.views.Base.extend({ - templateName: "small-frame" + className : "canvas-frame", + + templateName : "small-frame", + + postRenderTemplate : function() { + this.$el.addClass(this.photoClass() + ' ' + this.textClass()) + }, + + textClass : function(){ + var textLength = this.model.get("text").length + , baseClass = "text "; + + if(textLength <= 20){ + return baseClass + "extra-small" + } else if(textLength <= 140) { + return baseClass + "small" + } else if(textLength <= 500) { + return baseClass + "medium" + } else { + return baseClass + "large" + } + }, + + photoClass : function(){ + var photoCount = this.model.get('photos').length + , baseClass = "photo "; + + if(photoCount == 0 ) { + return "" + } else if(photoCount == 1){ + return baseClass + 'one' + } else if(photoCount == 2 ) { + return baseClass + 'two' + } else { + return baseClass + 'many' + } + } + }); \ No newline at end of file diff --git a/app/assets/stylesheets/new_styles/_canvas.scss b/app/assets/stylesheets/new_styles/_canvas.scss index 7db57446e..c28327127 100644 --- a/app/assets/stylesheets/new_styles/_canvas.scss +++ b/app/assets/stylesheets/new_styles/_canvas.scss @@ -1,5 +1,16 @@ -body { +@mixin tall() { + height : 405px; + max-height : 405px; + min-height : 405px; +} +@mixin wide() { + //width : 560px; + //min-width : 560px; + //max-width : 560px; +} + +body { background-color : #F6F6F6; } @@ -12,24 +23,125 @@ body { margin: 10px; width: 270px; + //clear : both; // here for testing! + .content { @include box-shadow(0,1px,3px,rgba(0,0,0,0.2)); + + position : relative; + background-color : #fff; - min-height : 180px; - max-height : 180px; + min-height : 140px; + max-height : 140px; overflow : hidden; - padding : 10px; + padding : 20px; margin-bottom : 5px; + + /* used in masking photos with overflow: hidden; */ + .image-container { + float : left; + overflow : hidden; + + img { + max-height : 100%; + max-width : 100%; + } + } + + .image-set { + float : left; + width : 100%; + } } /* larger declarations */ - &.x2.width { - width : 560px; + &.x2.width .content { @include wide(); } + &.x2.height .content { @include tall(); } + + &.text { + &.extra-small .content { + font-weight : bold; + font-size: 2.5em; + line-height: 1em; + } + + &.content { + display: table; + } + + &.small .content { + font-size: 1.4em; + line-height: 1.25em; + + text-decoration: bold; + } + &.medium .content { + @include tall(); + font-size: 1.6em; + } + &.large .content { @include wide() } } - &.x2.height .content { - min-height : 429px; - max-height : 429px; + &.photo { + &.one .content { + padding : 0; + min-height : 180px; + max-height : 180px; + + + .text-content { + position : absolute; + padding : 10px; + bottom : 0; + color : #eee; + } + } + + &.two .content { + // @include tall(); + // .image-container { + // width : 50%; + // } + } + &.many .content { @include tall(); @include wide(); } } + + &.text.small + .photo.one .content { + + } + &.text.small + .photo.two .content { @include wide() } + &.text.small + .photo.many .content { @include tall(); @include wide(); } + + &.text.medium + .photo.one .content {} + &.text.medium + .photo.two .content {} + &.text.medium + .photo.many .content {} + + &.text.large.photo.one .content { + @include tall(); @include wide(); + .text-content { + max-height: 26%; + padding : 20px; + color : #333; + } + + .image-set { + height: 65%; + width: 100%; + } + + .image-container { + width : 100%; + height : 100%; + + img { + width : 100%; + max-height : none; + } + } + + } + &.text.large + .photo.two .content {} + &.text.large + .photo.many .content {} + } \ No newline at end of file diff --git a/app/assets/templates/small-frame.jst.hbs b/app/assets/templates/small-frame.jst.hbs index 53db96d76..85c5978e3 100644 --- a/app/assets/templates/small-frame.jst.hbs +++ b/app/assets/templates/small-frame.jst.hbs @@ -1,8 +1,18 @@ -