h5滚动时侧滑出现_HTML5 页面滚动时文本滑入动画

CSS

语言:

CSSSCSS

确定

* {

-moz-box-sizing: border-box;

-webkit-box-sizing: border-box;

box-sizing: border-box;

}

body{margin: 0;}

section {

background: #eee;

padding: 40vh 10%;

overflow: hidden;

}

section p {

color: rgba(0, 0, 0, 0.5) !important;

font-weight: 100;

font-size: 36pt;

}

section.one {

background-color: #ffe62b;

}

section.two {

background-color: #ffcf00;

}

section.three {

background-color: #ffb700;

}

section.four {

background-color: #ff9e00;

}

section.five {

background-color: #ff7a00;

}

.module {

position: relative;

float: left;

margin: 5%;

opacity: 0;

}

.module:nth-child(even) {

margin-right: 0;

}

.come-in {

transform: translateX(-150px);

animation: come-in 0.5s cubic-bezier(0, -0.01, 0, 0.99) forwards;

}

.come-in:nth-child(odd) {

animation-delay: 0.1s;

animation-duration: 0.75s;

}

.leave {

transform: translateX(150px);

animation: leave 0.5s cubic-bezier(0, -0.01, 0, 0.99) forwards;

}

.leave:nth-child(odd) {

animation-delay: 0.1s;

animation-duration: 0.75s;

}

.already-visible {

transform: translateY(0);

animation: none;

opacity: 1;

}

@keyframes come-in {

to {

transform: translateX(0);

opacity: 1;

}

}

@keyframes leave {

to {

transform: translateX(-150);

opacity: 0;

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值