<div className={style.invite}>
<img src={inviteIcon} />
<div className={style.invite_content_box}>
<div className={`${style.invite_content_box_list}`}>
<div className={`${style.item} ${style.item_1}`} onClick={handleJumpInvite}>
邀请好友注册,享 <span>50</span> 条消息数
</div>
<div className={`${style.item} ${style.item_2}`}>新注册用户,免费体验三天</div>
<div className={`${style.item} ${style.item_3}`} onClick={handleJumpInvite}>
邀请好友注册,享 <span>50</span> 条消息数
</div>
</div>
</div>
</div>
.invite {
background: rgba(236, 7, 135, 0.30);
height: 32px;
line-height: 32px;
overflow: hidden;
margin-top: 12px;
border-radius: 16px;
> img {
margin-right: 4px;
margin-left: 8px;
}
.invite_content_box {
margin-top: 48px;
width: 208px;
.invite_content_box_list {
height: 72px;
position: relative;
animation: moreContentScroll 6s ease-out infinite;
animation-delay: 2s;
.item {
position: absolute;
width: 100%;
height: 24px;
line-height: 24px;
color: #FFF;
font-size: 14px;
font-style: normal;
font-weight: 400;
}
.item_1 {
top: 0;
}
.item_2 {
top: 24px;
}
.item_3 {
top: 48px;
}
}
}
}
@keyframes moreContentScroll{
0% {
transform: translateY(0);
}
5% {
transform: translateY(-24px);
}
50% {
transform: translateY(-24px);
}
55% {
transform: translateY(-48px);
}
100% {
transform: translateY(-48px);
}
}
参考如下网址