How to flip in famo.us? - famo.us

How I can do this to my Container Surface with famo.us? My container surface looks like this:
var input1Fix=new ContainerSurface({
size:[241,40],
properties:{
backgroundColor:'black',
overflow:'hidden'
}
});
input1FixModifier= new Modifier({
origin:[1, 0.5],
align:[1, 0.5]
});
var mailContainer= new ContainerSurface({
size:[40,40],
properties:{
backgroundColor:'#483f3e',
overflow:'hidden'
}
});
var mailContainerModifier= new Modifier({
origin:[0, 0.5],
align:[0, 0.5]
});
var mail= new ImageSurface({
size:[20, 20],
content:'img/mail.png',
overflow:'hidden'
});
var mailModifier= new Modifier({
origin:[0.5, 0,5],
align:[0.5, 0,5],
transform: Transform.translate(0, 10)
});
var input1= new InputSurface({
size:[200,40],
placeholder:' E-mail:',
properties:{
backgroundColor:'#483f3e',
border:'#483f3e',
color:'#9d9492',
overflow:'hidden'
}
});
var input1Modifier=new Modifier({
origin:[0.5,0.5],
align:[0.5,0.5]
});
So, I want when I click on surface that it rotates and changes color. What's the best way to do that?
I'm beginner with famo.us and javascript so, any help is good help. thanks for understanding ;)

You can use the Flipper View and set the back and front using surfaces or views.
To get it to flip horizontally, set the option direction: Flipper.DIRECTION_Y as in the snippet below.
define('main',function(require, exports, module) {
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Flipper = require("famous/views/Flipper");
var Modifier = require("famous/core/Modifier");
var mainContext = Engine.createContext();
mainContext.setPerspective(500);
var flipper = new Flipper({
direction: Flipper.DIRECTION_Y
});
var frontSurface = new Surface({
size : [200, 200],
content : 'front',
properties : {
background : 'red',
lineHeight : '200px',
textAlign : 'center'
}
});
var backSurface = new Surface({
size : [200, 200],
content : 'back',
properties : {
background : 'blue',
color : 'white',
lineHeight : '200px',
textAlign : 'center'
}
});
flipper.setFront(frontSurface);
flipper.setBack(backSurface);
var centerModifier = new Modifier({
align : [.5,.5],
origin : [.5,.5]
});
mainContext.add(centerModifier).add(flipper);
var toggle = false;
Engine.on('click', function(){
var angle = toggle ? 0 : Math.PI;
flipper.setAngle(angle, {curve : 'easeOutBounce', duration : 500});
toggle = !toggle;
});
});
require(['main']);
.double-sided {
-webkit-backface-visibility: visible;
backface-visibility: visible;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://requirejs.org/docs/release/2.1.16/minified/require.js"></script>
<script src="http://code.famo.us/lib/requestAnimationFrame.js"></script>
<script src="http://code.famo.us/lib/classList.js"></script>
<script src="http://code.famo.us/lib/functionPrototypeBind.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.famo.us/famous/0.3.5/famous.css" />
<script src="http://code.famo.us/famous/0.3.5/famous.min.js"></script>

Related

Google Diff Bar Chart - Change Bar Color

I have a Google Diff Bar chart. I am trying to change the color of the exterior bar. By default it is a faded color. I am able to change the inner bar color with color parameter under options. Can someone guide me out please? Here is my code below.
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", '1.1', {packages:['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var oldData = google.visualization.arrayToDataTable([
['Name', 'Popularity'],
['Cesar', 250],
['Rachel', 4200],
['Patrick', 2900],
['Eric', 8200]
]);
var newData = google.visualization.arrayToDataTable([
['Name', 'Popularity'],
['Cesar', 370],
['Rachel', 600],
['Patrick', 700],
['Eric', 3500]
]);
var colChartDiff = new google.visualization.ColumnChart(document.getElementById('colchart_diff'));
var options = {
diff: { newData: { widthFactor: 0.6 } },
legend: { position: 'top' } ,
colors: ['#f38eff', '#C0C0C0'],
backgroundColor: '#fffff5',
hAxis: {title: 'People'},
vAxis: {title: 'Numbers'}};
var diffData = colChartDiff.computeDiff(oldData, newData);
colChartDiff.draw(diffData, options);
}
</script>
You can set that in the diff object, e.g.,
var options = { ...
diff: {
oldData: { opacity: 1, color: '#e6693e' },
newData: { opacity: 1}
}...
}

