SlideShare ist ein Scribd-Unternehmen logo
1 von 83
Advanced
Technology
for
Web Design


Miami Design Meetup
October 13, 2010
Who?

I’m Bryce.
I live down the street.
I’ve been accused of being a backend
developer.
Backend Developer?
  save: function() {
    if (this.blank) {
      Telecaster.db.create("INSERT INTO files (name, content) VALUES (?, ?)",
                      [this.name, this.content], function(t, r){
        this.id = r.insertId;
        this.blank = false;
      }.bind(this));
    } else {
      Telecaster.db.update("UPDATE files SET name=?, content=? WHERE id=?",
                      [this.name, this.content, this.id], function(t, r){

      }.bind(this));
    }
    this.blank = false;
  }
Backend Developer

• This presentation is a bit terminal-centric.
• Mac OS X:
 • /Applications/Utilities/Terminal.app
• Windows:
 • Command Line or cmd.exe
Deal with it.
Browser Languages

HTML - content
CSS - display content
JavaScript - animate content
Additional Tools

Compass - CSS meta-framework
Rake - build tool
Charleston - site framework
Topics
• HAML
• SASS
• Compass
• CoffeeScript
• Rake
• Charleston
HAML
HAML
Hampton’s     HTML
Awesome       Abstraction
Markup        Markup
Language      Language
HTML

  <div class='editor_box'>
    <div class='chrome'>
      <input id='filename' />
      <span class='button' id='save_button'>Save</span>
      <span class='button' id='eval_button'>Eval</span>
    </div>
    <textarea id='editor'></textarea>
  </div>
HAML

  .editor_box
    .chrome
      %input#filename
      %span.button#save_button Save
      %span.button#eval_button Eval
    %textarea#editor
HAML

  .editor_box

    .chrome

      %input#filename

      %span.button#save_button Save
HAML

  .editor_box      class name
    .chrome

      %input#filename

      %span.button#save_button Save
HAML

  .editor_box      class name
    .chrome     Implicit div
      %input#filename

      %span.button#save_button Save
HAML

  .editor_box      class name
    .chrome     Implicit div
      %input#filename          tag name, id name
      %span.button#save_button Save
HAML

  .editor_box      class name
    .chrome     Implicit div
      %input#filename          tag name, id name
      %span.button#save_button Save
                   tag, class, and id names
HAML
!!! 5
%head
  %title haml demo
%body
  %h1 hello
  .content
    %p
      I am a paragraph.
    :markdown
      You can embed markdown in HAML, because HAML
      isn't great at body text.
HTML
<!DOCTYPE html>
<head>
  <title>haml demo</title>
</head>
<body>
  <h1>hello</h1>
  <div class='content'>
    <p>
      I am a paragraph.
    </p>
    <p>You can embed markdown in HAML, because HAML
    isn't great at body text.</p>
  </div>
</body>
Installation

• Mac OS X:
 1. gem install haml
• Windows:
 1. Install ruby from http://rubyinstaller.org
 2. gem install haml
HAML Work ow

1.Write HAML le
2.Use haml tool
3.Enjoy HTML le
HAML Work ow



haml demo.haml > demo.html
HAML Work ow
SASS
CSS

.header { height: 89px; … }
.header div { height: 89px; }
.header .logo { width: 253px; height: 89px;
…}
.header .logo a:link, .header .logo a:visited
{ width: 253px; height: 89px; }
SASS
$header_height: 89px
$logo_width: 253px

.header
  height: $header_height
  div
    height: $header_height
  .logo
    width: $logo_width
    height: $header_height
    a:link,
    a:visited
      width: $logo_width
      height: $header_height
SASS

$header_height: 89px

.header
  height: $header_height

  div
    width: $logo_width
SASS

$header_height: 89px       variable assignment

.header
  height: $header_height

  div
    width: $logo_width
SASS

$header_height: 89px         variable assignment

.header            properties get braced
  height: $header_height

  div
    width: $logo_width
SASS

$header_height: 89px         variable assignment

.header            properties get braced
  height: $header_height
                               variable reference
  div
    width: $logo_width
SASS

$header_height: 89px         variable assignment

.header            properties get braced
  height: $header_height
                               variable reference
  div     nesting
    width: $logo_width
