SlideShare a Scribd company logo
FAMO.US 
New generation of HTML5 Web Application Framework
ABOUT ME 
˖ )JOB$IFOBLBꟐ⯕崡 
˖ !IJOBCMVF 
˖ '3.3
:4'3.3 
˖ +4%$
-JHIUJOH5BML 
˖ 1)1$POG
8FC$POG 
˖ */,*OD1BSUOFS 
˖ #PVOUZ)VOUFS$50
WHAT IS FAMO.US? 
Is it famous? In Taiwan, NO.
ABOUT 2 YEARS AGO 
HTML5DevConf 2012 
http://www.slideshare.net/befamous/html5-devconf-oct-2012-tech-talk
Steve Newcomb - CEO Co-funder, Famo.us.
WHAT IS FAMO.US? 
• A framework for web application 
• New way to handle the HTML Elements 
• Simplify the DOM render in the browser 
• Solve the performance of DOM/CSS and JavaScript 
• Solve the difference in browsers 
• Easy to develop the web app
DEMO PLEASE 
http://famous-bird.herokuapp.com/
OLD “RENDER” 
WebCore in Webkit
parsing DOM tree 
construction 
Render Tree 
construction 
Layout of 
Render Tree 
RENDER ENGINE IN WEBKIT 
Simplified render 
Render Tree 
painting
NEW “RENDER” 
Famo.us Render Tree
Physics 
Engine 
Render 
Engine 
Rules 
Framework 
THE FAMO.US WAY 
famo.us render engine
parsing DOM tree 
construction 
Render Tree 
construction 
Layout of 
Render Tree 
Render Tree 
painting 
Physics 
Engine 
Render 
Engine 
Rules 
Framework 
WebCore 
Famo.us
WHY FAMO.US ? 
• New “Render Tree” ( an abstract DOM ) 
• All about JavaScript, no HTML ( Yes, If you do not like to write HTML ) 
• Modifiers control everything 
• Very GOOD performance 
• A little bad semantic structure of DOM 
• Make sure the render result are all the same in the browsers
「Easy to learn, easy to build, easy to maintain!」 
– Jeff Pope, Sencha.
HOW ABOUT FAMO.US 
• Easy to learn 
• Easy to build 
• Easy to maintain
CHALLENGE 
div class=container 
div class=animate cube style=width: 100px; 
height: 100px; background-color: #3366ff; 
span class=textJSDC/span 
/div 
/div 
.cube { 
animation-duration: 3s; 
animation-iteration-count: infinite; 
animation-name: rotate; 
} 
@keyframes rotate { 
from { 
transform: rotate(0deg); 
} 
to { 
transform: rotate(180deg); 
} 
} 
JSDC 
JSDC
IN FAMO.US 
var initialTime = Date.now(); 
/** 
* ( 180 * Math.PI / 180 ) / 3 
*/ 
var Modifier = new Modifier({ 
transform: function() { 
return Transform.rotate(0, Math.PI / 3 * 
(Date.now() - initialTime) % 3, 0); 
} 
}); 
var Surface = new Surface({ 
classes: [‘cube’], 
content: ‘JSDC’ 
}); 
JSDC 
JSDC
CHALLENGE 
div class=container 
div class=animate cube1 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(60deg); 
div class=animate cube2 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(120deg); 
div class=animate cube3 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(240deg); 
span class=textJSDC/span 
/div 
/div 
/div 
/div 
I’m JSDC 
a 
cube. 
$(‘.cube1’).on(‘click’, function(event) { 
$(this).css(‘transform’, ‘rotateZ(180deg)’); 
}); 
$(‘.cube3’).on(‘click’, function(event) { 
$(this).css(‘transform’, ‘rotateZ(120deg)’); 
}); 
cube. 
JSDC 
I’m a
IN FAMO.US 
var Modifier1 = new Modifier({ 
transform: Transform.rotate(0, Math.PI / 3, 0) 
}); 
var Surface1 = new Surface({ 
classes: [‘cube’], 
content: ‘JSDC’ 
}); 
Surface1.on(‘click’, function() { 
Modifier1.transformFrom(Transform.rotate(0, 
Math.PI, 0)); 
}); 
I’m JSDC 
a 
cube. 
cube. 
JSDC 
I’m a
CHALLENGE 
div class=container 
div class=animate cube1 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(60deg); 
span class=textJSDC/span 
/div 
div class=animate cube2 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(120deg); 
span class=textJSDC/span 
/div 
/div 
var $elem = $(‘.cube1’); 
$({deg: 0}).animate({deg: 120}, { 
duration: 2000, 
step: function(now) { 
$elem.css(‘transform’, ‘rotateZ(‘ + now + ‘deg)’); 
} 
}, function(event) { 
$(‘.cube2’).css(‘transform’, ‘rotateZ(180deg)’); 
}); 
JSDC 
JSDC 
JSDC 
JSDC
IN FAMO.US 
JSDC 
JSDC 
JSDC 
JSDC 
var Transitionable = new Transitionable([0, Math.PI / 
3, 0]); 
var Modifier1 = new Modifier({ 
transform: Transitionable 
}); 
var Surface1 = new Surface({ 
classes: [‘cube’], 
content: ‘JSDC’ 
}); 
Transitionable.set( 
Transform.multiply(Transitionable.getFinal(), 
Transform.rotate(0, Math.PI * 2 / 3, 0)), 
2000, 
function() { 
/* Rotate the Cube 2 */ 
} 
);
All JavaScript, 
NO HTML. 
(If you want)
RENDER TREE
http://en.wikipedia.org/wiki/File:Person-tree.jpg#mediaviewer/File:Person-tree.jpg
IN HTML WAY 
div class=container 
div class=animate cube style=width: 100px; height: 100px; background-color: #3366ff; transform: 
rotateZ(60deg); 
span class=textJSDC/span 
/div 
/div 
JSDC 
All in DOM
IN FAMO.US WAY 
JavaScript 
var mainContext = Engine.createContext(); 
var mod = new Modifier({ 
size: [100, 100], 
transform: Transform.rotateZ(60 * Math.PI / 180) /* radians = degrees * (pi/180) */ 
}); 
var surf = new Surface({ 
classes: ['animate', 'cube'], 
content: 'span class=textJSDC/span', 
properties: { 
backgroundColor: ‘#3366ff' 
} 
}); 
var view = new View(); 
view.add(mod).add(surf); 
mainContext.add(view);
IN FAMO.US WAY 
All in DOM 
body 
/body
IN FAMO.US WAY 
div class=famous-container 
div class=famous-surface animate cube style=width: 100px; height: 100px; -webkit-transform-origin: 0% 
0%; -webkit-transform: matrix3d(0.5, 0.866025403784439, 0, 0, -0.866025403784439, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 
0, 1); background-color: #3366ff;” 
span class=textJSDC/span 
/div 
/div 
JSDC 
After render
All JavaScript, 
NO HTML. 
(If you want)
DEMO PLEASE 
http://codepen.io/hinablue/pen/itpuf
RENDER TREE STRUCTURE 
Context 
Surface 
Context 
Modifier 
Surface 
Context 
Modifier 
ScrollView 
Surface 1 Surface 2
RENDER TREE PERFORMANCE 
• Keep DOM structure simple and clean 
• Less Reflows and Repaints in browser 
• Use EventsHandler to handle all the events 
• Calculate with JavaScript, paint and animate with CSS3 
• Math Library 
• Provide a Physics Engine to do more simulate feature
RENDER TREE IN DOM 
Container 
Group 
Surfaces 
Context 
Modifier 
BODY
REFLOWS  REPAINTS 
• Very fast Reflows and Repaints 
• No Repaints, if not necessary
RENDER TREE IN ACTION 
Scroller 
Reflows 
Repaints
HOW TO FAMO.US?
COOL TOOLS 
• Famous/Browserify-Seed 
• Famous/generator-famous 
• Famous-Webpack-Seed
DEMO PLEASE
MODIFIER IS KING!
MODIFIERS 
• Modifier can modify EVERYTHING 
• Modifier can modify modifiers with Modifier Chain 
• Modifier can modify modifiers and modify his own children of modifier with 
Modifier Chain 
• Modifier and ModifierChain are little different between Famo.us and famo.us- 
Angular
MODIFIER IS ATTRIBUTE 
Container 
Group 
Modifier 
style=“transform: 
matrix(…);”
MODIFIER IS WAT !?
MODIFIER’S WAT! 
• Modifier MUST have a context, like Surface or etc 
• Modifier can NOT allocate 
• Modifier can only use the Transitionable or the object in roles 
• Modifier and StateModifier is MORE different from Famo.us ~0.2.x 
• Modifier in the render tree is an RenderNode just the same with others but 
“isModifier” property is “true” 
• RenderNode usually can get the Modifier, if use “.get()” method
DEMO PLEASE 
http://jsfiddle.net/arayi/gjdgbrfr/
EVENT HANDLER 
• Defined your own events 
• Use pipe/subscribe to transmit the events 
• Not depend on DOM 
• Multiple events
EVENT IN RENDER TREE 
EventsHandler 
Subscribe Pipe 
EventsHandler
DEMO PLEASE 
http://codepen.io/hinablue/pen/itpuf
VIEW AND WIDGET 
• Modifier + Surface 
• Modifier + View 
• Modifier + Widget 
• Modifier + ElementAllocator 
• View + View 
• View + Widget
CREATE YOUR OWN VIEW 
Container 
Group 
Modifier 
Surfaces
DEMO PLEASE 
http://famous.hinablue.me/SlideShow/
LIBRARY 
• Math 
• Transform 
• Transition 
• Physics Engine 
• Device Input 
• Element Allocator
DEMO PLEASE 
http://periodic.famo.us/?source=NL_062314
WAT, WAIT, AGAIN !?
INTERGRATIONS
FAMOUS-* 
• Famous-Angular 
• Famous-React
FAMOUS-ANGULAR 
• Not very good documentation (Actually, you can find more in source code) 
• You must follow the Famo.us render tree rules. 
• `fa-` directive is not really compatible with others. 
• `fa-` Events and `ng-` Events can use together, but not recommend. 
• Customize directive in Famo.us is too hard to use if you are Angular beginner.
DEMO PLEASE 
http://goo.gl/5fMRKc
FAMOUS-REACT 
• Not stable for now
DEMO PLEASE 
http://famous.github.io/famous-react/
MORE INTEGRATION DEMOS 
• MeteorJS + famo.us 
• Famono 
• famous-views for Meteor 
• Pete Hunt, famous-react 
• Firebase with Famo.us 
• Backbone, source code from famous demo 
• [Video] famo.us + D3.js 
• [Video] Leap Motion
FUTURE
中⽂文社群 FAMOUS.TW 
https://www.facebook.com/groups/famous.tw
THANK YOU
LINKS 
• Web App Performance, a story of becoming famo.us 
• Unlike Facebook, Famo.us thinks HTML5 rocks. Here is why. 
• Famo.us Cracks The Secret Of High-Performance Apps By Tapping Another Dimension 
• Famo.us Reveals More Details About Its HTML5 Turbo-Charger 
• Famo.us describes how it created a magical user interface for the web
LINKS 
• Viewing Chrome's Paint Cycle 
• Minimizing browser reflow 
• Rendering: repaint, reflow/relayout, restyle 
• REFLOWS  REPAINTS: CSS PERFORMANCE MAKING YOUR JAVASCRIPT SLOW? 
• Improve Rendering Performance with Chrome Dev Tools 
• Scrolling Performance
LINKS 
• http://codepen.io/befamous/ 
• https://hackpad.com/Famo.us-links-kPsHMaDFboE 
• https://github.com/famous 
• http://famous-bird.herokuapp.com/ 
• http://www.famospace.com 
• http://codepen.io/hinablue/pen/itpuf 
• https://famo.us/blog/modifiers-affect-subtrees/ 
• http://periodic.famo.us/ 
• http://demo.famo.us/lightbox/ 
• http://demo.famo.us/paper/ 
• http://famous.hinablue.me/SlideShow/
LINKS 
• https://github.com/zackbrown/flickrous 
• http://thomasstreet.com/famous-angular-google/ 
• https://github.com/continuata/fa_tutorial1/ 
• https://github.com/hinablue/famous.tw 
• https://github.com/hinablue/famous.tw/issues 
• https://www.facebook.com/groups/famous.tw

