mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
376 lines
10 KiB
SCSS
376 lines
10 KiB
SCSS
|
|
/**
|
|
* Animations
|
|
* --------------------------------------------------
|
|
* The animations in this file are "simple" - not too complex
|
|
* and pretty easy on performance. They can be overidden
|
|
* and enhanced easily.
|
|
*/
|
|
$transition-duration: 250ms;
|
|
|
|
.noop-animation {
|
|
> .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave {
|
|
@include transition(all cubic-bezier(0.250, 0.460, 0.450, 0.940) $transition-duration);
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
}
|
|
}
|
|
|
|
|
|
// required for Android
|
|
.ng-animate .pane {
|
|
position: absolute;
|
|
}
|
|
|
|
|
|
/**
|
|
* Slide Left-Right
|
|
* --------------------------------------------------
|
|
* NEW content slides IN from the RIGHT, OLD slides OUT to the LEFT
|
|
* Reverse: NEW content slides IN from the LEFT, OLD slides OUT to the RIGHT
|
|
*/
|
|
|
|
.slide-left-right {
|
|
> .ng-enter, &.ng-enter,
|
|
> .ng-leave, &.ng-leave {
|
|
@include transition(all ease-in-out $transition-duration);
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
}
|
|
> .ng-enter, &.ng-enter {
|
|
/* NEW content placed far RIGHT BEFORE it slides IN from the RIGHT */
|
|
@include translate3d(100%, 0, 0);
|
|
}
|
|
> .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active {
|
|
/* NEW content ACTIVELY sliding IN from the RIGHT */
|
|
@include translate3d(0, 0, 0);
|
|
//.scroll { background: purple; } //for debugging
|
|
}
|
|
> .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active {
|
|
/* OLD content ACTIVELY sliding OUT to the LEFT */
|
|
@include translate3d(-100%, 0, 0);
|
|
//.scroll { background: green; } //for debugging
|
|
}
|
|
|
|
&.reverse {
|
|
> .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave {
|
|
@include transition(all ease-in-out $transition-duration);
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
}
|
|
> .ng-enter, &.ng-enter {
|
|
/* NEW content placed far LEFT BEFORE it slides IN from the LEFT */
|
|
@include translate3d(-100%, 0, 0);
|
|
}
|
|
> .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active {
|
|
/* NEW content ACTIVELY sliding IN from the LEFT */
|
|
@include translate3d(0, 0, 0);
|
|
//.scroll { background: blue; } //for debugging
|
|
}
|
|
> .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active {
|
|
/* OLD content ACTIVELY sliding OUT to the RIGHT */
|
|
@include translate3d(100%, 0, 0);
|
|
//.scroll { background: yellow; } //for debugging
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* iOS7 style slide left to right
|
|
* --------------------------------------------------
|
|
*/
|
|
$ios7-timing-function: ease-in-out;
|
|
$ios7-transition-duration: 250ms;
|
|
|
|
.slide-left-right-ios7 {
|
|
> .ng-enter, &.ng-enter,
|
|
> .ng-leave, &.ng-leave {
|
|
@include transition(all $ios7-timing-function $ios7-transition-duration);
|
|
position: absolute;
|
|
top: 0;
|
|
right: -1px;
|
|
bottom: 0;
|
|
left: -1px;
|
|
border-left: 1px solid #ddd;
|
|
border-right: 1px solid #ddd;
|
|
}
|
|
> .ng-enter, &.ng-enter {
|
|
/* NEW content placed far RIGHT BEFORE it slides IN from the RIGHT */
|
|
@include translate3d(100%, 0, 0);
|
|
}
|
|
> .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active {
|
|
/* NEW content ACTIVELY sliding IN from the RIGHT */
|
|
@include translate3d(0, 0, 0);
|
|
//.scroll { background: red; } //for debugging
|
|
}
|
|
> .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active {
|
|
/* OLD content ACTIVELY sliding OUT to the LEFT */
|
|
@include translate3d(-15%, 0, 0);
|
|
//.scroll { background: blue; } //for debugging
|
|
}
|
|
|
|
&.reverse {
|
|
> .ng-enter, &.ng-enter, > .ng-leave, &.ng-leave {
|
|
@include transition(all $ios7-timing-function $ios7-transition-duration);
|
|
position: absolute;
|
|
top: 0;
|
|
right: -1px;
|
|
bottom: 0;
|
|
left: -1px;
|
|
border-left: 1px solid #ddd;
|
|
border-right: 1px solid #ddd;
|
|
}
|
|
> .ng-enter, &.ng-enter {
|
|
/* NEW content placed far LEFT BEFORE it slides IN from the LEFT */
|
|
@include translate3d(-100%, 0, 0);
|
|
}
|
|
> .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active {
|
|
/* NEW content ACTIVELY sliding IN from the LEFT */
|
|
@include translate3d(0, 0, 0);
|
|
//.scroll { background: orange; } //for debugging
|
|
}
|
|
> .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active {
|
|
/* OLD content ACTIVELY sliding OUT to the RIGHT */
|
|
@include translate3d(15%, 0, 0);
|
|
//.scroll { background: maroon; } //for debugging
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.slide-in-left {
|
|
@include translate3d(0%,0,0);
|
|
&.ng-enter, > .ng-enter {
|
|
@include animation-name(slideInFromLeft);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
&.ng-leave, > .ng-leave {
|
|
@include animation-name(slideOutToLeft);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
}
|
|
|
|
|
|
.slide-in-left-add {
|
|
@include translate3d(100%,0,0);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
.slide-in-left-add-active {
|
|
@include animation-name(slideInFromLeft);
|
|
}
|
|
|
|
.slide-out-left {
|
|
@include translate3d(-100%,0,0);
|
|
&.ng-enter, > .ng-enter {
|
|
@include animation-name(slideOutToLeft);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
&.ng-leave, > .ng-leave {
|
|
@include animation-name(slideOutToLeft);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
}
|
|
|
|
.slide-out-left {
|
|
}
|
|
|
|
.slide-out-left-add {
|
|
@include translate3d(0,0,0);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
.slide-out-left-add-active {
|
|
@include animation-name(slideOutToLeft);
|
|
}
|
|
|
|
.slide-in-right {
|
|
@include translate3d(0%,0,0);
|
|
&.ng-enter, > .ng-enter {
|
|
@include animation-name(slideInFromRight);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
&.ng-leave, > .ng-leave {
|
|
@include animation-name(slideInFromRight);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
}
|
|
|
|
.slide-in-right-add {
|
|
@include translate3d(-100%,0,0);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
.slide-in-right-add-active {
|
|
@include animation-name(slideInFromRight);
|
|
}
|
|
|
|
.slide-out-right {
|
|
@include translate3d(100%,0,0);
|
|
&.ng-enter, > .ng-enter {
|
|
@include animation-name(slideOutToRight);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
&.ng-leave, > .ng-leave {
|
|
@include animation-name(slideOutToRight);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
}
|
|
|
|
.slide-out-right {
|
|
}
|
|
.slide-out-right-add {
|
|
@include translate3d(0,0,0);
|
|
@include animation-duration($transition-duration);
|
|
@include animation-timing-function(ease-in-out);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
.slide-out-right-add-active {
|
|
@include animation-name(slideOutToRight);
|
|
}
|
|
|
|
.slide-in-up {
|
|
// Start it down low
|
|
@include translate3d(0, 0%, 0);
|
|
opacity: 1;
|
|
|
|
&.ng-enter, .ng-enter {
|
|
// Start it down low
|
|
@include translate3d(0, 100%, 0);
|
|
|
|
@include animation-duration(400ms);
|
|
@include animation-timing-function($slide-in-up-function);
|
|
@include animation-fill-mode(both);
|
|
// Start hidden
|
|
opacity: 0;
|
|
}
|
|
|
|
&.ng-enter-active, .ng-enter-active {
|
|
@include animation-name(slideInUp);
|
|
}
|
|
|
|
&.ng-leave, .ng-leave {
|
|
@include animation-duration(400ms);
|
|
@include animation-timing-function($slide-in-up-function);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
|
|
&.ng-leave-active, .ng-leave {
|
|
@include animation-name(slideOutUp);
|
|
}
|
|
}
|
|
|
|
.slide-in-up-add {
|
|
@include animation-duration(400ms);
|
|
@include animation-timing-function($slide-in-up-function);
|
|
@include animation-fill-mode(both);
|
|
}
|
|
.slide-in-up-add-active {
|
|
@include animation-name(slideInUp);
|
|
}
|
|
|
|
.slide-in-up-remove {
|
|
@include animation-duration(400ms);
|
|
@include animation-timing-function($slide-in-up-function);
|
|
@include animation-fill-mode(forwards);
|
|
}
|
|
.slide-in-up-remove-active {
|
|
@include animation-name(slideOutUp);
|
|
}
|
|
|
|
.fade-in {
|
|
@include animation(fadeOut 0.3s);
|
|
&.active {
|
|
@include animation(fadeIn 0.3s);
|
|
}
|
|
}
|
|
|
|
.fade-in-not-out {
|
|
&.ng-enter, .ng-enter {
|
|
@include animation(fadeIn 0.3s);
|
|
position: relative;
|
|
}
|
|
&.ng-leave, .ng-leave {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* Some component specific animations
|
|
*/
|
|
$nav-title-slide-ios7-delay: 350ms;
|
|
.nav-title-slide-ios7 {
|
|
> .ng-enter, &.ng-enter,
|
|
> .ng-leave, &.ng-leave {
|
|
@include transition(all $nav-title-slide-ios7-delay);
|
|
@include transition-timing-function($ios7-timing-function);
|
|
opacity: 1;
|
|
}
|
|
> .ng-enter, &.ng-enter {
|
|
@include translate3d(30%, 0, 0);
|
|
opacity: 0;
|
|
}
|
|
> .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active {
|
|
@include translate3d(0, 0, 0);
|
|
opacity: 1;
|
|
}
|
|
> .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active {
|
|
@include translate3d(-30%, 0, 0);
|
|
opacity: 0;
|
|
}
|
|
|
|
}
|
|
.reverse {
|
|
.nav-title-slide-ios7 {
|
|
> .ng-enter, &.ng-enter,
|
|
> .ng-leave, &.ng-leave {
|
|
@include transition(all $nav-title-slide-ios7-delay);
|
|
@include transition-timing-function($ios7-timing-function);
|
|
opacity: 1;
|
|
}
|
|
> .ng-enter, &.ng-enter {
|
|
@include translate3d(-30%, 0, 0);
|
|
opacity: 0;
|
|
}
|
|
> .ng-enter.ng-enter-active, &.ng-enter.ng-enter-active {
|
|
@include translate3d(0, 0, 0);
|
|
opacity: 1;
|
|
}
|
|
> .ng-leave.ng-leave-active, &.ng-leave.ng-leave-active {
|
|
@include translate3d(30%, 0, 0);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
}
|