SlideShare a Scribd company logo
Beyond the standards

Advanced Animation and Physics in
JavaScript
Beyond the standards

Advanced Animation and Physics in
JavaScript
Beyond the standards

Pushing the web beyond its limits
Web Standards

 +   Great theory
 +   The way it should be

 -   Minor progress for 10 years
 -   Very difficult to push across parties
Okay then,
let‘s wait until
  something
   changes.
No way!
Let‘s push the
     web!
Walk.
How to create a walking character
1. The Basics

• Center or not?

• Click angles - How many possible directions?

• Preparing the images
2. The animation(s)

• Animate the character by changing the image

• Move the character
3. Tweak

• Walk in constant speed

• Easing

• Multiple clicks handling
Scroll.
How to create a scrollable, isometric
               world
But that‘s not possible!

• Isometry needs
  skewed, non-
  retangle elements

• HTML doesn‘ t have
  them
Don‘t think about limits

• So you cannot use
  events that „bleed
  through“ elements?

• Sure you can!

• Build your own event
  structure in JavaScript
Don‘t limit yourself to a given
standard - you can always build your
own with JavaScript.
There‘s one fundamental thing
     you need to know..
Knowledge is power
New standards
Canvas, CSS Transforms
Canvas

• Feels like a true HMTL element

• Easy JavaScript API

• Safari, Firefox, Opera

• ..IE support using ExCanvas



         Get your hands dirty!
CSS Transforms

• Webkit-only (Safari,
  iPhone, Android, Air)

• 2D transformations on
  HTML elements

• Yes, all kinds of 2d
  transformations:
  Rotating, Scaling,
 Skewing
Example: Coverflow
...wouldn‘t it be cool to
have CSS transforms in
    other browsers?
..omg,
IE already has!
Transformie

• Parses stylesheets and inline styles, tracks
  them using IE only onpropertychange

• Creates a custom matrix for every function
  (rotate, scale, skew)

• Multiplies all matrices

• Creates the IE matrix filter on the element
..but what about the rest?
CSS Transforms in other browsers

• Firefox (< 3.1)/Opera has no CSS transforms

• What can we do? Push the web!

• Two possible methods
  •   Rerender elements to canvas and modify them
  •   Insert elements into SVG and use its transform
      features
The Canvas approach

• Find all instances of -webkit-transform

• For every found element:
  •   Create a new <canvas> element at the exact same position as
      the original, with the same constrains

  •   Rotate/Modify/Translate the whole canvas by the values found in
      the transform functions

  •   Literally draw borders, background and text for the original item
      into the canvas and for all sub items

  •   Recompute the new constrains of the element
Example: Canvas
The SVG approach

• Find all instances of -webkit-transform

• For every found element:
  •   Serialize the whole node (outerHTML) into a string (without
      positioning data in the style attribute)

  •   Wrap it around a prepared SVG XML Header

  •   Also insert the transform value as <g transform=‘...‘>

  •   Encode the whole string to base64

  •   Create a new embed element with the base64 string as data
      source, and render it to the page
Example: SVG
Pushing the standards
  How library developers help
     defining standards
How a library dev smoothens the path
 before web standards jump in

• The Copy approach
  •   Replicate an existing standard on other platforms with the help
      of different technologies

  •   Example: Excanvas

• The „Lowest common multiple“ approach
  •   Take a couple of different standards across browsers and create
      a subset that can be used across browsers

  •   Example: Dojox GFX
Using the LCM approach, we can help
define new standards.


..since we are the ones that try to
find a suitable subset for the end-
developer
Now everyone!
Let‘s push the
     web!
Audience Response
Question?
Thank you for your attention!
      http://paulbakaus.com

More Related Content

What's hot

Java script202
Java script202Java script202
Java script202
Wasiq Zia
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPress
Anthony Montalbano
 
Intro javascript build a scraper (3:22)
Intro javascript   build a scraper (3:22)Intro javascript   build a scraper (3:22)
Intro javascript build a scraper (3:22)
Thinkful
 