Famo.us: Scrollview with draggable items: having problems with background surfaces and setPosition transitions

I'm very new to famo.us. I'm trying to extend this previous question about swiping items in a scrollview.
I want my version to have background surfaces behind the draggable which are revealed as the user swipes. I also want the draggable to snap back if the user does not complete a full swipe.
The two problems with it right now are:
1) The surfaces which I want to be behind the draggable are not behind the draggable. They should be hidden by it until the user swipes (I've made them transparent so the draggable can be seen).
2) the setPosition w/ transition causes an error: Uncaught TypeError: Cannot read property 'SUPPORTS_MULTIPLE' of undefined. If I don't provide the transition it works, but a transition would be preferred.
I should note also that I don't know if using a ContainerSurface is a good way of doing this so that could be part of the problem.
Code:
using: http://code.famo.us/famous/0.2/famous.js
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Scrollview = require("famous/views/Scrollview");
var RenderNode = require('famous/core/RenderNode');
var Transform = require('famous/core/Transform');
var Draggable = require('famous/modifiers/Draggable');
var ContainerSurface = require("famous/surfaces/ContainerSurface");
var StateModifier = require('famous/modifiers/StateModifier');
var mainContext = Engine.createContext();
var scrollview = new Scrollview();
var surfaces = [];
scrollview.sequenceFrom(surfaces);
var inFrontModifier = new StateModifier({
transform: Transform.translate(0, 0, 1)
});
for (var i = 0; i < 15; i++) {
var container = new ContainerSurface({
size: [undefined, 50],
properties: {
overflow: 'hidden'
}
});
var draggable = new Draggable( {
xRange: [-160, 160],
yRange: [0, 0]
});
draggable.dragId = i;
draggable.on('end', function(e) {
if (e.position[0] == 160) {
console.log('yes surface', this.dragId);
}
else if (e.position[0] == -160) {
console.log('no surface', this.dragId);
}
else {
this.setPosition([0,0,0], {
method: 'snap',
period: 300
});
}
});
var item = new Surface({
content: "Item: " + (i + 1),
size: [undefined, 50],
properties: {
backgroundColor: "lightgrey",
borderBottom: "1px solid grey",
lineHeight: "50px",
textAlign: "center"
}
});
var backgroundYesModifier = new StateModifier({
//on the left
origin: [0,0]
});
var backgroundYes = new Surface({
content: "Yes",
size: [160, 50],
properties: {
backgroundColor: "rgba(0,255,0,0.2)",
lineHeight: "50px",
textAlign: "center"
}
});
var backgroundNoModifier = new StateModifier({
//on the right
origin: [1,0]
});
var backgroundNo = new Surface({
content: "No",
size: [160, 50],
properties: {
backgroundColor: "rgba(255,0,0,0.2)",
lineHeight: "50px",
textAlign: "center"
}
});
var node = new RenderNode(draggable);
node.add(item);
//try to put the draggable in front of the background
container.add(inFrontModifier).add(node);
//add the background
container.add(backgroundNoModifier).add(backgroundNo);
container.add(backgroundYesModifier).add(backgroundYes);
item.pipe(draggable);
item.pipe(scrollview);
surfaces.push(container);
}
mainContext.add(scrollview);
The "on top of" can be solved simply by adding a zIndex=4 (4 is an arbitrary choice above your other zIndexes.)
I added the transition by using a slightly different form of the transition.
And while it is known that you don't want to create very many ContainerSurfaces in famo.us, I don't know what "too many" is and I don't know how to get the "hidden" to work otherwise.
Here is my version which I think does what you want:
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Scrollview = require("famous/views/Scrollview");
var RenderNode = require('famous/core/RenderNode');
var Transform = require('famous/core/Transform');
var Draggable = require('famous/modifiers/Draggable');
var ContainerSurface = require("famous/surfaces/ContainerSurface");
var StateModifier = require('famous/modifiers/StateModifier');
var Easing = require('famous/transitions/Easing');
var mainContext = Engine.createContext();
var scrollview = new Scrollview();
var surfaces = [];
scrollview.sequenceFrom(surfaces);
var inFrontModifier = new StateModifier({
transform: Transform.translate(0, 0, 1)
});
for (var i = 0; i < 15; i++) {
var container = new ContainerSurface({
size: [undefined, 50],
properties: {
overflow: 'hidden'
}
});
var draggable = new Draggable( {
xRange: [-160, 160],
yRange: [0, 0]
});
draggable.dragId = i;
draggable.on('end', function(e) {
if (e.position[0] == 160) {
console.log('yes surface', this.dragId);
}
else if (e.position[0] == -160) {
console.log('no surface', this.dragId);
}
else {
this.setPosition([0,0,0], {
curve: Easing.outBounce,
duration: 300
});
}
});
var item = new Surface({
content: "Item: " + (i + 1),
size: [undefined, 50],
properties: {
backgroundColor: "lightgrey",
borderBottom: "1px solid grey",
lineHeight: "50px",
textAlign: "center",
zIndex:4
}
});
var backgroundYesModifier = new StateModifier({
//on the left
origin: [0,0]
});
var backgroundYes = new Surface({
content: "Yes",
size: [160, 50],
properties: {
backgroundColor: "rgba(0,255,0,0.2)",
lineHeight: "50px",
textAlign: "center"
}
});
var backgroundNoModifier = new StateModifier({
//on the right
origin: [1,0]
});
var backgroundNo = new Surface({
content: "No",
size: [160, 50],
properties: {
backgroundColor: "rgba(255,0,0,0.2)",
lineHeight: "50px",
textAlign: "center"
}
});
var node = new RenderNode(draggable);
node.add(item);
//try to put the draggable in front of the background
container.add(inFrontModifier).add(node);
//add the background
container.add(backgroundNoModifier).add(backgroundNo);
container.add(backgroundYesModifier).add(backgroundYes);
item.pipe(draggable);
item.pipe(scrollview);
surfaces.push(container);
}
mainContext.add(scrollview);

