用bootstrap+css动画+html搭建响应式网页
index.html部分
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>中央厨房</title>
<!--
initial-scale=1.0//原始比例1.0
maxinum-scale=1.0//用户可以缩放的最大比例是1.0
user-scalable=no//用户是否能够缩放
-->
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<link rel="stylesheet" href="css/mystyle.css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<script src="js/jquery-2.1.1.min.js"></script>
</head>
<body>
<div id="pageContain">
<div class="page page1 current">
<div class="container">
<div class="row login">
<div class="col-xs-12">
<img src="img/logo_03.png" alt="" class="img1 img-responsive " style="margin-bottom:5%;" />
<img src="img/select1_tit_03.png" alt="" class="img2 img-responsive" style="margin-bottom:50px;" />
<form action="" class="form-horizontal img3">
<div class="form-group">
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="账号" />
</div>
</div>
<div class="form-group">
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="密码" />
</div>
</div>
<div class="form-group">
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="验证码" />
</div>
</div>
<div class="checkbox" style="margin-bottom:20px;">
<div class="col-sm-6">
<label style="color:#fff">
<input type="checkbox" />记住我
</label>
</div>
</div>
<div class="col-sm-6" style="padding:0">
<button type="submit" class="btn btn-info btn-block">立即登录</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="page page2">
<img src="img/bg2_1_02.png" alt="" class="img-responsive img5"/>
<img src="img/bg2_2_02.png" alt="" class="img-responsive img5"/>
<div class="container">
<img src="img/text1_03.png" alt="" class="img-responsive img4" />
<img src="img/img10_03.png" alt="" class="img-responsive img6" />
<img src="img/img2_03.png" alt="" class="img-responsive img7" />
</div>
</div>
<div class="page page3">
<div class="container">
<div class="row">
<img src="img/text2_07.png" alt="" class="img-responsive img11 col-md-4 col-sm-6 col-xs-12 text-left" />
</div>
<div class="row" >
<div class="col-xs-4">
<img src="img/image1_03.jpg" alt="" class=" img-responsive img8" />
</div>
<div class="col-xs-4">
<img src="img/image2_03.jpg" alt="" class=" img-responsive img9" />
</div>
<div class="col-xs-4">
<img src="img/image3_03.jpg" alt="" class="img-responsive img10" />
</div>
</div>
</div>
</div>
<div class="page page4">
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-4">
<img src="img/text8_03.png" alt="" class="img-responsive img12"/>
</div>
</div>
<img src="img/img6_03.jpg" alt="" class="img-responsive img6"/>
<img src="img/img7_03.jpg" alt="" class="img-responsive img13"/>
</div>
</div>
<div class="page page5">
<div class="container">
<div class="row" style="margin-top: 10%">
<div class="col-sm-6">
<img src="img/text4_11.png" alt="" class="img-responsive img21"/>
</div>
<div class="col-sm-6">
<img src="img/img8_03.jpg" alt="" class="img-responsive img22"/>
</div>
</div>
</div>
</div>
</div>
<ul id="navbar">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<script src="js/fullPage.min.js"></script>
<script>
var runPage;
runPage = new FullPage({
id: 'pageContain',
slideTime: 800,
effect: {
transform: {
translate: 'Y'
},
opacity: [0, 1] // [起始透明度, 结束时透明度];
},
mode: 'wheel, touch, nav:navbar', // 转换模式,表示 '滚轮,触摸,导航条:导航条id';
easing: 'ease' //规定慢速开始,然后变快,然后慢速结束的过渡效果
});
var bh = $("body").height();
$(".container").css("height", "" + bh + "");
</script>
</body>
</html>
</script>
</body>
</html>
mystyle.css部分
html {
overflow: hidden;
}
#pageContain {
overflow: hidden;
}
.page {
display: none;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
}
.contain {
width: 100%;
height: 100%;
display: none;
position: relative;
z-index: 0;
}
.current .contain, .slide .contain {
display: block;
}
.current {
display: block;
z-index: 1;
}
.slide {
display: block;
z-index: 2;
}
.swipe {
display: block;
z-index: 3;
transition-duration: 0ms !important;
-webkit-transition-duration: 0ms !important;
}
.page1 {
background: url(../images/bg_01_01.jpg) no-repeat;
background-size: cover;
}
.page2 {
background: #fff;
position: relative;
}
.page3 {
background: #fff;
}
.page4 {
background: #fff;
}
.page5 {
background: #fff;
}
#navBar {
z-index: 3;
position: absolute;
top: 34%;
right: 3%;
list-style: none;
}
#navBar .active {
background: url(../images/dot.png) no-repeat bottom;
width: 21px;
height: 21px;
}
#navBar li {
cursor: pointer;
margin-bottom: 10px;
width: 21px;
height: 21px;
background: url(../images/dot.png) 5px 5px no-repeat
}
.container{
position: relative;
min-height: 650px;
}
.login{
margin-top: 2%;
}
.form-group input{
font-size: 18px;
line-height: 50px;
height: 50px;
}
.img1{
animation: .6s box1 linear backwards;
}
.img2{
animation: .6s box1 linear backwards;
animation-delay: 0.6s;
-webkit-animation-delay: 0.6s;
}
.img3{
animation: .8s box1 linear backwards;
animation-delay: 1.2s;
-webkit-animation-delay: 1.2s;
}
@keyframes box1 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img4{
animation:2s box4 linear backwards;
position: absolute;
top:5%;
right: 0;
z-index: 10;
}
@keyframes box4 {
from{
opacity: 0;
right: -10%;
}
to{
opacity: 1;
right: 0%;
}
}
.img5{
animation:2s box5 linear backwards;
position: absolute;
bottom:20%;
left: 0;
z-index: 1;
-webkit-transform:scaleY(1);
-moz-transform:scaleY(1);
-o-transform:scaleY(1);
transform:scaleY(1);
}
@keyframes box5 {
from{
opacity: 0;
-webkit-transform:scaleY(0);
-moz-transform:scaleY(0);
-o-transform:scaleY(0);
transform:scaleY(0);
}
to{
opacity: 1;
-webkit-transform:scaleY(1);
-moz-transform:scaleY(1);
-o-transform:scaleY(1);
transform:scaleY(1);
}
}
.img6 {
animation: 1s box6 linear backwards;
width: 50%;
position: absolute;
bottom: 15%;
left:10%;
z-index: 5;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.img6:hover{
-webkit-transform:scale(1.1,1.1);
-moz-transform:scale(1.1,1.1);
-o-transform:scale(1.1,1.1);
transform:scale(1.1,1.1);
z-index: 9;
}
@keyframes box6 {
from{
opacity: 0;
left: -5%;
}
to{
opacity: 1;
left: 10%;
}
}
.img7 {
animation: 1s box7 linear backwards;
width: 50%;
position: absolute;
bottom: 15%;
right:10%;
z-index:8;
animation-delay: 0.8s;
-webkit-animation-delay: 0.8s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.img13{
width: 40%;
animation: 1s box7 linear backwards;
position: absolute;
bottom:15%;
right:10%;
z-index:8;
animation-delay: 0.8s;
-webkit-animation-delay: 0.8s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.img7:hover,.img13:hover{
-webkit-transform:scale(1.1,1.1);
-moz-transform:scale(1.1,1.1);
-o-transform:scale(1.1,1.1);
transform:scale(1.1,1.1);
}
@keyframes box7 {
from{
opacity: 0;
right: -5%;
}
to{
opacity: 1;
right: 10%;
}
}
.img8{
animation: 0.5s box8 linear backwards;
width: 80%;
animation-delay: 1.5s;
-webkit-animation-delay: 1.5s;
}
@keyframes box8 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img9{
animation: 0.5s box9 linear backwards;
width: 80%;
animation-delay: 1s;
-webkit-animation-delay: 1s;
}
@keyframes box9 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img10{
width: 80%;
animation: 0.5s box10 linear backwards;
}
@keyframes box10 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img11,.img12{
animation: 1.5s box11 linear backwards;
}
@keyframes box11 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img21{
transform: translateX(0);
animation: 1s box21 linear backwards;
width: 80%;
}
@keyframes box21 {
from{
opacity: 0;
transform: translateX(100%);
}
to{
opacity: 1;
transform: translateX(0);
}
}
.img22{
transform: translateX(0);
animation: 1s box22 linear backwards;
width: 80%;
}
@keyframes box22 {
from{
opacity: 0;
transform: translateX(-100%);
}
to{
opacity: 1;
transform: translateX(0);
}
}html {
overflow: hidden;
}
#pageContain {
overflow: hidden;
}
.page {
display: none;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
}
.contain {
width: 100%;
height: 100%;
display: none;
position: relative;
z-index: 0;
}
.current .contain, .slide .contain {
display: block;
}
.current {
display: block;
z-index: 1;
}
.slide {
display: block;
z-index: 2;
}
.swipe {
display: block;
z-index: 3;
transition-duration: 0ms !important;
-webkit-transition-duration: 0ms !important;
}
.page1 {
background:url(../img/bg_01_01.jpg) no-repeat;
background-size: cover;
}
.page2 {
background: #fff;
position: relative;
}
.page3 {
background: #fff;
}
.page4 {
background: #fff;
}
.page5 {
background: #fff;
}
.container{
position: relative;
min-height: 650px;
}
.login{
margin-top: 2%;
}
.form-group input{
font-size: 18px;
line-height: 50px;
height: 50px;
}
.img1{
animation: .6s box1 linear backwards;
}
.img2{
animation: .6s box1 linear backwards;
animation-delay: 0.6s;
-webkit-animation-delay: 0.6s;
}
.img3{
animation: .8s box1 linear backwards;
animation-delay: 1.2s;
-webkit-animation-delay: 1.2s;
}
@keyframes box1 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img4{
animation:2s box4 linear backwards;
position: absolute;
top:5%;
right: 0;
z-index: 10;
}
@keyframes box4 {
from{
opacity: 0;
right: -10%;
}
to{
opacity: 1;
right: 0%;
}
}
.img5{
animation:2s box5 linear backwards;
position: absolute;
bottom:20%;
left: 0;
z-index: 1;
-webkit-transform:scaleY(1);
-moz-transform:scaleY(1);
-o-transform:scaleY(1);
transform:scaleY(1);
}
@keyframes box5 {
from{
opacity: 0;
-webkit-transform:scaleY(0);
-moz-transform:scaleY(0);
-o-transform:scaleY(0);
transform:scaleY(0);
}
to{
opacity: 1;
-webkit-transform:scaleY(1);
-moz-transform:scaleY(1);
-o-transform:scaleY(1);
transform:scaleY(1);
}
}
.img6 {
animation: 1s box6 linear backwards;
width: 50%;
position: absolute;
bottom: 15%;
left:10%;
z-index: 5;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.img6:hover{
-webkit-transform:scale(1.1,1.1);
-moz-transform:scale(1.1,1.1);
-o-transform:scale(1.1,1.1);
transform:scale(1.1,1.1);
z-index: 9;
}
@keyframes box6 {
from{
opacity: 0;
left: -5%;
}
to{
opacity: 1;
left: 10%;
}
}
.img7 {
animation: 1s box7 linear backwards;
width: 50%;
position: absolute;
bottom: 15%;
right:10%;
z-index:8;
animation-delay: 0.8s;
-webkit-animation-delay: 0.8s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.img13{
width: 40%;
animation: 1s box7 linear backwards;
position: absolute;
bottom:15%;
right:10%;
z-index:8;
animation-delay: 0.8s;
-webkit-animation-delay: 0.8s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.img7:hover,.img13:hover{
-webkit-transform:scale(1.1,1.1);
-moz-transform:scale(1.1,1.1);
-o-transform:scale(1.1,1.1);
transform:scale(1.1,1.1);
}
@keyframes box7 {
from{
opacity: 0;
right: -5%;
}
to{
opacity: 1;
right: 10%;
}
}
.img8{
animation: 0.5s box8 linear backwards;
width: 80%;
animation-delay: 1.5s;
-webkit-animation-delay: 1.5s;
}
@keyframes box8 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img9{
animation: 0.5s box9 linear backwards;
width: 80%;
animation-delay: 1s;
-webkit-animation-delay: 1s;
}
@keyframes box9 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img10{
width: 80%;
animation: 0.5s box10 linear backwards;
}
@keyframes box10 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img11,.img12{
animation: 1.5s box11 linear backwards;
}
@keyframes box11 {
from{
opacity: 0;
}
to{
opacity: 1;
}
}
.img21{
transform: translateX(0);
animation: 1s box21 linear backwards;
width: 80%;
}
@keyframes box21 {
from{
opacity: 0;
transform: translateX(100%);
}
to{
opacity: 1;
transform: translateX(0);
}
}
.img22{
transform: translateX(0);
animation: 1s box22 linear backwards;
width: 80%;
}
@keyframes box22 {
from{
opacity: 0;
transform: translateX(-100%);
}
to{
opacity: 1;
transform: translateX(0);
}
}
#navbar {
z-index: 3;
position: absolute;
top: 34%;
right: 3%;
list-style: none;
}
#navbar li {
cursor: pointer;
margin-bottom: 10px;
width: 21px;
height: 21px;
background: url(../images/dot.png) 5px 5px no-repeat
}
#navbar .active {
background: url(../images/dot.png) no-repeat bottom;
width: 21px;
height: 21px;
}