Slide 1

Slide 1 text

Prototyping in the browser

Slide 2

Slide 2 text

II / Structure

Slide 3

Slide 3 text

— Recap

Slide 4

Slide 4 text

Homebrew

Slide 5

Slide 5 text

Download Install Configure Update Remove brew install brew uninstall brew upgrade brew list

Slide 6

Slide 6 text

Git * * More on Git/Github in a bit

Slide 7

Slide 7 text

## MAC OS .DS_Store ## TEXTMATE *.tmproj tmtags [...] ## PROJECT::GENERAL .sass-cache coverage rdoc pkg ## PROJECT::SPECIFIC *.gem .rvmrc .bundle

Slide 8

Slide 8 text

RVM

Slide 9

Slide 9 text

Install Remove Sandbox rvm install rvm uninstall rvm use rvm gemset

Slide 10

Slide 10 text

rvm_gemset_create_on_use_flag=1 rvm use ruby-1.9.3-p125@foobar

Slide 11

Slide 11 text

Ruby

Slide 12

Slide 12 text

module ViewHelpers # Calculate the years # for a copyright def copyright_years(start_year) end_year = Date.today.year if start_year == end_year "\#{start_year}" else "\#{start_year} ↵ –\#{end_year}" end end # Add your own helpers below... end

Slide 13

Slide 13 text

Rubygems

Slide 14

Slide 14 text

source :rubygems gem 'serve' gem 'haml' gem 'sass'

Slide 15

Slide 15 text

Serve

Slide 16

Slide 16 text

http://localhost:4000/ http://localhost:4000/hello

Slide 17

Slide 17 text

http://localhost:4000/stylesheets/screen.css http://localhost:4000/ http://localhost:4000/images

Slide 18

Slide 18 text

Create Run Export serve serve create serve export

Slide 19

Slide 19 text

Layouts

Slide 20

Slide 20 text

!!! 5 %html %head %title= @title %link(rel="stylesheet" ↵ href="/ stylesheets/screen.css") %body = yield

Slide 21

Slide 21 text

Layout Content yield:

Slide 22

Slide 22 text

Logic: Which layout?

Slide 23

Slide 23 text

GIT & GITHUB ”Crash Tour“

Slide 24

Slide 24 text

Version control

Slide 25

Slide 25 text

1 Revision 2 3 4 5 6 7 8 9 Revert

Slide 26

Slide 26 text

Branches

Slide 27

Slide 27 text

1 Merge 2 7 9 10 4 5 6 8 Branch

Slide 28

Slide 28 text

Collaboration

Slide 29

Slide 29 text

Remote Local Local User B User A

Slide 30

Slide 30 text

Workflow

Slide 31

Slide 31 text

git init git add . git status git commit -m “Commit message”

Slide 32

Slide 32 text

git add path/file.rb git rm path/file.rb git mv path/file.rb

Slide 33

Slide 33 text

git remote add origin [email protected]:polarblau/foo.git git clone [email protected]:polarblau/foo.git git fetch origin git merge origin git pull [...] git push

Slide 34

Slide 34 text

git checkout -b my-branch git checkout master

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Github

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

HAML

Slide 39

Slide 39 text

%tag(attribute="value") Content Content

Slide 40

Slide 40 text

Nesting

Slide 41

Slide 41 text

!!! 5 %html %head %title Hello HTML %body %p Hello World!

Slide 42

Slide 42 text

%body %div %h1 Hello World! %div %h1 Hello World!

Slide 43

Slide 43 text

Attributes

Slide 44

Slide 44 text

#foo(title="Hello!") Hello World
Hello World

Slide 45

Slide 45 text

Classes & IDs

Slide 46

Slide 46 text

#foo Hello World
Hello World

Slide 47

Slide 47 text

.foo Hello World
Hello World

Slide 48

Slide 48 text

.foo.bar Hello World
Hello World

Slide 49

Slide 49 text

#foo.foo.bar Hello World
Hello World

Slide 50

Slide 50 text

#foo(id="bar") Hello World

Slide 51

Slide 51 text

#foo(id="bar") Hello World
Hello World

Slide 52