Dragging related issue famo.us

I am very new to Famo.us I am trying to code the following. There are 4 famous image surface surface,surface2,surface3,surface4. Surface1 has image content other 3 are blank. I want to setContent of the other 3 surface by dragging image at them or by dragging surface1.
There are three problems with it:
1) After first drag I am setting the content and trying to move the imagesurface(surface) back to original location, but it is not moving.
2) When I am setting the imagesurface(surface) at any other location than (0,0,0) then the behavior is changed.
3) When I am changing the imagesurface with inputsurface there is huge time lag.
Here is my code:
define(function(require, exports, module) {
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Modifier = require("famous/core/Modifier");
var StateModifier = require("famous/modifiers/StateModifier");
var Draggable = require("famous/modifiers/Draggable");
var Transform = require("famous/core/Transform");
var Transitionable = require("famous/transitions/Transitionable");
var ImageSurface = require('famous/surfaces/ImageSurface');
var Timer = require('famous/utilities/Timer');
var EventHandler = require('famous/core/EventHandler');
var InputSurface = require("famous/surfaces/InputSurface");
var SnapTransition = require("famous/transitions/SnapTransition");
Transitionable.registerMethod('snap', SnapTransition);
var mainContext = Engine.createContext();
var eventHandler = new EventHandler();
var surface = new ImageSurface({
size: [200, 200],
content: 'img/1.jpg',
properties: {
cursor: 'pointer'
}
});
var background_surface = new ImageSurface({
size: [200, 200],
content: 'img/1.jpg',
properties: {
cursor: 'pointer'
}
});
var surface2 = new ImageSurface({
size: [200, 200],
// type: 'image'
content: ''
});
var surface3 = new ImageSurface({
size: [200, 200],
content: ''
});
var surface4 = new ImageSurface({
size: [410, 200],
content: ''
});
var mod2 = new Modifier({
transform: Transform.translate(500, 0, 0)
});
mainContext.add(mod2).add(surface2);
var mod3 = new Modifier({
transform: Transform.translate(710, 0, 0)
});
mainContext.add(mod3).add(surface3);
var mod4 = new Modifier({
transform: Transform.translate(500, 210, 0)
});
mainContext.add(mod4).add(surface4);
var draggable = new Draggable({
xRange: [-1000, 1000],
yRange: [-1000, 1000]
});
surface.pipe(draggable);
var mod = new Modifier({
});
var back_mod = new Modifier({
origin: [0,0]
});
var trans = {
method: 'snap',
period: 100,
dampingRatio: 0.3,
velocity: 0
};
var check=0;
draggable.on('start', function()
{ draggable.setPosition([0,0,0], trans);
check=0;
surface._matrix[12] = 0;
console.log(surface._matrix[12]);
});
surface.on('mouseup', function() {
draggable.setPosition([0,0,0], trans);
});
draggable.on('end', function(data){
surface2.on('mouseover', function(){
if(check==0)
{ draggable.setPosition([surface2._matrix[12],surface2._matrix[13],surface2._matrix[14]], trans);
check=1;
mainContext.add(back_mod).add(background_surface);
}
});
surface3.on('mouseover', function(){
if(check==0)
{console.log("Surface3");
draggable.setPosition([surface3._matrix[12],surface3._matrix[13],surface3._matrix[14]], trans);
mainContext.add(back_mod).add(background_surface);
check=1;}
});
surface4.on('mouseover', function(){
if(check==0){
console.log("Surface4");
draggable.setPosition([surface4._matrix[12]-256,surface4._matrix[13],surface4._matrix[14]], undefined);
var scale_factor= 410/200;
mod.setTransform(
Transform.scale(scale_factor,1, 0),
{ duration :0,curve: 'linear' }
);
check=1;
mainContext.add(back_mod).add(background_surface);
}
});
});
mainContext.add(mod).add(draggable).add(surface);
});
I'm a little unsure of what you're going for but... here's a different version where the draggable always returns to 0,0 and can be used again to set content of another image surface. Can you help with more detail on what you're trying to achieve?
define(function(require, exports, module) {
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Modifier = require("famous/core/Modifier");
var StateModifier = require("famous/modifiers/StateModifier");
var Draggable = require("famous/modifiers/Draggable");
var Transform = require("famous/core/Transform");
var Transitionable = require("famous/transitions/Transitionable");
var ImageSurface = require('famous/surfaces/ImageSurface');
var Timer = require('famous/utilities/Timer');
var EventHandler = require('famous/core/EventHandler');
var InputSurface = require("famous/surfaces/InputSurface");
var SnapTransition = require("famous/transitions/SnapTransition");
Transitionable.registerMethod('snap', SnapTransition);
var mainContext = Engine.createContext();
var surface = new ImageSurface({
size: [200, 200],
content: 'images/1.jpg',
properties: {
cursor: 'pointer'
}
});
var background_surface = new ImageSurface({
size: [200, 200],
content: 'images/1.jpg',
properties: {
cursor: 'pointer'
}
});
var surface2 = new ImageSurface({
size: [200, 200],
content: ''
});
var surface3 = new ImageSurface({
size: [200, 200],
content: ''
});
var surface4 = new ImageSurface({
size: [410, 200],
content: ''
});
var mod2 = new Modifier({
transform: Transform.translate(500, 0, 0)
});
mainContext.add(mod2).add(surface2);
var mod3 = new Modifier({
transform: Transform.translate(710, 0, 0)
});
mainContext.add(mod3).add(surface3);
var mod4 = new Modifier({
transform: Transform.translate(500, 210, 0)
});
mainContext.add(mod4).add(surface4);
var draggable = new Draggable({
xRange: [-1000, 1000],
yRange: [-1000, 1000]
});
draggable.imageSurface = surface;
surface.pipe(draggable);
var mod = new Modifier({
});
var back_mod = new Modifier({
origin: [0,0]
});
var trans = {
method: 'snap',
period: 100,
dampingRatio: 0.3,
velocity: 0
};
var check=0;
draggable.on('start', function()
{
check=0;
surface._matrix[12] = 0;
console.log(surface._matrix[12]);
});
draggable.on('end', function(data){
var theDraggable = this;
surface2.on('mouseover', function(){
if(check==0)
{
console.log("Surface2");
check=1;
this.setContent(theDraggable.imageSurface._imageUrl);
}
});
surface3.on('mouseover', function(){
if(check==0)
{console.log("Surface3");
this.setContent(theDraggable.imageSurface._imageUrl);
check=1;}
});
surface4.on('mouseover', function(){
if(check==0){
console.log("Surface4");
this.setContent(theDraggable.imageSurface._imageUrl);
check=1;
}
});
this.setPosition([0,0,0], trans);
});
mainContext.add(mod).add(draggable).add(surface);
});

