I Can't Believe It's Not Flash

Thomas Fuchs
Thomas FuchsJavaScript Guru um Slash7
I Can’t
Believe It’s
Not Flash!


@thomasfuchs
<omg  code="on  slides"/>
I Can't Believe It's Not Flash
Animating CSS properties
    Timer




JavaScript   Reflow   Rendering   Paint
 sets CSS
I Can't Believe It's Not Flash
Animating CSS properties
    Timer




JavaScript   Reflow   Rendering   Paint
 sets CSS
Performance hit
Performance hit




JavaScript      Reflow   Rendering   Paint
Performance hit




JavaScript      Reflow   Rendering   Paint
Performance hit




JavaScript      Reflow   Rendering   Paint
Performance hit




JavaScript      Reflow   Rendering   Paint
Performance hit




JavaScript      Reflow   Rendering   Paint
Browser CSS animation/
        transitions

  Timer




Browser   Reflow   Rendering   Paint
updates
  CSS
I Can't Believe It's Not Flash
Timer




JavaScript   Reflow   Rendering   Paint
 sets CSS

   Timer




Browser      Reflow   Rendering   Paint
updates
  CSS
Timer




JavaScript   Reflow   Rendering   Paint
 sets CSS

   Timer




Browser      Reflow   Rendering   Paint
updates
  CSS
-webkit-transform




                Paint

JavaScript
or Browser
 sets CSS
I Can't Believe It's Not Flash
I Can't Believe It's Not Flash
I Can't Believe It's Not Flash
<!DOCTYPE  html  PUBLIC  "-­‐//W3C//DTD  XHTML  1.0  Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-­‐transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en"  lang="en">
<head>
    <meta  http-­‐equiv="Content-­‐Type"  content="text/html;  charset=utf-­‐8"/>
    <title>index</title>
    <style  type="text/css"  media="screen">
        div  {
            position:  absolute;
            border:  3px  solid  red;
        }
        #d1  {
            left:  20px;  top:  20px;  width:  400px;  height:  400px;
            -­‐webkit-­‐transform:translateZ(0px);
        }
        #d2  {
            left:  100px;  top:  30px;  width:  150px;  height:  100px;
            -­‐webkit-­‐transform:translateZ(-­‐100px);
        }
        #d3  {
            left:  300px;  top:  40px;  width:  100px;  height:  50px;
            -­‐webkit-­‐transform:translateZ(-­‐200px);
        }
        #d4  {
            left:  320px;  top:  80px;  width:  90px;  height:  50px;
            -­‐webkit-­‐transform:translateZ(-­‐300px);
        }
        #d5  {
            left:  280px;  top:  90px;  width:  90px;  height:  50px;
            -­‐webkit-­‐transform:translateZ(-­‐400px);
        }
        body  {
            -­‐webkit-­‐transform-­‐style:  preserve-­‐3d;
       #d2  {
            left:  100px;  top:  30px;  width:  150px;  height:  100px;
            -­‐webkit-­‐transform:translateZ(-­‐100px);
        }
        #d3  {
            left:  300px;  top:  40px;  width:  100px;  height:  50px;
            -­‐webkit-­‐transform:translateZ(-­‐200px);
        }
        #d4  {
            left:  320px;  top:  80px;  width:  90px;  height:  50px;
            -­‐webkit-­‐transform:translateZ(-­‐300px);
        }
        #d5  {
            left:  280px;  top:  90px;  width:  90px;  height:  50px;
            -­‐webkit-­‐transform:translateZ(-­‐400px);
        }
        body  {
            -­‐webkit-­‐transform-­‐style:  preserve-­‐3d;
            -­‐webkit-­‐transform:rotateX(0deg)  rotateY(0deg)  rotateZ(0deg)  perspective(0);
        }
        body.stage2  {
            -­‐webkit-­‐transition:  -­‐webkit-­‐transform  10s;
            -­‐webkit-­‐transform:rotateX(30deg)  rotateY(-­‐50deg)  rotateZ(10deg)  perspective(0);
        }
    </style>
</head>
<body>
    <div  id="d1"></div>
    <div  id="d2"></div>
    <div  id="d3"></div>
    <div  id="d4"></div>
    <div  id="d5"></div>
</body>
</html>
Safari on Snow Leopard,
or on Windows: Nokia’s Starlight
        browser (alpha)
  http://www.starlight-webkit.org/
http://pepsicozeitgeist.com/
I Can't Believe It's Not Flash
Fullscreen HD Video CPU%

         HTML5: 10%

        FLASH: 100+%
         (and dropped frames)



http://jilion.com/sublime/video
I Can't Believe It's Not Flash
Canvas
    Timer




JavaScript            Paint
   uses
 Canvas
   APIs
I Can't Believe It's Not Flash
Physics engine
           with Canvas
         Timer




  1) clear canvas                    Paint
2) physics iteration
  3) draw shapes
                       Box2D physics engine
function  createBall(world,  x,  y)  {
    var  ballSd  =  new  b2CircleDef();
    ballSd.density  =  0.3;
    ballSd.radius  =  20+Math.random()*20;
    ballSd.restitution  =  0.1;
    ballSd.friction  =  0.2;
    var  ballBd  =  new  b2BodyDef();
    ballBd.rotation  =  0.3;
    ballBd.AddShape(ballSd);
    ballBd.position.Set(x,y);
    return  world.CreateBody(ballBd);
}
                   world.Step(ms,1);
3) draw shapes



 box2d
objects/
positions



                  canvas
http://pepsicozeitgeist.com/
Vector graphics
               SVG + VML




JavaScript    Reflow   Rendering   Paint
  creates
  vector
 graphics
  nodes
http://raphaeljs.com/
<path  fill="none"  stroke="#5cbfff"  
d="M52.2,40.5L47.23,55.5L38.53,70.5L33.88,85.5L36.63,100.5L50.1
,115.5L70.7,130.5L97.85,145.5L123.65,160.5L139.3,175.5L126.2,19
0.5L132.95,205.5L157.58,220.5L143.85,235.5L155.25,250.5L151.43,
265.5L149.05,280.5L104.5,295.5L103.6,310.5L97.85,325.5L94.58,34
0.5L86.7,355.5L78.95,370.5L69.35,385.5M56.4,440.5L42.3,455.5L32
.93,470.5L26.38,485.5L28.23,500.5L28.95,515.5L40.45,530.5L57.55
,545.5L80.18,560.5L123.55,575.5L144.95,590.5L137.33,605.5L134.9
8,620.5L149.7,635.5L162.73,650.5L142.83,665.5L164.2,680.5L106.2
5,695.5L97.28,710.5L88.75,725.5L90.83,740.5L87.15,755.5L85.15,7
70.5L62.55,785.5M52.78,840.5L41.5,855.5L33.1,870.5L22.38,885.5L
25.63,900.5L24.05,915.5L33.05,930.5L48.3,945.5L65.35,960.5L115.
2,975.5L137.7,990.5L136.43,1005.5L102.28,1020.5L132.28,1035.5L1
37.5,1050.5L132.05,1065.5L155.83,1080.5L107.3,1095.5L95.98,1110
.5L94.73,1125.5L94.65,1140.5L86.25,1155.5L83.4,1170.5L70.48,118
5.5M58.6,1240.5L43.38,1255.5L33.35,1270.5L28.43,1285.5L29.05,13
00.5L38.43,1315.5L51.35,1330.5L82.38,1345.5L105.73,1360.5L159.7
8,1375.5L176.05,1390.5L164.13,1405.5L139.48,1420.5L131.53,1435.
5L164.83,1450.5L161.15,1465.5L157.2,1480.5L112.68,1495.5L105.68
,1510.5L103.83,1525.5L104.25,1540.5L92.5,1555.5L91.35,1570.5L70
.48,1585.5M54.05,1640.5L48.6,1655.5L35.02,1670.5L32.8,1685.5L36
.98,1700.5L41.75,1715.5L63.78,1730.5L90.6,1745.5L112.28,1760.5L
161.35,1775.5L171.2,1790.5L180.43,1805.5L171.88,1820.5L168.65,1
835.5L153.88,1850.5L148.35,1865.5L140.28,1880.5L110.2,1895.5L10
4.68,1910.5L101.2,1925.5L96.7,1940.5L96.5,1955.5L80.08,1970.5L6
8.4,1985.5M54.8,2040.5L41.23,2055.5L35.85,2070.5L30.15,2085.5L3
http://pepsicozeitgeist.com/
I Can't Believe It's Not Flash
WebGL