Installation

• Mac OS X:
 1. gem install haml
• Windows:
 1. Install ruby from http://rubyinstaller.org
 2. gem install haml
SASS Work ow

1.Write SASS le
2.Use sass tool
3.Enjoy CSS le
SASS Work ow



sass demo.sass > demo.css
Compass
Compass

      CSS
Meta-framework
built with SASS
Compass
body#index               %body#index
  #headers                 #headers
                             #page-header
    #page-header              my groceries
     +span(6)               #files-header
                              link to groceries.csv
   #files-header             #description-header
     +span(8)                 i need these to eat!
   #description-header     #content
     +span(10)               %ul#groceries
                               %li turkey cutlets
  #content                     %li captain crunch
    ul#groceries               %li 12 green peppers
      +no-bullets              %li Brooklyn Local 1
Blueprint vs. Compass
•   Blueprint:                   •   Express structure as
                                     classes in HTML
    •   Express layout as
        classes in HTML          •   Do layout and
                                     formatting in CSS
    •   Do text formatting in
        CSS                      •   Mix in Compass styles
                                     where needed
    •   Don’t mess up the
        Blueprint styles         •   Great way to build
                                     stable layouts
    •   Marginally better than
        tables

•   Compass:
A Bit of History

   HAML
     +
   SASS
Ruby on Rails 3

Gem le:


gem 'haml-rails'
???compass/sass
HAML + SASS
Topics
• HAML
• SASS
• Compass
• CoffeeScript
• Rake
• Charleston
CoffeeScript
JavaScript


LISP in C’s Clothing
           - Douglas Crockford
JavaScript

Functional
                        math = {
Object-oriented           root: Math.sqrt,
                          square: square,
Runs everywhere            cube: function(x) {
                             return x * square(x);
                          }
Gnarly syntax           };

Esoteric restrictions
CoffeeScript

                                math = {
                                  root: Math.sqrt,
math =
                                  square: square,
  root:   Math.sqrt
                                   cube: function(x) {
  square: square
                                     return x * square(x);
  cube:   (x) -> x * square x
                                  }
                                };
CoffeeScript
 • Indentation-based syntax
 • Simpler function de nitions
 • Simpler loops and conditionals

for roid in asteroids
  for roid2 in asteroids when roid isnt roid2
    roid.explode() if roid.overlaps roid2
CoffeeScript
•   Compiles to safe, valid cross-browser compatible JavaScript


var _i, _j, _len, _len2, _ref, _ref2, roid, roid2;
_ref = asteroids;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
  roid = _ref[_i];
  _ref2 = asteroids;
  for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
    roid2 = _ref2[_j];
    if (roid !== roid2) {
      if (roid.overlaps(roid2)) {
        roid.explode();
      }
    }
  }
}
CoffeeScript

         • Not a “JavaScript framework” like
            Prototype or jQuery


$('.navigation').click (e) ->
  return if e.target.tagName.toLowerCase() is 'a'
  if this isnt (current_nav and current_nav[0])
    close_menus()
    current_nav = $(this)
    current_nav.addClass 'active'
  false
http://bit.ly/jsvscs
save: function() {
  if (this.blank) {
    Telecaster.db.create("INSERT INTO files (name, content) VALUES (?, ?)",
                    [this.name, this.content], function(t, r){
      this.id = r.insertId;
      this.blank = false;
    }.bind(this));
  } else {
    Telecaster.db.update("UPDATE files SET name=?, content=? WHERE id=?",
                    [this.name, this.content, this.id], function(t, r){
    }.bind(this));
  }
  this.blank = false;
}



save: ->
  if @blank
    Telecaster.db.create "INSERT INTO files (name, content) VALUES (?, ?)",
      [@name, @content],
      (t, r) =>
        @id = r.insertId
        @blank = false
  else
    Telecaster.db.update "UPDATE files SET name=?, content=? WHERE id=?",
      [@name, @content, @id],
      (t, r) =>
  @blank = false
Disclaimer

CoffeeScript is just for fun. Until it
reaches 1.0, there are no
guarantees that the syntax won't
change between versions.
   http://jashkenas.github.com/coffee-script/
                             emphasis added
Disclaimer

