SlideShare a Scribd company logo
Hello.

http://is.gd/AWD-on-Ice-2011
ADAPTIVE WEB DESIGN WORKSHOP




    The Agenda
๏   Progressive Enhancement

    ‣ vs Graceful Degradation

    ‣ How & Why It Works

๏   Content & Organization
๏   Semantics

    ‣ HTML5

    ‣ Microformats




                                   2
ADAPTIVE WEB DESIGN WORKSHOP




    The Agenda
๏   Design

    ‣ Parsing Errors

    ‣ Designing in Layers

    ‣ Adaptive Layouts

    ‣ “Mobile First”
๏   Interactivity

    ‣ Unobtrusive JavaScript
    ‣ Adaptive Interfaces

    ‣ Hijax

                                   3
ADAPTIVE WEB DESIGN WORKSHOP




    The Agenda
๏   Accessibility

    ‣ Design Considerations

    ‣ ARIA




                                   4
Adaptive Web Design Workshop [Iceweb 2011]
VillageReach.org
Progressive
Enhancement
?
Technological
 restrictions
Adaptive Web Design Workshop [Iceweb 2011]
MCMLXXVII
MCMLXXVII
  (that’s 1977)
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
HTML   CSS
fault tolerance
n. a system’s ability to continue to
operate when it encounters and
unexpected error.
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Browsers IGNORE
 what they don’t
   understand
Graceful
Degradation
Modern
Browsers
   Older Browsers
Modern
Browsers
   Older Browsers
Progressive
Enhancement
Progressive
Graceful Degradation   Enhancement
Content
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
:-)
Adaptive Web Design Workshop [Iceweb 2011]
Ooooh.
Shiny!
Progressive
Enhancement
 ISN’T about
  browsers.
Browsers and
 technologies
COME AND GO
Don’t lose sight
of your USERS
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience



                     Accessibility

                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience



                          ARIA

                      JavaScript

                           CSS

                         HTML
             BASIC                          ADVANCED

                     Browser Capabilities


                     Text & HTTP
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Content
 is WHY
we build
websites
Clear,
well-written
prose is key.
Organize
 & prioritize
your content
Don’t
obscure
content.
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Header

                       Nav
Features

                      Extra

                       Social
Programs
                    Newsletter



 News



           Footer
Header

Features               Nav

Programs              Extra

 News                 Social

                    Newsletter

           Footer
User Experience




                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Semantics 101
 <p>HTML5 introduces several <em>really</em>
 useful elements and a ton of new APIs.</p>


 <p>Please fill out the form below.
 <strong>Note: all fields are required.</strong></p>


 <p>I like to work with markup languages because
 <strong>they are simple and easy to read</strong>.
 They also have that certain <i lang="fr" title="I
 don&#8217;t know what">je ne sais quoi</i>.</p>
ADAPTIVE WEB DESIGN WORKSHOP




Semantics 101




                               small
ADAPTIVE WEB DESIGN WORKSHOP




Semantics 101


                               hr
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <figure id="fig-1">
  <img src="photo.jpeg" alt=""/>
  <figcaption>Photo of Albert Einstein</figcaption>
 </figure>


 <figure id="fig-2">
  <table>
    <caption>2011 Forecast Earnings</caption>
    <!-- a bunch of data -->
  </table>
 </figure>
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <section>
  <!-- pretty much anything can go here -->
 </section>


 <article>
  <!-- pretty much anything can go here -->
 </article>
Adaptive Web Design Workshop [Iceweb 2011]
section
section > article
Adaptive Web Design Workshop [Iceweb 2011]
article
article > section
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <header>
  <!-- titles, etc. go here -->
 </header>


 <footer>
  <!-- meta/supplementary information goes here -->
 </footer>
Adaptive Web Design Workshop [Iceweb 2011]
header
Adaptive Web Design Workshop [Iceweb 2011]
footer
article
article > header
article
article > footer
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <nav>
  <ol>
    <li><a href="#details">Details</a></li>
    <li><a href="#lodging">Lodging</a></li>
    <li><a href="#location">Location</a></li>
    <li><a href="#topics">Topics</a></li>
    <li><a href="#contact">Contact Us</a></li>
  </ol>
  <p><a href="register">Register Now</a>
    <b>Only 5 spaces left</b></p>
 </nav>
Adaptive Web Design Workshop [Iceweb 2011]
nav
Adaptive Web Design Workshop [Iceweb 2011]
nav
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <article>

    <!-- main content -->

    <aside>
     <!-- something related -->
    </aside>

 </article>
Adaptive Web Design Workshop [Iceweb 2011]
aside
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Implicit sections (HTML4)
                               <h1> HTML5
                               <p> HTML5 is currently under development...
                               <p> Like its immediate predecessors, HTML...


                               <h2> W3C standardization process
                               <p> The Web Hypertext Application...
                               <p> The HTML5 specification...
                               <p> According to the W3C timetable...
                               <p> Ian Hickson, editor of the HTML5...


                               <h2> Markup
                               <p> HTML5 introduces a number of...
                               <p> The HTML5 syntax is no longer...




                                1 HTML5
                                1.1 W3C standardization process
                                1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




Explicit sections (HTML5)
                                    <h1> HTML5
                                    <p> HTML5 is currently under development...
                                    <p> Like its immediate predecessors, HTML...


                                    <h2> W3C standardization process
                          section


                                    <p> The Web Hypertext Application...
                                    <p> The HTML5 specification...
                                    <p> According to the W3C timetable...
                                    <p> Ian Hickson, editor of the HTML5...


                                    <h2> Markup
                          section




                                    <p> HTML5 introduces a number of...
                                    <p> The HTML5 syntax is no longer...




                                     1 HTML5
                                     1.1 W3C standardization process
                                     1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




Explicit sections (HTML5)
                                    <h1> HTML5
                                    <p> HTML5 is currently under development...
                                    <p> Like its immediate predecessors, HTML...


                                    <h1> W3C standardization process
                          section


                                    <p> The Web Hypertext Application...
                                    <p> The HTML5 specification...
                                    <p> According to the W3C timetable...
                                    <p> Ian Hickson, editor of the HTML5...


                                    <h1> Markup
                          section




                                    <p> HTML5 introduces a number of...
                                    <p> The HTML5 syntax is no longer...




                                     1 HTML5
                                     1.1 W3C standardization process
                                     1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




Explicit sections (HTML5)
                                    <h1> HTML5
                                    <p> HTML5 is currently under development...
                                    <p> Like its immediate predecessors, HTML...


                                    <h4> W3C standardization process
                          section


                                    <p> The Web Hypertext Application...
                                    <p> The HTML5 specification...
                                    <p> According to the W3C timetable...
                                    <p> Ian Hickson, editor of the HTML5...


                                    <h6> Markup
                          section




                                    <p> HTML5 introduces a number of...
                                    <p> The HTML5 syntax is no longer...




                                     1 HTML5
                                     1.1 W3C standardization process
                                     1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




    Sections
๏   section
๏   article
๏   aside
๏   footer
๏   header
๏   nav




                                   87
ADAPTIVE WEB DESIGN WORKSHOP




Outline limitations in HTML4
                               <h1> Title
                               <h2> Subtitle
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...




                                1 Title
                                1.1 Subtitle
ADAPTIVE WEB DESIGN WORKSHOP




Heading groups (HTML5)

                          hgroup
                                   <h1> Title
                                   <h2> Subtitle
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...




                                    1 Title
ADAPTIVE WEB DESIGN WORKSHOP




Aside: rooted sections
                               <h1> Title
                               <p> Text content continues...
                               <p> Text content continues...


                               <h2> Section heading
                               <p> Text content continues...
                               <blockquote>
                                 <h2> Rooted heading
                                 <p> Text content continues...
                                 <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...




                                1 Title
                                1.1 Section heading
ADAPTIVE WEB DESIGN WORKSHOP




    Sectioning roots
๏   body
๏   blockquote
๏   details
๏   fieldset
๏   figure
๏   td




                                   91
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Dates & Times
 <input type="date" name="dob"/>
ADAPTIVE WEB DESIGN WORKSHOP




Numbers
 <input type="number" name="foo"/>




 <input type="range" min="1" max="11" name="foo"/>
ADAPTIVE WEB DESIGN WORKSHOP




Format validation
 <input type="email" …/>       <input type="url" …/>
ADAPTIVE WEB DESIGN WORKSHOP




Format validation
 <input type="text"
        pattern="d{6}w{3}"
        placeholder="6 digits followed by 3 letters"
        .../>
Ad-hoc
Semantics
ADAPTIVE WEB DESIGN WORKSHOP




Classi cation
ADAPTIVE WEB DESIGN WORKSHOP




Identi cation
ADAPTIVE WEB DESIGN WORKSHOP




Microformats
 <section class="vcard">
  <figure>
    <img class="photo" src="aaron-gustafson.jpg" alt=""/>
  </figure>
  <h1 class="fn">Aaron Gustafson</h1>
  …
  <p>Aaron … is <b class="role">Group Manager</b> of the
    <a class="org" href="http://webstandards.org">Web
    Standards Project (WaSP)</a> ….</p>
 </section>
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Header
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="header">
  <a href="#donate" class="donate-link"
     title="Click here to view our donation options">Donate</a>
  <a href="http://villagereach.org/feed/" class="rss-link"
     title="View our RSS Feed">RSS Feed</a>
  <div id="site-title">
    <a href="http://villagereach.org" title="Village Reach: Home">
     <span>Village Reach</span>
    </a>
  </div>
 </div><!-- #header -->
Adaptive Web Design Workshop [Iceweb 2011]
Features




Programs




 News
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div class="entry-content entry">
  <!-- Features -->
  <div class="boxes three home">
    <!-- Programs -->
  </div>
  <div id="latestNews">
    <!-- Latest News -->
  </div>
 </div>
Adaptive Web Design Workshop [Iceweb 2011]
Nav
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="hybrid-search-3" class="widget search widget-search">
  <div class="widget-inside">
    <form method="get" class="search-form" id="search-form"
 action="http://villagereach.org/">
      <!--Search Form -->
    </form><!-- .search-form -->
  </div>
 </div>
 <div id="navigation">
  <div id="page-nav" class="page-nav">
    <ul class="menu sf-menu">
      <!-- Navigation -->
    </ul>
  </div>
 </div><!-- #navigation -->