More Related Content

PDF
以Vue開發電子商務網站
架構與眉角
PDF
第一次用 Vue.js 就愛上 [改]
PDF
Vue js 大型專案架構
PDF
VueJS Introduction
ODP
An Introduction to Vuejs
PDF
Vue 淺談前端建置工具
PDF
An introduction to Vue.js
PDF
Vue.js
以Vue開發電子商務網站
架構與眉角
第一次用 Vue.js 就愛上 [改]
Vue js 大型專案架構
VueJS Introduction
An Introduction to Vuejs
Vue 淺談前端建置工具
An introduction to Vue.js
Vue.js

What's hot (20)

PDF
Vue JS Intro
PPTX
How to Build SPA with Vue Router 2.0
PDF
Javascript MVVM with Vue.JS
PDF
Vuejs for Angular developers
PDF
PDF
Vue.js for beginners
PDF
The Point of Vue - Intro to Vue.js
PDF
Vue js and Vue Material
PPTX
Vue business first
PDF
Scalable Front-end Development with Vue.JS
PPTX
Vue Introduction
PDF
Love at first Vue
PDF
Why Vue.js?
PPTX
Vue 2.0 + Vuex Router & Vuex at Vue.js
PPT
Vue.js Getting Started
PDF
Enjoy the vue.js
PDF
Vue.js is boring - and that's a good thing
PDF
Building a Single Page Application with VueJS
PDF
Room with a Vue - Introduction to Vue.js
PDF
VueJS: The Simple Revolution
Vue JS Intro
How to Build SPA with Vue Router 2.0
Javascript MVVM with Vue.JS
Vuejs for Angular developers
Vue.js for beginners
The Point of Vue - Intro to Vue.js
Vue js and Vue Material
Vue business first
Scalable Front-end Development with Vue.JS
Vue Introduction
Love at first Vue
Why Vue.js?
Vue 2.0 + Vuex Router & Vuex at Vue.js
Vue.js Getting Started
Enjoy the vue.js
Vue.js is boring - and that's a good thing
Building a Single Page Application with VueJS
Room with a Vue - Introduction to Vue.js
VueJS: The Simple Revolution
Ad

Similar to Famo.us - New generation of HTML5 Web Application Framework (20)

PDF
Famo.us introduction
PDF
Famous-il kick-off presentation
PDF
Famo.us: From Zero to UI
PDF
Famo.us - HTML5 Dev Conference Tech Talk
PPTX
Famo.us : A new kind of web UI for the future
PDF
HTML5 DevConf Oct 2012 Tech Talk
PDF
Reveal.js
PPTX
The truth behind virtual dom
KEY
HTML5, CSS3, and other fancy buzzwords
PPTX
Class[3][5th jun] [three js]
PDF
Intro to HTML5
PDF
The Mobile Web - HTML5 on mobile devices
PDF
bawawjspdx082117
PPTX
CSS Transitions, Transforms, Animations
PPTX
Browsers. Magic is inside.
KEY
Getting started with CSS frameworks using Zurb foundation
PDF
Build an App with JavaScript & jQuery
PDF
Building a game engine with jQuery
PPTX
Html5 more than just html5 v final
PPTX
The truth behind virtual dom
Famo.us introduction
Famous-il kick-off presentation
Famo.us: From Zero to UI
Famo.us - HTML5 Dev Conference Tech Talk
Famo.us : A new kind of web UI for the future
HTML5 DevConf Oct 2012 Tech Talk
Reveal.js
The truth behind virtual dom
HTML5, CSS3, and other fancy buzzwords
Class[3][5th jun] [three js]
Intro to HTML5
The Mobile Web - HTML5 on mobile devices
bawawjspdx082117
CSS Transitions, Transforms, Animations
Browsers. Magic is inside.
Getting started with CSS frameworks using Zurb foundation
Build an App with JavaScript & jQuery
Building a game engine with jQuery
Html5 more than just html5 v final
The truth behind virtual dom
Ad

More from Hina Chen (7)

PDF
生在幸福的 JS 年代
PDF
Webconf 2013 - Media Query 123
PDF
JSDC.tw lighting talk
PDF
3sss book
PDF
Min book
PDF
Layout presentation
PDF
960 grid system simple howto
生在幸福的 JS 年代
Webconf 2013 - Media Query 123
JSDC.tw lighting talk
3sss book
Min book
Layout presentation
960 grid system simple howto

Recently uploaded (20)

PDF
Introduction to the IoT system, how the IoT system works
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Digital Literacy And Online Safety on internet
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
innovation process that make everything different.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
Sims 4 Historia para lo sims 4 para jugar
DOCX
Unit-3 cyber security network security of internet system
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Introduction to Information and Communication Technology
Introduction to the IoT system, how the IoT system works
presentation_pfe-universite-molay-seltan.pptx
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
Design_with_Watersergyerge45hrbgre4top (1).ppt
Cloud-Scale Log Monitoring _ Datadog.pdf
international classification of diseases ICD-10 review PPT.pptx
Decoding a Decade: 10 Years of Applied CTI Discipline
introduction about ICD -10 & ICD-11 ppt.pptx
Digital Literacy And Online Safety on internet
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
innovation process that make everything different.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Sims 4 Historia para lo sims 4 para jugar
Unit-3 cyber security network security of internet system
Introuction about ICD -10 and ICD-11 PPT.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Introduction to Information and Communication Technology