Can halt() stop the animation at the end state?

I want halt() my translate animation and have it instantly end up at its final location. halt() currently stops the animation where it currently is.
var Engine = require('famous/core/Engine');
var Surface = require('famous/core/Surface');
var Transform = require('famous/core/Transform');
var StateModifier = require('famous/modifiers/StateModifier');
var Easing = require('famous/transitions/Easing');
var mainContext = Engine.createContext();
var surface = new Surface({
size: [100, 100],
content: 'click me to halt',
properties: {
color: 'white',
textAlign: 'center',
backgroundColor: '#FA5C4F'
}
});
var stateModifier = new StateModifier({
origin: [0.5, 0]
});
mainContext.add(stateModifier).add(surface);
stateModifier.setTransform(
Transform.translate(0, 300, 0),
{ duration : 8000, curve: 'linear' }
);
surface.on('click', function() {
stateModifier.halt();
surface.setContent('halted');
});
Your solution does seem very hacky.. why don't you just apply the same transform without a transition..
surface.on('click', function() {
stateModifier.halt();
stateModifier.setTransform(Transform.translate(0, 300, 0));
surface.setContent('halted');
});
EDIT:
Even better you can just get the final transform directly..
surface.on('click', function() {
stateModifier.setTransform(stateModifier.getFinalTransform());
surface.setContent('halted');
});
I discovered a hack for this, at least for pre-0.2.0.
You can set the final state using Translate.set() using a very large number to force the last state of the animation.
It would be nice to see support for this somehow with halt() in future versions of Famo.us
var Engine = require('famous/core/Engine');
var Surface = require('famous/core/Surface');
var Transform = require('famous/core/Transform');
var StateModifier = require('famous/modifiers/StateModifier');
var Easing = require('famous/transitions/Easing');
var mainContext = Engine.createContext();
var surface = new Surface({
size: [100, 100],
content: 'click me to halt',
properties: {
color: 'white',
textAlign: 'center',
backgroundColor: '#FA5C4F'
}
});
var stateModifier = new StateModifier({
origin: [0.5, 0]
});
mainContext.add(stateModifier).add(surface);
stateModifier.setTransform(
Transform.translate(0, 300, 0),
{ duration : 8000, curve: 'linear' }
);
surface.on('click', function() {
// This forces the translate animation to its end state
var translate = stateModifier._transformState.translate;
translate.set(translate.get(Number.MAX_VALUE));
surface.setContent('halted');
});