Adaptive Web Design Workshop [Iceweb 2011]
Extra

   Social


Newsletter
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="text-8" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Extra -->
  </div>
 </div>
 <div id="text-7" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Social -->
  </div>
 </div>
 <div id="mc_signup_container">
  <!-- Newsletter -->
 </div>
Adaptive Web Design Workshop [Iceweb 2011]
Footer
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="footer-container">
  <div id="footer">
    <p class="copyright">Copyright &#169; 2011 <a class="site-link"
 href="http://villagereach.org" title="VillageReach"
 rel="home"><span>VillageReach</span></a>. - All rights
 reserved.</p>
  </div><!-- #footer -->
 </div><!-- #footer-container -->
User Experience




                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors


                               p{
                                 color: red;
                               }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors


                               p{
                                 color: red;
                               }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors


                               p{
                                 color: red;
                                 font-weight: bold;
                               }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors


                               p{
                                 color: red;
                                 font-weight: bold;
                               }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 p {
   color: #ccc;
   color: rgba( 0, 0, 0, .5 );
 }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 html[lang] p {
   color: #ccc;
   color: rgba( 0, 0, 0, .5 );
 }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 @-moz-document url-prefix() {
   html[lang] p {
     color: #ccc;
     color: rgba( 0, 0, 0, .5 );
   }
 }
#intro {
  /* Basic Layout */
}

/* ... */

body[id=css-zen-garden] #intro {
 /* Advanced Layout */
}
#intro {
  /* Basic Layout */
}

/* ... */

[foo], #intro {
  /* Advanced Layout */
}
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 @import 'not-for-IE7-or-below.css' screen;

 @media screen, print, refrigerator {
   /* IE will get these rules */
 }
ADAPTIVE WEB DESIGN WORKSHOP




Organization



                               design
ADAPTIVE WEB DESIGN WORKSHOP




Organization


                               type        color


                                  layout
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 /* =Typography */
 img {
   display: block;
 }

 /* =Layout */
 @media screen {
   .frame .inner {
     border: 10px solid;
   }
 }

 /* =Color */
 .frame .inner {
   background-color: rgb(227, 222, 215);
   border-color: rgb(227, 222, 215);
 }
ADAPTIVE WEB DESIGN WORKSHOP




Organization

                  type.css




                 layout.css    main.css




                  color.css
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 {embed="styles/typography"}

 @media screen {
   {embed="styles/layout-screen"}
 }

 {embed="styles/color"}
                                    Example using ExpressionEngine embed tags
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 {embed="styles/reset"}

 {embed="styles/typography"}

 @media screen {
   {embed="styles/layout-screen"}
 }

 @media print {
   {embed="styles/layout-print"}
 }

 {embed="styles/color"}

 {embed="styles/effects"}
                                    Example using ExpressionEngine embed tags
ADAPTIVE WEB DESIGN WORKSHOP




Monkey-patching
 <link rel="stylesheet" href="main.css"/>
 <!--[if IE 9]><link rel="stylesheet" href="ie9.css"/><![endif]-->
 <!--[if lte IE 8]><link rel="stylesheet" href="ie8.css"/><![endif]-->
 <!--[if lte IE 7]><link rel="stylesheet" href="ie7.css"/><![endif]-->
 <!--[if lte IE 6]><link rel="stylesheet" href="ie6.css"/><![endif]-->
ADAPTIVE WEB DESIGN WORKSHOP




Monkey-patching
 @-moz-document url-prefix() {

       /* GENERATED CONTENT - FF3 doesn't allow positioning */
       #extra-mile:before {
          content: '';
       }
       #extra-mile:first-of-type:before {
          content: url(extra-mile-sign.png);
       }

 }
ADAPTIVE WEB DESIGN WORKSHOP




Media Queries
ADAPTIVE WEB DESIGN WORKSHOP




@Media blocks
 @media screen {
   /* Styles for screen media only */
 }
ADAPTIVE WEB DESIGN WORKSHOP




@Media blocks+
 @media screen and (max-width:450px) {
   /* Styles for screen media when browser
      is 450px wide or below */
 }
ADAPTIVE WEB DESIGN WORKSHOP




Getting granular
 @media
   screen and (min-device-width:1024px)
          and (max-width:989px),
   screen and (max-device-width:480px),
   screen and (max-device-width:480px)
          and (orientation:landscape),
   screen and (min-device-width:481px)
          and (orientation:portrait) {
   /* Layout for narrower desktop (below 990px)
      or
      iPhone running iOS 3 (or equivalent)
      or
      iPhone running iOS 4 (or equivalent) in “landscape” view
      or
      iPad (or equivalent) in “portrait” view */
 }
ADAPTIVE WEB DESIGN WORKSHOP




Mobile First w/ media queries
 /* Universal Layout */

 @media screen {
   /* Styles for all screens */
 }

 @media screen and (min-width:481px) {
   /* Styles for all screens 480px+ width */
 }

 @media screen and (min-width:754px) {
   /* Styles for all screens 754px+ width */
 }
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Mobile First w/ media queries
 #hd {
   background: url(hd-bg-small.png) repeat-x 50% 50%;
 }
 #hd .logo a {
   background: url(logo-small.png) no-repeat 50% 0;
   display: block;
   width: 240px;
   height: 109px;
   /* … */
 }
 @media screen and (min-width: 481px) {
   #hd {
     background: url(hd-bg.png) no-repeat 50% 52px;
   }
   #hd .logo a {
     background-image: url(logo.png);
     width: 342px;
     height: 155px;
   }
 }
Header

                       Nav
Features

                      Extra

                       Social
Programs
                    Newsletter



 News



           Footer
Adaptive Web Design Workshop [Iceweb 2011]
Header

                       Nav
Features

                      Extra

                       Social
Programs
                    Newsletter



 News



           Footer
User Experience




                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Photo credit: spike55151
ADAPTIVE WEB DESIGN WORKSHOP




Sins of our past
 <a href="javascript:someFunction();">some text</a>


 <a href="javascript:void(null);"
    onclick="someFunction();">some text</a>


 <a href="#" onclick="someFunction();">some text</a>
ADAPTIVE WEB DESIGN WORKSHOP




A minor improvement
 <a href="http://offsite.com"
    onclick="newWin( this.href ); return false;">
    some text</a>
Photo credit: Giando
ADAPTIVE WEB DESIGN WORKSHOP




Event listeners
 window.onload = handleExternalLinks;

 function handleExternalLinks()
 {
   var server = document.location.hostname;
   var anchors = document.getElementsByTagName("a");
   var i, href;
   for( i=0; i < anchors.length; i++ )
   {
     href = anchors[i].href;
     if ( href.indexOf("http://" + server) == -1 &&
           href.indexOf("https://" + server) == -1 )
     {
        // HREF is not a file on my server
        anchors[i].onclick = function()
        {
           newWin( this.href );
        };
     }
   }
 }
Photo credit: hebedesign
ADAPTIVE WEB DESIGN WORKSHOP




Listen and delegate
 document
   .getElementsByTagName( 'body' )[0]
     .onclick = clickDelegator;

 function clickDelegator( e )
 {
   e = ( e ) ? e : event;
   var el = e.target || e.srcElement;
   // external links
   if ( el.nodeName.toLowerCase() == 'a' &&
        el.getAttribute( 'rel' ) == 'external' )
   {
      newWin( el.href );
   }
 }
Photo credit: josh-n
ADAPTIVE WEB DESIGN WORKSHOP




Test for dependencies
 function someFunction()
 {
   if ( !document.getElementsByTagName ) return;

     // code that uses document.getElementsByTagName()

 }
ADAPTIVE WEB DESIGN WORKSHOP




Test for dependencies
 function someFunction()
 {
   if ( !document.getElementsByTagName ||
        !document.getElementById ) return;

     /* code that uses document.getElementsByTagName()
        and document.getElementById() */

 }
ADAPTIVE WEB DESIGN WORKSHOP




Test for dependencies
 function someFunction()
 {
   if ( !document.getElementsByTagName ||
        !document.getElementsByTagName('p') ) return;

     // code that requires the presence of a P element

 }
ADAPTIVE WEB DESIGN WORKSHOP




Test for dependencies
 function someFunction()
 {
   if ( !document.getElementById ||
        !document.getElementById('content') ) return;

     // code that requires the presence of #content

 }
ADAPTIVE WEB DESIGN WORKSHOP




Test for dependencies
 function someFunction()
 {
   if ( typeof( Prototype ) == 'undefined' ||
        parseFloat( Prototype.Version ) < 1.5 ) return;

     // code that uses Prototype 1.5 or higher

 }
ADAPTIVE WEB DESIGN WORKSHOP




Test for dependencies
 window.addEventListener(
    'load',
    function(){
       if ( document.getElementsByTagName &&
            document.getElementById )
       {
          someFunction();
       }
    },
    false
 );
Photo credit: ambery
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Without JavaScript
With JavaScript
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Source of blog entry page

 <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/
    comments/#comments"
    data-replace="/comments/{url_title}/">View comments on this
    entry and add your own</a>


 {if segment_4=="comments"}
     <section id="comments" class="focal">
     {embed="inc/.comments" url_title="{url_title}"}
     </section>
 {if:else}
     {comment_loader}
 {/if}
                                              Examples use ExpressionEngine tags
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Source of blog entry page

 <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/
    comments/#comments"
    data-replace="/comments/{url_title}/">View comments on this
    entry and add your own</a>


 {if segment_4=="comments"}
     <section id="comments" class="focal">
     {embed="inc/.comments" url_title="{url_title}"}
     </section>
 {if:else}
     {comment_loader}
 {/if}
                                              Examples use ExpressionEngine tags
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Source of /comments/{url_title} (technically /pages/comments/{url_title})

 {embed="inc/.comments" url_title="{segment_3}"}
                                                          Example uses ExpressionEngine tags
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
                                                                  https://gist.github.com/b976b67e88ffbfc9f125


 $.fn.ajaxInclude = function(){
      return this.each(function() {
           var $el               = $( this ),
                 target          = $el.data( 'target' ),
                 $targetEl       = target && $( target ) || $el,
                 methods         = [ 'append', 'replace', 'before', 'after' ],
                 ml              = methods.length,
                 method,
                 url;
           while ( ml-- ) {
                 method = methods[ ml ];
                 if ( $el.is( '[data-' + method + ']' ) ) {
                       url       = $el.data( method );
                       break;
                 }
           }
           if ( method == 'replace' ) { method += 'With'; }
           if ( url && method ) {
                 $.get( url, function( data ){
                       $el.trigger( 'ajaxInclude', [$targetEl, data] );
                       $targetEl[ method ]( data );
                 });
           }
      });
 };
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Replace:
 <a data-replace="articles/latest/fragment"
    href="...">Latest Articles</a>


