Beruflich Dokumente
Kultur Dokumente
Our approach... one site and one codebase for all devices.
Why
We love native apps! We have an iPhone app and are working on an Android app.
Gives us native speed, native look and feel, push notifications, offline support...
But we didnt want to ignore the mobile web because of native apps.
How
280px
Only one menu is visible at a time. Simplies navigation and works on mobile. There are view transitions, though.
1. 2.
Back to Card Actions
Dialog windows
These layout elements are used for the back of cards, for user pages, and elsewhere.
Touch fallbacks
Icons
Our compiler embeds an inline base64 encoded datauri of the image. One less request.
.app-icon { background-image: embed(../images/icons-1x.png); background-position: -9999px -9999px; &.board-icon { background-position: -60px -30px; } }
(This is LESS.)
@media screen and (-webkit-min-device-pixel-ratio: 1.5), screen and (-webkit-min-device-pixel-ratio: 2) { .app-icon { background-image: url(../images/icons-2x.png); background-size: 690px 144px; } }
This image is 1380x288 (2x), but we use the 1x background-size so all the icon-specific background-positions line up.
Thursday, March 22, 12
We listen for window resizes with JavaScript and add an appropriate class to the body element. CSS takes care of everything else.
(This is CoffeeScript.)
For example...
body.extra-small-window body.large-window
This method gives us an easy way to check the window size in view code.
Views
We use Backbone for views. It makes views straightforward and keeps code exible.
...and this.
class CardMenuView extends EditableView events: "click "click "click "click "click "click
.js-change-members": "changeMembers" .js-edit-labels": "editLabels" .js-move-card": "moveCard" .js-due-date": "changeDueDate" .js-vote": "vote" .js-close-card": "close"
render: => data = {foo: bar} $(@el).html( Mustache.to_html( templates.popover_card_menu, data ) ) changeMembers: (e) => Util.stop(e) PopOver.pushView view: model.getView(CardMemberSelectView) # ... editLabels(), moveCard(), etc.
Push another view (select members) onto the stack. PopOver will load the view and handle transitions.
Templates
We use Mustache for templates. They are strictly logic-less, which keeps code clean.
Note: The view wraps this with an element with class View.className, in this case .list-card. Make good use of className so you dont end up with useless divs.
Thanks!
trello.com twitter.com/trello twitter.com/bobbygrace