纯css实现电影大白的卡通形象效果

代码语言:html

所属分类:动画

代码描述:纯css实现电影大白的卡通形象效果

代码标签: 电影 白的 卡通 形象 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
.cc, #baymax, #baymax .head, #baymax .head .mouth, #baymax .body, #baymax .body .chest, #baymax .body .chest i, #baymax .body .chest i:before, #baymax .body .belly {
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  position: absolute;
}

html, body {
  position: absolute;
  overflow: hidden;
  height: 100%;
  width: 100%;
  background-color: white;
}

body {
  background-color: rgba(176, 0, 2, 0.8);
}

#baymax {
  cursor: pointer;
  top: 50%;
  left: 50%;
}
#baymax .head {
  z-index: 10;
  top: -120px;
  left: 50%;
  border-radius: 50%;
  width: 90px;
  height: 60px;
  background-color: white;
  box-shadow: 0 -15px 30px rgba(23, 34, 45, 0.2) inset, 0 5px 15px rgba(23, 34, 45, 0.2);
}
#baymax .head .eye, #baymax .head .mouth {
  position: absolute;
  display: inline-block;
}
#baymax .head .eye {
  animation: blink 6s ease-in-out infinite;
  margin-top: -4.5px;
  background-color: #202b36;
  border-radius: 50%;
  width: 8.1px;
  height: 9px;
  top: 40%;
  left: 50%;
}
#baymax .head .eye.left {
  margin-left: -24.5px;
}
#baymax .head .eye.right {
  margin-left: 15.5px;
}
#baymax .head .mouth {
  top: 40%;
  left: 50%;
  width: 38px;
  background-color: #202b36;
  height: 1px;
}
#baymax .body {
  z-index: 5;
  top: 0px;
  left: 50%;
}
#baymax .body .arm {
  z-index: 1;
  position: absolute;
  left: 50%;
  top: 50%;
}
#baymax .body .arm.right {
  -moz-transform: scale(-1, 1);
  -ms-transform: scale(-1, 1);
  -webkit-transform: scale(-1, 1);
  transform: scale(-1, 1);
}
#baymax .body .arm.left {
  -moz-transform: scale(1, 1);
  -ms-transform: scale(1, 1);
  -webkit-transform: scale(1, 1);
  transform: scale(1, 1);
}
#baymax .body .arm .fingers:before, #baymax .body .arm .fingers:after {
  content: "";
  position: absolute;
  background-color: white;
  border-radius: 50%;
  width: 18px;
  height: 40px;
  z-index: 2;
}
#baymax .body .arm .fingers:before {
  margin-left: -130px;
  margin-top: 145px;
  box-shadow: 2px -4px 4px rgba(23, 34, 45, 0.4) inset;
  -moz-transform-origin: top center;
  -ms-transform-origin: top center;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -moz-transform: rotate(-25deg);
  -ms-transform: rotate(-25deg);
  -webkit-transform: rotate(-25deg);
  transform: rotate(-25deg);
}
#baymax .body .arm .fingers:after {
  margin-left: -102px;
  margin-top: 140px;
  box-shadow: -2px -4px 8px rgba(23, 34, 45, 0.3) inset;
  -moz-transform-origin: top center;
  -ms-transform-origin: top center;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -moz-transform: rotate(-5deg);
  -ms-transform: rotate(-5deg);
  -webkit-transform: rotate(-5deg);
  transform: rotate(-5deg);
  z-index: -1;
}
#baymax .body .arm:before, #baymax .body .arm:after {
  content: "";
  position: absolute;
  background-color: white;
  border-radius: 50%;
  z-index: 1;
}
#baymax .body .arm:before {
  width: 90px;
  height: 200px;
  left: -80px;
  top: -75px;
  -moz-transform-origin: top center;
  -ms-transform-origin: top center;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -moz-transform: rotate(30deg);
  -ms-transform: rotate(30deg);
  -webkit-transform: rotate(30deg);
  transform: rotate(30deg);
}
#baymax .body .arm:after {
  width: 80px;
  height: 150px;
  left: -158px;
  top: 20px;
  -moz-transform-origin: top center;
  -ms-transform-origin: top center;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -moz-transform: rotate(-5deg);
  -ms-transform: rotate(-5deg);
  -webkit-transform: rotate(-5deg);
  transform: rotate(-5deg);
  box-shadow: 4px -10px 10px rgba(23, 34, 45, 0.2) inset;
}
#baymax .body .chest {
  width: 190px;
  height: 260px;
  top: 20px;
  background-color: white;
  position: absolute;
  display: inline-block;
  border-radius: 50%;
  -moz-transform-origin: top center;
  -ms-transform-origin: top center;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  z-index: 3;
}
#baymax .body .chest i {
  width: 21px;
  height: 21px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 -5px 8px rgba(23, 34, 45, 0.15) inset, 2px 3px 2px rgba(2.........完整代码请登录后点击上方下载按钮下载查看

网友评论0