Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(message): add message animation #1689

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions style/web/components/message/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,59 @@
}
}
}

// Message动画
@keyframes tMessageAnimation {
0% {
opacity: 0;
transform: translateY(-50px);
}

100% {
opacity: 1;
}
}

.animation-enter {
animation-duration: @message-anim-duration;
animation-fill-mode: both;
animation-timing-function: ease;
animation-play-state: paused;
}

.animation-exit {
animation-duration: @message-anim-duration;
animation-fill-mode: both;
animation-timing-function: ease;
animation-play-state: paused;
animation-direction: reverse;
}

.animation-active {
animation-play-state: running;
animation-fill-mode: both;
}

&-enter,
&-enter-from,
&-appear {
.animation-enter;
}

&-exit {
.animation-exit;
}

&-enter-active,
&-appear-active {
animation-name: tMessageIn;
.animation-active;
}

&-exit-active {
animation-name: tMessageIn;
.animation-active;
}
}

.@{prefix}-message__list {
Expand Down
2 changes: 2 additions & 0 deletions style/web/components/message/_var.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@

// Angular Icon 组件会多一层容器,这层容器用 [data-t-icon] 命中
@msg-icon-selector: ~"> .t-icon, > [data-@{prefix}-icon] > .t-icon, .@{prefix}-loading";

@message-anim-duration: @anim-duration-base;
Loading