2010-10-15 17:37:49 +00:00
/ * Transitions from jQtouch ( with small modifications ) : http : / / www . jqtouch . com /
Built by David Kaneda and maintained by Jonathan Stark .
2010-10-13 16:45:10 +00:00
* /
2012-01-02 18:41:45 +00:00
. in {
-webkit-animation-timing-function : ease-out ;
-webkit-animation-duration : 325ms ;
-moz-animation-timing-function : ease-out ;
-moz-animation-duration : 325ms ;
}
. out {
-webkit-animation-timing-function : ease-in ;
-webkit-animation-duration : 250ms ;
-moz-animation-timing-function : ease-in ;
2012-01-02 18:57:30 +00:00
-moz-animation-duration : 250ms ;
2010-10-13 16:45:10 +00:00
}
. slide . out {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateX ( -100 % ) ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : slideouttoleft ;
2011-12-30 18:02:57 +00:00
-moz-transform : translateX ( -100 % ) ;
-moz-animation-name : slideouttoleft ;
2010-10-13 16:45:10 +00:00
}
2011-09-28 16:14:52 +00:00
. slide . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateX ( 0 ) ;
2012-01-02 17:04:13 +00:00
-webkit-animation-name : fadein ;
2012-01-02 17:15:29 +00:00
-moz-transform : translateX ( 0 ) ;
2012-01-02 16:52:02 +00:00
-moz-animation-name : fadein ;
2010-10-13 16:45:10 +00:00
}
. slide . out . reverse {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateX ( 100 % ) ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : slideouttoright ;
2011-12-30 18:02:57 +00:00
-moz-transform : translateX ( 100 % ) ;
-moz-animation-name : slideouttoright ;
2010-10-13 16:45:10 +00:00
}
2011-09-28 16:14:52 +00:00
. slide . in . reverse {
-webkit-transform : translateX ( 0 ) ;
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadein ;
2011-12-30 18:02:57 +00:00
-moz-transform : translateX ( 0 ) ;
2012-01-02 16:52:02 +00:00
-moz-animation-name : fadein ;
2011-09-28 16:14:52 +00:00
}
. slideup . out {
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadeout ;
-moz-animation-name : fadeout ;
2011-09-28 16:14:52 +00:00
z-index : 0 ;
}
2010-10-13 16:45:10 +00:00
. slideup . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateY ( 0 ) ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : slideinfrombottom ;
2011-12-30 18:02:57 +00:00
-moz-transform : translateY ( 0 ) ;
-moz-animation-name : slideinfrombottom ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
}
2011-09-28 16:14:52 +00:00
. slideup . in . reverse {
2010-10-13 16:45:10 +00:00
z-index : 0 ;
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadein ;
-moz-animation-name : fadein ;
2010-10-13 16:45:10 +00:00
}
. slideup . out . reverse {
z-index : 10 ;
2011-12-30 18:02:57 +00:00
-webkit-transform : translateY ( 100 % ) ;
-moz-transform : translateY ( 100 % ) ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : slideouttobottom ;
2011-12-30 18:02:57 +00:00
-moz-animation-name : slideouttobottom ;
2010-10-13 16:45:10 +00:00
}
2011-09-28 16:14:52 +00:00
. slidedown . out {
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadeout ;
-moz-animation-name : fadeout ;
2011-09-28 16:14:52 +00:00
z-index : 0 ;
2010-10-13 16:45:10 +00:00
}
2011-09-28 16:14:52 +00:00
2010-10-13 16:45:10 +00:00
. slidedown . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateY ( 0 ) ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : slideinfromtop ;
2011-12-30 18:02:57 +00:00
-moz-transform : translateY ( 0 ) ;
-moz-animation-name : slideinfromtop ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
}
2011-09-28 16:14:52 +00:00
. slidedown . in . reverse {
2010-10-13 16:45:10 +00:00
z-index : 0 ;
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadein ;
-moz-animation-name : fadein ;
2010-10-13 16:45:10 +00:00
}
. slidedown . out . reverse {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateY ( -100 % ) ;
2011-12-30 18:02:57 +00:00
-moz-transform : translateY ( -100 % ) ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
-webkit-animation-name : slideouttotop ;
2011-12-30 18:02:57 +00:00
-moz-animation-name : slideouttotop ;
2010-10-13 16:45:10 +00:00
}
@ -webkit-keyframes slideinfromright {
from { -webkit- transform : translateX ( 100 % ) ; }
to { -webkit- transform : translateX ( 0 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideinfromright {
from { -moz- transform : translateX ( 100 % ) ; }
to { -moz- transform : translateX ( 0 ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideinfromleft {
from { -webkit- transform : translateX ( -100 % ) ; }
to { -webkit- transform : translateX ( 0 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideinfromleft {
from { -moz- transform : translateX ( -100 % ) ; }
to { -moz- transform : translateX ( 0 ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideouttoleft {
from { -webkit- transform : translateX ( 0 ) ; }
to { -webkit- transform : translateX ( -100 % ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideouttoleft {
from { -moz- transform : translateX ( 0 ) ; }
to { -moz- transform : translateX ( -100 % ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideouttoright {
from { -webkit- transform : translateX ( 0 ) ; }
to { -webkit- transform : translateX ( 100 % ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideouttoright {
from { -moz- transform : translateX ( 0 ) ; }
to { -moz- transform : translateX ( 100 % ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideinfromtop {
from { -webkit- transform : translateY ( -100 % ) ; }
to { -webkit- transform : translateY ( 0 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideinfromtop {
from { -moz- transform : translateY ( -100 % ) ; }
to { -moz- transform : translateY ( 0 ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideinfrombottom {
from { -webkit- transform : translateY ( 100 % ) ; }
to { -webkit- transform : translateY ( 0 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideinfrombottom {
from { -moz- transform : translateY ( 100 % ) ; }
to { -moz- transform : translateY ( 0 ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideouttobottom {
from { -webkit- transform : translateY ( 0 ) ; }
to { -webkit- transform : translateY ( 100 % ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideouttobottom {
from { -moz- transform : translateY ( 0 ) ; }
to { -moz- transform : translateY ( 100 % ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes slideouttotop {
from { -webkit- transform : translateY ( 0 ) ; }
to { -webkit- transform : translateY ( -100 % ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes slideouttotop {
from { -moz- transform : translateY ( 0 ) ; }
to { -moz- transform : translateY ( -100 % ) ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes fadein {
from { opacity : 0 ; }
to { opacity : 1 ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes fadein {
from { opacity : 0 ; }
to { opacity : 1 ; }
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes fadeout {
from { opacity : 1 ; }
to { opacity : 0 ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes fadeout {
from { opacity : 1 ; }
to { opacity : 0 ; }
}
2010-10-13 16:45:10 +00:00
2011-09-28 16:14:52 +00:00
. fade . out {
z-index : 0 ;
2011-12-28 17:45:39 +00:00
opacity : 0 ;
2011-12-30 17:08:30 +00:00
-webkit-animation-duration : 150ms ;
2011-09-28 16:14:52 +00:00
-webkit-animation-name : fadeout ;
2011-12-30 18:02:57 +00:00
-moz-animation-duration : 150ms ;
-moz-animation-name : fadeout ;
2011-09-28 16:14:52 +00:00
}
2010-10-13 16:45:10 +00:00
. fade . in {
2010-10-29 06:40:11 +00:00
opacity : 1 ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
2011-12-30 17:08:30 +00:00
-webkit-animation-duration : 300ms ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : fadein ;
2011-12-30 18:02:57 +00:00
-moz-animation-duration : 300ms ;
-moz-animation-name : fadein ;
2010-10-13 16:45:10 +00:00
}
2010-10-15 17:37:49 +00:00
Changes to allow 3rd party transitions. Developers can now register a custom transition by adding their transition handler to the $.mobile.transitionHandlers dictionary. The name of the custom transition is used as the key within the transtionsHandlers dictionary, and should be the same name used within the @data-transtion attribute.
The expected prototype for a transitionHandler is as follows:
function handler(name, reverse, $to, $from)
The name parameter is the name of the transition as specified by @data-transition attribute, reverse is a boolean that is false for a normal transition, and true for a reverse transition. The $to param is a jQuery collection containing the page that is being transitioned "to", and $from is an optional collection that tells us what page we are transitioning "from". Because $from is optional, handler developers should take care and check $from to make sure it is not undefined before attempting to dereference it.
In addition to registering custom transition by name, developers can specify a handler to use in the case where a transition name is specified and does not exist within the $.mobile.transitionHanlders dictionary. Within jQuery Mobile, the default handler for unknown transition types is the $.mobile.css3Transition() handler. This handler always assumes that the transition name is to be used as a CSS class to be placed on the $to and $from elements. To change the default handler, simply set $.mobile.defaultTransitionHandler to you function handler:
$.mobile.defaultTransitionHandler = myTransitionHandler;
The changes to make all this necessary are as follows:
- Created $.mobile.noneTransitionHandler which is the default transitionHandler for the framework that simply adds and removes the page active class on the $from and $to pages with no animations.
- Moved class based transition code into a new plugin jquery.mobile.transition.js file. This plugin, when present, overrides the noneTransitionHandler as the defaultTranstionHandler for the framework so that CSS3 animation transitions are available.
- Removed code related to the setting/removal of the ui-mobile-viewport-perspective class. The css3TransitionHandler plugin takes care of automatically placing a "viewport-<transition name>" class on the viewport (body) element. This allows any other transition to specify properties on the viewport that are necessary to accomplish the transition.
- changed the CSS class ui-mobile-viewport-perspective to viewport-flip to match code changes. This makes it more apparent that setting -webkit-perspective is only used with the flip transition.
- Updated js/index.php, Makefile and build.xml to include the new jquery.mobile.transition.js file.
2011-04-26 21:06:10 +00:00
/ * The properties in this rule are only necessary for the 'flip' transition .
2010-10-29 20:23:04 +00:00
* We need specify the perspective to create a projection matrix . This will add
* some depth as the element flips . The depth number represents the distance of
* the viewer from the z-plane . According to the CSS3 spec , 1000 is a moderate
* value .
* /
Changes to allow 3rd party transitions. Developers can now register a custom transition by adding their transition handler to the $.mobile.transitionHandlers dictionary. The name of the custom transition is used as the key within the transtionsHandlers dictionary, and should be the same name used within the @data-transtion attribute.
The expected prototype for a transitionHandler is as follows:
function handler(name, reverse, $to, $from)
The name parameter is the name of the transition as specified by @data-transition attribute, reverse is a boolean that is false for a normal transition, and true for a reverse transition. The $to param is a jQuery collection containing the page that is being transitioned "to", and $from is an optional collection that tells us what page we are transitioning "from". Because $from is optional, handler developers should take care and check $from to make sure it is not undefined before attempting to dereference it.
In addition to registering custom transition by name, developers can specify a handler to use in the case where a transition name is specified and does not exist within the $.mobile.transitionHanlders dictionary. Within jQuery Mobile, the default handler for unknown transition types is the $.mobile.css3Transition() handler. This handler always assumes that the transition name is to be used as a CSS class to be placed on the $to and $from elements. To change the default handler, simply set $.mobile.defaultTransitionHandler to you function handler:
$.mobile.defaultTransitionHandler = myTransitionHandler;
The changes to make all this necessary are as follows:
- Created $.mobile.noneTransitionHandler which is the default transitionHandler for the framework that simply adds and removes the page active class on the $from and $to pages with no animations.
- Moved class based transition code into a new plugin jquery.mobile.transition.js file. This plugin, when present, overrides the noneTransitionHandler as the defaultTranstionHandler for the framework so that CSS3 animation transitions are available.
- Removed code related to the setting/removal of the ui-mobile-viewport-perspective class. The css3TransitionHandler plugin takes care of automatically placing a "viewport-<transition name>" class on the viewport (body) element. This allows any other transition to specify properties on the viewport that are necessary to accomplish the transition.
- changed the CSS class ui-mobile-viewport-perspective to viewport-flip to match code changes. This makes it more apparent that setting -webkit-perspective is only used with the flip transition.
- Updated js/index.php, Makefile and build.xml to include the new jquery.mobile.transition.js file.
2011-04-26 21:06:10 +00:00
. viewport-flip {
2010-10-29 20:23:04 +00:00
-webkit-perspective : 1000 ;
2011-12-30 18:02:57 +00:00
-moz-perspective : 1000 ;
2010-11-02 20:29:12 +00:00
position : absolute ;
}
. ui-mobile-viewport-transitioning ,
. ui-mobile-viewport-transitioning . ui-page {
width : 100 % ;
2011-02-01 02:42:38 +00:00
height : 100 % ;
2011-01-27 01:41:30 +00:00
overflow : hidden ;
2010-10-29 20:23:04 +00:00
}
2010-10-15 19:47:04 +00:00
. flip {
-webkit-animation-duration : . 65s ;
2010-11-04 06:30:44 +00:00
-webkit-backface-visibility : hidden ;
-webkit-transform : translateX ( 0 ) ; /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */
2011-12-30 18:02:57 +00:00
-moz-animation-duration : . 65s ;
-moz-backface-visibility : hidden ;
-moz-transform : translateX ( 0 ) ; /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */
2010-10-15 19:47:04 +00:00
}
. flip . out {
2010-10-29 06:40:11 +00:00
-webkit-transform : rotateY ( -180deg ) scale ( . 8 ) ;
2010-10-15 19:47:04 +00:00
-webkit-animation-name : flipouttoleft ;
2011-12-30 18:02:57 +00:00
-moz-transform : rotateY ( -180deg ) scale ( . 8 ) ;
-moz-animation-name : flipouttoleft ;
2010-10-15 19:47:04 +00:00
}
2011-09-28 16:14:52 +00:00
. flip . in {
2012-01-02 16:52:02 +00:00
opacity : 1 ;
z-index : 10 ;
2012-01-02 17:15:29 +00:00
-webkit-animation-duration : 300ms ;
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadein ;
2012-01-02 17:15:29 +00:00
-moz-animation-duration : 300ms ;
2012-01-02 16:52:02 +00:00
-moz-animation-name : fadein ;
2010-10-15 19:47:04 +00:00
}
2011-09-28 16:14:52 +00:00
/* Shake it all about */
2010-10-15 19:47:04 +00:00
. flip . out . reverse {
2010-10-29 06:40:11 +00:00
-webkit-transform : rotateY ( 180deg ) scale ( . 8 ) ;
2010-10-15 19:47:04 +00:00
-webkit-animation-name : flipouttoright ;
2011-12-30 18:02:57 +00:00
-moz-transform : rotateY ( 180deg ) scale ( . 8 ) ;
-moz-animation-name : flipouttoright ;
2010-10-15 19:47:04 +00:00
}
2011-09-28 16:14:52 +00:00
. flip . in . reverse {
2012-01-02 16:52:02 +00:00
opacity : 1 ;
z-index : 10 ;
2012-01-02 17:15:29 +00:00
-webkit-animation-duration : 300ms ;
2012-01-02 16:52:02 +00:00
-webkit-animation-name : fadein ;
2012-01-02 17:15:29 +00:00
-moz-animation-duration : 300ms ;
2012-01-02 16:52:02 +00:00
-moz-animation-name : fadein ;
2011-09-28 16:14:52 +00:00
}
2012-01-04 10:31:00 +00:00
/* for non-3d supporting browsers, use fade */
. ui-unsupported-csstransform3d . flip . out ,
. ui-unsupported-csstransform3d . flip . out . reverse {
z-index : 0 ;
opacity : 0 ;
-webkit-animation-duration : 150ms ;
-webkit-animation-name : fadeout ;
-moz-animation-duration : 150ms ;
-moz-animation-name : fadeout ;
}
2010-10-15 19:47:04 +00:00
@ -webkit-keyframes flipinfromright {
from { -webkit- transform : rotateY ( -180 deg ) scale ( .8 ) ; }
to { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes flipinfromright {
from { -moz- transform : rotateY ( -180 deg ) scale ( .8 ) ; }
to { -moz- transform : rotateY ( 0 ) scale ( 1 ) ; }
}
2010-10-15 19:47:04 +00:00
@ -webkit-keyframes flipinfromleft {
from { -webkit- transform : rotateY ( 180 deg ) scale ( .8 ) ; }
to { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes flipinfromleft {
from { -moz- transform : rotateY ( 180 deg ) scale ( .8 ) ; }
to { -moz- transform : rotateY ( 0 ) scale ( 1 ) ; }
}
2010-10-15 19:47:04 +00:00
@ -webkit-keyframes flipouttoleft {
from { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
to { -webkit- transform : rotateY ( -180 deg ) scale ( .8 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes flipouttoleft {
from { -moz- transform : rotateY ( 0 ) scale ( 1 ) ; }
to { -moz- transform : rotateY ( -180 deg ) scale ( .8 ) ; }
}
2010-10-15 19:47:04 +00:00
@ -webkit-keyframes flipouttoright {
from { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
to { -webkit- transform : rotateY ( 180 deg ) scale ( .8 ) ; }
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes flipouttoright {
from { -moz- transform : rotateY ( 0 ) scale ( 1 ) ; }
to { -moz- transform : rotateY ( 180 deg ) scale ( .8 ) ; }
}
2010-10-13 16:45:10 +00:00
. pop {
-webkit-transform-origin : 50 % 50 % ;
2011-12-30 18:02:57 +00:00
-moz-transform-origin : 50 % 50 % ;
2010-10-13 16:45:10 +00:00
}
. pop . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : scale ( 1 ) ;
2011-12-30 18:02:57 +00:00
-moz-transform : scale ( 1 ) ;
2010-10-29 06:40:11 +00:00
opacity : 1 ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : popin ;
2011-12-30 18:02:57 +00:00
-moz-animation-name : popin ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
}
2012-01-02 16:27:44 +00:00
. pop . out {
z-index : 0 ;
-webkit-animation-name : fadeout ;
-moz-animation-name : fadeout ;
}
2011-09-28 16:14:52 +00:00
. pop . in . reverse {
z-index : 0 ;
2012-01-02 16:27:44 +00:00
-webkit-animation-name : fadein ;
-moz-animation-name : fadein ;
2011-09-28 16:14:52 +00:00
}
2010-10-13 16:45:10 +00:00
. pop . out . reverse {
2012-01-02 18:41:45 +00:00
-webkit-transform : scale ( 0 ) ;
-moz-transform : scale ( 0 ) ;
2010-10-29 06:40:11 +00:00
opacity : 0 ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : popout ;
2011-12-30 18:02:57 +00:00
-moz-animation-name : popout ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
}
@ -webkit-keyframes popin {
from {
2012-01-02 18:41:45 +00:00
-webkit-transform : scale ( 0 ) ;
2010-10-13 16:45:10 +00:00
opacity : 0 ;
}
to {
-webkit-transform : scale ( 1 ) ;
opacity : 1 ;
}
}
2011-12-30 18:02:57 +00:00
@ -moz-keyframes popin {
from {
2012-01-02 18:41:45 +00:00
-moz-transform : scale ( 0 ) ;
2011-12-30 18:02:57 +00:00
opacity : 0 ;
}
to {
-moz-transform : scale ( 1 ) ;
opacity : 1 ;
}
}
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes popout {
from {
-webkit-transform : scale ( 1 ) ;
opacity : 1 ;
}
to {
2012-01-02 18:41:45 +00:00
-webkit-transform : scale ( 0 ) ;
2010-10-13 16:45:10 +00:00
opacity : 0 ;
}
2011-12-30 18:02:57 +00:00
}
@ -moz-keyframes popout {
from {
-moz-transform : scale ( 1 ) ;
opacity : 1 ;
}
to {
2012-01-02 18:41:45 +00:00
-moz-transform : scale ( 0 ) ;
2011-12-30 18:02:57 +00:00
opacity : 0 ;
}
2010-10-13 16:45:10 +00:00
}