(#36) Add popups

This commit is contained in:
计算机202-于梓漪 2022-01-21 20:11:11 +08:00
parent df4229bf2f
commit 49851d4a57
2 changed files with 61 additions and 5 deletions

View File

@ -12,4 +12,38 @@ view.popups {
background-color: $theme-color-light-layout;
border-radius: 15px;
z-index: 2;
}
view.popups.block {
display: block;
}
view.popups.none {
display: none;
}
view.popups.show {
animation-duration: 0.5s;
animation-name: show;
}
view.popups.hide {
animation-duration: 0.5s;
animation-name: hide;
}
@keyframes show{
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes hide{
from {
opacity: 1;
}
to {
opacity: 0;
}
}

View File

@ -2,28 +2,50 @@ import { Modular, Manager } from "../../core/Module";
class Popups<M extends Manager> extends Modular<M> {
/**
*
*/
public static readonly animateTime: number = 100;
public data? = {
/**
*
*/
isShow: false
};
display:false,
private disappearTimer?: number;
/**
*
*/
isShow:false
};
disappearTimer: number | undefined;
/**
*
*/
public showPopups() {
this.setData({ isShow: true });
this.setData({
isShow:true,
display:true
});
}
/**
*
*/
public hidePopups() {
this.setData({ isShow: false });
this.setData({
isShow:false
});
this.disappearTimer = setTimeout(() => {
this.setData({
display: false
});
}, Popups.animateTime);
}
public override onLoad() {