SlideShare a Scribd company logo
1 of 21
Download to read offline
More native look and feel
  with HTML5 canvas
Cases, advantages, issues and solutions
How to compare DOM and CANVAS?

We will use FlashJS engine.

It have CANVAS and DOM renderers, so we
can launch same code in both ways.

flashjs.com
Why?
Why not HTML?
HTML Node - is heavy
to render object.

● Designed for advanced
  layouts, sometimes it is
  useless and harmful
● CSS
● Legacy properties, logic
Why canvas?
One DOM interface - unlimited number of
objects, so much more easier to render.
Why canvas?
Using canvas for UI components rendering is
very close to event delegation - you delegate
not only events but rendering as well.
Cases
Typical cases

Responsible components with transformation of
many objects.

              DOM example
             CANVAS example
Typical cases

DOM interface decoration with animated
objects.

              DOM example
             CANVAS example
Typical cases
For example - you`ll need to draw timelines like
this with DOM. How many DIVs will you need?
?
Your case
Anti-cases
Anticases
Small amount of objects without transforms or
transitions / animations are enought.
Anticases
Your objects have
to include content
with advanced layout.
And much more...
CANVAS is not a silver bullet for HTML
perfomance...
Big canvas - bad canvas?
Frameworks
Probably you`ll need easy to use interfaces for
sprites, animations, scales, nested objects and
much more, but HTML5 canvas API is too low
level thing - you`d better to use frameworks.
Canvas UI development issues
Because of previous issue - you`ll need batch
assets resizing for different screen sizes.
Canvas UI development issues
Using large universal engines
seems to be wrong way sometimes.

There is space for
your own wheel.
?
Questions
Thanks =)
Denis Radin
PixelsCommander.com




Special thanks to FlashJS
engine - www.flashjs.com

More Related Content

Similar to More native look and feel of mobile JS applications with HTML5 canvas

101207 raphael
101207 raphael101207 raphael
101207 raphael
jonwyatt
 
Maintainable Javascript carsonified
Maintainable Javascript carsonifiedMaintainable Javascript carsonified
Maintainable Javascript carsonified
Christian Heilmann
 

Similar to More native look and feel of mobile JS applications with HTML5 canvas (20)

Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issues
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
101207 raphael
101207 raphael101207 raphael
101207 raphael
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
 
Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
 
The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
Node PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsNode PDX: Intro to Sails.js
Node PDX: Intro to Sails.js
 
Practical html5
Practical html5Practical html5
Practical html5
 
Maintainable Javascript carsonified
Maintainable Javascript carsonifiedMaintainable Javascript carsonified
Maintainable Javascript carsonified
 
JS digest. July 2018
JS digest.  July 2018JS digest.  July 2018
JS digest. July 2018
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
Image video processing and canvas element by Abhay Rao
Image video processing and canvas element by Abhay RaoImage video processing and canvas element by Abhay Rao
Image video processing and canvas element by Abhay Rao
 
From Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holesFrom Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holes
 
Quantum. Just Quantum
Quantum. Just QuantumQuantum. Just Quantum
Quantum. Just Quantum
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Spectrum 16 pmc 16 - preparing legacy projects for responsive design
Spectrum 16   pmc 16 - preparing legacy projects for responsive designSpectrum 16   pmc 16 - preparing legacy projects for responsive design
Spectrum 16 pmc 16 - preparing legacy projects for responsive design
 
What is HTML5
What is HTML5What is HTML5
What is HTML5
 
Custom WordPress Development Company USA
Custom WordPress Development Company USACustom WordPress Development Company USA
Custom WordPress Development Company USA
 
Dita for the web: Make Adaptive Content Simple for Writers and Developer
Dita for the web: Make Adaptive Content Simple for Writers and DeveloperDita for the web: Make Adaptive Content Simple for Writers and Developer
Dita for the web: Make Adaptive Content Simple for Writers and Developer
 

More from Denis Radin

More from Denis Radin (10)

Mining crypto in browser as a bleeding edge performance challenge for the Web...
Mining crypto in browser as a bleeding edge performance challenge for the Web...Mining crypto in browser as a bleeding edge performance challenge for the Web...
Mining crypto in browser as a bleeding edge performance challenge for the Web...
 
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderPixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shader
 
Migrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityMigrating your Web app to Virtual Reality
Migrating your Web app to Virtual Reality
 
Building native apps with web components
Building native apps with web componentsBuilding native apps with web components
Building native apps with web components
 
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
 
1.Loading
1.Loading1.Loading
1.Loading
 
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
 
Front-end tower of Babylon
Front-end tower of BabylonFront-end tower of Babylon
Front-end tower of Babylon
 
JavaScript and HTML in shipbuilding and aircraft industries
JavaScript and HTML in shipbuilding and aircraft industriesJavaScript and HTML in shipbuilding and aircraft industries
JavaScript and HTML in shipbuilding and aircraft industries
 
FlAnalyzer
FlAnalyzerFlAnalyzer
FlAnalyzer
 

More native look and feel of mobile JS applications with HTML5 canvas