Before:
 <a data-before="articles/latest/fragment"
    href="...">Latest Articles</a>


After:
 <a data-after="articles/latest/fragment"
    href="...">Latest Articles</a>
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
 $("[data-append],[data-replace],”+
   “[data-after],[data-before]").ajaxInclude();
ADAPTIVE WEB DESIGN WORKSHOP




                               176
JavaScript
             CSS
ADAPTIVE WEB DESIGN WORKSHOP




Remember stu like this?
 <a href="foo.html"
    style="color:blue;"
    onmouseover="this.style.color='red'"
    onmouseout="this.style.color='blue'">Foo</a>
ADAPTIVE WEB DESIGN WORKSHOP




Remember stu like this?
 <a href="foo.html"
    style="color:blue;"
    onmouseover="this.style.color='red'"
    onmouseout="this.style.color='blue'">Foo</a>


 a, a:link, a:visited {
   color: blue;
 }
 a:hover {
   color: red;
 }
ADAPTIVE WEB DESIGN WORKSHOP




Isn’t this the same?
 for( i=0; i<objects.length; i++){
   objects[i].style.display = 'none';
 }
ADAPTIVE WEB DESIGN WORKSHOP




Small improvement
 for( i=0; i<objects.length; i++){
   objects[i].style.position = 'absolute';
   objects[i].style.left      = '-999em';
 }
ADAPTIVE WEB DESIGN WORKSHOP




Separation
  for( i=0; i<objects.length; i++){
    objects[i].addClassName( 'hidden' );
  }


  .hidden {
    position: absolute;
    left: -999em;
  }
ADAPTIVE WEB DESIGN WORKSHOP




    Maintenance options
๏   external style rules added to your CSS le (by hand)
๏   external CSS le added to the document (by hand)
๏   external CSS le added to the document via script
๏   embedding CSS in the document via script




                                                          182
ADAPTIVE WEB DESIGN WORKSHOP




Option 1: Add by hand
 /* =START WickedCool Script CSS (do not remove) */
 .wicked {
   color: red;
   font: bold 4em/2 "Comic Sans";
 }
 .cool {
   color: blue;
   font: bold 4em/2 "Comic Sans";
 }
 /* =END WickedCool Script CSS */
ADAPTIVE WEB DESIGN WORKSHOP




Option 2: Include by hand
  <script src="WickedCool.js"></script>
  <link rel="stylesheet" href="WickedCool.css" />
ADAPTIVE WEB DESIGN WORKSHOP




Option 2: Include by hand
  <script src="WickedCool.js"></script>
  <link rel="stylesheet" href="WickedCool.css" />


  <head>
    <!-- … -->
    <link rel="stylesheet" href="WickedCool.css" />
  </head>
  <body>
    <!-- … -->
    <script src="WickedCool.js"></script>
  </body>
ADAPTIVE WEB DESIGN WORKSHOP




Option 3: Scripted include
  function FindPath( filename )
  {
    var path = false;
    var scripts = document.getElementsByTagName( 'script' );
    for( var i=0; i<scripts.length; i++ )
    {
      if( scripts[i].getAttribute( 'src' ) &&
          scripts[i].getAttribute( 'src' )
                    .indexOf( filename ) != -1 )
      {
        path = scripts[i]
                 .getAttribute( 'src' )
                 .replace( new RegExp( filename ), '' );
        break;
      }
    }
    return path;
  }
ADAPTIVE WEB DESIGN WORKSHOP




Option 3: Scripted include
  var WickedCool = {
     jsFile:    'WickedCool.js',
     cssFile:   'WickedCool.css',
     initialize: function(){
       // determine the path
       var path = FindPath( this.jsFile );
       // add the CSS file
       var css = document.createElement( 'link' );
       css.setAttribute( 'rel', 'stylesheet' );
       css.setAttribute( 'href', path + this.cssFile );
       document.getElementsByTagName( 'head' )[0]
               .appendChild( css );
       // do the rest of the wicked cool stuff
     }
  };
ADAPTIVE WEB DESIGN WORKSHOP




Option 4: Scripted embed
  function addCSS( styles )
  {
    var el = document.createElement( 'style' );
         el.setAttribute( 'type', 'text/css' );
    if ( el.styleSheet )
    {
      el.styleSheet.cssText = styles;
    }
    else
    {
      el.appendChild( document.createTextNode( styles ) );
    }
    document.getElementsByTagName( 'head' )[0]
             .appendChild( el );
  }
ADAPTIVE WEB DESIGN WORKSHOP




Option 4: Scripted embed
  var WickedCool = {
     _css: '.wicked { color: red; ' +
           '          font: bold 4em/2 "Comic Sans"; } ' +
           '.cool { color: blue; ' +
           '        font: bold 4em/2' "Comic Sans"; }',
     initialize: function()
     {
       // add the CSS
       addCSS( this._css );
       // do the rest of the wicked cool stuff
     }
  };




                                              based on the work of Nicholas Zakas
Apply No Style
Before Its Time
ADAPTIVE WEB DESIGN WORKSHOP




How do we do that?
  .TabInterface-folder {
    /* ... */
  }


  #TabInterface .tab {
    /* ... */
  }
  #TabInterface .tab.active {
    /* ... */
  }




                                190
ADAPTIVE WEB DESIGN WORKSHOP




How do we do that?
               Tactic                Default        Activated


add “-on” to the class         .tabbed         .tabbed-on




add an activation class .auto-submit           .auto-submit.active



change the form of the
                               .replace-me     .replaced
class
ADAPTIVE WEB DESIGN WORKSHOP




Media Queries
ADAPTIVE WEB DESIGN WORKSHOP




Mobile interfaces
ADAPTIVE WEB DESIGN WORKSHOP




Swapping content
 var trigger = 659;

 // …

 function toggleDisplay()
 {
     var width = $window.width();
     if ( showing == 'old' &&
           width <= trigger )
     {
          $old_nav.replaceWith($new_nav);
          showing = 'new';
     }
     else if ( showing == 'new' &&
                width > trigger )
     {
          $new_nav.replaceWith($old_nav);
          showing = 'old';
     }
 }
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <ul>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
ADAPTIVE WEB DESIGN WORKSHOP




Style?
 <ul style=”height: 300px;”>
  <li style=”height: 300px;” >
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li style=”height: 300px;” >
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li style=”height: 300px;” >
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Style?
 <ul class="jcarousel-skin-vr" style=”height: 300px;”>
  <li style=”height: 300px;”>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li style=”height: 300px;”>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li style=”height: 300px;”>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
ADAPTIVE WEB DESIGN WORKSHOP




Script
 <ul id="vr-carousel">
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
ADAPTIVE WEB DESIGN WORKSHOP




Script
 $j('#vr-carousel').jcarousel({
  auto: 6,
  visible: 1,
  animation: 0,
  wrap: 'both',
  scroll: 1,
  initCallback: vrCarousel_initCallback,
  itemFirstInCallback: vrCarousel_itemFirstInCallback,
  itemFirstInCallback: vrCarousel_fadeIn,
  itemFirstOutCallback: vrCarousel_fadeOut
 });
ADAPTIVE WEB DESIGN WORKSHOP




Script
 function vrCarousel_initCallback( carousel, item, idx, state )
 {
   // Pause autoscrolling if the user moves
   // with the cursor over the clip.
   carousel.clip.hover(function() {
       carousel.stopAuto();
   }, function() {
       carousel.startAuto();
   });

  $j('.jcarousel-item').css('opacity', 0);
 };
ADAPTIVE WEB DESIGN WORKSHOP




Script
 function vrCarousel_initCallback( carousel, item, idx, state )
 {
   var $i = carousel.list.find(‘img’), h = 0;

    // get the max h
    $i.each(function(){
     var test = $j(this).height();
     if ( test > h ){ h = test; }
    });

    // …

    carousel.list.height(h);
    $j('.jcarousel-item').css({
     opacity: 0, height: h
    });

 };
http://flex.madebymufffin.com
User Experience



                     Accessibility

                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Accessibility
“special needs”
“special needs”
    can be
 CONTEXTUAL
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Tweet</button>

 <a class=”button”>Tweet</a>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Tweet</button>

 <a class=”button”>Tweet</a>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Search Mail</button>

 <div>Search Mail</div>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Search Mail</button>

 <div>Search Mail</div>
ADAPTIVE WEB DESIGN WORKSHOP




ARIA maps the OS to the web
Semantics+
ADAPTIVE WEB DESIGN WORKSHOP




All the web’s a play…
 <section id="main" role="main">
  <!-- The primary content for the page would go here -->
 </section>
Adaptive Web Design Workshop [Iceweb 2011]
<header role="banner">
<nav role="navigation">
<form role="search">
<section role="main">
Adaptive Web Design Workshop [Iceweb 2011]
<footer role="contentinfo">
<nav role="navigation">
Adaptive Web Design Workshop [Iceweb 2011]
<nav role="navigation">
ADAPTIVE WEB DESIGN WORKSHOP




Semantic comparison
             Ad-hoc                   ARIA Role               HTML5

 #header, #top                 banner                header (kind of)


 #main, #content               main                  none


 #extra, .sidebar              complementary, note   aside


 #footer, #bottom              contentinfo           footer


 #nav                          navigation            nav


 .hentry                       article               article
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




These are the droids you seek
 <span role="button">OK</span>


 <div role="alert">
  <p>Something went wrong.</p>
 </div>


 <div role="alertdialog">
  <p>Something went wrong.</p>
  <img src="x.png" alt="dismiss" role="button" />
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <a role=”button”>Tweet</a>
    class=”button”>Tweet</a>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <a role=”button”>Tweet</a>
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




