css实现一个鼠标悬浮翻书动画效果代码
代码语言:html
所属分类:悬停
代码描述:css实现一个鼠标悬浮翻书动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8" />
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,600&subset=latin,latin-ext);
.container > header,
.codrops-top {
font-family: 'Lato', Arial, sans-serif;
color: #34495e;
}
.container > header {
margin: 0 auto;
padding: 2em;
text-align: center;
background: #34495e;
color: #fff;
}
.container > header h1 {
font-size: 2.625em;
line-height: 1.3;
margin: 0;
font-weight: 300;
}
.container > header span {
display: block;
font-size: 60%;
color: #16a085;
padding: 0 0 0.6em 0.1em;
}
/* To Navigation Style */
.codrops-top {
background: #253749;
text-transform: uppercase;
width: 100%;
font-size: 0.69em;
line-height: 2.2;
}
.codrops-top a {
text-decoration: none;
padding: 0 1em;
letter-spacing: 0.1em;
color: #fff;
display: inline-block;
}
.codrops-top a:hover {
background: rgba(255,255,255,0.1);
color: #fff;
}
.codrops-top span.right {
float: right;
}
.codrops-top span.right a {
float: left;
display: block;
}
.codrops-icon:before {
font-family: 'codropsicons';
margin: 0 4px;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.codrops-icon-drop:before {
content: "\e001";
}
.codrops-icon-prev:before {
content: "\e004";
}
/* Demo Buttons Style */
.codrops-demos {
padding-top: 1em;
font-size: 0.9em;
}
.codrops-demos a {
text-decoration: none;
outline: none;
display: inline-block;
margin: 0.5em;
font-size: 1.1em;
padding: 0.7em 1.1em;
border: 3px solid #16a085;
color: #16a085;
font-weight: 700;
}
.codrops-demos a:hover,
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover {
border-color: #fff;
color: #fff;
}
p.note {
font-size: 1.1em;
text-align: center;
padding: 40px 10px 100px;
max-width: 700px;
margin: 0 auto;
line-height: 1.4;
}
@media screen and (max-width: 25em) {
.codrops-icon span {
display: none;
}
}
/*
A. Mini Reset
*/
*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
* {
margin: 0;
padding: 0;
}
::before,
::after {
content: "";
}
html,
body {
height: 100%;
-webkit-font-smoothing: subpixel-antialiased;
}
html {
font-size: 100%;
}
body {
background: #ecf0f1;
color: #34495e;
font-family: 'Lato', 'Arial', sans-serif;
font-weight: 400;
line-height: 1.2;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
a {
color: #2c3e50;
text-decoration: none;
}
.btn {
display: inline-block;
text-transform: uppercase;
border: 2px solid #2c3e50;
margin-top: 100px;
font-size: 0.7em;
font-weight: 700;
padding: 0.1em 0.4em;
text-align: center;
-webkit-transition: color 0.3s, border-color 0.3s;
-moz-transition: color 0.3s, border-color 0.3s;
transition: color 0.3s, border-color 0.3s;
}
.btn:hover {
border-color: #16a085;
color: #16a085;
}
/* basic grid, only for this demo */
.align {
clear: both;
margin: 90px auto 20px;
width: 100%;
max-width: 1170px;
text-align: center;
}
.align > li {
width: 500px;
min-height: 300px;
display: inline-block;
margin: 30px 20px 30px 30px;
padding: 0 0 0 60px;
vertical-align: top;
}
/* ///////////////////////////////////////////////////
HARDCOVER
Table of Contents
1. container
2. background & color
3. opening cover, back cover and pages
4. position, transform y transition
5. events
6. Bonus
- Cover design
- Ribbon
- Figcaption
7. mini-reset
/////////////////////////////////////////////////////*/
/*
1. container
*/
.book {
position: relative;
width: 160px;
height: 220px;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
perspective: 1000px;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
}
/*
2. background & color
*/
/* HARDCOVER FRONT */
.hardcover_front li:first-child {
background-color: #eee;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
}
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0