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

What's hot (20)

PDF
Introduction to polymer project
Christoforus Surjoputro
 
PDF
Visual resume
Milan Skorić
 
PPTX
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
GreeceJS
 
PPT
JavaScript UI Architecture: Be all that you can be
Kyle Simpson
 
PDF
Usability in the GeoWeb
Dave Bouwman
 
PPT
Testable client side_mvc_apps_in_javascript
Timothy Oxley
 
ODP
Effective TDD - Less is more
Ben Lau
 
PDF
Google Polymer Framework
Kostas Karolemeas
 
PPTX
Polymer and web component
Imam Raza
 
PDF
Polymer
jskvara
 
PPTX
How to build a web application with Polymer
Sami Suo-Heikki
 
PDF
Introduction to Web Components
Fu Cheng
 
PDF
Polymer, A Web Component Polyfill Library
naohito maeda
 
PPTX
Goodbye JavaScript Hello Blazor
Ed Charbeneau
 
PPT
Web II - 01 - Introduction to server-side development
Randy Connolly
 
PPTX
Google Polymer Introduction
David Price
 
PDF
Building a Secure App with Google Polymer and Java / Spring
sdeeg
 
PPT
GWT
yuvalb
 
PPTX
Building modern share point apps (angularjs, npm, bower, grunt, VS2015)
Sergei Sergeev
 
PPTX
Web Components
FITC
 
Introduction to polymer project
Christoforus Surjoputro
 
Visual resume
Milan Skorić
 
The rise of Polymer and Web Components (Kostas Karolemeas) - GreeceJS #17
GreeceJS
 
JavaScript UI Architecture: Be all that you can be
Kyle Simpson
 
Usability in the GeoWeb
Dave Bouwman
 
Testable client side_mvc_apps_in_javascript
Timothy Oxley
 
Effective TDD - Less is more
Ben Lau
 
Google Polymer Framework
Kostas Karolemeas
 
Polymer and web component
Imam Raza
 
Polymer
jskvara
 
How to build a web application with Polymer
Sami Suo-Heikki
 
Introduction to Web Components
Fu Cheng
 
Polymer, A Web Component Polyfill Library
naohito maeda
 
Goodbye JavaScript Hello Blazor
Ed Charbeneau
 
Web II - 01 - Introduction to server-side development
Randy Connolly
 
Google Polymer Introduction
David Price
 
Building a Secure App with Google Polymer and Java / Spring
sdeeg
 
GWT
yuvalb
 
Building modern share point apps (angularjs, npm, bower, grunt, VS2015)
Sergei Sergeev
 
Web Components
FITC
 

Similar to HTML5 for Rich User Experience (20)

PPTX
Html5
Zahin Omar Alwa
 
PDF
HTML5 features & JavaScript APIs
Fisnik Doko
 
PDF
Speak the Web 15.02.2010
Patrick Lauke
 
PDF
HTML5 New Features and Resources
Ron Reiter
 
PDF
An Intro to Mobile HTML5
James Pearce
 
PPTX
HTML5 on Mobile
Adam Lu
 
PDF
Developing the Next Generation Embedded HMIs
mentoresd
 
PDF
HTML5 and web platform
dynamis
 
PDF
HTML5 and Google Chrome - DevFest09
mihaiionescu
 
PDF
HTML5 and Beyond
dynamis
 
PDF
Keypoints html5
dynamis
 
PDF
Change by HTML5
dynamis
 
KEY
WHAT IS HTML5? (at CSS Nite Osaka)
Shumpei Shiraishi
 
PDF
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Sadaaki HIRAI
 
PDF
Jsf2 html5-jazoon
Roger Kitain
 
PPTX
The web as it should be
thebeebs
 
PPTX
Practical html5
Maurice De Beijer [MVP]
 
PDF
Building a Better Web with HTML5 and CSS3
Karambir Singh Nain
 
HTML5 features & JavaScript APIs
Fisnik Doko
 
Speak the Web 15.02.2010
Patrick Lauke
 
HTML5 New Features and Resources
Ron Reiter
 
An Intro to Mobile HTML5
James Pearce
 
HTML5 on Mobile
Adam Lu
 
Developing the Next Generation Embedded HMIs
mentoresd
 
HTML5 and web platform
dynamis
 
HTML5 and Google Chrome - DevFest09
mihaiionescu
 
HTML5 and Beyond
dynamis
 
Keypoints html5
dynamis
 
Change by HTML5
dynamis
 
WHAT IS HTML5? (at CSS Nite Osaka)
Shumpei Shiraishi
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Sadaaki HIRAI
 
Jsf2 html5-jazoon
Roger Kitain
 
The web as it should be
thebeebs
 
Practical html5
Maurice De Beijer [MVP]
 
Building a Better Web with HTML5 and CSS3
Karambir Singh Nain
 
Ad

Recently uploaded (20)

PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
July Patch Tuesday
Ivanti
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
July Patch Tuesday
Ivanti
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Python basic programing language for automation
DanialHabibi2
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Ad

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