Famo.us - New generation of HTML5 Web Application Framework

  • 1. FAMO.US New generation of HTML5 Web Application Framework
  • 2. ABOUT ME ˖ )JOB$IFOBLBꟐ⯕崡 ˖ !IJOBCMVF ˖ '3.3 :4'3.3 ˖ +4%$ -JHIUJOH5BML ˖ 1)1$POG 8FC$POG ˖ */,*OD1BSUOFS ˖ #PVOUZ)VOUFS$50
  • 3. WHAT IS FAMO.US? Is it famous? In Taiwan, NO.
  • 4. ABOUT 2 YEARS AGO HTML5DevConf 2012 http://www.slideshare.net/befamous/html5-devconf-oct-2012-tech-talk
  • 5. Steve Newcomb - CEO Co-funder, Famo.us.
  • 6. WHAT IS FAMO.US? • A framework for web application • New way to handle the HTML Elements • Simplify the DOM render in the browser • Solve the performance of DOM/CSS and JavaScript • Solve the difference in browsers • Easy to develop the web app
  • 9. parsing DOM tree construction Render Tree construction Layout of Render Tree RENDER ENGINE IN WEBKIT Simplified render Render Tree painting
  • 11. Physics Engine Render Engine Rules Framework THE FAMO.US WAY famo.us render engine
  • 12. parsing DOM tree construction Render Tree construction Layout of Render Tree Render Tree painting Physics Engine Render Engine Rules Framework WebCore Famo.us
  • 13. WHY FAMO.US ? • New “Render Tree” ( an abstract DOM ) • All about JavaScript, no HTML ( Yes, If you do not like to write HTML ) • Modifiers control everything • Very GOOD performance • A little bad semantic structure of DOM • Make sure the render result are all the same in the browsers
  • 14. 「Easy to learn, easy to build, easy to maintain!」 – Jeff Pope, Sencha.
  • 15. HOW ABOUT FAMO.US • Easy to learn • Easy to build • Easy to maintain
  • 16. CHALLENGE div class=container div class=animate cube style=width: 100px; height: 100px; background-color: #3366ff; span class=textJSDC/span /div /div .cube { animation-duration: 3s; animation-iteration-count: infinite; animation-name: rotate; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(180deg); } } JSDC JSDC
  • 17. IN FAMO.US var initialTime = Date.now(); /** * ( 180 * Math.PI / 180 ) / 3 */ var Modifier = new Modifier({ transform: function() { return Transform.rotate(0, Math.PI / 3 * (Date.now() - initialTime) % 3, 0); } }); var Surface = new Surface({ classes: [‘cube’], content: ‘JSDC’ }); JSDC JSDC
  • 18. CHALLENGE div class=container div class=animate cube1 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(60deg); div class=animate cube2 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(120deg); div class=animate cube3 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(240deg); span class=textJSDC/span /div /div /div /div I’m JSDC a cube. $(‘.cube1’).on(‘click’, function(event) { $(this).css(‘transform’, ‘rotateZ(180deg)’); }); $(‘.cube3’).on(‘click’, function(event) { $(this).css(‘transform’, ‘rotateZ(120deg)’); }); cube. JSDC I’m a
  • 19. IN FAMO.US var Modifier1 = new Modifier({ transform: Transform.rotate(0, Math.PI / 3, 0) }); var Surface1 = new Surface({ classes: [‘cube’], content: ‘JSDC’ }); Surface1.on(‘click’, function() { Modifier1.transformFrom(Transform.rotate(0, Math.PI, 0)); }); I’m JSDC a cube. cube. JSDC I’m a
  • 20. CHALLENGE div class=container div class=animate cube1 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(60deg); span class=textJSDC/span /div div class=animate cube2 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(120deg); span class=textJSDC/span /div /div var $elem = $(‘.cube1’); $({deg: 0}).animate({deg: 120}, { duration: 2000, step: function(now) { $elem.css(‘transform’, ‘rotateZ(‘ + now + ‘deg)’); } }, function(event) { $(‘.cube2’).css(‘transform’, ‘rotateZ(180deg)’); }); JSDC JSDC JSDC JSDC
  • 21. IN FAMO.US JSDC JSDC JSDC JSDC var Transitionable = new Transitionable([0, Math.PI / 3, 0]); var Modifier1 = new Modifier({ transform: Transitionable }); var Surface1 = new Surface({ classes: [‘cube’], content: ‘JSDC’ }); Transitionable.set( Transform.multiply(Transitionable.getFinal(), Transform.rotate(0, Math.PI * 2 / 3, 0)), 2000, function() { /* Rotate the Cube 2 */ } );
  • 22. All JavaScript, NO HTML. (If you want)
  • 25. IN HTML WAY div class=container div class=animate cube style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(60deg); span class=textJSDC/span /div /div JSDC All in DOM
  • 26. IN FAMO.US WAY JavaScript var mainContext = Engine.createContext(); var mod = new Modifier({ size: [100, 100], transform: Transform.rotateZ(60 * Math.PI / 180) /* radians = degrees * (pi/180) */ }); var surf = new Surface({ classes: ['animate', 'cube'], content: 'span class=textJSDC/span', properties: { backgroundColor: ‘#3366ff' } }); var view = new View(); view.add(mod).add(surf); mainContext.add(view);
  • 27. IN FAMO.US WAY All in DOM body /body
  • 28. IN FAMO.US WAY div class=famous-container div class=famous-surface animate cube style=width: 100px; height: 100px; -webkit-transform-origin: 0% 0%; -webkit-transform: matrix3d(0.5, 0.866025403784439, 0, 0, -0.866025403784439, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); background-color: #3366ff;” span class=textJSDC/span /div /div JSDC After render
  • 29. All JavaScript, NO HTML. (If you want)
  • 31. RENDER TREE STRUCTURE Context Surface Context Modifier Surface Context Modifier ScrollView Surface 1 Surface 2
  • 32. RENDER TREE PERFORMANCE • Keep DOM structure simple and clean • Less Reflows and Repaints in browser • Use EventsHandler to handle all the events • Calculate with JavaScript, paint and animate with CSS3 • Math Library • Provide a Physics Engine to do more simulate feature
  • 33. RENDER TREE IN DOM Container Group Surfaces Context Modifier BODY
  • 34. REFLOWS REPAINTS • Very fast Reflows and Repaints • No Repaints, if not necessary
  • 35. RENDER TREE IN ACTION Scroller Reflows Repaints
  • 37. COOL TOOLS • Famous/Browserify-Seed • Famous/generator-famous • Famous-Webpack-Seed
  • 40. MODIFIERS • Modifier can modify EVERYTHING • Modifier can modify modifiers with Modifier Chain • Modifier can modify modifiers and modify his own children of modifier with Modifier Chain • Modifier and ModifierChain are little different between Famo.us and famo.us- Angular
  • 41. MODIFIER IS ATTRIBUTE Container Group Modifier style=“transform: matrix(…);”
  • 43. MODIFIER’S WAT! • Modifier MUST have a context, like Surface or etc • Modifier can NOT allocate • Modifier can only use the Transitionable or the object in roles • Modifier and StateModifier is MORE different from Famo.us ~0.2.x • Modifier in the render tree is an RenderNode just the same with others but “isModifier” property is “true” • RenderNode usually can get the Modifier, if use “.get()” method
  • 45. EVENT HANDLER • Defined your own events • Use pipe/subscribe to transmit the events • Not depend on DOM • Multiple events
  • 46. EVENT IN RENDER TREE EventsHandler Subscribe Pipe EventsHandler
  • 48. VIEW AND WIDGET • Modifier + Surface • Modifier + View • Modifier + Widget • Modifier + ElementAllocator • View + View • View + Widget
  • 49. CREATE YOUR OWN VIEW Container Group Modifier Surfaces
  • 51. LIBRARY • Math • Transform • Transition • Physics Engine • Device Input • Element Allocator
  • 55. FAMOUS-* • Famous-Angular • Famous-React
  • 56. FAMOUS-ANGULAR • Not very good documentation (Actually, you can find more in source code) • You must follow the Famo.us render tree rules. • `fa-` directive is not really compatible with others. • `fa-` Events and `ng-` Events can use together, but not recommend. • Customize directive in Famo.us is too hard to use if you are Angular beginner.
  • 58. FAMOUS-REACT • Not stable for now
  • 60. MORE INTEGRATION DEMOS • MeteorJS + famo.us • Famono • famous-views for Meteor • Pete Hunt, famous-react • Firebase with Famo.us • Backbone, source code from famous demo • [Video] famo.us + D3.js • [Video] Leap Motion
  • 64. LINKS • Web App Performance, a story of becoming famo.us • Unlike Facebook, Famo.us thinks HTML5 rocks. Here is why. • Famo.us Cracks The Secret Of High-Performance Apps By Tapping Another Dimension • Famo.us Reveals More Details About Its HTML5 Turbo-Charger • Famo.us describes how it created a magical user interface for the web
  • 65. LINKS • Viewing Chrome's Paint Cycle • Minimizing browser reflow • Rendering: repaint, reflow/relayout, restyle • REFLOWS REPAINTS: CSS PERFORMANCE MAKING YOUR JAVASCRIPT SLOW? • Improve Rendering Performance with Chrome Dev Tools • Scrolling Performance
  • 66. LINKS • http://codepen.io/befamous/ • https://hackpad.com/Famo.us-links-kPsHMaDFboE • https://github.com/famous • http://famous-bird.herokuapp.com/ • http://www.famospace.com • http://codepen.io/hinablue/pen/itpuf • https://famo.us/blog/modifiers-affect-subtrees/ • http://periodic.famo.us/ • http://demo.famo.us/lightbox/ • http://demo.famo.us/paper/ • http://famous.hinablue.me/SlideShow/
  • 67. LINKS • https://github.com/zackbrown/flickrous • http://thomasstreet.com/famous-angular-google/ • https://github.com/continuata/fa_tutorial1/ • https://github.com/hinablue/famous.tw • https://github.com/hinablue/famous.tw/issues • https://www.facebook.com/groups/famous.tw