Pagelet in action
Pagelet in actionPagelet in action
Pagelet in action
Pu Shiming
 

What's hot (20)

Gatsby vs. Next.js
Gatsby vs. Next.jsGatsby vs. Next.js
Gatsby vs. Next.js
 
Unobtrusive js
Unobtrusive jsUnobtrusive js
Unobtrusive js
 
Java script202
Java script202Java script202
Java script202
 
WebGL: Yesterday, Today, Tomorrow
WebGL: Yesterday, Today, TomorrowWebGL: Yesterday, Today, Tomorrow
WebGL: Yesterday, Today, Tomorrow
 
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
 Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c... Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
 
Using WordPress as a Backend for Your React Project
Using WordPress as a Backend for Your React ProjectUsing WordPress as a Backend for Your React Project
Using WordPress as a Backend for Your React Project
 
Blazor - C# for the web
Blazor - C# for the webBlazor - C# for the web
Blazor - C# for the web
 
Building Responsible Wordpress Sites
Building Responsible Wordpress SitesBuilding Responsible Wordpress Sites
Building Responsible Wordpress Sites
 
When Javascript isn't Javascript
When Javascript isn't Javascript When Javascript isn't Javascript
When Javascript isn't Javascript
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
How to build a static website in two and a half days with Nuxt and Tailwind CSS
How to build a static website in two and a half days with Nuxt and Tailwind CSSHow to build a static website in two and a half days with Nuxt and Tailwind CSS
How to build a static website in two and a half days with Nuxt and Tailwind CSS
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPress
 
You Don't Know WebGL at GREE Tech Talk #08
You Don't Know WebGL at GREE Tech Talk #08You Don't Know WebGL at GREE Tech Talk #08
You Don't Know WebGL at GREE Tech Talk #08
 
Intro javascript build a scraper (3:22)
Intro javascript   build a scraper (3:22)Intro javascript   build a scraper (3:22)
Intro javascript build a scraper (3:22)
 
Web workers and service workers
Web workers and service workersWeb workers and service workers
Web workers and service workers
 
Week7 assignment c
Week7 assignment cWeek7 assignment c
Week7 assignment c
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
Critical rendering path presentation
Critical rendering path presentationCritical rendering path presentation
Critical rendering path presentation
 
Pagelet in action
Pagelet in actionPagelet in action
Pagelet in action
 
HTML5shim
HTML5shimHTML5shim
HTML5shim
 

Similar to Beyond the Standards

Web Design Workshop
Web Design WorkshopWeb Design Workshop
Web Design Workshop
SuseZ
 

Similar to Beyond the Standards (20)

New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Years
 
Rapid Prototyping With J Query
Rapid Prototyping With J QueryRapid Prototyping With J Query
Rapid Prototyping With J Query
 
Web Design Workshop
Web Design WorkshopWeb Design Workshop
Web Design Workshop
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
Html5
Html5Html5
Html5
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
frontend-161011205424.pptx
frontend-161011205424.pptxfrontend-161011205424.pptx
frontend-161011205424.pptx
 
Accessible Javascript with and without WAI ARIA
Accessible Javascript with and without WAI ARIAAccessible Javascript with and without WAI ARIA
Accessible Javascript with and without WAI ARIA
 
frontend-161011205424 (1).pdf
frontend-161011205424 (1).pdffrontend-161011205424 (1).pdf
frontend-161011205424 (1).pdf
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Drupal 6 JavaScript and jQuery
Drupal 6 JavaScript and jQueryDrupal 6 JavaScript and jQuery
Drupal 6 JavaScript and jQuery
 
Html5
Html5Html5
Html5
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynote
 
Progressive Enhancement with JavaScript and Ajax
Progressive Enhancement with JavaScript and AjaxProgressive Enhancement with JavaScript and Ajax
Progressive Enhancement with JavaScript and Ajax
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UI
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
Reef: AJAX the way it should be 
Reef: AJAX the way it should be Reef: AJAX the way it should be 
Reef: AJAX the way it should be 
 

More from Paul Bakaus

