2010-10-13 16:45:10 +00:00
. spin {
2010-10-29 06:40:11 +00:00
-webkit-transform : rotate ( 360deg ) ;
-webkit-animation-name : spin ;
-webkit-animation-duration : 1s ;
-webkit-animation-iteration-count : infinite ;
2011-06-27 21:05:16 +00:00
-webkit-animation-timing-function : linear ;
2010-10-13 16:45:10 +00:00
}
@ -webkit-keyframes spin {
from { -webkit- transform : rotate ( 0 deg ) ; }
to { -webkit- transform : rotate ( 360 deg ) ; }
}
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
* /
. in , . out {
-webkit-animation-timing-function : ease-in-out ;
-webkit-animation-duration : 350ms ;
}
. 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-09-28 16:14:52 +00:00
. slide . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateX ( 0 ) ;
2011-09-28 16:14:52 +00:00
-webkit-animation-name : slideinfromright ;
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-09-28 16:14:52 +00:00
. slide . in . reverse {
-webkit-transform : translateX ( 0 ) ;
-webkit-animation-name : slideinfromleft ;
}
. slideup . out {
-webkit-animation-name : dontmove ;
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 ;
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 ;
2011-09-28 16:14:52 +00:00
-webkit-animation-name : dontmove ;
2010-10-13 16:45:10 +00:00
}
. slideup . out . reverse {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateY ( 100 % ) ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
-webkit-animation-name : slideouttobottom ;
}
2011-09-28 16:14:52 +00:00
. slidedown . out {
2010-10-13 16:45:10 +00:00
-webkit-animation-name : dontmove ;
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 ;
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 ;
2011-09-28 16:14:52 +00:00
-webkit-animation-name : dontmove ;
2010-10-13 16:45:10 +00:00
}
. slidedown . out . reverse {
2010-10-29 06:40:11 +00:00
-webkit-transform : translateY ( -100 % ) ;
2010-10-13 16:45:10 +00:00
z-index : 10 ;
-webkit-animation-name : slideouttotop ;
}
@ -webkit-keyframes slideinfromright {
from { -webkit- transform : translateX ( 100 % ) ; }
to { -webkit- transform : translateX ( 0 ) ; }
}
@ -webkit-keyframes slideinfromleft {
from { -webkit- transform : translateX ( -100 % ) ; }
to { -webkit- transform : translateX ( 0 ) ; }
}
@ -webkit-keyframes slideouttoleft {
from { -webkit- transform : translateX ( 0 ) ; }
to { -webkit- transform : translateX ( -100 % ) ; }
}
@ -webkit-keyframes slideouttoright {
from { -webkit- transform : translateX ( 0 ) ; }
to { -webkit- transform : translateX ( 100 % ) ; }
}
@ -webkit-keyframes slideinfromtop {
from { -webkit- transform : translateY ( -100 % ) ; }
to { -webkit- transform : translateY ( 0 ) ; }
}
@ -webkit-keyframes slideinfrombottom {
from { -webkit- transform : translateY ( 100 % ) ; }
to { -webkit- transform : translateY ( 0 ) ; }
}
@ -webkit-keyframes slideouttobottom {
from { -webkit- transform : translateY ( 0 ) ; }
to { -webkit- transform : translateY ( 100 % ) ; }
}
@ -webkit-keyframes slideouttotop {
from { -webkit- transform : translateY ( 0 ) ; }
to { -webkit- transform : translateY ( -100 % ) ; }
}
@ -webkit-keyframes fadein {
from { opacity : 0 ; }
to { opacity : 1 ; }
}
@ -webkit-keyframes fadeout {
from { opacity : 1 ; }
to { opacity : 0 ; }
}
2011-09-28 16:14:52 +00:00
. fade . out {
z-index : 0 ;
-webkit-animation-name : fadeout ;
}
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 ;
-webkit-animation-name : fadein ;
}
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 ;
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. */
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-09-28 16:14:52 +00:00
. flip . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : rotateY ( 0 ) scale ( 1 ) ;
2011-09-28 16:14:52 +00:00
-webkit-animation-name : flipinfromleft ;
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-09-28 16:14:52 +00:00
. flip . in . reverse {
-webkit-transform : rotateY ( 0 ) scale ( 1 ) ;
-webkit-animation-name : flipinfromright ;
}
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 ) ; }
}
@ -webkit-keyframes flipinfromleft {
from { -webkit- transform : rotateY ( 180 deg ) scale ( .8 ) ; }
to { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
}
@ -webkit-keyframes flipouttoleft {
from { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
to { -webkit- transform : rotateY ( -180 deg ) scale ( .8 ) ; }
}
@ -webkit-keyframes flipouttoright {
from { -webkit- transform : rotateY ( 0 ) scale ( 1 ) ; }
to { -webkit- transform : rotateY ( 180 deg ) scale ( .8 ) ; }
}
2010-10-13 16:45:10 +00:00
2010-10-15 17:37:49 +00:00
/* Hackish, but reliable. */
2010-10-13 16:45:10 +00:00
@ -webkit-keyframes dontmove {
from { opacity : 1 ; }
to { opacity : 1 ; }
}
. pop {
-webkit-transform-origin : 50 % 50 % ;
}
. pop . in {
2010-10-29 06:40:11 +00:00
-webkit-transform : scale ( 1 ) ;
opacity : 1 ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : popin ;
z-index : 10 ;
}
2011-09-28 16:14:52 +00:00
. pop . in . reverse {
z-index : 0 ;
-webkit-animation-name : dontmove ;
}
2010-10-13 16:45:10 +00:00
. pop . out . reverse {
2010-10-29 06:40:11 +00:00
-webkit-transform : scale ( . 2 ) ;
opacity : 0 ;
2010-10-13 16:45:10 +00:00
-webkit-animation-name : popout ;
z-index : 10 ;
}
@ -webkit-keyframes popin {
from {
-webkit-transform : scale ( . 2 ) ;
opacity : 0 ;
}
to {
-webkit-transform : scale ( 1 ) ;
opacity : 1 ;
}
}
@ -webkit-keyframes popout {
from {
-webkit-transform : scale ( 1 ) ;
opacity : 1 ;
}
to {
-webkit-transform : scale ( . 2 ) ;
opacity : 0 ;
}
}