UNPKG

1.06 kBJavaScriptView Raw
1import Animations, {scale3d} from '../../mixin/internal/slideshow-animations';
2import {assign, css} from 'uikit-util';
3
4export default assign({}, Animations, {
5
6 fade: {
7
8 show() {
9 return [
10 {opacity: 0},
11 {opacity: 1}
12 ];
13 },
14
15 percent(current) {
16 return 1 - css(current, 'opacity');
17 },
18
19 translate(percent) {
20 return [
21 {opacity: 1 - percent},
22 {opacity: percent}
23 ];
24 }
25
26 },
27
28 scale: {
29
30 show() {
31 return [
32 {opacity: 0, transform: scale3d(1 - .2)},
33 {opacity: 1, transform: scale3d(1)}
34 ];
35 },
36
37 percent(current) {
38 return 1 - css(current, 'opacity');
39 },
40
41 translate(percent) {
42 return [
43 {opacity: 1 - percent, transform: scale3d(1 - .2 * percent)},
44 {opacity: percent, transform: scale3d(1 - .2 + .2 * percent)}
45 ];
46 }
47
48 }
49
50});