shaders


    Timer




JavaScript           Paint
WebGL
<script  id="vshader"  type="x-­‐shader/x-­‐vertex">
    uniform  mat4  u_modelViewMatrix;
    uniform  mat4  u_modelViewProjMatrix;
    uniform  mat4  u_normalMatrix;
    uniform  vec3  lightDir;

    attribute  vec3  vNormal;
    attribute  vec4  vTexCoord;
    attribute  vec4  vPosition;
                
    varying  float  v_Dot;
    varying  vec2  v_texCoord;
                
    void  main()
    {
        gl_Position  =  u_modelViewProjMatrix  *  vPosition;
        v_texCoord  =  vTexCoord.st;
        vec4  transNormal  =  u_normalMatrix  *  vec4(vNormal,1);
        v_Dot  =  max(dot(transNormal.xyz,  lightDir),  0.0);
    }
</script>
   var  exampleScene  =  scene(
        {},

        /*  A  renderer  node  binds  subnodes  to  a  WebGL  canvas  element
              defined  in  the  HTML  tab  then  clears  the  depth  and  colour  buffers
          */
        renderer({
                                canvasId:  'theCanvas',
                                clear  :  {  depth  :  true,  color  :  true}
                        },
                /*  A  simple  phong  GLSL  shader  to  render  sub-­‐nodes,  with
                      a  single  light  source.  This  shader  type  only  supports
                      a  one  light  source.
                  */
                shader(
                    {  type:  'simple-­‐shader'  },

                    lights(                                        scenejs.org
                        {
                            lights:  [
                                {
                                    pos:  {  x:  -­‐30.0,  y:  30.0,  z:  -­‐30.0  }
                                }
                            ]},

                        /*  Perspective  transformation
                          */
http://github.com/OneGeek/WebGLU
http://learningwebgl.com/
http://ftp.mozilla.org/pub/mozilla.org/
      firefox/nightly/latest-trunk/
I Can't Believe It's Not Flash
JavaScript & CSS
CSS Transforms & Animations
   2D bitmapped graphics
      Physics engines
      Vector graphics
        HTML5 video
           WebGL
THANKS!



@thomasfuchs
1 von 48

Recomendados

HTML5 Canvas - The Future of Graphics on the Web von
HTML5 Canvas - The Future of Graphics on the WebHTML5 Canvas - The Future of Graphics on the Web
HTML5 Canvas - The Future of Graphics on the WebRobin Hawkes
42.4K views40 Folien
Introduction to HTML5 Canvas von
Introduction to HTML5 CanvasIntroduction to HTML5 Canvas
Introduction to HTML5 CanvasMindy McAdams
8.5K views37 Folien
Google's HTML5 Work: what's next? von
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Patrick Chanezon
13.5K views37 Folien
фабрика Blockly von
фабрика Blocklyфабрика Blockly
фабрика BlocklyЕвгений Белов
596 views16 Folien
Intro to HTML5 von
Intro to HTML5Intro to HTML5
Intro to HTML5Jussi Pohjolainen
843 views34 Folien
Html5 von
Html5Html5
Html5Soliman ElSaber
717 views24 Folien

Más contenido relacionado

Was ist angesagt?

How to build a html5 websites.v1 von
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1Bitla Software
2.4K views84 Folien
Mastering CSS Animations von
Mastering CSS AnimationsMastering CSS Animations
Mastering CSS AnimationsGoodbytes
2.5K views52 Folien
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG von
JavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVGJavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVGPatrick Chanezon
1.6K views38 Folien
CSS3 : Animation ,Transitions, Gradients von
CSS3 : Animation ,Transitions, GradientsCSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, GradientsJatin_23
1.7K views18 Folien
CSS3 Transforms Transitions and Animations von
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsInayaili León
2.3K views66 Folien
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018 von
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018Codemotion
200 views72 Folien

Was ist angesagt?(20)

How to build a html5 websites.v1 von Bitla Software
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
Bitla Software2.4K views
Mastering CSS Animations von Goodbytes
Mastering CSS AnimationsMastering CSS Animations
Mastering CSS Animations
Goodbytes2.5K views
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG von Patrick Chanezon
JavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVGJavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
Patrick Chanezon1.6K views
CSS3 : Animation ,Transitions, Gradients von Jatin_23
CSS3 : Animation ,Transitions, GradientsCSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, Gradients
Jatin_231.7K views
CSS3 Transforms Transitions and Animations von Inayaili León
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and Animations
Inayaili León2.3K views
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018 von Codemotion
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018
Codemotion200 views
Yearning jQuery von Remy Sharp
Yearning jQueryYearning jQuery
Yearning jQuery
Remy Sharp16K views
Processing and Processing.js von jeresig
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
jeresig2.7K views
Dynamic CSS: Transforms, Transitions, and Animation Basics von Beth Soderberg
Dynamic CSS: Transforms, Transitions, and Animation BasicsDynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation Basics
Beth Soderberg7K views
Shibuya.js Lightning Talks von jeresig
Shibuya.js Lightning TalksShibuya.js Lightning Talks
Shibuya.js Lightning Talks
jeresig1.5K views
CSS3 2D/3D transform von Kenny Lee
CSS3 2D/3D transformCSS3 2D/3D transform
CSS3 2D/3D transform
Kenny Lee5.2K views
JavaScript 1.5 to 2.0 (TomTom) von jeresig
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)
jeresig17.7K views
Randomising css animations von asjb
Randomising css animationsRandomising css animations
Randomising css animations
asjb6.7K views
Vue.js + Django - configuración para desarrollo con webpack y HMR von Javier Abadía
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMR
Javier Abadía3.2K views
Canvas von Rajon
CanvasCanvas
Canvas
Rajon 293 views
HTML5: friend or foe (to Flash)? von Remy Sharp
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?
Remy Sharp53.4K views
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013) von Brian Sam-Bodden
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Brian Sam-Bodden6.6K views

Destacado

Yes! I'm Lonesome tonight von
Yes! I'm Lonesome tonightYes! I'm Lonesome tonight
Yes! I'm Lonesome tonightIvor Jones
1.9K views41 Folien
Windy day von
Windy dayWindy day
Windy dayIvor Jones
612 views38 Folien
Superacion von
SuperacionSuperacion
SuperacionFredy Balaguera
967 views11 Folien
Diferencia porno / sensual von
Diferencia porno / sensualDiferencia porno / sensual
Diferencia porno / sensualFredy Balaguera
2K views13 Folien
Labellezaazul von
LabellezaazulLabellezaazul
LabellezaazulFredy Balaguera
529 views32 Folien
Brutas von
BrutasBrutas
BrutasFredy Balaguera
1.2K views15 Folien

Destacado(20)

Yes! I'm Lonesome tonight von Ivor Jones
Yes! I'm Lonesome tonightYes! I'm Lonesome tonight
Yes! I'm Lonesome tonight
Ivor Jones1.9K views
Developers in the New Age of the Web von klamping
Developers in the New Age of the WebDevelopers in the New Age of the Web
Developers in the New Age of the Web
klamping636 views
Rich and Snappy Apps (No Scaling Required) von Thomas Fuchs
Rich and Snappy Apps (No Scaling Required)Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)
Thomas Fuchs7K views
Bikini selfies and suggestive lip dubs: Examining queer women’s performances... von Stefanie Duguay
Bikini selfies and suggestive lip dubs: Examining queer women’s performances...Bikini selfies and suggestive lip dubs: Examining queer women’s performances...
Bikini selfies and suggestive lip dubs: Examining queer women’s performances...
Stefanie Duguay1.7K views

Similar a I Can't Believe It's Not Flash

HTML5 - A Whirlwind tour von
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourLohith Goudagere Nagaraj
617 views30 Folien
CSS3 Takes on the World von
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the WorldJonathan Snook
1.5K views54 Folien
[A5]deview 2012 pt hds webkit_gpu von
[A5]deview 2012 pt hds webkit_gpu[A5]deview 2012 pt hds webkit_gpu
[A5]deview 2012 pt hds webkit_gpuNAVER D2
4.1K views31 Folien
PreDevCampSF - CSS3 Tricks von
PreDevCampSF - CSS3 TricksPreDevCampSF - CSS3 Tricks
PreDevCampSF - CSS3 Tricksincidentist
1.9K views18 Folien
Interface Styling & Scripting on WebKit Mobile von
Interface Styling & Scripting on WebKit MobileInterface Styling & Scripting on WebKit Mobile
Interface Styling & Scripting on WebKit MobileDavid Aurelio
1.1K views33 Folien
CSS3: Ready for Primetime? von
CSS3: Ready for Primetime?CSS3: Ready for Primetime?
CSS3: Ready for Primetime?Jeff Bridgforth
1.9K views105 Folien

Similar a I Can't Believe It's Not Flash(20)

[A5]deview 2012 pt hds webkit_gpu von NAVER D2
[A5]deview 2012 pt hds webkit_gpu[A5]deview 2012 pt hds webkit_gpu
[A5]deview 2012 pt hds webkit_gpu
NAVER D24.1K views
PreDevCampSF - CSS3 Tricks von incidentist
PreDevCampSF - CSS3 TricksPreDevCampSF - CSS3 Tricks
PreDevCampSF - CSS3 Tricks
incidentist1.9K views
Interface Styling & Scripting on WebKit Mobile von David Aurelio
Interface Styling & Scripting on WebKit MobileInterface Styling & Scripting on WebKit Mobile
Interface Styling & Scripting on WebKit Mobile
David Aurelio1.1K views
JavaONE 2012 Using Java with HTML5 and CSS3 von Helder da Rocha
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3
Helder da Rocha822 views
Implementing Awesome: An HTML5/CSS3 Workshop von Shoshi Roberts
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
Shoshi Roberts3.5K views
SVCC 2013 D3.js Presentation (10/05/2013) von Oswald Campesato
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
Oswald Campesato2.1K views
HTML5 تکنولوژی های موجود در von Shiraz LUG
HTML5 تکنولوژی های موجود در HTML5 تکنولوژی های موجود در
HTML5 تکنولوژی های موجود در
Shiraz LUG71 views
Css animation von Aaron King
Css animationCss animation
Css animation
Aaron King4.8K views
codebits 2009 HTML5 JS APIs von Remy Sharp
codebits 2009 HTML5 JS APIscodebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIs
Remy Sharp932 views
The CSS of Tomorrow (Front Row 2011) von Peter Gasston
The CSS of Tomorrow (Front Row 2011)The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)
Peter Gasston1.7K views
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich von Robert Nyman
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichHTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
Robert Nyman5.7K views
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com von applicake
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
applicake1.3K views

