html文本滚轮显示,CSS3 滚动型文本显示效果

CSS

语言:

CSSSCSS

确定

@import "https://fonts.googleapis.com/css?family=Baloo+Paaji";

html,

body {

height: 100%;

}

body {

font-family: 'Baloo Paaji', cursive;

background: #1e90ff;

display: flex;

justify-content: center;

align-items: center;

}

.container {

width: 400px;

height: 220px;

position: relative;

}

h1,

h2 {

font-size: 75px;

text-transform: uppercase;

margin:0;

}

h1 span,

h2 span {

width: 100%;

float: left;

color: #ffffff;

-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);

clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);

transform: translateY(-50px);

opacity: 0;

animation-name: titleAnimation;

animation-timing-function: ease;

animation-duration: 3s;

}

h1 span {

animation-delay: 0.6s;

-webkit-animation-fill-mode: forwards;

}

h1 span:first-child {

animation-delay: 0.7s;

}

h1 span:last-child {

color: #ffe221;

animation-delay: 0.5s;

}

h2 {

top: 0;

position: absolute;

}

h2 span {

animation-delay: 4.1s;

-webkit-animation-fill-mode: forwards;

}

h2 span:first-child {

animation-delay: 4.2s;

}

h2 span:last-child {

color: #ffe221;

animation-delay: 4s;

}

.usechrome {

font-size: 10px;

color: #fff;

font-family: helvetica, arial;

position: absolute;

bottom: 20px;

width: 100%;

text-align: center;

left: 0;

}

@keyframes titleAnimation {

0% {

transform: translateY(-50px);

opacity: 0;

-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);

clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);

}

20% {

transform: translateY(0);

opacity: 1;

-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 30%);

clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 30%);

}

80% {

transform: translateY(0);

opacity: 1;

-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 30%);

clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 30%);

}

100% {

transform: translateY(50px);

opacity: 0;

-webkit-clip-path: polygon(100% 0, 100% -30%, 0 100%, 0 100%);

clip-path: polygon(100% 0, 100% -30%, 0 100%, 0 100%);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值