ebollens / edu13-responsive-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Responsive Web Design - Demo

This demo is intended to present the basics of responsive web design.

This demo was given as part of the Educause 2013 Responsive Web Design workshop.

Usage

The demo is divided into five steps:

  1. Converting fixed-width designs to fluid-width designs
  2. Adding media queries for collapse
  3. Adding media queries for intermediate and extra-large behaviors
  4. Hiding content to reduce scrolling
  5. Using a polyfill to present responsive images

To this end, there is a base.css file that defines the fixed width style, and then steps 1 - 4 may be arrived at by adding step-X.css files where X is the step to arrive at, plus all earlier steps.

For example, the head for step 3 reads:

<head>
<meta charset="UTF-8">
<title>Travel Blog</title>
<link href="./css/base.css" rel="stylesheet" type="text/css">
<link href="./css/step-1.css" rel="stylesheet" type="text/css">
<link href="./css/step-2.css" rel="stylesheet" type="text/css">
<link href="./css/step-3.css" rel="stylesheet" type="text/css">
</head>

For step 5, add the Javascript files in js to the head as well:

<head>
<meta charset="UTF-8">
<title>Travel Blog</title>
<link href="./css/base.css" rel="stylesheet" type="text/css">
<link href="./css/step-1.css" rel="stylesheet" type="text/css">
<link href="./css/step-2.css" rel="stylesheet" type="text/css">
<link href="./css/step-3.css" rel="stylesheet" type="text/css">
<link href="./css/step-4.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/matchMedia.js"></script>
<script type="text/javascript" src="js/matchMedia.addListener.js"></script>
<script type="text/javascript" src="js/picturefill.js"></script>
</head>

Additionally, for step 5, convert the main content images from an img tag to using the Picturefill syntax such as:

<span data-picture data-alt="">
      <span data-src="images/city1-360.jpg"></span>
      <span data-src="images/city1-480.jpg" data-media="(min-width: 361px)"></span>
      <span data-src="images/city1.jpg"     data-media="(min-width: 481px)"></span>
      <noscript>
          <img src="images/city1.jpg" alt="">
      </noscript>
</span>

License

This demo is open-source software licensed under the BSD 3-clause license. The full text of the license may be found in the LICENSE file.

Credits

This demo was written by Eric Bollens and Amos Williams.

This demo takes advantage of several outstanding open-source products:

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 65.5%Language:CSS 34.5%