Más de Thomas Fuchs

Zepto and the rise of the JavaScript Micro-Frameworks von
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksThomas Fuchs
21.4K views87 Folien
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K von
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
13.6K views39 Folien
Prototype & Scriptaculous von
Prototype  & ScriptaculousPrototype  & Scriptaculous
Prototype & ScriptaculousThomas Fuchs
984 views63 Folien
Extreme JavaScript Performance von
Extreme JavaScript PerformanceExtreme JavaScript Performance
Extreme JavaScript PerformanceThomas Fuchs
64K views105 Folien
Textorize von
TextorizeTextorize
TextorizeThomas Fuchs
4.1K views38 Folien
Adventures In JavaScript Testing von
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript TestingThomas Fuchs
1.5K views62 Folien

Más de Thomas Fuchs(7)

Zepto and the rise of the JavaScript Micro-Frameworks von Thomas Fuchs
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-Frameworks
Thomas Fuchs21.4K views
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K von Thomas Fuchs
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Thomas Fuchs13.6K views
Prototype & Scriptaculous von Thomas Fuchs
Prototype  & ScriptaculousPrototype  & Scriptaculous
Prototype & Scriptaculous
Thomas Fuchs984 views
Extreme JavaScript Performance von Thomas Fuchs
Extreme JavaScript PerformanceExtreme JavaScript Performance
Extreme JavaScript Performance
Thomas Fuchs64K views
Adventures In JavaScript Testing von Thomas Fuchs
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript Testing
Thomas Fuchs1.5K views
Ruby On Rails Introduction von Thomas Fuchs
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
Thomas Fuchs57K views