Famous: Swipe items within a Scrollview

I'm looking to implement similar functionality to Mailbox (http://www.mailboxapp.com/) where you can swipe an individual item within a list in order to action it, using Famous (http://famo.us).
I tried to add the 'Draggable' modifier to each list item, however it seems that you can't add modifiers to surfaces that are part of a Scrollview.
Anyone (from Famous or otherwise) know how I might do this?
Figured it out. In order to modifiers to surfaces inside a scrollview, they need to be wrapped in a RenderNode.
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Scrollview = require("famous/views/Scrollview");
var RenderNode = require('famous/core/RenderNode');
var Transform = require('famous/core/Transform');
var Draggable = require('famous/modifiers/Draggable');
var mainContext = Engine.createContext();
var scrollview = new Scrollview();
var surfaces = [];
scrollview.sequenceFrom(surfaces);
for (var i = 0, temp; i < 40; i++) {
draggable = new Draggable( {
xRange: [-220, 220],
yRange: [0, 0],
});
item = new Surface({
content: "Surface: " + (i + 1),
size: [undefined, 200],
properties: {
backgroundColor: "hsl(" + (i * 360 / 40) + ", 100%, 50%)",
lineHeight: "200px",
textAlign: "center"
}
});
node = new RenderNode(draggable)
node.add(item);
item.pipe(draggable);
item.pipe(scrollview);
surfaces.push(node);
}
mainContext.add(scrollview);
via # (markmarijnissen) Famo.us Scrollview height)
Explanation: In a Scrollview, the sequenceFrom method creates a ViewSequence from the array. As long as the items being added can return a getSize(), the rendering will work correctly. The RenderNode meets this criteria. You can also create a custom View because it extends RenderNode also.
Below is a code snippet that uses a custom View that allows the surface to drag and shows a response to the drag direction based on the final position criteria.
define('main', function(require, exports, module) {
var Engine = require("famous/core/Engine");
var Scrollview = require("famous/views/Scrollview");
var DragView = require('DragView');
var mainContext = Engine.createContext();
var scrollview = new Scrollview();
var views = [];
scrollview.sequenceFrom(views);
for (var i = 0; i < 40; i++) {
var view = new DragView({
size: [undefined, 200],
content: "Surface: " + (i + 1),
backgroundColor: "hsl(" + (i * 360 / 20) + ", 100%, 70%)"
});
view._eventOutput.pipe(scrollview);
views.push(view);
}
mainContext.add(scrollview);
});
// Custom Drag View Item
define('DragView', function(require, exports, module) {
var Surface = require("famous/core/Surface");
var Scrollview = require("famous/views/Scrollview");
var RenderNode = require('famous/core/RenderNode');
var Modifier = require('famous/core/Modifier');
var View = require('famous/core/View');
var Transform = require('famous/core/Transform');
var Draggable = require('famous/modifiers/Draggable');
var TransitionableTransform = require('famous/transitions/TransitionableTransform');
var RenderController = require('famous/views/RenderController');
function _updatingDrag(e) {
var pos = e.position;
this.surface.setContent('Draggable Position is ' + pos);
}
function _endDrag(e) {
var pos = e.position;
this.surface.setContent('Draggable End Position is ' + pos);
this.draggable.setPosition([0, 0], {
duration: 300
}, function() {
this.renderer.hide();
}.bind(this));
if (pos[0] > 200) {
console.log('showing OK');
this.renderer.show(this.ok);
}
if (pos[0] < -200) {
console.log('showing Not OK');
this.renderer.show(this.not);
}
}
function DragView() {
View.apply(this, arguments);
var draggable = new Draggable({
xRange: [-220, 220],
yRange: [0, 0],
});
var item = new Surface({
content: this.options.content,
size: [undefined, 200],
properties: {
backgroundColor: this.options.backgroundColor,
lineHeight: "200px",
textAlign: "center"
}
});
var okItem = new Surface({
content: String.fromCharCode(10004),
size: [220, 200],
properties: {
color: "white",
backgroundColor: "green",
lineHeight: "200px",
fontSize: "100px",
textAlign: "center"
}
});
var notOkItem = new Surface({
content: String.fromCharCode(10006),
size: [220, 200],
properties: {
color: "white",
backgroundColor: "red",
lineHeight: "200px",
fontSize: "100px",
textAlign: "center"
}
});
var renderer = new RenderController();
draggable.subscribe(item);
draggable.on('update', _updatingDrag.bind({
surface: item
}));
draggable.on('end', _endDrag.bind({
surface: item,
draggable: draggable,
renderer: renderer,
ok: okItem,
not: notOkItem
}));
item.pipe(this._eventOutput);
this.add(draggable).add(item)
this.add(renderer);
}
DragView.prototype = Object.create(View.prototype);
DragView.prototype.constructor = DragView;
module.exports = DragView;
});
// Start Main App
require(['main']);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://requirejs.org/docs/release/2.1.16/minified/require.js"></script>
<script src="http://code.famo.us/lib/requestAnimationFrame.js"></script>
<script src="http://code.famo.us/lib/classList.js"></script>
<script src="http://code.famo.us/lib/functionPrototypeBind.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.famo.us/famous/0.3.5/famous.css" />
<script src="http://code.famo.us/famous/0.3.5/famous.min.js"></script>