Slide 52 text

Boolean attributes

Slide 53

Slide 53 text

%input(selected=true)

Slide 54

Slide 54 text

Comments

Slide 55

Slide 55 text

/ A comment .foo Hello World
Hello World

Slide 56

Slide 56 text

/ .foo Hello World

Slide 57

Slide 57 text

-# A comment .foo Hello World
Hello World

Slide 58

Slide 58 text

Inline Ruby

Slide 59

Slide 59 text

- headline = "Hello World" %h1= headline

Hello World

Slide 60

Slide 60 text

- id = 2 + 5 %h1(id="headline-#{id}") Headline

Hello World

Slide 61

Slide 61 text

%ul - ["Huey", "Dewey", "Louie"].each do |name| %li= name
  • Huey
  • Dewey
  • Louie

Slide 62

Slide 62 text

Escaping HTML

Slide 63

Slide 63 text

%h1 &= "Adam & Eve"

Adam & Eve

Slide 64

Slide 64 text

Partials (via Serve)

Slide 65

Slide 65 text

%footer = render "shared/footer" Layout Footer Page

Slide 66

Slide 66 text

Errors

Slide 67

Slide 67 text

SASS

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

SASS

Slide 70

Slide 70 text

h1, h2 font-size: 24px color: red

Slide 71

Slide 71 text

Nesting

Slide 72

Slide 72 text

Selectors

Slide 73

Slide 73 text

article font-size: 1em h1 font-size: 1.5em span color: red font-weight: bold

Slide 74

Slide 74 text

article { font-size: 1em; } article h1 { font-size: 1.5em; } article h1 span { color: red; font-weight: bold; }

Slide 75

Slide 75 text

Properties

Slide 76

Slide 76 text

article .foo border: left: width: 4px color: red

Slide 77

Slide 77 text

article .foo { border-left-width: 4px; border-left-color: red; }

Slide 78

Slide 78 text

Reference parent

Slide 79

Slide 79 text

article section &.foo color: red &.bar color: blue

Slide 80

Slide 80 text

article section.foo { color: red; } article section.bar { color: blue; }

Slide 81

Slide 81 text

article section body.js & color: red body.no-js & color: blue

Slide 82

Slide 82 text

body.js article section { color: red; } body.no-js article section { color: blue; }

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

Variables

Slide 85

Slide 85 text

$headline-highlight: #f00 h1 span color: $headline-highlight

Slide 86

Slide 86 text

h1 span { color: red; }

Slide 87

Slide 87 text

Operations

Slide 88

Slide 88 text

$width: 100px div width: $width / 2

Slide 89

Slide 89 text

div { width: 50px; }

Slide 90

Slide 90 text

$width: 100px div width: $width / 2 - 20px

Slide 91

Slide 91 text

div { width: 30px; }

Slide 92

Slide 92 text

Functions

Slide 93

Slide 93 text

$headline-highlight: #f00 h1 color: lighten($headline-highlight, 50%)

Slide 94

Slide 94 text

h1 { color: #ff3333; }

Slide 95

Slide 95 text

Interpolation

Slide 96

Slide 96 text

$side: top div border-#{$side}: 3px solid red

Slide 97

Slide 97 text

div { border-top: 3px solid red; }

Slide 98

Slide 98 text

Mixins

Slide 99

Slide 99 text

=very-important font-weight: bold font-size: 24px color: red h1 +very-important

Slide 100

Slide 100 text

h1 { font-weight: bold; font-size: 24px; color: red; }

Slide 101

Slide 101 text

Arguments

Slide 102

Slide 102 text

=very-important($color: red) font-weight: bold font-size: 24px color: $color h1 +very-important h2 +very-important(blue)

Slide 103

Slide 103 text

h1 { font-weight: bold; font-size: 24px; color: red; } h2 { font-weight: bold; font-size: 24px; color: blue; }

Slide 104

Slide 104 text

Includes

Slide 105

Slide 105 text

@import "shared/colors"

Slide 106

Slide 106 text

Errors

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

FROM MOCKUP TO PROTOTYPE

Slide 109

Slide 109 text

WHAT THE FL*G?