What’s happening?

                               B       B
                               (off)   (on)




 <span>
  <img src="bold-off.png" alt="bold" />
 </span>
 <span>
  <img src="bold-on.png" alt="bold" />
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




What’s happening?

                               B       B
                               (off)   (on)




 <span>
  <img src="bold-off.png" alt="not bold" />
 </span>
 <span>
  <img src="bold-on.png" alt="bold" />
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




What’s happening?

                               B       B
                               (off)   (on)




 <span role="button" aria-pressed="false">
  <img src="bold-off.png" alt="not bold" />
 </span>
 <span role="button" aria-pressed="true">
  <img src="bold-on.png" alt="bold" />
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




Complex interfaces
ADAPTIVE WEB DESIGN WORKSHOP




Traditional approach
 <h1>Pumpkin Pie</h1>
 <div class="container">
  <div class="section">
    <h2>Overview</h2>
    <img src="pie.jpg" alt="">
    <p>Whether you're hosting a festive party or a casual
    get-together with friends, our Pumpkin Pie will make
    entertaining easy!</p>
    <!-- ... -->
  </div>
  <!-- ... -->
  <ul class="tabs">
    <li><a href="#">Overview</a></li>
    <li><a href="#">Ingredients</a></li>
    <li><a href="#">Directions</a></li>
    <li><a href="#">Nutrition</a></li>
  </ul>
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




Cleaner approach
 <h1>Pumpkin Pie</h1>
 <div class="tabbed">
  <h2>Overview</h2>
  <img src="pie.jpg" alt="" />
  <p>Whether you're hosting a festive party or a casual
  get-together with friends, our Pumpkin Pie will make
  entertaining easy!</p>
  <!-- ... -->
  <h2>Ingredients</h2>
  <ul>
    <li>1 (9<abbr title="inch">in</abbr>) unbaked deep
       dish pie crust</li>
    <li>½ cup white sugar</li>
    <!-- ... -->
  </ul>
  <h2>Directions</h2>
  <!-- ... -->
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




Cleaner approach
 <h1>Pumpkin Pie</h1>
 <div class="tabbed">
  <h2>Overview</h2>
  <img src="pie.jpg" alt="" />
  <p>Whether you're hosting a festive party or a casual
  get-together with friends, our Pumpkin Pie will make
  entertaining easy!</p>
  <!-- ... -->
  <h2>Ingredients</h2>
  <ul>
    <li>1 (9<abbr title="inch">in</abbr>) unbaked deep
       dish pie crust</li>
    <li>½ cup white sugar</li>
    <!-- ... -->
  </ul>
  <h2>Directions</h2>
  <!-- ... -->
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




No JS, basic CSS
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic


                               Page
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic


                               Page




                               JS?
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic


                               Page




                               JS?    No
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic



               Split                 Page
          the content &
           make some
               tabs


                                     JS?
                               Yes          No
ADAPTIVE WEB DESIGN WORKSHOP




On DOM ready
 <h1>Pumpkin Pie</h1>
 <div class="tabbed-on">
  <section>
    <h2>Overview</h2>
    <img src="pie.jpg" alt="">
    <p>Whether you're hosting a festive party or a casual
    get-together with friends, our Pumpkin Pie will make
    entertaining easy!</p>
    <!-- ... -->
  </section>
  <!-- ... -->
  <ul class="tabs">
    <li><a href="#">Overview</a></li>
    <li><a href="#">Ingredients</a></li>
    <li><a href="#">Directions</a></li>
    <li><a href="#">Nutrition</a></li>
  </ul>
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA
                               role="tablist"




                                                246
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA




               role="tab"
               aria-selected="true"
               aria-controls="folder-1"
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA                    role="tab"
                               aria-selected="false"
                               aria-controls="folder-4"
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA




                               role="tabpanel"
                               aria-hidden="false"
                               aria-labelledby="folder-1-tab"
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA




                               role="application"
                               aria-activedescendant="folder-1"
ADAPTIVE WEB DESIGN WORKSHOP




Result!
Photo credit: emilio labrador
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                             Accessibility
 CSS Rules                     Display E ect
                                                             E ect
 visibility: hidden;           Element is hidden from        Content is ignored by screen
                               view, but is not removed      readers
                               from the normal ow (i.e. it
                               still takes up the space it
                               normally would)

 display: none;                Element is removed from       Content is ignored by screen
                               the normal ow and hidden;     readers
                               the space it occupied is
                               collapsed

 height: 0;                    Element is collapsed and      Content is ignored by screen
 width: 0;                     contents are hidden           readers
 overflow: hidden;
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                             Accessibility
 CSS Rules                     Display E ect
                                                             E ect
 text-indent: -999em;          Contents are shifted o -      Screen readers have access
                               screen and hidden from        to the content, but the
                               view, but links may “focus”   content is limited to text and
                               oddly and negative indent     inline elements
                               may not prove long enough
                               to fully hide content


 position: absolute;           Content is removed from       Screen readers have access
 left: -999em;                 the normal ow and shifted     to the content
                               o the left-hand edge; the
                               space it occupied is
                               collapsed
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                             Accessibility
 CSS Rules                     Display E ect
                                                             E ect
 position: absolute;           Content is positioned         Screen readers have access
 /* IE6, IE7 */                absolutely (and is removed    to the content
 clip: rect(
   1px 1px 1px 1px             from the normal ow), but
       );                      remains in place and is
 /* W3C */                     clipped to become invisible
 clip: rect(
   1px, 1px, 1px, 1px
       );
 padding: 0;
 border: 0;
 height: 1px;
 width: 1px;
 overflow: hidden;
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                             Accessibility
 CSS Rules                     Display E ect
                                                             E ect
 visibility: hidden;           Element is hidden from        Content is ignored by screen
                               view, but is not removed      readers
                               from the normal ow (i.e. it
                               still takes up the space it
                               normally would)

 display: none;                Element is removed from       Content is ignored by screen
                               the normal ow and hidden;     readers
                               the space it occupied is
                               collapsed

 height: 0;                    Element is collapsed and      Content is ignored by screen
 width: 0;                     contents are hidden           readers
 overflow: hidden;
ADAPTIVE WEB DESIGN WORKSHOP




“Fixing” libraries
 (function(){
   var $button = $('#myButton'),
       $text = $('#myText'),
       visible = true;
   $button.click(function(){
    if ( visible ) {
      $text.slideUp('fast');
    } else {
      $text.slideDown('fast');
    }
    visible = ! visible;
   });
 })();
ADAPTIVE WEB DESIGN WORKSHOP




“Fixing” libraries
 (function(){
   var $button = $('#myButton'),
       $text = $('#myText'),
       visible = true;
   $button.click(function(){
    if ( visible ) {
      $text.slideUp('fast',function(){
         $text.addClass('accessibly-hidden')
             .slideDown(0);
       });
    } else {
      $text.slideUp(0,function(){
         $text.removeClass('accessibly-hidden')
             .slideDown('fast');
       });
    }
    visible = ! visible;
   });
 })();
photo by cfpg
ADAPTIVE WEB DESIGN WORKSHOP




Managing focus
 <div tabindex="0">
  <p>This <code>div</code> can now receive focus using a
 keyboard’s <kbd>tab</kbd> key. How cool is that?</p>
 </div>

 <div tabindex="-1">
  <p>This <code>div</code> won’t be focused by a user via the
 <kbd>tab</kbd> key, but JavaScript can <code>focus()</code> it.
 Nifty, huh?</p>
 </div>
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <input class="tweet-counter" value="140" disabled="disabled">
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span id="chars_left_notice" class="numeric">
  <strong id="status-field-char-counter"
        class="char-counter">140</strong>
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span class="tweet-counter">140
  <b class="hidden"> characters remaining</b></span>


 .hidden {
   position: absolute;
   left: −999em;
 }
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span class="tweet-counter">maximum of 140 characters</span>



 <span class="tweet-counter">140
  <b class="hidden"> characters remaining</b></span>
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span aria-live="polite" aria-atomic="true"
       class="tweet-counter">140<b class="hidden">
       characters remaining</b></span>
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!
Adaptive Web Design Workshop [Iceweb 2011]
Header
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="header">
  <a href="#donate" class="donate-link"
     title="Click here to view our donation options">Donate</a>
  <a href="http://villagereach.org/feed/" class="rss-link"
     title="View our RSS Feed">RSS Feed</a>
  <div id="site-title">
    <a href="http://villagereach.org" title="Village Reach: Home">
     <span>Village Reach</span>
    </a>
  </div>
 </div><!-- #header -->
Features




Programs




 News
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div class="entry-content entry">
  <!-- Features -->
  <div class="boxes three home">
    <!-- Programs -->
  </div>
  <div id="latestNews">
    <!-- Latest News -->
  </div>
 </div>
Nav
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="hybrid-search-3" class="widget search widget-search">
  <div class="widget-inside">
    <form method="get" class="search-form" id="search-form"
 action="http://villagereach.org/">
      <!--Search Form -->
    </form><!-- .search-form -->
  </div>
 </div>
 <div id="navigation">
  <div id="page-nav" class="page-nav">
    <ul class="menu sf-menu">
      <!-- Navigation -->
    </ul>
  </div>
 </div><!-- #navigation -->
Extra

   Social


Newsletter
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="text-8" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Extra -->
  </div>
 </div>
 <div id="text-7" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Social -->
  </div>
 </div>
 <div id="mc_signup_container">
  <!-- Newsletter -->
 </div>
Footer
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="footer-container">
  <div id="footer">
    <p class="copyright">Copyright &#169; 2011 <a class="site-link"
 href="http://villagereach.org" title="VillageReach"
 rel="home"><span>VillageReach</span></a>. - All rights
 reserved.</p>
  </div><!-- #footer -->
 </div><!-- #footer-container -->
Adaptive Web Design Workshop [Iceweb 2011]
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles & States
 <div class="jcarousel-container jcarousel-container-horizontal"
      style="display: block; ">
  <ul id="vr-carousel">
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
     on our progress</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
     National Expansion</span>
  </li>
  …
  </ul>
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles & States
 <div id="jcarousel-control">
  <div class="jcarousel-prev jcarousel-prev-horizontal"
        style="display: block; " disabled="false"></div>
  <span id="jcarousel-control-caption">
    VillageReach Announces Mozambique National Expansion
  </span>
  <div class="jcarousel-next jcarousel-next-horizontal"
        style="display: block; " disabled="false"></div>
 </div>
