Skip to content

Instantly share code, notes, and snippets.

@kesne
Created May 27, 2012 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kesne/2802167 to your computer and use it in GitHub Desktop.
Save kesne/2802167 to your computer and use it in GitHub Desktop.
Comprehensive overview of adding book transitions.
enyo.Book.transition({
//Name of the transition:
name: "everything",
//Using this will set up the step function, automatically transitioning between values.
//If you don't set this as true, you're expected to provide your own step function.
auto: true,
//Set it up to use next/back animations.
directional: true,
//Set the easing function. The default is enyo.easing.quadInOut. You can also define your own easing function here.
easing: enyo.easing.quadInOut,
//Set up properties about the transition itself:
transition: {
//The duration, in ms, of the transition:
duration: 500,
next: {
//Some animations use different in/out transitions, so you can define them here.
//The book will automagically transition numerical values.
from: {
opacity: 0,
transform: {
scale: 0.7
}
},
visible: {
opacity: 1,
transform: {
scale: 1
}
},
out: {
opacity: 0,
transform: {
scale: 1.3
}
}
//NOTE: If your "from" and "out" are the same, you can just give the property "hidden" the values.
},
back: {
//You get the idea.
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment