css实现可爱兔子耳朵动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现可爱兔子耳朵动画效果代码

代码标签: css 可爱 兔子 耳朵 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  


  
  
<style>
html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  background: #E2B29F;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rabbit {
  position: relative;
}
.rabbit .rabbit__body {
  width: 4em;
  height: 5.6em;
  background: #F4F4F4;
  border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
  transform: rotate(-40deg);
  box-shadow: inset -2.3em -2.7em 0 0 #D2DAEE;
}
.rabbit .rabbit__head {
  position: absolute;
  width: 4em;
  height: 4.6em;
  top: -2.5em;
  left: -2em;
  background: #e1e6f4;
  border-radius: 50% 50% 50% 50%/65% 60% 40% 35%;
  transform: rotate(-120deg);
  overflow: hidden;
}
.rabbit .rabbit__head:before {
  content: "";
  position: absolute;
  width: 0.65em;
  height: 0.5em;
  top: -0.1em;
  left: 1.8em;
  background: #F97996;
  border-radius: 50% 50% 50% 50%/30% 30% 70% 70%;
  transform: rotate(130deg);
}
.rabbit .rabbit__head:after {
  content: "";
  position: absolute;
  width: 1em;
  height: 1em;
  top: 1.5em;
  left: 1.6em;
  background: #F4F4F4;
  border-radius: 50%;
  box-shadow: inset 0.1em 0.15em 0 0.37em #3D261C;
}
.rabbit .rabbit__ear {
  position: absolute;
  border-radius: 50% 50% 50% 50%/40% 40% 60% 60%;
  transform-origin: 50% 100%;
}
.rabbit .rabbit__ear--left {
  width: 2.2em;
  height: 4.7em;
  top: -5.7em;
  left: -0.2em;
  background: #F3E3DE;
  transform: rotate(40deg);
  box-shadow: inset 0.3em -0.4em 0 -0.1em #c7d1ea;
  -webkit-animation: ear-left 5s infinite ease-out;
          animation: ear-left 5s infinite ease-out;
}
.rabbit .rabbit__ear--right {
  width: 2em;
  height: 4.7em;
  top: -5.5em;
  left: -0.7em;
  background: #D2DAEE;
  transform: rotate(10deg);
  -webkit-animation: ear-right 5s infinite ease-out;
          animation: ear-right 5s infinite ease-out;
}
.rabbit .rabbit__leg {
  position: absolute;
}
.rabbit .rabbit__leg--one {
  width: 0.8em;
  height: 3em;
  top: 2.3em;
  left: 0.2em;
  background: #c7d1ea;
  border-radius: 50% 50% 50% 50%/30% 30% 70% 70%;
  transform-origin: 50% 0%;
  transform: rotate(15deg);
}
.rabbit .rabbit__leg--one:before {
  content: "";
  position: absolute;
  width: 0.8em;
  height: 0.5em;
  top: 2.6em;
  left: -0.2em;
  background: #c7d1ea;
  border-radius: 50% 50% 50% 50%/70% 70% 30% 30%;
  transform: rotate(-10deg);
}
.rabbit .rabbit__leg--three {
  width: 0.9em;
  height: 3em;
  top: 2.4em;
  left: 0.7em;
  background: #e1e6f4;
  border-radius: 50% 50% 50% 50%/30% 30% 70% 70%;
  transform-origin: 50% 0%;
  transform: rotate(10deg);
}
.rabbit .rabbit__leg--three:before {
  content: "";
  position: absolute;
  width: 0.8em;
  height: 0.5em;
  top: 2.6em;
  left: -0.2em;
  background: #e1e6f4;
  border-radius: 50% 50% 50% 50%/70% 70% 30.........完整代码请登录后点击上方下载按钮下载查看

网友评论0