Último

The Power of Heat Decarbonisation Plans in the Built Environment von
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built EnvironmentIES VE
84 views20 Folien
"Surviving highload with Node.js", Andrii Shumada von
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
58 views29 Folien
Deep Tech and the Amplified Organisation: Core Concepts von
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core ConceptsHolonomics
17 views21 Folien
The Role of Patterns in the Era of Large Language Models von
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language ModelsYunyao Li
91 views65 Folien
Cocktail of Environments. How to Mix Test and Development Environments and St... von
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Aleksandr Tarasov
23 views135 Folien
Inawisdom IDP von
Inawisdom IDPInawisdom IDP
Inawisdom IDPPhilipBasford
15 views48 Folien

Último(20)

The Power of Heat Decarbonisation Plans in the Built Environment von IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE84 views
"Surviving highload with Node.js", Andrii Shumada von Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 views
Deep Tech and the Amplified Organisation: Core Concepts von Holonomics
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core Concepts
Holonomics17 views
The Role of Patterns in the Era of Large Language Models von Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li91 views
Cocktail of Environments. How to Mix Test and Development Environments and St... von Aleksandr Tarasov
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
NTGapps NTG LowCode Platform von Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu437 views
AI + Memoori = AIM von Memoori
AI + Memoori = AIMAI + Memoori = AIM
AI + Memoori = AIM
Memoori14 views
Discover Aura Workshop (12.5.23).pdf von Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j15 views
Business Analyst Series 2023 - Week 4 Session 8 von DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10145 views
Business Analyst Series 2023 - Week 4 Session 7 von DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10146 views
"Package management in monorepos", Zoltan Kochan von Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views
Future of AR - Facebook Presentation von Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
Mobile Core Solutions & Successful Cases.pdf von IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 views
"Running students' code in isolation. The hard way", Yurii Holiuk von Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays36 views
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell von Fwdays
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
Fwdays14 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... von Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro35 views
AIM102-S_Cognizant_CognizantCognitive von PhilipBasford
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitive
PhilipBasford21 views

I Can't Believe It's Not Flash

  • 1. I Can’t Believe It’s Not Flash! @thomasfuchs
  • 4. Animating CSS properties Timer JavaScript Reflow Rendering Paint sets CSS
  • 6. Animating CSS properties Timer JavaScript Reflow Rendering Paint sets CSS
  • 8. Performance hit JavaScript Reflow Rendering Paint
  • 9. Performance hit JavaScript Reflow Rendering Paint
  • 10. Performance hit JavaScript Reflow Rendering Paint
  • 11. Performance hit JavaScript Reflow Rendering Paint
  • 12. Performance hit JavaScript Reflow Rendering Paint
  • 13. Browser CSS animation/ transitions Timer Browser Reflow Rendering Paint updates CSS
  • 15. Timer JavaScript Reflow Rendering Paint sets CSS Timer Browser Reflow Rendering Paint updates CSS
  • 16. Timer JavaScript Reflow Rendering Paint sets CSS Timer Browser Reflow Rendering Paint updates CSS
  • 17. -webkit-transform Paint JavaScript or Browser sets CSS
  • 21. <!DOCTYPE  html  PUBLIC  "-­‐//W3C//DTD  XHTML  1.0  Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-­‐transitional.dtd"> <html  xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en"  lang="en"> <head>    <meta  http-­‐equiv="Content-­‐Type"  content="text/html;  charset=utf-­‐8"/>    <title>index</title>    <style  type="text/css"  media="screen">        div  {            position:  absolute;            border:  3px  solid  red;        }        #d1  {            left:  20px;  top:  20px;  width:  400px;  height:  400px;            -­‐webkit-­‐transform:translateZ(0px);        }        #d2  {            left:  100px;  top:  30px;  width:  150px;  height:  100px;            -­‐webkit-­‐transform:translateZ(-­‐100px);        }        #d3  {            left:  300px;  top:  40px;  width:  100px;  height:  50px;            -­‐webkit-­‐transform:translateZ(-­‐200px);        }        #d4  {            left:  320px;  top:  80px;  width:  90px;  height:  50px;            -­‐webkit-­‐transform:translateZ(-­‐300px);        }        #d5  {            left:  280px;  top:  90px;  width:  90px;  height:  50px;            -­‐webkit-­‐transform:translateZ(-­‐400px);        }        body  {            -­‐webkit-­‐transform-­‐style:  preserve-­‐3d;
  • 22.        #d2  {            left:  100px;  top:  30px;  width:  150px;  height:  100px;            -­‐webkit-­‐transform:translateZ(-­‐100px);        }        #d3  {            left:  300px;  top:  40px;  width:  100px;  height:  50px;            -­‐webkit-­‐transform:translateZ(-­‐200px);        }        #d4  {            left:  320px;  top:  80px;  width:  90px;  height:  50px;            -­‐webkit-­‐transform:translateZ(-­‐300px);        }        #d5  {            left:  280px;  top:  90px;  width:  90px;  height:  50px;            -­‐webkit-­‐transform:translateZ(-­‐400px);        }        body  {            -­‐webkit-­‐transform-­‐style:  preserve-­‐3d;            -­‐webkit-­‐transform:rotateX(0deg)  rotateY(0deg)  rotateZ(0deg)  perspective(0);        }        body.stage2  {            -­‐webkit-­‐transition:  -­‐webkit-­‐transform  10s;            -­‐webkit-­‐transform:rotateX(30deg)  rotateY(-­‐50deg)  rotateZ(10deg)  perspective(0);        }    </style> </head> <body>    <div  id="d1"></div>    <div  id="d2"></div>    <div  id="d3"></div>    <div  id="d4"></div>    <div  id="d5"></div> </body> </html>
  • 23. Safari on Snow Leopard, or on Windows: Nokia’s Starlight browser (alpha) http://www.starlight-webkit.org/
  • 26. Fullscreen HD Video CPU% HTML5: 10% FLASH: 100+% (and dropped frames) http://jilion.com/sublime/video
  • 28. Canvas Timer JavaScript Paint uses Canvas APIs
  • 30. Physics engine with Canvas Timer 1) clear canvas Paint 2) physics iteration 3) draw shapes Box2D physics engine
  • 31. function  createBall(world,  x,  y)  {    var  ballSd  =  new  b2CircleDef();    ballSd.density  =  0.3;    ballSd.radius  =  20+Math.random()*20;    ballSd.restitution  =  0.1;    ballSd.friction  =  0.2;    var  ballBd  =  new  b2BodyDef();    ballBd.rotation  =  0.3;    ballBd.AddShape(ballSd);    ballBd.position.Set(x,y);    return  world.CreateBody(ballBd); }
  • 32.                    world.Step(ms,1);
  • 33. 3) draw shapes box2d objects/ positions canvas
  • 35. Vector graphics SVG + VML JavaScript Reflow Rendering Paint creates vector graphics nodes
  • 37. <path  fill="none"  stroke="#5cbfff"   d="M52.2,40.5L47.23,55.5L38.53,70.5L33.88,85.5L36.63,100.5L50.1 ,115.5L70.7,130.5L97.85,145.5L123.65,160.5L139.3,175.5L126.2,19 0.5L132.95,205.5L157.58,220.5L143.85,235.5L155.25,250.5L151.43, 265.5L149.05,280.5L104.5,295.5L103.6,310.5L97.85,325.5L94.58,34 0.5L86.7,355.5L78.95,370.5L69.35,385.5M56.4,440.5L42.3,455.5L32 .93,470.5L26.38,485.5L28.23,500.5L28.95,515.5L40.45,530.5L57.55 ,545.5L80.18,560.5L123.55,575.5L144.95,590.5L137.33,605.5L134.9 8,620.5L149.7,635.5L162.73,650.5L142.83,665.5L164.2,680.5L106.2 5,695.5L97.28,710.5L88.75,725.5L90.83,740.5L87.15,755.5L85.15,7 70.5L62.55,785.5M52.78,840.5L41.5,855.5L33.1,870.5L22.38,885.5L 25.63,900.5L24.05,915.5L33.05,930.5L48.3,945.5L65.35,960.5L115. 2,975.5L137.7,990.5L136.43,1005.5L102.28,1020.5L132.28,1035.5L1 37.5,1050.5L132.05,1065.5L155.83,1080.5L107.3,1095.5L95.98,1110 .5L94.73,1125.5L94.65,1140.5L86.25,1155.5L83.4,1170.5L70.48,118 5.5M58.6,1240.5L43.38,1255.5L33.35,1270.5L28.43,1285.5L29.05,13 00.5L38.43,1315.5L51.35,1330.5L82.38,1345.5L105.73,1360.5L159.7 8,1375.5L176.05,1390.5L164.13,1405.5L139.48,1420.5L131.53,1435. 5L164.83,1450.5L161.15,1465.5L157.2,1480.5L112.68,1495.5L105.68 ,1510.5L103.83,1525.5L104.25,1540.5L92.5,1555.5L91.35,1570.5L70 .48,1585.5M54.05,1640.5L48.6,1655.5L35.02,1670.5L32.8,1685.5L36 .98,1700.5L41.75,1715.5L63.78,1730.5L90.6,1745.5L112.28,1760.5L 161.35,1775.5L171.2,1790.5L180.43,1805.5L171.88,1820.5L168.65,1 835.5L153.88,1850.5L148.35,1865.5L140.28,1880.5L110.2,1895.5L10 4.68,1910.5L101.2,1925.5L96.7,1940.5L96.5,1955.5L80.08,1970.5L6 8.4,1985.5M54.8,2040.5L41.23,2055.5L35.85,2070.5L30.15,2085.5L3
  • 40. WebGL shaders Timer JavaScript Paint
  • 41. WebGL <script  id="vshader"  type="x-­‐shader/x-­‐vertex">    uniform  mat4  u_modelViewMatrix;    uniform  mat4  u_modelViewProjMatrix;    uniform  mat4  u_normalMatrix;    uniform  vec3  lightDir;    attribute  vec3  vNormal;    attribute  vec4  vTexCoord;    attribute  vec4  vPosition;                    varying  float  v_Dot;    varying  vec2  v_texCoord;                    void  main()    {        gl_Position  =  u_modelViewProjMatrix  *  vPosition;        v_texCoord  =  vTexCoord.st;        vec4  transNormal  =  u_normalMatrix  *  vec4(vNormal,1);        v_Dot  =  max(dot(transNormal.xyz,  lightDir),  0.0);    } </script>
  • 42.    var  exampleScene  =  scene(        {},        /*  A  renderer  node  binds  subnodes  to  a  WebGL  canvas  element              defined  in  the  HTML  tab  then  clears  the  depth  and  colour  buffers          */        renderer({                                canvasId:  'theCanvas',                                clear  :  {  depth  :  true,  color  :  true}                        },                /*  A  simple  phong  GLSL  shader  to  render  sub-­‐nodes,  with                      a  single  light  source.  This  shader  type  only  supports                      a  one  light  source.                  */                shader(                    {  type:  'simple-­‐shader'  },                    lights( scenejs.org                        {                            lights:  [                                {                                    pos:  {  x:  -­‐30.0,  y:  30.0,  z:  -­‐30.0  }                                }                            ]},                        /*  Perspective  transformation                          */
  • 45. http://ftp.mozilla.org/pub/mozilla.org/ firefox/nightly/latest-trunk/
  • 47. JavaScript & CSS CSS Transforms & Animations 2D bitmapped graphics Physics engines Vector graphics HTML5 video WebGL