CoffeeScript is just for fun. Until it
reaches 1.0, there are no
guarantees that the syntax won't
change between versions.
   http://jashkenas.github.com/coffee-script/
                             emphasis added
Installation

• Mac OS X with homebrew:
 1. brew install coffee-script
• Windows:
 1. Please read http://bit.ly/coffee4win
CoffeeScript

Build-time
    vs.
Load-time
Build-time



coffee -c maths.coffee
Load-time


<script type="text/coffeescript">
 # CoffeeScript here
</script>
<script src="coffee-script.js"></script>
CoffeeScript
Topics
• HAML
• SASS
• Compass
• CoffeeScript
• Rake
• Charleston
Rake
Build Tools
Rake


 Ruby-based build tool
Used internally by HAML,
   SASS, CoffeeScript
Rake

require 'rake'
require 'fileutils'
include FileUtils

HAMLS = Rake::FileList['pages/*.html.haml']
HAML_OUTPUT = HAMLS.map{ |f| f.sub(/^pages/, 'output').sub(/.haml$/, '') }

HAMLS.zip(HAML_OUTPUT) do |p|
  input, output = p
  file output => [input, 'output'] do
    sh 'haml', input, output
  end
end
Rake


My secret Rake le technique
Rake


My secret Rake le technique
Just copy the last one you wrote
and modify it as little as possible.
Rake
Charleston
Charleston


The static site generator
     I want to use.
Charleston
Charleston

• Bundle of Rake rules
• Example HAML, SASS, and CoffeeScript
   les
• Installs HAML and SASS
• Requires separate CoffeeScript install
Charleston Installation

• Mac OS X:
  • sudo gem install charleston
• Windows:
  1. Install ruby from http://rubyinstaller.org
  2. gem install charleston
Charleston Usage

charleston my_project
cd my_project
rake
open output/index.html
Charleston
Creating a New Page
1. Create new HTML or HAML le in
   your_project/pages
2. Link to new_page.html (even if it’s HAML) in
   your existing pages



  %a(href='new_page.html')
Charleston
Creating a New Stylesheet
1. Create new CSS or SASS le in
   your_project/stylesheets
2. Reference stylesheets/your_stylesheet.css
   (even if it’s SASS) in appropriate HTML les


    %link(rel='stylesheet' type='text/css' href='stylesheets/screen.css')
Charleston
Creating a New Script
1. Create new JavaScript or CoffeeScript le in
   your_project/javascripts
2. Reference javascripts/your_script.js (even if
   it’s CoffeeScript) in appropriate HTML les


  %script(type='text/javascript' src='javascripts/example.js')
Charleston
Adding an Image
1. Put the image le in your_project/images
2. Reference images/charleston_chew.jpg in
   appropriate HTML les




  %img(src='images/charleston_chew.jpg' alt='some candy’)
Charleston

• Each Charleston project is a separate
  directory.
• You should aggressively version-control
  these projects.
• The only  les you need to upload are in
  the output directory.
Charleston
Summary
   HAML
    SASS
  Compass
 CoffeeScript
    Rake
 Charleston
Photo Credits
All photos are of your friendly local historic mansion
landmark, Villa Vizcaya.

http://www. ickr.com/photos/gesteves/3336482837/
http://www. ickr.com/photos/mattkieffer/4671838772/
http://www. ickr.com/photos/portablematthew/21583071/
http://www. ickr.com/photos/spbutterworth/2755374263/
http://www. ickr.com/photos/gesteves/3337338344/
http://www. ickr.com/photos/italintheheart/4017460039/
Questions

Weitere ähnliche Inhalte

Was ist angesagt?

Your own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyYour own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with Ruby
Lindsay Holmwood
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
Itai Koren
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
Wynn Netherland
 

Was ist angesagt? (20)

CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gem
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 
Sass, Compass
Sass, CompassSass, Compass
Sass, Compass
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Your own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyYour own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with Ruby
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effects
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
HTML5 Canvas - The Future of Graphics on the Web
HTML5 Canvas - The Future of Graphics on the WebHTML5 Canvas - The Future of Graphics on the Web
HTML5 Canvas - The Future of Graphics on the Web
 
Rapid web development, the right way.
Rapid web development, the right way.Rapid web development, the right way.
Rapid web development, the right way.
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
 
GOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatGOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for that
 
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass Presentation
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
 

Andere mochten auch

introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
vikram singh
 

Andere mochten auch (9)

Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)
 
