This document discusses several trends in web development, including mobile-first and responsive design, data-oriented development, and single page applications. It defines key concepts like responsive design using CSS media queries and flexible layouts, data binding, and single page application frameworks like AngularJS. The document provides examples and references to learn more.
9. What is Responsive Web Design?
A development and design technique that
provides an optimal viewing experience
across multiple devices.
10. Responsive Design and CSS Media
Queries
• CSS Media queries allow different styles to be
applied for:
– Printing
– Screen sizes
– Device orientations
– Display resolutions
@media screen and (max-width : 320px)
@media screen and (resolution: 96dpi)
@media (min-width: 700px) and (orientation: landscape)
@media print
11. Targeting Screens with Media
Queries
• CSS Media queries can be used to target
different screen sizes
@media screen and (max-width:320px)
{
nav ul
{
height: 100%;
}
nav ul > li {
float: none;
}
}
12. <picture>
<source media="(min-width: 45em)" src="large.jpg">
<source media="(min-width: 18em)" src="med.jpg">
<source src="small.jpg">
<img src="small.jpg" alt="">
<p>Accessible text</p>
</picture>
Responsive Images
• New ways to define responsive images are
being discussed:
http://responsiveimages.org/
13. Responsive Images Polyfill
• The PictureFill polyfill script can be used to
emulate responsive images today:
<span data-picture data-alt="A giant stone face">
<span data-src="small.jpg"></span>
<span data-src="medium.jpg"
data-media="(min-width: 400px)"></span>
<span data-src="large.jpg"
data-media="(min-width: 800px)"></span>
<span data-src="xlarge.jpg"
data-media="(min-width: 1000px)"></span>
</span>
https://github.com/scottjehl/picturefill
17. Agenda
• Mobile First and Responsive Web Design
• Data-Oriented vs. Control-Oriented
Development
• Single Page Applications
18. Data Binding
• JavaScript doesn't provide native support for
data binding
• Two-way data binding can lead to significant
reductions in code
John DoeName: Name Property
Changes updated
in control
Changes updated
in property
19. Control-Oriented Development
Workflow
John DoeName:
1. Code assigns value to a textbox
document.getElementById('name').value = 'John Doe';
2. User modifies data
3. User clicks a button
4. Code pulls the value out of the textbox
var name = document.getElementById('name').value;
Submit
20. Data-Oriented Development
Workflow
John DoeName:
1. Property is bound to a textbox
<input type="text" data-bind="value: name"/>
2. User modifies data
3. User clicks a button
4. Property value is automatically updated!
Submit
21. Data-Oriented Development Example
Name: <input type="text" data-bind="value: name"/>
<br />
<span data-bind="text: name"></span>
<br />
<button data-bind="click:changeName">Change Name</button>
...
var viewModel = {
name: ko.observable("Rex"),
changeName: function () { this.name = "Ted"; }
};
ko.applyBindings(viewModel);
HTML5 data-*
attribute
29. var demoApp = angular.module('demoApp', []);
demoApp.controller('SimpleController', function ($scope) {
$scope.customers = [
{ name: 'Dave Jones', city: 'Phoenix' },
{ name: 'Jamie Riley', city: 'Atlanta' },
{ name: 'Heedy Wahlin', city: 'Chandler' },
{ name: 'Thomas Winter', city: 'Seattle' }
];
});
Define a Module
Define a
Controller
A Quick Look at a Controller
30. Summary
• There are a lot of new technologies trending in
the Web world (in addition to HTML5):
– Mobile first development
– Responsive Design
– Flexible layouts such as Flexbox
– Client-side Data Binding
– Single Page Applications
– Much more…
33. Onsite Training
• Interested in onsite training for your team? We
provide training on the following topics (plus
more):
– Node.js
– JavaScript (language, patterns, technologies, more)
– jQuery
– AngularJS and SPAs
– C# (language, patterns, advanced concepts, more)
– ASP.NET MVC
– Web API
– Windows 8 Programming