Adaptive Web Design
    Workshop
          by Aaron Gustafson



            More of the same:
     http://adaptivewebdesign.info
         http://easy-designs.net
      http://blog.easy-designs.net
      http://aaron-gustafson.com



             Slides available at
  http://slideshare.net/AaronGustafson



 © Aaron Gustafson. All Rights Reserved.

More Related Content

PDF
Adaptive Web Design Workshop [WebVisions NYC 2012]
PDF
Adaptive Web Design Workshop [inspire 2011]
PDF
Adaptive Web Design [WebVisions Portland 2012]
PDF
Crx 2.2 Deep-Dive
PDF
Optimizing HTML5 Sites with CQ5/WEM
PDF
What's new in Portal and WCM 8.5
PDF
HTML5 Technical Executive Summary
PDF
Managing Content In Portal Wcm
Adaptive Web Design Workshop [WebVisions NYC 2012]
Adaptive Web Design Workshop [inspire 2011]
Adaptive Web Design [WebVisions Portland 2012]
Crx 2.2 Deep-Dive
Optimizing HTML5 Sites with CQ5/WEM
What's new in Portal and WCM 8.5
HTML5 Technical Executive Summary
Managing Content In Portal Wcm

What's hot (20)

PDF
Wordcamp Thessaloniki 2011 The Nextweb
PDF
Word camp nextweb
PPTX
Integrate any Angular Project into WebSphere Portal
PDF
4Ward Company Presentation
PPTX
Web Apps atop a Content Repository
PPT
IBM Portal Web intro
PPT
WebSphere Portal Business Overview
PDF
PDF
JavaOne 2010 Keynote
PDF
DPC2007 Zend Framework (Gaylord Aulke)
 
PPT
IBM WebSphere Portal
PPTX
Station Four: Web Redesign Presentation
PPT
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
PDF
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
PPTX
Web Sphere Portal
PDF
Websphere Portal
PDF
DPC2007 CodeGear, Delphi For PHP (Pawel Glowacki)
 
PPT
WebSphere Portal Technical Overview
PDF
01 web sphere portal business overview
PDF
Fundamental Progressive Enhancement [Web Builder 2.0 - 2008]
Wordcamp Thessaloniki 2011 The Nextweb
Word camp nextweb
Integrate any Angular Project into WebSphere Portal
4Ward Company Presentation
Web Apps atop a Content Repository
IBM Portal Web intro
WebSphere Portal Business Overview
JavaOne 2010 Keynote
DPC2007 Zend Framework (Gaylord Aulke)
 
IBM WebSphere Portal
Station Four: Web Redesign Presentation
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
Web Sphere Portal
Websphere Portal
DPC2007 CodeGear, Delphi For PHP (Pawel Glowacki)
 
WebSphere Portal Technical Overview
01 web sphere portal business overview
Fundamental Progressive Enhancement [Web Builder 2.0 - 2008]
Ad

Similar to Adaptive Web Design Workshop [Iceweb 2011] (20)

PDF
HTML5 & CSS3 Workshop [FoWD NYC 2011]
PDF
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
PDF
HTML5: The New html for the web
PDF
KEY
Html5 Primer
PPTX
HTML5 introduction for beginners
KEY
PDF
Beginner & Intermediate Guide to HTML5/CSS3 In Drupal
KEY
Everything you need to know about HTML5 in 15 min
PDF
HTML5, just another presentation :)
PDF
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
PDF
HTML5, the Evolution of Smart Media
ZIP
Html5 public
PDF
East of Toronto .NET Usergroup - Put the 5 in HTML
ODP
Light introduction to HTML
DOCX
Report html5
PPSX
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
PPTX
Html,CSS & UI/UX design
HTML5 & CSS3 Workshop [FoWD NYC 2011]
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
HTML5: The New html for the web
Html5 Primer
HTML5 introduction for beginners
Beginner & Intermediate Guide to HTML5/CSS3 In Drupal
Everything you need to know about HTML5 in 15 min
HTML5, just another presentation :)
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5, the Evolution of Smart Media
Html5 public
East of Toronto .NET Usergroup - Put the 5 in HTML
Light introduction to HTML
Report html5
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
Html,CSS & UI/UX design
Ad

More from Aaron Gustafson (20)

