Skip to content

Instantly share code, notes, and snippets.

@tanmaypatel
Created February 4, 2014 08:01
Show Gist options
  • Save tanmaypatel/8799738 to your computer and use it in GitHub Desktop.
Save tanmaypatel/8799738 to your computer and use it in GitHub Desktop.
Changing Transitions of Pages in jQuery Mobile 1.4.0 using LESS and 3L
.slide
{
@animation-duration: 500ms;
&.in
{
.transform(translateX(0) scale(1));
.animation(inanimation @animation-duration ease-in-out);
.opacity(1);
}
&.in.reverse
{
.transform(translateX(0) scale(1));
.animation(inreverseanimation @animation-duration ease-in-out);
.opacity(1);
}
&.out
{
.opacity(0.1);
.transform(scale(0.1));
z-index: -99;
.animation(outanimation @animation-duration ease-out);
}
&.out.reverse
{
.opacity(0.1);
.transform(scale(0.1));
z-index: -99;
.animation(outreverseanimation @animation-duration ease-out);
}
@-webkit-keyframes inanimation {.inanimationdefinition;}
@-o-keyframes inanimation {.inanimationdefinition;}
@keyframes inanimation {.inanimationdefinition;}
@-webkit-keyframes inreverseanimation {.inreverseanimationdefinition;}
@-o-keyframes inreverseanimation {.inreverseanimationdefinition;}
@keyframes inreverseanimation {.inreverseanimationdefinition;}
@-webkit-keyframes outanimation {.outanimationdefinition;}
@-o-keyframes outanimation {.outanimationdefinition;}
@keyframes outanimation {.outanimationdefinition;}
@-webkit-keyframes outreverseanimation {.outreverseanimationdefinition;}
@-o-keyframes outreverseanimation {.outreverseanimationdefinition;}
@keyframes outreverseanimation {.outreverseanimationdefinition;}
.inanimationdefinition()
{
from
{
.transform(translateX(200%) scale(2));
.opacity(0);
}
to
{
.transform(translateX(0) scale(1));
.opacity(1);
}
}
.inreverseanimationdefinition()
{
from
{
.transform(translateX(-200%) scale(2));
.opacity(0);
}
to
{
.transform(translateX(0) scale(1));
.opacity(1);
}
}
.outanimationdefinition()
{
from
{
.transform(translateX(0) scale(1));
.opacity(1);
}
to
{
.transform(translateX(-200%) scale(2));
.opacity(0.1);
z-index: 99;
}
}
.outreverseanimationdefinition()
{
from
{
.transform(translateX(0) scale(1));
.opacity(1);
}
to
{
.transform(translateX(200%) scale(2));
.opacity(0);
z-index: 99;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment