1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- export default {
- data: {
- animMaskData: [],
- animContentData: [],
- },
- animOp: {
- createMaskShowAnim() {
- const animation = my.createAnimation({
- duration: 200,
- timingFunction: 'cubic-bezier(.55, 0, .55, .2)',
- });
- this.maskAnim = animation;
-
- animation.opacity(1).step();
- this.setData({
- animMaskData: animation.export(),
- });
- },
- createMaskHideAnim() {
- this.maskAnim.opacity(0).step();
- this.setData({
- animMaskData: this.maskAnim.export(),
- });
- },
- createContentShowAnim() {
- const animation = my.createAnimation({
- duration: 200,
- timingFunction: 'cubic-bezier(.55, 0, .55, .2)',
- });
- this.contentAnim = animation;
- animation.translateY(0).step();
- this.setData({
- animContentData: animation.export(),
- });
- },
- createContentHideAnim() {
- this.contentAnim.translateY('100%').step();
- this.setData({
- animContentData: this.contentAnim.export(),
- });
- },
- },
- };
|