More from Paul Bakaus (6)

Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
Rapid Prototyping mit jQuery (German)
Rapid Prototyping mit jQuery (German)Rapid Prototyping mit jQuery (German)
Rapid Prototyping mit jQuery (German)
 
Rapid Prototyping With jQuery
Rapid Prototyping With jQueryRapid Prototyping With jQuery
Rapid Prototyping With jQuery
 
An in-depth look at jQuery
An in-depth look at jQueryAn in-depth look at jQuery
An in-depth look at jQuery
 
Ignore the DOM (German)
Ignore the DOM (German)Ignore the DOM (German)
Ignore the DOM (German)
 
Ignore the DOM
Ignore the DOMIgnore the DOM
Ignore the DOM
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 

Beyond the Standards

  • 1. Beyond the standards Advanced Animation and Physics in JavaScript
  • 2. Beyond the standards Advanced Animation and Physics in JavaScript
  • 3. Beyond the standards Pushing the web beyond its limits
  • 4. Web Standards + Great theory + The way it should be - Minor progress for 10 years - Very difficult to push across parties
  • 5. Okay then, let‘s wait until something changes.
  • 7. Walk. How to create a walking character
  • 8. 1. The Basics • Center or not? • Click angles - How many possible directions? • Preparing the images
  • 9. 2. The animation(s) • Animate the character by changing the image • Move the character
  • 10. 3. Tweak • Walk in constant speed • Easing • Multiple clicks handling
  • 11. Scroll. How to create a scrollable, isometric world
  • 12. But that‘s not possible! • Isometry needs skewed, non- retangle elements • HTML doesn‘ t have them
  • 13. Don‘t think about limits • So you cannot use events that „bleed through“ elements? • Sure you can! • Build your own event structure in JavaScript
  • 14. Don‘t limit yourself to a given standard - you can always build your own with JavaScript.
  • 15. There‘s one fundamental thing you need to know..
  • 18. Canvas • Feels like a true HMTL element • Easy JavaScript API • Safari, Firefox, Opera • ..IE support using ExCanvas Get your hands dirty!
  • 19. CSS Transforms • Webkit-only (Safari, iPhone, Android, Air) • 2D transformations on HTML elements • Yes, all kinds of 2d transformations: Rotating, Scaling, Skewing
  • 21. ...wouldn‘t it be cool to have CSS transforms in other browsers?
  • 23. Transformie • Parses stylesheets and inline styles, tracks them using IE only onpropertychange • Creates a custom matrix for every function (rotate, scale, skew) • Multiplies all matrices • Creates the IE matrix filter on the element
  • 24. ..but what about the rest?
  • 25. CSS Transforms in other browsers • Firefox (< 3.1)/Opera has no CSS transforms • What can we do? Push the web! • Two possible methods • Rerender elements to canvas and modify them • Insert elements into SVG and use its transform features
  • 26. The Canvas approach • Find all instances of -webkit-transform • For every found element: • Create a new <canvas> element at the exact same position as the original, with the same constrains • Rotate/Modify/Translate the whole canvas by the values found in the transform functions • Literally draw borders, background and text for the original item into the canvas and for all sub items • Recompute the new constrains of the element
  • 28. The SVG approach • Find all instances of -webkit-transform • For every found element: • Serialize the whole node (outerHTML) into a string (without positioning data in the style attribute) • Wrap it around a prepared SVG XML Header • Also insert the transform value as <g transform=‘...‘> • Encode the whole string to base64 • Create a new embed element with the base64 string as data source, and render it to the page
  • 30. Pushing the standards How library developers help defining standards
  • 31.
  • 32. How a library dev smoothens the path before web standards jump in • The Copy approach • Replicate an existing standard on other platforms with the help of different technologies • Example: Excanvas • The „Lowest common multiple“ approach • Take a couple of different standards across browsers and create a subset that can be used across browsers • Example: Dojox GFX
  • 33. Using the LCM approach, we can help define new standards. ..since we are the ones that try to find a suitable subset for the end- developer
  • 36. Thank you for your attention! http://paulbakaus.com