52 lines
761 B
JavaScript

import Page from '../../common/page';
Page({
data: {
show: false,
name: 'fade'
},
onClickFade() {
this.trigger('fade');
},
onClickFadeUp() {
this.trigger('fade-up');
},
onClickFadeDown() {
this.trigger('fade-down');
},
onClickFadeLeft() {
this.trigger('fade-left');
},
onClickFadeRight() {
this.trigger('fade-right');
},
onClickSlideUp() {
this.trigger('slide-up');
},
onClickSlideDown() {
this.trigger('slide-down');
},
onClickSlideLeft() {
this.trigger('slide-left');
},
onClickSlideRight() {
this.trigger('slide-right');
},
trigger(name) {
this.setData({ name, show: true });
setTimeout(() => {
this.setData({ show: false });
}, 500);
}
});