SlideShare a Scribd company logo
for
Rich User Experience

              phpXperts DevCon 2012
HTML5 for Rich User Experience
FLASHBACK..
WHAT IS   ?
A FLASH KILLER ?
HTML
             +
            JS
             +
           CSS

That’s all ?
Progress Meter
                                                               Web Storage
 Geo location
                                      Drag And Drop
             Semantics

     SPEECH INPUT                                                  Canvas 3D


                                                          Notifications
File / Hardware Access API

    Canvas
                                                        New Events
                             Form Controls
                                                          Web Socket
        History API                          Graphics
Graphics..

      Canvas
      WebGL
Things we can do with Canvas

Make Stunning Graph / Charts
Create 2D, 3D objects
Draw any Irregular shape
Image Processing
3D modeling
And many more…
Things we can do with Canvas
Graph Example




                http://www.humblesoftware.com/finance/index
Things we can do with Canvas
  Create 2D, 3D objects




                          http://alteredqualia.com/canvasmol/
Things we can do with Canvas
   Draw any Irregular shape




              http://hakim.se/experiments/html5/sketch/#4350e239
Things we can do with Canvas

        Image
    Processing




          http://people.opera.com/patrickl/experiments/canvas/image-edit/
Things we can do with Canvas
   3D Modeling




        http://www.giuseppesicari.it/progetti/javascript-3d-model-viewer/
WebGL
 The beast..
World flights visualization using WebGL




http://www.senchalabs.org/philogl/PhiloGL/examples/worldFlights2/
More WebGL Demos ?
http://www.chromeexperiments.com/
New Form Features
Email Field
Validation
                     Accomplishing all these will
Placeholder           require lot of plugins (e.g
                        jquery.validate plugin,
Required Attribute
                            overlabel etc)
Number Input

Date Picker
Range Input                & many more..
http://devfiles.myopera.com/articles/4582/html5-forms-example.html
History API

window.history.state
window.history.pushState(data, title [, url])
window.history.replaceState(data, title [, url])




Best Example : Github project files browser
History API (contd.)
Use Cases:

    File Browser

    E-commerce Product Viewer
    Single Page Mobile Application
Semantics
OLD SCHOOL              NEW
<div id=“header”>       <header> … </header>
</div>
                        <footer> … </footer>

                        <article> … </article>
<div id=“footer”>
</div>                  <hggroup>,<nav>,<aside>
                        <figure>,<time>,
                        <figcaption>
<div class=“article”>
</div>
Native Drag & Drop
Multimedia
Video Player




Audio Player
File / Hardware Access API
Camera & microphone access (no plugins)
<video autoplay controls></video>
<input type="button" value="?" onclick="record(this)" id="start">
<input type="button" value="?" onclick="stop(this)" id="stop"
disabled>
var localMediaStream, recorder;

var record = function(button) {
  recorder = mediaStream.recorder();
};

var stop = function(button) {
  mediaStream.stop();
  recorder.getRecordedData(function(blob) {
    // Upload blob using XHR2.
  });
};

window.navigator.getUserMedia('video', function(stream) {
  document.querySelector('video').src =
window.URL.createObjectURL(stream);
  localMediaStream = stream;
}, function(e) {
  console.log(e);
});
File / Hardware Access API
Drag in
document.querySelector('#dropzone').
  window.addEventListener('drop', function(e) {
    var reader = new FileReader();
    reader.onload = function(e) {
      document.querySelector('img').src = e.target.result;
    };
    reader.readAsDataURL(e.dataTransfer.files[0]);
}, false);


Example : Gmail Attachment Handler (see for yourself ;) )
File / Hardware Access API
Drag out ??
var files = document.querySelectorAll('.dragout');
for (var i = 0, file; file = files[i]; ++i) {
  file.addEventListener('dragstart', function(e) {
    e.dataTransfer.setData('DownloadURL',
this.dataset.downloadurl);
  }, false);
}


http://www.thecssninja.com/demo/gmail_dragout/
Notification API


window.notifications = window.notifications ||
    window.webkitNotifications || window.mozNotifications;

function showNotifications(pic, title, text) {
  if (notifications.checkPermission() == 0) {
    return;
  }

    var note = notifications.createNotification(pic, title, text);
    note.show();

    setTimeout(function(note) { // close note after a timeout
      note.cancel();
    }, 6000, notification);
}
Web Storage / Client Storage
                                                   * Moved to own spec




Earlier ..                     Now
• Cookies                      • Web Storage APIs: localStorage / sessionStorage
• Flash Storage                • Web SQL Database
• Internet Explorer UserData   • IndexedDB
• Google Gears                 • Application Cache
                               • File* APIs
Web Storage / Client Storage
Possible Use Cases

Shopping Cart

Notepad type Application (AutoSave Feature)

TODO Apps

Game Data
Web Sockets
             * Moved to own spec




AJAX Limitations




One Direction Communication
Web Sockets
             * Moved to own spec




With Web Sockets




Bidirectional Communication
Web Sockets
                * Moved to own spec




Best Use Cases
Chat / Live Help Application

Live Streaming API (e.g twitter updates)

Multiplayer Games

Game Data

Collaborative Apps (e.g Google Spreadsheet)

Stock ticker
Geo Location API
                   * Moved to own spec


Identify User’s Location




>> Serve location based content
In Short

HTML5 minimizes dependency (plugins, libraries)

Makes the user experience smoother

Allows to build more scalable apps
Aah, snap!

          did we forget the Mobile Thing ??



               Good News!

Both iPhone and Android have Webkit based Browser
                who support HTML5
Some HTML5 Resources
http://www.html5rocks.com/
Update about all the HTML features, slides etc

http://html5-demos.appspot.com/
Demos, presentations ..

http:// modernizr.com
Detect feature availability of HTML5 in browsers

http://dev.opera.com/articles/tags/html5
Lot of articles related to HTML5 features

http://html5doctor.com/
Articles about HTML5 elements and their usage

http://caniuse.com/
HTML5/CSS/SVG Compatibility in Browsers chart


http://html5readiness.com/
HTML5/CSS3 Readiness for browsers in a rainbow chart
QUESTIONS ?

More Related Content

PPT
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
PPT
Html5 Overview
PPT
HTML5 Overview
PPTX
Introduction to html5
PPTX
HTML5: An Overview
PDF
Html5 CSS3 jQuery Basic
PPT
Java script202
PPTX
Unobtrusive js
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Html5 Overview
HTML5 Overview
Introduction to html5
HTML5: An Overview
Html5 CSS3 jQuery Basic
Java script202
Unobtrusive js

What's hot (20)

PDF
Introduction to polymer project
PDF
Visual resume
PPTX
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
PPT
JavaScript UI Architecture: Be all that you can be
PDF
Usability in the GeoWeb
PPT
Testable client side_mvc_apps_in_javascript
ODP
Effective TDD - Less is more
PDF
Google Polymer Framework
PPTX
Polymer and web component
PDF
Polymer
PPTX
How to build a web application with Polymer
PDF
Introduction to Web Components
PDF
Polymer, A Web Component Polyfill Library
PPTX
Goodbye JavaScript Hello Blazor
PPT
Web II - 01 - Introduction to server-side development
PPTX
Google Polymer Introduction
PDF
Building a Secure App with Google Polymer and Java / Spring
PPT
GWT
PPTX
Building modern share point apps (angularjs, npm, bower, grunt, VS2015)
PPTX
Web Components
Introduction to polymer project
Visual resume
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
JavaScript UI Architecture: Be all that you can be
Usability in the GeoWeb
Testable client side_mvc_apps_in_javascript
Effective TDD - Less is more
Google Polymer Framework
Polymer and web component
Polymer
How to build a web application with Polymer
Introduction to Web Components
Polymer, A Web Component Polyfill Library
Goodbye JavaScript Hello Blazor
Web II - 01 - Introduction to server-side development
Google Polymer Introduction
Building a Secure App with Google Polymer and Java / Spring
GWT
Building modern share point apps (angularjs, npm, bower, grunt, VS2015)
Web Components
Ad

Similar to HTML5 for Rich User Experience (20)

PPTX
PDF
HTML5 features & JavaScript APIs
PDF
Speak the Web 15.02.2010
PDF
HTML5 New Features and Resources
PDF
An Intro to Mobile HTML5
PPTX
HTML5 on Mobile
PDF
Developing the Next Generation Embedded HMIs
PDF
HTML5 and web platform
PDF
HTML5 and Google Chrome - DevFest09
PDF
HTML5 and Beyond
PDF
Keypoints html5
PDF
Change by HTML5
KEY
WHAT IS HTML5? (at CSS Nite Osaka)
PDF
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
PDF
Jsf2 html5-jazoon
PPTX
The web as it should be
PPTX
Practical html5
PDF
Building a Better Web with HTML5 and CSS3
HTML5 features & JavaScript APIs
Speak the Web 15.02.2010
HTML5 New Features and Resources
An Intro to Mobile HTML5
HTML5 on Mobile
Developing the Next Generation Embedded HMIs
HTML5 and web platform
HTML5 and Google Chrome - DevFest09
HTML5 and Beyond
Keypoints html5
Change by HTML5
WHAT IS HTML5? (at CSS Nite Osaka)
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Jsf2 html5-jazoon
The web as it should be
Practical html5
Building a Better Web with HTML5 and CSS3
Ad

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Modernizing your data center with Dell and AMD
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PPT
Teaching material agriculture food technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
Modernizing your data center with Dell and AMD
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Teaching material agriculture food technology
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx

HTML5 for Rich User Experience

  • 1. for Rich User Experience phpXperts DevCon 2012
  • 6. HTML + JS + CSS That’s all ?
  • 7. Progress Meter Web Storage Geo location Drag And Drop Semantics SPEECH INPUT Canvas 3D Notifications File / Hardware Access API Canvas New Events Form Controls Web Socket History API Graphics
  • 8. Graphics.. Canvas WebGL
  • 9. Things we can do with Canvas Make Stunning Graph / Charts Create 2D, 3D objects Draw any Irregular shape Image Processing 3D modeling And many more…
  • 10. Things we can do with Canvas Graph Example http://www.humblesoftware.com/finance/index
  • 11. Things we can do with Canvas Create 2D, 3D objects http://alteredqualia.com/canvasmol/
  • 12. Things we can do with Canvas Draw any Irregular shape http://hakim.se/experiments/html5/sketch/#4350e239
  • 13. Things we can do with Canvas Image Processing http://people.opera.com/patrickl/experiments/canvas/image-edit/
  • 14. Things we can do with Canvas 3D Modeling http://www.giuseppesicari.it/progetti/javascript-3d-model-viewer/
  • 16. World flights visualization using WebGL http://www.senchalabs.org/philogl/PhiloGL/examples/worldFlights2/
  • 17. More WebGL Demos ? http://www.chromeexperiments.com/
  • 18. New Form Features Email Field Validation Accomplishing all these will Placeholder require lot of plugins (e.g jquery.validate plugin, Required Attribute overlabel etc) Number Input Date Picker Range Input & many more..
  • 20. History API window.history.state window.history.pushState(data, title [, url]) window.history.replaceState(data, title [, url]) Best Example : Github project files browser
  • 21. History API (contd.) Use Cases: File Browser E-commerce Product Viewer Single Page Mobile Application
  • 22. Semantics OLD SCHOOL NEW <div id=“header”> <header> … </header> </div> <footer> … </footer> <article> … </article> <div id=“footer”> </div> <hggroup>,<nav>,<aside> <figure>,<time>, <figcaption> <div class=“article”> </div>
  • 25. File / Hardware Access API Camera & microphone access (no plugins) <video autoplay controls></video> <input type="button" value="?" onclick="record(this)" id="start"> <input type="button" value="?" onclick="stop(this)" id="stop" disabled> var localMediaStream, recorder; var record = function(button) { recorder = mediaStream.recorder(); }; var stop = function(button) { mediaStream.stop(); recorder.getRecordedData(function(blob) { // Upload blob using XHR2. }); }; window.navigator.getUserMedia('video', function(stream) { document.querySelector('video').src = window.URL.createObjectURL(stream); localMediaStream = stream; }, function(e) { console.log(e); });
  • 26. File / Hardware Access API Drag in document.querySelector('#dropzone'). window.addEventListener('drop', function(e) { var reader = new FileReader(); reader.onload = function(e) { document.querySelector('img').src = e.target.result; }; reader.readAsDataURL(e.dataTransfer.files[0]); }, false); Example : Gmail Attachment Handler (see for yourself ;) )
  • 27. File / Hardware Access API Drag out ?? var files = document.querySelectorAll('.dragout'); for (var i = 0, file; file = files[i]; ++i) { file.addEventListener('dragstart', function(e) { e.dataTransfer.setData('DownloadURL', this.dataset.downloadurl); }, false); } http://www.thecssninja.com/demo/gmail_dragout/
  • 28. Notification API window.notifications = window.notifications || window.webkitNotifications || window.mozNotifications; function showNotifications(pic, title, text) { if (notifications.checkPermission() == 0) { return; } var note = notifications.createNotification(pic, title, text); note.show(); setTimeout(function(note) { // close note after a timeout note.cancel(); }, 6000, notification); }
  • 29. Web Storage / Client Storage * Moved to own spec Earlier .. Now • Cookies • Web Storage APIs: localStorage / sessionStorage • Flash Storage • Web SQL Database • Internet Explorer UserData • IndexedDB • Google Gears • Application Cache • File* APIs
  • 30. Web Storage / Client Storage Possible Use Cases Shopping Cart Notepad type Application (AutoSave Feature) TODO Apps Game Data
  • 31. Web Sockets * Moved to own spec AJAX Limitations One Direction Communication
  • 32. Web Sockets * Moved to own spec With Web Sockets Bidirectional Communication
  • 33. Web Sockets * Moved to own spec Best Use Cases Chat / Live Help Application Live Streaming API (e.g twitter updates) Multiplayer Games Game Data Collaborative Apps (e.g Google Spreadsheet) Stock ticker
  • 34. Geo Location API * Moved to own spec Identify User’s Location >> Serve location based content
  • 35. In Short HTML5 minimizes dependency (plugins, libraries) Makes the user experience smoother Allows to build more scalable apps
  • 36. Aah, snap! did we forget the Mobile Thing ?? Good News! Both iPhone and Android have Webkit based Browser who support HTML5
  • 37. Some HTML5 Resources http://www.html5rocks.com/ Update about all the HTML features, slides etc http://html5-demos.appspot.com/ Demos, presentations .. http:// modernizr.com Detect feature availability of HTML5 in browsers http://dev.opera.com/articles/tags/html5 Lot of articles related to HTML5 features http://html5doctor.com/ Articles about HTML5 elements and their usage http://caniuse.com/ HTML5/CSS/SVG Compatibility in Browsers chart http://html5readiness.com/ HTML5/CSS3 Readiness for browsers in a rainbow chart