diff --git a/imports/_easing.less b/imports/_easing.less new file mode 100644 index 0000000..51619e8 --- /dev/null +++ b/imports/_easing.less @@ -0,0 +1,3 @@ +// custom easing imports +@easeOutCirc: cubic-bezier(0, 0.590, 0.375, 1); +@easeInCirc: cubic-bezier(0.590, 0, 1, 0.375); \ No newline at end of file diff --git a/imports/_mixins.less b/imports/_mixins.less new file mode 100644 index 0000000..c0b0a17 --- /dev/null +++ b/imports/_mixins.less @@ -0,0 +1,5 @@ +// mixins +.animated() { + animation-duration: 0.3s; + animation-fill-mode: both; +} \ No newline at end of file diff --git a/keyframes/basic-fade.keyframes.less b/keyframes/basic-fade.keyframes.less new file mode 100644 index 0000000..ab340a3 --- /dev/null +++ b/keyframes/basic-fade.keyframes.less @@ -0,0 +1,30 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Basic Fades +@keyframes tdFadeIn { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@keyframes tdFadeOut { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +.tdFadeIn() { + animation-name: tdFadeIn; +} +.tdFadeOut() { + animation-name: tdFadeOut; +} diff --git a/keyframes/drop.keyframes.less b/keyframes/drop.keyframes.less new file mode 100644 index 0000000..e863720 --- /dev/null +++ b/keyframes/drop.keyframes.less @@ -0,0 +1,72 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Drop In +@keyframes tdDropInLeft { + 0% { + opacity: 0; + } + 1% { + opacity: 1; + transform: rotate(2deg) translateY(-15px); + transform-origin: right bottom; + animation-timing-function: ease-in; + } + + 50% { + opacity: 1; + transform: rotate(0) translateY(0px); + transform-origin: right bottom; + animation-timing-function: ease-out; + } + + 75% { + transform: rotate(-0.5deg) translateY(0px); + transform-origin: left bottom; + animation-timing-function: @easeInCirc; + } + 100% { + opacity: 1; + transform: rotate(0) translateY(0px); + transform-origin: center bottom; + animation-timing-function: @easeOutCirc; + } +} + +@keyframes tdDropInRight { + 0% { + opacity: 0; + } + 1% { + opacity: 1; + transform: rotate(-2deg) translateY(-15px); + transform-origin: left bottom; + animation-timing-function: ease-in; + } + + 50% { + opacity: 1; + transform: rotate(0) translateY(0px); + transform-origin: left bottom; + animation-timing-function: ease-out; + } + + 75% { + transform: rotate(0.5deg) translateY(0px); + transform-origin: right bottom; + animation-timing-function: @easeInCirc; + } + 100% { + opacity: 1; + transform: rotate(0) translateY(0px); + transform-origin: center bottom; + animation-timing-function: @easeOutCirc; + } +} + +.tdDropInLeft() { + animation-name: tdDropInLeft; +} +.tdDropInRight() { + animation-name: tdDropInRight; +} \ No newline at end of file diff --git a/keyframes/fade.keyframes.less b/keyframes/fade.keyframes.less new file mode 100644 index 0000000..4a07ee2 --- /dev/null +++ b/keyframes/fade.keyframes.less @@ -0,0 +1,134 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Fading Entrances +@keyframes tdFadeInDown { + 0% { + opacity: 0; + transform: translateY(-10px); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes tdFadeInLeft { + 0% { + opacity: 0; + transform: translateX(10px); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} + +@keyframes tdFadeInUp { + 0% { + opacity: 0; + transform: translateY(10px); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes tdFadeInRight { + 0% { + opacity: 0; + transform: translateX(-10px); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} + +.tdFadeInDown() { + animation-name: tdFadeInDown; +} +.tdFadeInLeft() { + animation-name: tdFadeInLeft; +} +.tdFadeInUp() { + animation-name: tdFadeInUp; +} +.tdFadeInRight() { + animation-name: tdFadeInRight; +} + +// Fading Exits +@keyframes tdFadeOutUp { + 0% { + opacity: 1; + transform: translateY(0); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 0; + transform: translateY(-10px); + } +} + +@keyframes tdFadeOutRight { + 0% { + opacity: 1; + transform: translateX(0); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 0; + transform: translateX(10px); + } +} + +@keyframes tdFadeOutDown { + 0% { + opacity: 1; + transform: translateY(0); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 0; + transform: translateY(10px); + } +} + +@keyframes tdFadeOutLeft { + 0% { + opacity: 1; + transform: translateX(0); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 0; + transform: translateX(-10px); + } +} + +.tdFadeOutUp() { + animation-name: tdFadeOutUp; +} +.tdFadeOutRight() { + animation-name: tdFadeOutRight; +} +.tdFadeOutDown() { + animation-name: tdFadeOutDown; +} +.tdFadeOutLeft() { + animation-name: tdFadeOutLeft; +} diff --git a/keyframes/hinge-flip.keyframes.less b/keyframes/hinge-flip.keyframes.less new file mode 100644 index 0000000..b8293da --- /dev/null +++ b/keyframes/hinge-flip.keyframes.less @@ -0,0 +1,55 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Hinge Flip +@keyframes tdHingeFlipIn { + 0% { + opacity: 0; + transform: perspective(600px) rotateX(0deg); + transform-origin: center top; + animation-timing-function: @easeOutCirc; + } + + 50% { + transform: perspective(600px) rotateX(-10deg); + transform-origin: center top; + animation-timing-function: ease-in; + } + + 100% { + opacity: 1; + transform: perspective(600px) rotateX(0deg); + transform-origin: center top; + animation-timing-function: ease-out; + } +} + +.tdHingeFlipIn() { + animation-name: tdHingeFlipIn; +} + +@keyframes tdHingeFlipOut { + 0% { + opacity: 1; + transform: perspective(600px) rotateX(0deg); + transform-origin: center top; + animation-timing-function: @easeOutCirc; + } + + 50% { + transform: perspective(600px) rotateX(-10deg); + transform-origin: center top; + animation-timing-function: ease-in; + } + + 100% { + opacity: 0; + transform: perspective(600px) rotateX(0deg); + transform-origin: center top; + animation-timing-function: ease-out; + } +} + +.tdHingeFlipOut() { + animation-name: tdHingeFlipOut; +} diff --git a/keyframes/plop.keyframes.less b/keyframes/plop.keyframes.less new file mode 100644 index 0000000..8dd7db1 --- /dev/null +++ b/keyframes/plop.keyframes.less @@ -0,0 +1,79 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Plop Entrances +@keyframes tdPlopIn { + 0% { + opacity: 0; + transform: scale(0.9,0.9); + } + 10% { + opacity: 1; + transform: scale(0.7,1.3); + } + 70% { + transform: scale(1.1,0.95); + } + 90% { + transform: scale(0.97,1.05); + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +@keyframes tdPlopInDown { + 0% { + opacity: 0; + transform: scale(0.9,0.8); + transform-origin: center top; + } + 10% { + opacity: 1; + transform: scale(0.8,1.3); + transform-origin: center top; + } + 70% { + transform: scale(1,0.95); + transform-origin: center top; + } + 100% { + opacity: 1; + transform: scale(1); + transform-origin: center top; + } +} + +@keyframes tdPlopInUp { + 0% { + opacity: 0; + transform: scale(0.9,0.8); + transform-origin: center bottom; + } + 10% { + opacity: 1; + transform: scale(0.8,1.3); + transform-origin: center bottom; + } + 70% { + transform: scale(1,0.95); + transform-origin: center bottom; + } + 100% { + opacity: 1; + transform: scale(1); + transform-origin: center bottom; + } +} + +.tdPlopIn() { + animation-name: tdPlopIn; +} +.tdPlopInDown() { + animation-name: tdPlopInDown; +} +.tdPlopInUp() { + animation-name: tdPlopInUp; +} + diff --git a/keyframes/stamp.keyframes.less b/keyframes/stamp.keyframes.less new file mode 100644 index 0000000..3b7e2ad --- /dev/null +++ b/keyframes/stamp.keyframes.less @@ -0,0 +1,57 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Stamp Entrances +@keyframes tdStampIn { + 0% { + opacity: 0; + transform: scale(1.3); + animation-timing-function: @easeInCirc; + } + 50% { + opacity: 1; + } + 70% { + opacity: 1; + transform: scale(1); + } + 90% { + opacity: 1; + transform: scale(1.03); + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +@keyframes tdStampInSwing { + 0% { + opacity: 0; + transform: scale(1.3) rotate(-10deg); + animation-timing-function: @easeInCirc; + } + 50% { + opacity: 1; + } + 70% { + opacity: 1; + transform: scale(1); + } + 90% { + opacity: 1; + transform: scale(1.03); + } + 100% { + opacity: 1; + transform: scale(1) rotate(0); + } +} + +.tdStampIn() { + animation-name: tdStampIn; +} +.tdStampInSwing() { + animation-name: tdStampInSwing; +} + diff --git a/keyframes/swing.keyframes.less b/keyframes/swing.keyframes.less new file mode 100644 index 0000000..9866206 --- /dev/null +++ b/keyframes/swing.keyframes.less @@ -0,0 +1,47 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Swing +@keyframes tdSwingIn { + 0% { + opacity: 0; + transform: rotate(-10deg) scale(0.85); + animation-timing-function: @easeOutCirc; + } + + 70% { + opacity: 1; + transform: rotate(1deg); + animation-timing-function: ease; + } + 100% { + opacity: 1; + transform: rotate(0deg) scale(1); + animation-timing-function: ease; + } +} + +@keyframes tdSwingOut { + 0% { + opacity: 1; + transform: rotate(0deg) scale(1); + animation-timing-function: @easeOutCirc; + } + 30% { + opacity: 1; + transform: rotate(-1deg); + animation-timing-function: ease; + } + 100% { + opacity: 0; + transform: rotate(10deg) scale(0.85); + animation-timing-function: ease; + } +} + +.tdSwingIn() { + animation-name: tdSwingIn; +} +.tdSwingOut() { + animation-name: tdSwingOut; +} diff --git a/keyframes/zoom.expand.keyframes.less b/keyframes/zoom.expand.keyframes.less new file mode 100644 index 0000000..5f96bf0 --- /dev/null +++ b/keyframes/zoom.expand.keyframes.less @@ -0,0 +1,77 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Expand Entrances +@keyframes tdExpandIn { + 0% { + opacity: 0; + transform: scale(0.85); + animation-timing-function: @easeOutCirc; + } + + 100% { + opacity: 1; + transform: scale(1); + } +} + +@keyframes tdExpandInBounce { + 0% { + opacity: 0; + transform: scale(0.85); + animation-timing-function: @easeOutCirc; + } + 70% { + transform: scale(1.03); + animation-timing-function: ease; + } + 100% { + opacity: 1; + transform: scale(1); + animation-timing-function: ease; + } +} + +.tdExpandIn() { + animation-name: tdExpandIn; +} +.tdExpandInBounce() { + animation-name: tdExpandInBounce; +} + +// Expand Exits +@keyframes tdExpandOut { + 0% { + opacity: 1; + transform: scale(1); + animation-timing-function: @easeOutCirc; + } + 100% { + opacity: 0; + transform: scale(1.2); + } +} + +@keyframes tdExpandOutBounce { + 0% { + opacity: 1; + transform: scale(1); + animation-timing-function: @easeOutCirc; + } + 30% { + opacity: 1; + transform: scale(0.95); + animation-timing-function: ease; + } + 100% { + opacity: 0; + transform: scale(1.2); + } +} + +.tdExpandOut() { + animation-name: tdExpandOut; +} +.tdExpandOutBounce() { + animation-name: tdExpandOutBounce; +} diff --git a/keyframes/zoom.shrink.keyframes.less b/keyframes/zoom.shrink.keyframes.less new file mode 100644 index 0000000..98d4d63 --- /dev/null +++ b/keyframes/zoom.shrink.keyframes.less @@ -0,0 +1,77 @@ +@import (reference) './imports/_easing.less'; +@import (reference) './imports/_mixins.less'; + +// Shrink Entrances +@keyframes tdShrinkIn { + 0% { + opacity: 0; + transform: scale(1.2); + animation-timing-function: @easeOutCirc; + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +@keyframes tdShrinkInBounce { + 0% { + opacity: 0; + transform: scale(1.2); + animation-timing-function: @easeOutCirc; + } + 70% { + transform: scale(0.95); + animation-timing-function: ease; + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +.tdShrinkIn() { + animation-name: tdShrinkIn; +} +.tdShrinkInBounce() { + animation-name: tdShrinkInBounce; +} + +// Shrink Exits +@keyframes tdShrinkOut { + 0% { + opacity: 1; + transform: scale(1); + animation-timing-function: @easeOutCirc; + } + 100% { + opacity: 0; + transform: scale(0.85); + animation-timing-function: ease; + } +} + +@keyframes tdShrinkOutBounce { + 0% { + opacity: 1; + transform: scale(1); + animation-timing-function: @easeOutCirc; + } + 30% { + opacity: 1; + transform: scale(1.03); + animation-timing-function: ease; + } + 100% { + opacity: 0; + transform: scale(0.85); + animation-timing-function: ease; + } +} + +.tdShrinkOut() { + animation-name: tdShrinkOut; +} +.tdShrinkOutBounce() { + animation-name: tdShrinkOutBounce; +} diff --git a/modules/basic-fade.less b/modules/basic-fade.less index 13cdb5f..b4bfd8f 100644 --- a/modules/basic-fade.less +++ b/modules/basic-fade.less @@ -1,27 +1,8 @@ -/* Basic Fades */ -@keyframes tdFadeIn { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } -} - -@keyframes tdFadeOut { - 0% { - opacity: 1; - } - - 100% { - opacity: 0; - } -} +@import './keyframes/basic-fade.keyframes.less'; .tdFadeIn { - animation-name: tdFadeIn; + .tdFadeIn(); } .tdFadeOut { - animation-name: tdFadeOut; + .tdFadeOut(); } diff --git a/modules/drop.less b/modules/drop.less index 611be1c..7c9e348 100644 --- a/modules/drop.less +++ b/modules/drop.less @@ -1,69 +1,8 @@ -/* Drop In */ -@keyframes tdDropInLeft { - 0% { - opacity: 0; - } - 1% { - opacity: 1; - transform: rotate(2deg) translateY(-15px); - transform-origin: right bottom; - animation-timing-function: ease-in; - } - - 50% { - opacity: 1; - transform: rotate(0) translateY(0px); - transform-origin: right bottom; - animation-timing-function: ease-out; - } - - 75% { - transform: rotate(-0.5deg) translateY(0px); - transform-origin: left bottom; - animation-timing-function: @easeInCirc; - } - 100% { - opacity: 1; - transform: rotate(0) translateY(0px); - transform-origin: center bottom; - animation-timing-function: @easeOutCirc; - } -} - -@keyframes tdDropInRight { - 0% { - opacity: 0; - } - 1% { - opacity: 1; - transform: rotate(-2deg) translateY(-15px); - transform-origin: left bottom; - animation-timing-function: ease-in; - } - - 50% { - opacity: 1; - transform: rotate(0) translateY(0px); - transform-origin: left bottom; - animation-timing-function: ease-out; - } - - 75% { - transform: rotate(0.5deg) translateY(0px); - transform-origin: right bottom; - animation-timing-function: @easeInCirc; - } - 100% { - opacity: 1; - transform: rotate(0) translateY(0px); - transform-origin: center bottom; - animation-timing-function: @easeOutCirc; - } -} +@import './keyframes/drop.keyframes.less'; .tdDropInLeft { - animation-name: tdDropInLeft; + .tdDropInLeft(); } .tdDropInRight { - animation-name: tdDropInRight; + .tdDropInRight(); } \ No newline at end of file diff --git a/modules/fade.less b/modules/fade.less index 82e9267..ac60703 100644 --- a/modules/fade.less +++ b/modules/fade.less @@ -1,131 +1,27 @@ -/* Fading Entrances */ -@keyframes tdFadeInDown { - 0% { - opacity: 0; - transform: translateY(-10px); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 1; - transform: translateY(0); - } -} - -@keyframes tdFadeInLeft { - 0% { - opacity: 0; - transform: translateX(10px); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 1; - transform: translateX(0); - } -} - -@keyframes tdFadeInUp { - 0% { - opacity: 0; - transform: translateY(10px); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 1; - transform: translateY(0); - } -} - -@keyframes tdFadeInRight { - 0% { - opacity: 0; - transform: translateX(-10px); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 1; - transform: translateX(0); - } -} +@import './keyframes/fade.keyframes.less'; .tdFadeInDown { - animation-name: tdFadeInDown; + .tdFadeInDown(); } .tdFadeInLeft { - animation-name: tdFadeInLeft; + .tdFadeInLeft(); } .tdFadeInUp { - animation-name: tdFadeInUp; + .tdFadeInUp(); } .tdFadeInRight { - animation-name: tdFadeInRight; -} - -/* Fading Exits */ -@keyframes tdFadeOutUp { - 0% { - opacity: 1; - transform: translateY(0); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 0; - transform: translateY(-10px); - } -} - -@keyframes tdFadeOutRight { - 0% { - opacity: 1; - transform: translateX(0); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 0; - transform: translateX(10px); - } -} - -@keyframes tdFadeOutDown { - 0% { - opacity: 1; - transform: translateY(0); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 0; - transform: translateY(10px); - } -} - -@keyframes tdFadeOutLeft { - 0% { - opacity: 1; - transform: translateX(0); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 0; - transform: translateX(-10px); - } + .tdFadeInRight(); } .tdFadeOutUp { - animation-name: tdFadeOutUp; + .tdFadeOutUp(); } .tdFadeOutRight { - animation-name: tdFadeOutRight; + .tdFadeOutRight(); } .tdFadeOutDown { - animation-name: tdFadeOutDown; + .tdFadeOutDown(); } .tdFadeOutLeft { - animation-name: tdFadeOutLeft; + .tdFadeOutLeft(); } diff --git a/modules/hinge-flip.less b/modules/hinge-flip.less index b5f8424..8db4630 100644 --- a/modules/hinge-flip.less +++ b/modules/hinge-flip.less @@ -1,52 +1,9 @@ -/* Hinge Flip */ -@keyframes tdHingeFlipIn { - 0% { - opacity: 0; - transform: perspective(600px) rotateX(0deg); - transform-origin: center top; - animation-timing-function: @easeOutCirc; - } - - 50% { - transform: perspective(600px) rotateX(-10deg); - transform-origin: center top; - animation-timing-function: ease-in; - } - - 100% { - opacity: 1; - transform: perspective(600px) rotateX(0deg); - transform-origin: center top; - animation-timing-function: ease-out; - } -} +@import './keyframes/hinge-flip.keyframes.less'; .tdHingeFlipIn { - animation-name: tdHingeFlipIn; -} - -@keyframes tdHingeFlipOut { - 0% { - opacity: 1; - transform: perspective(600px) rotateX(0deg); - transform-origin: center top; - animation-timing-function: @easeOutCirc; - } - - 50% { - transform: perspective(600px) rotateX(-10deg); - transform-origin: center top; - animation-timing-function: ease-in; - } - - 100% { - opacity: 0; - transform: perspective(600px) rotateX(0deg); - transform-origin: center top; - animation-timing-function: ease-out; - } + .tdHingeFlipIn(); } .tdHingeFlipOut { - animation-name: tdHingeFlipOut; + .tdHingeFlipOut(); } diff --git a/modules/plop.less b/modules/plop.less index a5210c6..a936c2e 100644 --- a/modules/plop.less +++ b/modules/plop.less @@ -1,76 +1,12 @@ -/* Plop Entrances */ -@keyframes tdPlopIn { - 0% { - opacity: 0; - transform: scale(0.9,0.9); - } - 10% { - opacity: 1; - transform: scale(0.7,1.3); - } - 70% { - transform: scale(1.1,0.95); - } - 90% { - transform: scale(0.97,1.05); - } - 100% { - opacity: 1; - transform: scale(1); - } -} - -@keyframes tdPlopInDown { - 0% { - opacity: 0; - transform: scale(0.9,0.8); - transform-origin: center top; - } - 10% { - opacity: 1; - transform: scale(0.8,1.3); - transform-origin: center top; - } - 70% { - transform: scale(1,0.95); - transform-origin: center top; - } - 100% { - opacity: 1; - transform: scale(1); - transform-origin: center top; - } -} - -@keyframes tdPlopInUp { - 0% { - opacity: 0; - transform: scale(0.9,0.8); - transform-origin: center bottom; - } - 10% { - opacity: 1; - transform: scale(0.8,1.3); - transform-origin: center bottom; - } - 70% { - transform: scale(1,0.95); - transform-origin: center bottom; - } - 100% { - opacity: 1; - transform: scale(1); - transform-origin: center bottom; - } -} +@import './keyframes/plop.keyframes.less'; .tdPlopIn { - animation-name: tdPlopIn; + .tdPlopIn(); } .tdPlopInDown { - animation-name: tdPlopInDown; + .tdPlopInDown(); } .tdPlopInUp { - animation-name: tdPlopInUp; + .tdPlopInUp(); } diff --git a/modules/stamp.less b/modules/stamp.less index aaf33d9..090487b 100644 --- a/modules/stamp.less +++ b/modules/stamp.less @@ -1,54 +1,9 @@ -/* Stamp Entrances */ -@keyframes tdStampIn { - 0% { - opacity: 0; - transform: scale(1.3); - animation-timing-function: @easeInCirc; - } - 50% { - opacity: 1; - } - 70% { - opacity: 1; - transform: scale(1); - } - 90% { - opacity: 1; - transform: scale(1.03); - } - 100% { - opacity: 1; - transform: scale(1); - } -} - -@keyframes tdStampInSwing { - 0% { - opacity: 0; - transform: scale(1.3) rotate(-10deg); - animation-timing-function: @easeInCirc; - } - 50% { - opacity: 1; - } - 70% { - opacity: 1; - transform: scale(1); - } - 90% { - opacity: 1; - transform: scale(1.03); - } - 100% { - opacity: 1; - transform: scale(1) rotate(0); - } -} +@import './keyframes/stamp.keyframes.less'; .tdStampIn { - animation-name: tdStampIn; + .tdStampIn(); } .tdStampInSwing { - animation-name: tdStampInSwing; + .tdStampInSwing(); } diff --git a/modules/swing.less b/modules/swing.less index 19baa5b..4069b8e 100644 --- a/modules/swing.less +++ b/modules/swing.less @@ -1,44 +1,8 @@ -/* Swing */ -@keyframes tdSwingIn { - 0% { - opacity: 0; - transform: rotate(-10deg) scale(0.85); - animation-timing-function: @easeOutCirc; - } - - 70% { - opacity: 1; - transform: rotate(1deg); - animation-timing-function: ease; - } - 100% { - opacity: 1; - transform: rotate(0deg) scale(1); - animation-timing-function: ease; - } -} - -@keyframes tdSwingOut { - 0% { - opacity: 1; - transform: rotate(0deg) scale(1); - animation-timing-function: @easeOutCirc; - } - 30% { - opacity: 1; - transform: rotate(-1deg); - animation-timing-function: ease; - } - 100% { - opacity: 0; - transform: rotate(10deg) scale(0.85); - animation-timing-function: ease; - } -} +@import './keyframes/swing.keyframes.less'; .tdSwingIn { - animation-name: tdSwingIn; + .tdSwingIn(); } .tdSwingOut { - animation-name: tdSwingOut; + .tdSwingOut(); } diff --git a/modules/zoom.less b/modules/zoom.less index 3eb156e..18ad058 100644 --- a/modules/zoom.less +++ b/modules/zoom.less @@ -1,152 +1,28 @@ -/* Expand Entrances */ -@keyframes tdExpandIn { - 0% { - opacity: 0; - transform: scale(0.85); - animation-timing-function: @easeOutCirc; - } - - 100% { - opacity: 1; - transform: scale(1); - } -} - -@keyframes tdExpandInBounce { - 0% { - opacity: 0; - transform: scale(0.85); - animation-timing-function: @easeOutCirc; - } - 70% { - transform: scale(1.03); - animation-timing-function: ease; - } - 100% { - opacity: 1; - transform: scale(1); - animation-timing-function: ease; - } -} +@import './keyframes/zoom.expand.keyframes.less'; +@import './keyframes/zoom.shrink.keyframes.less'; .tdExpandIn { - animation-name: tdExpandIn; + .tdExpandIn(); } .tdExpandInBounce { - animation-name: tdExpandInBounce; -} - -/* Expand Exits */ -@keyframes tdExpandOut { - 0% { - opacity: 1; - transform: scale(1); - animation-timing-function: @easeOutCirc; - } - 100% { - opacity: 0; - transform: scale(1.2); - } + .tdExpandInBounce(); } - -@keyframes tdExpandOutBounce { - 0% { - opacity: 1; - transform: scale(1); - animation-timing-function: @easeOutCirc; - } - 30% { - opacity: 1; - transform: scale(0.95); - animation-timing-function: ease; - } - 100% { - opacity: 0; - transform: scale(1.2); - } -} - .tdExpandOut { - animation-name: tdExpandOut; + .tdExpandOut(); } .tdExpandOutBounce { - animation-name: tdExpandOutBounce; -} - - - - -/* Shrink Entrances */ -@keyframes tdShrinkIn { - 0% { - opacity: 0; - transform: scale(1.2); - animation-timing-function: @easeOutCirc; - } - 100% { - opacity: 1; - transform: scale(1); - } -} - -@keyframes tdShrinkInBounce { - 0% { - opacity: 0; - transform: scale(1.2); - animation-timing-function: @easeOutCirc; - } - 70% { - transform: scale(0.95); - animation-timing-function: ease; - } - 100% { - opacity: 1; - transform: scale(1); - } + .tdExpandOutBounce(); } .tdShrinkIn { - animation-name: tdShrinkIn; + .tdShrinkIn(); } .tdShrinkInBounce { - animation-name: tdShrinkInBounce; + .tdShrinkInBounce(); } - -/* Shrink Exits */ -@keyframes tdShrinkOut { - 0% { - opacity: 1; - transform: scale(1); - animation-timing-function: @easeOutCirc; - } - 100% { - opacity: 0; - transform: scale(0.85); - animation-timing-function: ease; - } -} - -@keyframes tdShrinkOutBounce { - 0% { - opacity: 1; - transform: scale(1); - animation-timing-function: @easeOutCirc; - } - 30% { - opacity: 1; - transform: scale(1.03); - animation-timing-function: ease; - } - 100% { - opacity: 0; - transform: scale(0.85); - animation-timing-function: ease; - } -} - .tdShrinkOut { - animation-name: tdShrinkOut; + .tdShrinkOut(); } .tdShrinkOutBounce { - animation-name: tdShrinkOutBounce; + .tdShrinkOutBounce(); } diff --git a/tuesday.less b/tuesday.less index 629550b..8355f33 100644 --- a/tuesday.less +++ b/tuesday.less @@ -3,15 +3,11 @@ /* ==== A quirky CSS Animation Library ==== */ /* ======================================== */ -@easeOutCirc: cubic-bezier(0, 0.590, 0.375, 1); -@easeInCirc: cubic-bezier(0.590, 0, 1, 0.375); +@import (reference) 'imports/_easing.less'; +@import (reference) 'imports/_mixins.less'; .animated { - animation-duration: 0.3s; - animation-fill-mode: both; -} -.animated.infinite { - animation-iteration-count: infinite; + .animated(); } // load animation modules