css实现可爱面包烹饪面包动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现可爱面包烹饪面包动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css?family=Amatic+SC");
.footer {
bottom: 0;
color: white;
top: 35rem;
font-size: 2rem;
}
.footer .title {
font-family: 'Amatic SC';
}
.footer .sub {
display: flex;
justify-content: space-around;
font-size: 1rem;
font-family: 'Amatic SC';
}
.footer .sub a {
color: #f1c3e1;
text-decoration: none;
}
.footer .sub a:hover {
color: white;
}
body {
width: 99%;
height: 36rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #222;
}
.container {
display: flex;
justify-content: center;
align-items: center;
margin: auto;
top: 0;
bottom: 0;
width: 32rem;
background-color: #7bb4da;
border-radius: 32rem;
overflow: hidden;
border: 5px solid white;
height: 32rem;
transform: scale(0.7);
-webkit-transform: scale(0.7);
-moz-transform: scale(0.7);
}
.bread__base {
width: 12.4rem;
height: 13.5rem;
position: absolute;
background-color: #ffda96;
z-index: 10;
left: 14.3rem;
top: 8.2rem;
border-radius: 6rem 6rem 2rem 2rem;
border: 6px solid black;
transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
}
.bread__shadow {
position: absolute;
width: 13.7rem;
height: 14.6rem;
background-color: #d3885c;
z-index: 9;
left: 14.6rem;
top: 7.3rem;
border: 5px solid black;
border-radius: 7rem 9rem 4rem 10rem;
transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
}
.bread__bit--first {
position: absolute;
width: 2.5rem;
height: 2.6rem;
background-color: #e0a667;
z-index: 15;
top: 6.6rem;
left: 22.5rem;
border-radius: 2rem;
box-shadow: -3px 4px black;
}
.bread__bit--first:after {
content: '';
position: absolute;
width: 2.4rem;
height: 2.2rem;
background-color: #e0a667;
z-index: 18;
top: 2.1rem;
left: 1.1rem;
border-radius: 2rem;
box-shadow: -5px 5px black;
}
.bread__bit--first:before {
content: '';
position: absolute;
width: 1.6rem;
height: 1.4rem;
background-color: #e0a667;
z-index: 18;
top: 3.9rem;
left: 2.7rem;
border-radius: 2rem;
box-shadow: -3px 4px black;
}
.bread__bit--second {
position: absolute;
width: 2.5rem;
height: 2.6rem;
background-color: #e0a667;
z-index: 15;
top: 10.9rem;
left: 26.2rem;
border-radius: 2rem;
box-shadow: -1px 4px black;
}
.bread__bit--third {
position: absolute;
width: 3.2rem;
height: 2.9rem;
background-color: #7bb4da;
z-index: 15;
top: 5.6rem;
left: 22.5rem;
border-radius: 2rem;
box-shadow: 1px 5px black;
}
.bread__bit--third:after {
content: '';
position: absolute;
width: 2.5rem;
height: 2.6rem;
background-color: #7bb4da;
z-index: 18;
top: 2rem;
left: 1.8rem;
border-radius: 2rem;
box-shadow: -2px 5px black;
}
.bread__bit--third:before {
content: '';
position: absolute;
width: 1.6rem;
height: 1.4rem;
background-color: #7bb4da;
z-index: 18;
top: 4.2rem;
left: 3.6rem;
border-radius: 2rem;
box-shadow: -3px 4px black;
}
.bread__bit--aux {
position: absolute;
width: 3.2rem;
height: 2.9rem;
background-color: #7bb4da;
z-index: 15;
top: 10rem;
left: 26.5rem;
border-radius: 2rem;
box-shadow: -2px 6px black;
}
.bread__bit--aux:after {
content: '';
width: 9rem;
height: 3rem;
background-color: #7bb4da;
position: absolute;
left: -3.8rem;
top: -2.4rem;
transform: rotate(49deg);
-webkit-transform: rotate(49deg);
-moz-transform: rotate(49deg);
}
.bread__eyes--open:after {
content: '';
background-color: #ffda96;
position: absolute;
width: 7.9rem;
height: 0.8rem;
z-index: 30;
top: 15.1rem;
}
.bread__eyes--open--l {
position: absolute;
width: 1.3rem;
height: 1.3rem;
z-index: 25;
background-color: black;
border-radius: 5rem;
left: 16.9rem;
top: 16rem;
animation: 8s .3s eyesOpen infinite;
}
.bread__eyes--open--l:after {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #ffda96;
content: '';
position: absolute;
left: 0.8rem;
}
.bread__eyes--open--l:before {
content: '';
width: 1.2rem;
height: 1.2rem;
position: absolute;
top: -1.1rem;
border-radius: 2rem;
box-shadow: 0px -4px black;
left: -0.1rem;
}
.bread__eyes--open--r {
position: absolute;
width: 1.3rem;
height: 1.3rem;
z-index: 25;
background-color: black;
border-radius: 5rem;
left: 21.7rem;
top: 16.2rem;
animation: 8s .3s eyesOpen infinite;
}
.bread__eyes--open--r:after {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #ffda96;
content: '';
position: absolute;
left: 0.8rem;
}
.bread__eyes--open--r:before {
content: '';
width: 1.2rem;
height: 1.2rem;
position: absolute;
top: -1.3rem;
border-radius: 2rem;
box-shadow: 0px -4px black;
left: -0.1rem;
}
.bread__eyes--closed--l {
opacity: 0;
position: absolute;
width: 2rem;
height: 2rem;
z-index: 30;
left: 16.5rem;
border-radius: 2rem;
top: 16.7rem;
box-shadow: -1px -4px black;
animation: 8s 0.3s eyesClosed infinite;
-webkit-animation: 8s 0.3s eyesClosed infinite;
/* Safari 4+ */
-moz-animation: 8s 0.3s eyesClosed infinite;
/* Fx 5+ */
-o-animation: 8s 0.3s eyesClosed infinite;
/* Opera 12+ */
}
.bread__eyes--closed--l:before {
content: '';
width: 1.2rem;
height: 1.2rem;
position: absolute;
top: -1.8rem;
border-radius: 2rem;
box-shadow: 0px -4px black;
left: 0.3rem;
}
.bread__eyes--closed--r {
opacity: 0;
position: absolute;
width: 1.7rem;
height: 2rem;
z-index: 30;
left: 21.5rem;
border-radius: 2rem;
top: 16.7rem;
box-shadow: -1px -4px black;
animation: 8s 0.3s eyesClosed infinite;
-webkit-animation: 8s 0.3s eyesClosed infinite;
/* Safari 4+ */
-moz-animation: 8s 0.3s eyesClosed infinite;
/* Fx 5+ */
-o-animation: 8s 0.3s eyesClosed infinite;
/* Opera 12+ */
}
.bread__eyes--closed--r:before {
content: '';
width: 1.2rem;
height: 1.2rem;
position: absolute;
top: -1.8rem;
border-radius: 2rem;
box-shadow: 0px -4px black;
left: 0.1rem;
}
.bread__eyes--closed--aux {
opacity: 0;
position: absolute;
width: 9rem;
height: 1rem;
z-index: 36;
background-color: #ffda96;
left: 16rem;
top: 17rem;
animation: 8s 0.3s eyesClosed infinite;
-webkit-animation: 8s .3s eyesClosed infinite;
/* Safari 4+ */
-moz-animation: 8s .3s eyesClosed infinite;
/* Fx 5+ */
-o-animation: 8s .3s eyesClosed infinite;
/* Opera 12+ */
}
.bread__eyes--closed--aux2 {
opacity: 0;
position: absolute;
width: 9rem;
height: 1rem;
z-index: 36;
background-color: #ffda96;
left: 16rem;
top: 15.1rem;
animation: 8s 0.5s eyesClosed infinite;
-webkit-animation: 8s .5s eyesClosed infinite;
/* Safari 4+ */
-moz-animation: 8s .5s eyesClosed infinite;
/* Fx 5+ */
-o-animation: 8s .5s eyesClosed infinite;
/* Opera 12+ */
}
.bread__mouth--normal {
opacity: 1;
animation: 8s .2s mouthClosed infinite;
-webkit-animation: 8s .2s mouthClosed infinite;
/* Safari 4+ */
-moz-animation: 8s .2s mouthClosed infinite;
/* Fx 5+ */
-o-animation: 8s .2s mouthClosed infinite;
/* Opera 12+ */
position: absolute;
width: 2.3rem;
height: 2.3rem;
z-index: 20;
top: 16.2rem;
left: 18.7rem;
border-radius: 1rem;
box-shadow: 0px 6px black;
}
.bread__mouth--normal:after {
content: '';
position: absolute;
width: 5rem;
height: 2rem;
background-color: #ffda96;
left: -1rem;
}
.bread__mouth--open {
opacity: 0;
animation: 8s .2s mouthOpen infinite;
-webkit-animation: 8s .2s mouthOpen infinite;
/* Safari 4+ */
-moz-animation: 8s .2s mouthOpen infinite;
/* Fx 5+ */
-o-animation: 8s .2s mouthOpen infinite;
/* Opera 12+ */
position: absolute;
width: 1.5rem;
height: 1.5rem;
background-c.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0