PDF
Delivering Critical Information and Services [JavaScript & Friends 2021]
PDF
Adapting to Reality [Guest Lecture, March 2021]
PDF
Designing the Conversation [Beyond Tellerrand 2019]
PPTX
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
PDF
Progressive Web Apps: Where Do I Begin?
PDF
Media in the Age of PWAs [ImageCon 2019]
PDF
Adapting to Reality [Starbucks Lunch & Learn]
PDF
Conversational Semantics for the Web [CascadiaJS 2018]
PDF
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
PDF
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PDF
Designing the Conversation [Concatenate 2018]
PDF
Designing the Conversation [Accessibility DC 2018]
PDF
Performance as User Experience [AEADC 2018]
PDF
The Web Should Just Work for Everyone
PDF
Performance as User Experience [AEA SEA 2018]
PDF
Performance as User Experience [An Event Apart Denver 2017]
PDF
Advanced Design Methods 1, Day 2
PDF
Advanced Design Methods 1, Day 1
PDF
Designing the Conversation [Paris Web 2017]
PDF
Exploring Adaptive Interfaces [Generate 2017]
Delivering Critical Information and Services [JavaScript & Friends 2021]
Adapting to Reality [Guest Lecture, March 2021]
Designing the Conversation [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Progressive Web Apps: Where Do I Begin?
Media in the Age of PWAs [ImageCon 2019]
Adapting to Reality [Starbucks Lunch & Learn]
Conversational Semantics for the Web [CascadiaJS 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Accessibility DC 2018]
Performance as User Experience [AEADC 2018]
The Web Should Just Work for Everyone
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [An Event Apart Denver 2017]
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 1
Designing the Conversation [Paris Web 2017]
Exploring Adaptive Interfaces [Generate 2017]

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Programs and apps: productivity, graphics, security and other tools
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf

Adaptive Web Design Workshop [Iceweb 2011]

  • 2. ADAPTIVE WEB DESIGN WORKSHOP The Agenda ๏ Progressive Enhancement ‣ vs Graceful Degradation ‣ How & Why It Works ๏ Content & Organization ๏ Semantics ‣ HTML5 ‣ Microformats 2
  • 3. ADAPTIVE WEB DESIGN WORKSHOP The Agenda ๏ Design ‣ Parsing Errors ‣ Designing in Layers ‣ Adaptive Layouts ‣ “Mobile First” ๏ Interactivity ‣ Unobtrusive JavaScript ‣ Adaptive Interfaces ‣ Hijax 3
  • 4. ADAPTIVE WEB DESIGN WORKSHOP The Agenda ๏ Accessibility ‣ Design Considerations ‣ ARIA 4
  • 8. ?
  • 19. HTML CSS
  • 20. fault tolerance n. a system’s ability to continue to operate when it encounters and unexpected error.
  • 24. Browsers IGNORE what they don’t understand
  • 26. Modern Browsers Older Browsers
  • 27. Modern Browsers Older Browsers
  • 34. :-)
  • 39. Don’t lose sight of your USERS
  • 40. User Experience BASIC ADVANCED Browser Capabilities
  • 41. User Experience BASIC ADVANCED Browser Capabilities Content
  • 42. User Experience Semantics BASIC ADVANCED Browser Capabilities Content
  • 43. User Experience Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 44. User Experience Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 45. User Experience Accessibility Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 46. User Experience ARIA JavaScript CSS HTML BASIC ADVANCED Browser Capabilities Text & HTTP
  • 47. User Experience BASIC ADVANCED Browser Capabilities Content
  • 48. Content is WHY we build websites
  • 54. Header Nav Features Extra Social Programs Newsletter News Footer
  • 55. Header Features Nav Programs Extra News Social Newsletter Footer
  • 56. User Experience Semantics BASIC ADVANCED Browser Capabilities Content
  • 58. ADAPTIVE WEB DESIGN WORKSHOP Semantics 101 <p>HTML5 introduces several <em>really</em> useful elements and a ton of new APIs.</p> <p>Please fill out the form below. <strong>Note: all fields are required.</strong></p> <p>I like to work with markup languages because <strong>they are simple and easy to read</strong>. They also have that certain <i lang="fr" title="I don&#8217;t know what">je ne sais quoi</i>.</p>
  • 59. ADAPTIVE WEB DESIGN WORKSHOP Semantics 101 small
  • 60. ADAPTIVE WEB DESIGN WORKSHOP Semantics 101 hr
  • 69. ADAPTIVE WEB DESIGN WORKSHOP Organization <figure id="fig-1"> <img src="photo.jpeg" alt=""/> <figcaption>Photo of Albert Einstein</figcaption> </figure> <figure id="fig-2"> <table> <caption>2011 Forecast Earnings</caption> <!-- a bunch of data --> </table> </figure>
  • 70. ADAPTIVE WEB DESIGN WORKSHOP Organization <section> <!-- pretty much anything can go here --> </section> <article> <!-- pretty much anything can go here --> </article>
  • 77. ADAPTIVE WEB DESIGN WORKSHOP Organization <header> <!-- titles, etc. go here --> </header> <footer> <!-- meta/supplementary information goes here --> </footer>
  • 86. ADAPTIVE WEB DESIGN WORKSHOP Organization <nav> <ol> <li><a href="#details">Details</a></li> <li><a href="#lodging">Lodging</a></li> <li><a href="#location">Location</a></li> <li><a href="#topics">Topics</a></li> <li><a href="#contact">Contact Us</a></li> </ol> <p><a href="register">Register Now</a> <b>Only 5 spaces left</b></p> </nav>
  • 88. nav
  • 90. nav
  • 91. ADAPTIVE WEB DESIGN WORKSHOP Organization <article> <!-- main content --> <aside> <!-- something related --> </aside> </article>
  • 93. aside
  • 95. ADAPTIVE WEB DESIGN WORKSHOP Implicit sections (HTML4) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h2> W3C standardization process <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h2> Markup <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 96. ADAPTIVE WEB DESIGN WORKSHOP Explicit sections (HTML5) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h2> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h2> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 97. ADAPTIVE WEB DESIGN WORKSHOP Explicit sections (HTML5) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h1> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h1> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 98. ADAPTIVE WEB DESIGN WORKSHOP Explicit sections (HTML5) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h4> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h6> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 99. ADAPTIVE WEB DESIGN WORKSHOP Sections ๏ section ๏ article ๏ aside ๏ footer ๏ header ๏ nav 87
  • 100. ADAPTIVE WEB DESIGN WORKSHOP Outline limitations in HTML4 <h1> Title <h2> Subtitle <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title 1.1 Subtitle
  • 101. ADAPTIVE WEB DESIGN WORKSHOP Heading groups (HTML5) hgroup <h1> Title <h2> Subtitle <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title
  • 102. ADAPTIVE WEB DESIGN WORKSHOP Aside: rooted sections <h1> Title <p> Text content continues... <p> Text content continues... <h2> Section heading <p> Text content continues... <blockquote> <h2> Rooted heading <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title 1.1 Section heading
  • 103. ADAPTIVE WEB DESIGN WORKSHOP Sectioning roots ๏ body ๏ blockquote ๏ details ๏ fieldset ๏ figure ๏ td 91
  • 105. ADAPTIVE WEB DESIGN WORKSHOP Dates & Times <input type="date" name="dob"/>
  • 106. ADAPTIVE WEB DESIGN WORKSHOP Numbers <input type="number" name="foo"/> <input type="range" min="1" max="11" name="foo"/>
  • 107. ADAPTIVE WEB DESIGN WORKSHOP Format validation <input type="email" …/> <input type="url" …/>
  • 108. ADAPTIVE WEB DESIGN WORKSHOP Format validation <input type="text" pattern="d{6}w{3}" placeholder="6 digits followed by 3 letters" .../>
  • 110. ADAPTIVE WEB DESIGN WORKSHOP Classi cation
  • 111. ADAPTIVE WEB DESIGN WORKSHOP Identi cation
  • 112. ADAPTIVE WEB DESIGN WORKSHOP Microformats <section class="vcard"> <figure> <img class="photo" src="aaron-gustafson.jpg" alt=""/> </figure> <h1 class="fn">Aaron Gustafson</h1> … <p>Aaron … is <b class="role">Group Manager</b> of the <a class="org" href="http://webstandards.org">Web Standards Project (WaSP)</a> ….</p> </section>
  • 118. Header
  • 119. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="header"> <a href="#donate" class="donate-link" title="Click here to view our donation options">Donate</a> <a href="http://villagereach.org/feed/" class="rss-link" title="View our RSS Feed">RSS Feed</a> <div id="site-title"> <a href="http://villagereach.org" title="Village Reach: Home"> <span>Village Reach</span> </a> </div> </div><!-- #header -->
  • 122. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div class="entry-content entry"> <!-- Features --> <div class="boxes three home"> <!-- Programs --> </div> <div id="latestNews"> <!-- Latest News --> </div> </div>
  • 124. Nav
  • 125. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="hybrid-search-3" class="widget search widget-search"> <div class="widget-inside"> <form method="get" class="search-form" id="search-form" action="http://villagereach.org/"> <!--Search Form --> </form><!-- .search-form --> </div> </div> <div id="navigation"> <div id="page-nav" class="page-nav"> <ul class="menu sf-menu"> <!-- Navigation --> </ul> </div> </div><!-- #navigation -->
  • 127. Extra Social Newsletter
  • 128. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="text-8" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Extra --> </div> </div> <div id="text-7" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Social --> </div> </div> <div id="mc_signup_container"> <!-- Newsletter --> </div>
  • 130. Footer
  • 131. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="footer-container"> <div id="footer"> <p class="copyright">Copyright &#169; 2011 <a class="site-link" href="http://villagereach.org" title="VillageReach" rel="home"><span>VillageReach</span></a>. - All rights reserved.</p> </div><!-- #footer --> </div><!-- #footer-container -->
  • 132. User Experience Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 133. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p{ color: red; }
  • 134. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p{ color: red; }
  • 135. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p{ color: red; font-weight: bold; }
  • 136. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p{ color: red; font-weight: bold; }
  • 137. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p { color: #ccc; color: rgba( 0, 0, 0, .5 ); }
  • 138. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors html[lang] p { color: #ccc; color: rgba( 0, 0, 0, .5 ); }
  • 139. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors @-moz-document url-prefix() { html[lang] p { color: #ccc; color: rgba( 0, 0, 0, .5 ); } }
  • 140. #intro { /* Basic Layout */ } /* ... */ body[id=css-zen-garden] #intro { /* Advanced Layout */ }
  • 141. #intro { /* Basic Layout */ } /* ... */ [foo], #intro { /* Advanced Layout */ }
  • 142. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors @import 'not-for-IE7-or-below.css' screen; @media screen, print, refrigerator { /* IE will get these rules */ }
  • 143. ADAPTIVE WEB DESIGN WORKSHOP Organization design
  • 144. ADAPTIVE WEB DESIGN WORKSHOP Organization type color layout
  • 145. ADAPTIVE WEB DESIGN WORKSHOP Organization /* =Typography */ img { display: block; } /* =Layout */ @media screen { .frame .inner { border: 10px solid; } } /* =Color */ .frame .inner { background-color: rgb(227, 222, 215); border-color: rgb(227, 222, 215); }
  • 146. ADAPTIVE WEB DESIGN WORKSHOP Organization type.css layout.css main.css color.css
  • 147. ADAPTIVE WEB DESIGN WORKSHOP Organization {embed="styles/typography"} @media screen {   {embed="styles/layout-screen"} } {embed="styles/color"} Example using ExpressionEngine embed tags
  • 148. ADAPTIVE WEB DESIGN WORKSHOP Organization {embed="styles/reset"} {embed="styles/typography"} @media screen {   {embed="styles/layout-screen"} } @media print {   {embed="styles/layout-print"} } {embed="styles/color"} {embed="styles/effects"} Example using ExpressionEngine embed tags
  • 149. ADAPTIVE WEB DESIGN WORKSHOP Monkey-patching <link rel="stylesheet" href="main.css"/> <!--[if IE 9]><link rel="stylesheet" href="ie9.css"/><![endif]--> <!--[if lte IE 8]><link rel="stylesheet" href="ie8.css"/><![endif]--> <!--[if lte IE 7]><link rel="stylesheet" href="ie7.css"/><![endif]--> <!--[if lte IE 6]><link rel="stylesheet" href="ie6.css"/><![endif]-->
  • 150. ADAPTIVE WEB DESIGN WORKSHOP Monkey-patching @-moz-document url-prefix() { /* GENERATED CONTENT - FF3 doesn't allow positioning */ #extra-mile:before { content: ''; } #extra-mile:first-of-type:before { content: url(extra-mile-sign.png); } }
  • 151. ADAPTIVE WEB DESIGN WORKSHOP Media Queries
  • 152. ADAPTIVE WEB DESIGN WORKSHOP @Media blocks @media screen { /* Styles for screen media only */ }
  • 153. ADAPTIVE WEB DESIGN WORKSHOP @Media blocks+ @media screen and (max-width:450px) { /* Styles for screen media when browser is 450px wide or below */ }
  • 154. ADAPTIVE WEB DESIGN WORKSHOP Getting granular @media screen and (min-device-width:1024px) and (max-width:989px), screen and (max-device-width:480px), screen and (max-device-width:480px) and (orientation:landscape), screen and (min-device-width:481px) and (orientation:portrait) { /* Layout for narrower desktop (below 990px) or iPhone running iOS 3 (or equivalent) or iPhone running iOS 4 (or equivalent) in “landscape” view or iPad (or equivalent) in “portrait” view */ }
  • 155. ADAPTIVE WEB DESIGN WORKSHOP Mobile First w/ media queries /* Universal Layout */ @media screen { /* Styles for all screens */ } @media screen and (min-width:481px) { /* Styles for all screens 480px+ width */ } @media screen and (min-width:754px) { /* Styles for all screens 754px+ width */ }
  • 164. ADAPTIVE WEB DESIGN WORKSHOP Mobile First w/ media queries #hd { background: url(hd-bg-small.png) repeat-x 50% 50%; } #hd .logo a { background: url(logo-small.png) no-repeat 50% 0; display: block; width: 240px; height: 109px; /* … */ } @media screen and (min-width: 481px) { #hd { background: url(hd-bg.png) no-repeat 50% 52px; } #hd .logo a { background-image: url(logo.png); width: 342px; height: 155px; } }
  • 165. Header Nav Features Extra Social Programs Newsletter News Footer
  • 167. Header Nav Features Extra Social Programs Newsletter News Footer
  • 168. User Experience Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 170. ADAPTIVE WEB DESIGN WORKSHOP Sins of our past <a href="javascript:someFunction();">some text</a> <a href="javascript:void(null);" onclick="someFunction();">some text</a> <a href="#" onclick="someFunction();">some text</a>
  • 171. ADAPTIVE WEB DESIGN WORKSHOP A minor improvement <a href="http://offsite.com" onclick="newWin( this.href ); return false;"> some text</a>
  • 173. ADAPTIVE WEB DESIGN WORKSHOP Event listeners window.onload = handleExternalLinks; function handleExternalLinks() { var server = document.location.hostname; var anchors = document.getElementsByTagName("a"); var i, href; for( i=0; i < anchors.length; i++ ) { href = anchors[i].href; if ( href.indexOf("http://" + server) == -1 && href.indexOf("https://" + server) == -1 ) { // HREF is not a file on my server anchors[i].onclick = function() { newWin( this.href ); }; } } }
  • 175. ADAPTIVE WEB DESIGN WORKSHOP Listen and delegate document .getElementsByTagName( 'body' )[0] .onclick = clickDelegator; function clickDelegator( e ) { e = ( e ) ? e : event; var el = e.target || e.srcElement; // external links if ( el.nodeName.toLowerCase() == 'a' && el.getAttribute( 'rel' ) == 'external' ) { newWin( el.href ); } }
  • 177. ADAPTIVE WEB DESIGN WORKSHOP Test for dependencies function someFunction() { if ( !document.getElementsByTagName ) return; // code that uses document.getElementsByTagName() }
  • 178. ADAPTIVE WEB DESIGN WORKSHOP Test for dependencies function someFunction() { if ( !document.getElementsByTagName || !document.getElementById ) return; /* code that uses document.getElementsByTagName() and document.getElementById() */ }
  • 179. ADAPTIVE WEB DESIGN WORKSHOP Test for dependencies function someFunction() { if ( !document.getElementsByTagName || !document.getElementsByTagName('p') ) return; // code that requires the presence of a P element }
  • 180. ADAPTIVE WEB DESIGN WORKSHOP Test for dependencies function someFunction() { if ( !document.getElementById || !document.getElementById('content') ) return; // code that requires the presence of #content }
  • 181. ADAPTIVE WEB DESIGN WORKSHOP Test for dependencies function someFunction() { if ( typeof( Prototype ) == 'undefined' || parseFloat( Prototype.Version ) < 1.5 ) return; // code that uses Prototype 1.5 or higher }
  • 182. ADAPTIVE WEB DESIGN WORKSHOP Test for dependencies window.addEventListener( 'load', function(){ if ( document.getElementsByTagName && document.getElementById ) { someFunction(); } }, false );
  • 195. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Source of blog entry page <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/ comments/#comments" data-replace="/comments/{url_title}/">View comments on this entry and add your own</a> {if segment_4=="comments"} <section id="comments" class="focal"> {embed="inc/.comments" url_title="{url_title}"} </section> {if:else} {comment_loader} {/if} Examples use ExpressionEngine tags
  • 196. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Source of blog entry page <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/ comments/#comments" data-replace="/comments/{url_title}/">View comments on this entry and add your own</a> {if segment_4=="comments"} <section id="comments" class="focal"> {embed="inc/.comments" url_title="{url_title}"} </section> {if:else} {comment_loader} {/if} Examples use ExpressionEngine tags
  • 197. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Source of /comments/{url_title} (technically /pages/comments/{url_title}) {embed="inc/.comments" url_title="{segment_3}"} Example uses ExpressionEngine tags
  • 198. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern https://gist.github.com/b976b67e88ffbfc9f125 $.fn.ajaxInclude = function(){ return this.each(function() { var $el = $( this ), target = $el.data( 'target' ), $targetEl = target && $( target ) || $el, methods = [ 'append', 'replace', 'before', 'after' ], ml = methods.length, method, url; while ( ml-- ) { method = methods[ ml ]; if ( $el.is( '[data-' + method + ']' ) ) { url = $el.data( method ); break; } } if ( method == 'replace' ) { method += 'With'; } if ( url && method ) { $.get( url, function( data ){ $el.trigger( 'ajaxInclude', [$targetEl, data] ); $targetEl[ method ]( data ); }); } }); };
  • 199. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Replace: <a data-replace="articles/latest/fragment" href="...">Latest Articles</a> Before: <a data-before="articles/latest/fragment" href="...">Latest Articles</a> After: <a data-after="articles/latest/fragment" href="...">Latest Articles</a>
  • 200. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern $("[data-append],[data-replace],”+ “[data-after],[data-before]").ajaxInclude();
  • 201. ADAPTIVE WEB DESIGN WORKSHOP 176
  • 202. JavaScript CSS
  • 203. ADAPTIVE WEB DESIGN WORKSHOP Remember stu like this? <a href="foo.html" style="color:blue;" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'">Foo</a>
  • 204. ADAPTIVE WEB DESIGN WORKSHOP Remember stu like this? <a href="foo.html" style="color:blue;" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'">Foo</a> a, a:link, a:visited { color: blue; } a:hover { color: red; }
  • 205. ADAPTIVE WEB DESIGN WORKSHOP Isn’t this the same? for( i=0; i<objects.length; i++){ objects[i].style.display = 'none'; }
  • 206. ADAPTIVE WEB DESIGN WORKSHOP Small improvement for( i=0; i<objects.length; i++){ objects[i].style.position = 'absolute'; objects[i].style.left = '-999em'; }
  • 207. ADAPTIVE WEB DESIGN WORKSHOP Separation for( i=0; i<objects.length; i++){ objects[i].addClassName( 'hidden' ); } .hidden { position: absolute; left: -999em; }
  • 208. ADAPTIVE WEB DESIGN WORKSHOP Maintenance options ๏ external style rules added to your CSS le (by hand) ๏ external CSS le added to the document (by hand) ๏ external CSS le added to the document via script ๏ embedding CSS in the document via script 182
  • 209. ADAPTIVE WEB DESIGN WORKSHOP Option 1: Add by hand /* =START WickedCool Script CSS (do not remove) */ .wicked { color: red; font: bold 4em/2 "Comic Sans"; } .cool { color: blue; font: bold 4em/2 "Comic Sans"; } /* =END WickedCool Script CSS */
  • 210. ADAPTIVE WEB DESIGN WORKSHOP Option 2: Include by hand <script src="WickedCool.js"></script> <link rel="stylesheet" href="WickedCool.css" />
  • 211. ADAPTIVE WEB DESIGN WORKSHOP Option 2: Include by hand <script src="WickedCool.js"></script> <link rel="stylesheet" href="WickedCool.css" /> <head> <!-- … --> <link rel="stylesheet" href="WickedCool.css" /> </head> <body> <!-- … --> <script src="WickedCool.js"></script> </body>
  • 212. ADAPTIVE WEB DESIGN WORKSHOP Option 3: Scripted include function FindPath( filename ) { var path = false; var scripts = document.getElementsByTagName( 'script' ); for( var i=0; i<scripts.length; i++ ) { if( scripts[i].getAttribute( 'src' ) && scripts[i].getAttribute( 'src' ) .indexOf( filename ) != -1 ) { path = scripts[i] .getAttribute( 'src' ) .replace( new RegExp( filename ), '' ); break; } } return path; }
  • 213. ADAPTIVE WEB DESIGN WORKSHOP Option 3: Scripted include var WickedCool = { jsFile: 'WickedCool.js', cssFile: 'WickedCool.css', initialize: function(){ // determine the path var path = FindPath( this.jsFile ); // add the CSS file var css = document.createElement( 'link' ); css.setAttribute( 'rel', 'stylesheet' ); css.setAttribute( 'href', path + this.cssFile ); document.getElementsByTagName( 'head' )[0] .appendChild( css ); // do the rest of the wicked cool stuff } };
  • 214. ADAPTIVE WEB DESIGN WORKSHOP Option 4: Scripted embed function addCSS( styles ) { var el = document.createElement( 'style' ); el.setAttribute( 'type', 'text/css' ); if ( el.styleSheet ) { el.styleSheet.cssText = styles; } else { el.appendChild( document.createTextNode( styles ) ); } document.getElementsByTagName( 'head' )[0] .appendChild( el ); }
  • 215. ADAPTIVE WEB DESIGN WORKSHOP Option 4: Scripted embed var WickedCool = { _css: '.wicked { color: red; ' + ' font: bold 4em/2 "Comic Sans"; } ' + '.cool { color: blue; ' + ' font: bold 4em/2' "Comic Sans"; }', initialize: function() { // add the CSS addCSS( this._css ); // do the rest of the wicked cool stuff } }; based on the work of Nicholas Zakas
  • 217. ADAPTIVE WEB DESIGN WORKSHOP How do we do that? .TabInterface-folder { /* ... */ } #TabInterface .tab { /* ... */ } #TabInterface .tab.active { /* ... */ } 190
  • 218. ADAPTIVE WEB DESIGN WORKSHOP How do we do that? Tactic Default Activated add “-on” to the class .tabbed .tabbed-on add an activation class .auto-submit .auto-submit.active change the form of the .replace-me .replaced class
  • 219. ADAPTIVE WEB DESIGN WORKSHOP Media Queries
  • 220. ADAPTIVE WEB DESIGN WORKSHOP Mobile interfaces
  • 221. ADAPTIVE WEB DESIGN WORKSHOP Swapping content var trigger = 659; // … function toggleDisplay() { var width = $window.width(); if ( showing == 'old' && width <= trigger ) { $old_nav.replaceWith($new_nav); showing = 'new'; } else if ( showing == 'new' && width > trigger ) { $new_nav.replaceWith($old_nav); showing = 'old'; } }
  • 226. ADAPTIVE WEB DESIGN WORKSHOP Semantics <ul> <li> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 227. ADAPTIVE WEB DESIGN WORKSHOP Style? <ul style=”height: 300px;”> <li style=”height: 300px;” > <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li style=”height: 300px;” > <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li style=”height: 300px;” > <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 229. ADAPTIVE WEB DESIGN WORKSHOP Style? <ul class="jcarousel-skin-vr" style=”height: 300px;”> <li style=”height: 300px;”> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li style=”height: 300px;”> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li style=”height: 300px;”> <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 230. ADAPTIVE WEB DESIGN WORKSHOP Script <ul id="vr-carousel"> <li> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 231. ADAPTIVE WEB DESIGN WORKSHOP Script $j('#vr-carousel').jcarousel({ auto: 6, visible: 1, animation: 0, wrap: 'both', scroll: 1, initCallback: vrCarousel_initCallback, itemFirstInCallback: vrCarousel_itemFirstInCallback, itemFirstInCallback: vrCarousel_fadeIn, itemFirstOutCallback: vrCarousel_fadeOut });
  • 232. ADAPTIVE WEB DESIGN WORKSHOP Script function vrCarousel_initCallback( carousel, item, idx, state ) { // Pause autoscrolling if the user moves // with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); $j('.jcarousel-item').css('opacity', 0); };
  • 233. ADAPTIVE WEB DESIGN WORKSHOP Script function vrCarousel_initCallback( carousel, item, idx, state ) { var $i = carousel.list.find(‘img’), h = 0; // get the max h $i.each(function(){ var test = $j(this).height(); if ( test > h ){ h = test; } }); // … carousel.list.height(h); $j('.jcarousel-item').css({ opacity: 0, height: h }); };
  • 235. User Experience Accessibility Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 238. “special needs” can be CONTEXTUAL
  • 242. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 243. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 244. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Tweet</button> <a class=”button”>Tweet</a>
  • 245. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Tweet</button> <a class=”button”>Tweet</a>
  • 246. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 247. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 248. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Search Mail</button> <div>Search Mail</div>
  • 249. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Search Mail</button> <div>Search Mail</div>
  • 250. ADAPTIVE WEB DESIGN WORKSHOP ARIA maps the OS to the web
  • 252. ADAPTIVE WEB DESIGN WORKSHOP All the web’s a play… <section id="main" role="main"> <!-- The primary content for the page would go here --> </section>
  • 263. ADAPTIVE WEB DESIGN WORKSHOP Semantic comparison Ad-hoc ARIA Role HTML5 #header, #top banner header (kind of) #main, #content main none #extra, .sidebar complementary, note aside #footer, #bottom contentinfo footer #nav navigation nav .hentry article article
  • 265. ADAPTIVE WEB DESIGN WORKSHOP These are the droids you seek <span role="button">OK</span> <div role="alert"> <p>Something went wrong.</p> </div> <div role="alertdialog"> <p>Something went wrong.</p> <img src="x.png" alt="dismiss" role="button" /> </div>
  • 266. ADAPTIVE WEB DESIGN WORKSHOP What is it? <a role=”button”>Tweet</a> class=”button”>Tweet</a>
  • 267. ADAPTIVE WEB DESIGN WORKSHOP What is it? <a role=”button”>Tweet</a>
  • 269. ADAPTIVE WEB DESIGN WORKSHOP What’s happening? B B (off) (on) <span> <img src="bold-off.png" alt="bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 270. ADAPTIVE WEB DESIGN WORKSHOP What’s happening? B B (off) (on) <span> <img src="bold-off.png" alt="not bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 271. ADAPTIVE WEB DESIGN WORKSHOP What’s happening? B B (off) (on) <span role="button" aria-pressed="false"> <img src="bold-off.png" alt="not bold" /> </span> <span role="button" aria-pressed="true"> <img src="bold-on.png" alt="bold" /> </span>
  • 272. ADAPTIVE WEB DESIGN WORKSHOP Complex interfaces
  • 273. ADAPTIVE WEB DESIGN WORKSHOP Traditional approach <h1>Pumpkin Pie</h1> <div class="container"> <div class="section"> <h2>Overview</h2> <img src="pie.jpg" alt=""> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> </div> <!-- ... --> <ul class="tabs"> <li><a href="#">Overview</a></li> <li><a href="#">Ingredients</a></li> <li><a href="#">Directions</a></li> <li><a href="#">Nutrition</a></li> </ul> </div>
  • 274. ADAPTIVE WEB DESIGN WORKSHOP Cleaner approach <h1>Pumpkin Pie</h1> <div class="tabbed"> <h2>Overview</h2> <img src="pie.jpg" alt="" /> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> <h2>Ingredients</h2> <ul> <li>1 (9<abbr title="inch">in</abbr>) unbaked deep dish pie crust</li> <li>½ cup white sugar</li> <!-- ... --> </ul> <h2>Directions</h2> <!-- ... --> </div>
  • 275. ADAPTIVE WEB DESIGN WORKSHOP Cleaner approach <h1>Pumpkin Pie</h1> <div class="tabbed"> <h2>Overview</h2> <img src="pie.jpg" alt="" /> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> <h2>Ingredients</h2> <ul> <li>1 (9<abbr title="inch">in</abbr>) unbaked deep dish pie crust</li> <li>½ cup white sugar</li> <!-- ... --> </ul> <h2>Directions</h2> <!-- ... --> </div>
  • 276. ADAPTIVE WEB DESIGN WORKSHOP No JS, basic CSS
  • 277. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Page
  • 278. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Page JS?
  • 279. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Page JS? No
  • 280. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Split Page the content & make some tabs JS? Yes No
  • 281. ADAPTIVE WEB DESIGN WORKSHOP On DOM ready <h1>Pumpkin Pie</h1> <div class="tabbed-on"> <section> <h2>Overview</h2> <img src="pie.jpg" alt=""> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> </section> <!-- ... --> <ul class="tabs"> <li><a href="#">Overview</a></li> <li><a href="#">Ingredients</a></li> <li><a href="#">Directions</a></li> <li><a href="#">Nutrition</a></li> </ul> </div>
  • 282. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tablist" 246
  • 283. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tab" aria-selected="true" aria-controls="folder-1"
  • 284. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tab" aria-selected="false" aria-controls="folder-4"
  • 285. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tabpanel" aria-hidden="false" aria-labelledby="folder-1-tab"
  • 286. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="application" aria-activedescendant="folder-1"
  • 287. ADAPTIVE WEB DESIGN WORKSHOP Result!
  • 288. Photo credit: emilio labrador
  • 289. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display E ect E ect visibility: hidden; Element is hidden from Content is ignored by screen view, but is not removed readers from the normal ow (i.e. it still takes up the space it normally would) display: none; Element is removed from Content is ignored by screen the normal ow and hidden; readers the space it occupied is collapsed height: 0; Element is collapsed and Content is ignored by screen width: 0; contents are hidden readers overflow: hidden;
  • 290. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display E ect E ect text-indent: -999em; Contents are shifted o - Screen readers have access screen and hidden from to the content, but the view, but links may “focus” content is limited to text and oddly and negative indent inline elements may not prove long enough to fully hide content position: absolute; Content is removed from Screen readers have access left: -999em; the normal ow and shifted to the content o the left-hand edge; the space it occupied is collapsed
  • 291. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display E ect E ect position: absolute; Content is positioned Screen readers have access /* IE6, IE7 */ absolutely (and is removed to the content clip: rect( 1px 1px 1px 1px from the normal ow), but ); remains in place and is /* W3C */ clipped to become invisible clip: rect( 1px, 1px, 1px, 1px ); padding: 0; border: 0; height: 1px; width: 1px; overflow: hidden;
  • 292. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display E ect E ect visibility: hidden; Element is hidden from Content is ignored by screen view, but is not removed readers from the normal ow (i.e. it still takes up the space it normally would) display: none; Element is removed from Content is ignored by screen the normal ow and hidden; readers the space it occupied is collapsed height: 0; Element is collapsed and Content is ignored by screen width: 0; contents are hidden readers overflow: hidden;
  • 293. ADAPTIVE WEB DESIGN WORKSHOP “Fixing” libraries (function(){ var $button = $('#myButton'), $text = $('#myText'), visible = true; $button.click(function(){ if ( visible ) { $text.slideUp('fast'); } else { $text.slideDown('fast'); } visible = ! visible; }); })();
  • 294. ADAPTIVE WEB DESIGN WORKSHOP “Fixing” libraries (function(){ var $button = $('#myButton'), $text = $('#myText'), visible = true; $button.click(function(){ if ( visible ) { $text.slideUp('fast',function(){ $text.addClass('accessibly-hidden') .slideDown(0); }); } else { $text.slideUp(0,function(){ $text.removeClass('accessibly-hidden') .slideDown('fast'); }); } visible = ! visible; }); })();
  • 296. ADAPTIVE WEB DESIGN WORKSHOP Managing focus <div tabindex="0"> <p>This <code>div</code> can now receive focus using a keyboard’s <kbd>tab</kbd> key. How cool is that?</p> </div> <div tabindex="-1"> <p>This <code>div</code> won’t be focused by a user via the <kbd>tab</kbd> key, but JavaScript can <code>focus()</code> it. Nifty, huh?</p> </div>
  • 298. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here!
  • 299. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <input class="tweet-counter" value="140" disabled="disabled">
  • 300. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span id="chars_left_notice" class="numeric"> <strong id="status-field-char-counter" class="char-counter">140</strong> </span>
  • 301. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span> .hidden { position: absolute; left: −999em; }
  • 302. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span class="tweet-counter">maximum of 140 characters</span> <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>
  • 303. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span aria-live="polite" aria-atomic="true" class="tweet-counter">140<b class="hidden"> characters remaining</b></span>
  • 304. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here!
  • 306. Header
  • 307. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="header"> <a href="#donate" class="donate-link" title="Click here to view our donation options">Donate</a> <a href="http://villagereach.org/feed/" class="rss-link" title="View our RSS Feed">RSS Feed</a> <div id="site-title"> <a href="http://villagereach.org" title="Village Reach: Home"> <span>Village Reach</span> </a> </div> </div><!-- #header -->
  • 309. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div class="entry-content entry"> <!-- Features --> <div class="boxes three home"> <!-- Programs --> </div> <div id="latestNews"> <!-- Latest News --> </div> </div>
  • 310. Nav
  • 311. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="hybrid-search-3" class="widget search widget-search"> <div class="widget-inside"> <form method="get" class="search-form" id="search-form" action="http://villagereach.org/"> <!--Search Form --> </form><!-- .search-form --> </div> </div> <div id="navigation"> <div id="page-nav" class="page-nav"> <ul class="menu sf-menu"> <!-- Navigation --> </ul> </div> </div><!-- #navigation -->
  • 312. Extra Social Newsletter
  • 313. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="text-8" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Extra --> </div> </div> <div id="text-7" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Social --> </div> </div> <div id="mc_signup_container"> <!-- Newsletter --> </div>
  • 314. Footer
  • 315. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="footer-container"> <div id="footer"> <p class="copyright">Copyright &#169; 2011 <a class="site-link" href="http://villagereach.org" title="VillageReach" rel="home"><span>VillageReach</span></a>. - All rights reserved.</p> </div><!-- #footer --> </div><!-- #footer-container -->
  • 317. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles & States <div class="jcarousel-container jcarousel-container-horizontal" style="display: block; "> <ul id="vr-carousel"> <li> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> … </ul> </div>
  • 318. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles & States <div id="jcarousel-control"> <div class="jcarousel-prev jcarousel-prev-horizontal" style="display: block; " disabled="false"></div> <span id="jcarousel-control-caption"> VillageReach Announces Mozambique National Expansion </span> <div class="jcarousel-next jcarousel-next-horizontal" style="display: block; " disabled="false"></div> </div>
  • 319. Adaptive Web Design Workshop by Aaron Gustafson More of the same: http://adaptivewebdesign.info http://easy-designs.net http://blog.easy-designs.net http://aaron-gustafson.com Slides available at http://slideshare.net/AaronGustafson © Aaron Gustafson. All Rights Reserved.