DIWE - Advanced PHP Concepts
DIWE - Advanced PHP ConceptsDIWE - Advanced PHP Concepts
DIWE - Advanced PHP Concepts
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web Services
 

Ähnlich wie Advanced Technology for Web Application Design

Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
Even Wu
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
Chris Lee
 
The Art Of Readable Code
The Art Of Readable CodeThe Art Of Readable Code
The Art Of Readable Code
Baidu, Inc.
 

Ähnlich wie Advanced Technology for Web Application Design (20)

Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Css3 and gwt in perfect harmony
Css3 and gwt in perfect harmonyCss3 and gwt in perfect harmony
Css3 and gwt in perfect harmony
 
Css3 and gwt in perfect harmony
Css3 and gwt in perfect harmonyCss3 and gwt in perfect harmony
Css3 and gwt in perfect harmony
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
 
Rails 3 (beta) Roundup
Rails 3 (beta) RoundupRails 3 (beta) Roundup
Rails 3 (beta) Roundup
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPress
 
The Art Of Readable Code
The Art Of Readable CodeThe Art Of Readable Code
The Art Of Readable Code
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Less(CSS Pre Processor) Introduction
Less(CSS Pre Processor) IntroductionLess(CSS Pre Processor) Introduction
Less(CSS Pre Processor) Introduction
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introduction
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the Backend
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Advanced Technology for Web Application Design

  • 2. Who? I’m Bryce. I live down the street. I’ve been accused of being a backend developer.
  • 3. Backend Developer?   save: function() {     if (this.blank) {       Telecaster.db.create("INSERT INTO files (name, content) VALUES (?, ?)", [this.name, this.content], function(t, r){         this.id = r.insertId;         this.blank = false;       }.bind(this));     } else {       Telecaster.db.update("UPDATE files SET name=?, content=? WHERE id=?", [this.name, this.content, this.id], function(t, r){       }.bind(this));     }     this.blank = false;   }
  • 4. Backend Developer • This presentation is a bit terminal-centric. • Mac OS X: • /Applications/Utilities/Terminal.app • Windows: • Command Line or cmd.exe
  • 5.
  • 6.
  • 8. Browser Languages HTML - content CSS - display content JavaScript - animate content
  • 9. Additional Tools Compass - CSS meta-framework Rake - build tool Charleston - site framework
  • 10. Topics • HAML • SASS • Compass • CoffeeScript • Rake • Charleston
  • 11. HAML
  • 12. HAML Hampton’s HTML Awesome Abstraction Markup Markup Language Language
  • 13. HTML   <div class='editor_box'>     <div class='chrome'>       <input id='filename' />       <span class='button' id='save_button'>Save</span>       <span class='button' id='eval_button'>Eval</span>     </div>     <textarea id='editor'></textarea>   </div>
  • 16. HAML   .editor_box class name     .chrome       %input#filename       %span.button#save_button Save
  • 17. HAML   .editor_box class name     .chrome Implicit div       %input#filename       %span.button#save_button Save
  • 18. HAML   .editor_box class name     .chrome Implicit div       %input#filename tag name, id name       %span.button#save_button Save
  • 19. HAML   .editor_box class name     .chrome Implicit div       %input#filename tag name, id name       %span.button#save_button Save tag, class, and id names
  • 20. HAML !!! 5 %head   %title haml demo %body   %h1 hello   .content     %p       I am a paragraph.     :markdown       You can embed markdown in HAML, because HAML       isn't great at body text.
  • 21. HTML <!DOCTYPE html> <head>   <title>haml demo</title> </head> <body>   <h1>hello</h1>   <div class='content'>     <p>       I am a paragraph.     </p>     <p>You can embed markdown in HAML, because HAML     isn't great at body text.</p>   </div> </body>
  • 22. Installation • Mac OS X: 1. gem install haml • Windows: 1. Install ruby from http://rubyinstaller.org 2. gem install haml
  • 23. HAML Work ow 1.Write HAML le 2.Use haml tool 3.Enjoy HTML le
  • 24. HAML Work ow haml demo.haml > demo.html
  • 26. SASS
  • 27. CSS .header { height: 89px; … } .header div { height: 89px; } .header .logo { width: 253px; height: 89px; …} .header .logo a:link, .header .logo a:visited { width: 253px; height: 89px; }
  • 28. SASS $header_height: 89px $logo_width: 253px .header   height: $header_height   div     height: $header_height   .logo     width: $logo_width     height: $header_height     a:link,     a:visited       width: $logo_width       height: $header_height
  • 30. SASS $header_height: 89px variable assignment .header   height: $header_height   div     width: $logo_width
  • 31. SASS $header_height: 89px variable assignment .header properties get braced   height: $header_height   div     width: $logo_width
  • 32. SASS $header_height: 89px variable assignment .header properties get braced   height: $header_height variable reference   div     width: $logo_width
  • 33. SASS $header_height: 89px variable assignment .header properties get braced   height: $header_height variable reference   div nesting     width: $logo_width
  • 34. Installation • Mac OS X: 1. gem install haml • Windows: 1. Install ruby from http://rubyinstaller.org 2. gem install haml
  • 35. SASS Work ow 1.Write SASS le 2.Use sass tool 3.Enjoy CSS le
  • 36. SASS Work ow sass demo.sass > demo.css
  • 38. Compass CSS Meta-framework built with SASS
  • 39. Compass body#index %body#index #headers #headers   #page-header   #page-header      my groceries      +span(6)    #files-header      link to groceries.csv    #files-header    #description-header      +span(8)      i need these to eat!    #description-header   #content      +span(10)     %ul#groceries       %li turkey cutlets   #content       %li captain crunch     ul#groceries       %li 12 green peppers       +no-bullets       %li Brooklyn Local 1
  • 40. Blueprint vs. Compass • Blueprint: • Express structure as classes in HTML • Express layout as classes in HTML • Do layout and formatting in CSS • Do text formatting in CSS • Mix in Compass styles where needed • Don’t mess up the Blueprint styles • Great way to build stable layouts • Marginally better than tables • Compass:
  • 41. A Bit of History HAML + SASS
  • 42. Ruby on Rails 3 Gem le: gem 'haml-rails' ???compass/sass
  • 44. Topics • HAML • SASS • Compass • CoffeeScript • Rake • Charleston
  • 46. JavaScript LISP in C’s Clothing - Douglas Crockford
  • 47. JavaScript Functional math = { Object-oriented root: Math.sqrt, square: square, Runs everywhere cube: function(x) { return x * square(x); } Gnarly syntax }; Esoteric restrictions
  • 48. CoffeeScript math = { root: Math.sqrt, math = square: square, root: Math.sqrt cube: function(x) { square: square return x * square(x); cube: (x) -> x * square x } };
  • 49. CoffeeScript • Indentation-based syntax • Simpler function de nitions • Simpler loops and conditionals for roid in asteroids for roid2 in asteroids when roid isnt roid2 roid.explode() if roid.overlaps roid2
  • 50. CoffeeScript • Compiles to safe, valid cross-browser compatible JavaScript var _i, _j, _len, _len2, _ref, _ref2, roid, roid2; _ref = asteroids; for (_i = 0, _len = _ref.length; _i < _len; _i++) { roid = _ref[_i]; _ref2 = asteroids; for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { roid2 = _ref2[_j]; if (roid !== roid2) { if (roid.overlaps(roid2)) { roid.explode(); } } } }
  • 51. CoffeeScript • Not a “JavaScript framework” like Prototype or jQuery $('.navigation').click (e) ->   return if e.target.tagName.toLowerCase() is 'a'   if this isnt (current_nav and current_nav[0])     close_menus()     current_nav = $(this)     current_nav.addClass 'active'   false
  • 52. http://bit.ly/jsvscs save: function() {   if (this.blank) {     Telecaster.db.create("INSERT INTO files (name, content) VALUES (?, ?)", [this.name, this.content], function(t, r){       this.id = r.insertId;       this.blank = false;     }.bind(this));   } else {     Telecaster.db.update("UPDATE files SET name=?, content=? WHERE id=?", [this.name, this.content, this.id], function(t, r){     }.bind(this));   }   this.blank = false; } save: ->   if @blank     Telecaster.db.create "INSERT INTO files (name, content) VALUES (?, ?)",       [@name, @content],       (t, r) =>         @id = r.insertId         @blank = false   else     Telecaster.db.update "UPDATE files SET name=?, content=? WHERE id=?",       [@name, @content, @id],       (t, r) =>   @blank = false
  • 53. Disclaimer CoffeeScript is just for fun. Until it reaches 1.0, there are no guarantees that the syntax won't change between versions. http://jashkenas.github.com/coffee-script/ emphasis added
  • 54. Disclaimer CoffeeScript is just for fun. Until it reaches 1.0, there are no guarantees that the syntax won't change between versions. http://jashkenas.github.com/coffee-script/ emphasis added
  • 55. Installation • Mac OS X with homebrew: 1. brew install coffee-script • Windows: 1. Please read http://bit.ly/coffee4win
  • 56. CoffeeScript Build-time vs. Load-time
  • 58. Load-time <script type="text/coffeescript"> # CoffeeScript here </script> <script src="coffee-script.js"></script>
  • 60. Topics • HAML • SASS • Compass • CoffeeScript • Rake • Charleston
  • 61. Rake
  • 63. Rake Ruby-based build tool Used internally by HAML, SASS, CoffeeScript
  • 64. Rake require 'rake' require 'fileutils' include FileUtils HAMLS = Rake::FileList['pages/*.html.haml'] HAML_OUTPUT = HAMLS.map{ |f| f.sub(/^pages/, 'output').sub(/.haml$/, '') } HAMLS.zip(HAML_OUTPUT) do |p|   input, output = p   file output => [input, 'output'] do     sh 'haml', input, output   end end
  • 65. Rake My secret Rake le technique
  • 66. Rake My secret Rake le technique Just copy the last one you wrote and modify it as little as possible.
  • 67. Rake
  • 69. Charleston The static site generator I want to use.
  • 71. Charleston • Bundle of Rake rules • Example HAML, SASS, and CoffeeScript les • Installs HAML and SASS • Requires separate CoffeeScript install
  • 72. Charleston Installation • Mac OS X: • sudo gem install charleston • Windows: 1. Install ruby from http://rubyinstaller.org 2. gem install charleston
  • 73. Charleston Usage charleston my_project cd my_project rake open output/index.html
  • 74.
  • 75. Charleston Creating a New Page 1. Create new HTML or HAML le in your_project/pages 2. Link to new_page.html (even if it’s HAML) in your existing pages %a(href='new_page.html')
  • 76. Charleston Creating a New Stylesheet 1. Create new CSS or SASS le in your_project/stylesheets 2. Reference stylesheets/your_stylesheet.css (even if it’s SASS) in appropriate HTML les %link(rel='stylesheet' type='text/css' href='stylesheets/screen.css')
  • 77. Charleston Creating a New Script 1. Create new JavaScript or CoffeeScript le in your_project/javascripts 2. Reference javascripts/your_script.js (even if it’s CoffeeScript) in appropriate HTML les %script(type='text/javascript' src='javascripts/example.js')
  • 78. Charleston Adding an Image 1. Put the image le in your_project/images 2. Reference images/charleston_chew.jpg in appropriate HTML les %img(src='images/charleston_chew.jpg' alt='some candy’)
  • 79. Charleston • Each Charleston project is a separate directory. • You should aggressively version-control these projects. • The only les you need to upload are in the output directory.
  • 81. Summary HAML SASS Compass CoffeeScript Rake Charleston
  • 82. Photo Credits All photos are of your friendly local historic mansion landmark, Villa Vizcaya. http://www. ickr.com/photos/gesteves/3336482837/ http://www. ickr.com/photos/mattkieffer/4671838772/ http://www. ickr.com/photos/portablematthew/21583071/ http://www. ickr.com/photos/spbutterworth/2755374263/ http://www. ickr.com/photos/gesteves/3337338344/ http://www. ickr.com/photos/italintheheart/4017460039/

Hinweis der Redaktion

  1. MY FRIEND &amp;#x201C;BRANDON&amp;#x201D;
  2. Hampton Catlin
  3. HAML is older than SASS SASS was originally part of HAML The&amp;#x2019;ve been separate for, like, two weeks