纯css布局实现一个画家作画的动画

代码语言:html

所属分类:动画

代码描述:纯css布局实现一个画家作画的动画

代码标签: 实现 一个 画家 画的 动画

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


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

<style>
*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
}

/* Generic */
body {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  background-color: #FCF2E6;
}

.main {
  position: relative;
  width: 55vw;
  height: 41vw;
}

/*-------------*/
.nube {
  position: absolute;
  top: 0;
  left: 5vw;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 4vw;
  height: 1vw;
  -webkit-animation: nube ease 8s infinite alternate;
  animation: nube ease 8s infinite alternate;
}

.nube:nth-of-type(2) {
  left: 40vw;
  top: 5vw;
  animation: nube ease 12s infinite reverse alternate;
}

.nube-1, .nube-2 {
  position: relative;
  border-radius: 50%;
  margin-left: -.5vw;
  border-top: 1.5vw solid white;
  border-left: 1.5vw solid white;
  border-bottom: 1.5vw solid transparent;
  border-right: 1.5vw solid transparent;
  -webkit-transform: rotateZ(45deg);
  -ms-transform: rotate(45deg);
  transform: rotateZ(45deg);
}

.nube-2 {
  margin-top: .25vw;
  border-top: 1.25vw solid white;
  border-left: 1.25vw solid white;
  border-bottom: 1.25vw solid transparent;
  border-right: 1.25vw solid transparent;
}

.pajaro {
  position: absolute;
  width: 3vw;
  height: 4vw;
  top: 6vw;
  left: 11vw;
  z-index: 1;
  -webkit-animation: pajaro 4s infinite;
  animation: pajaro 4s infinite;
}

.pajaro-i {
  position: absolute;
  width: 0.15vw;
  -webkit-transform-origin: bottom left;
  -ms-transform-origin: bottom left;
  transform-origin: bottom left;
}

.pajaro-1 {
  bottom: -.5vw;
  left: 1.5vw;
  width: 3vw;
  height: 3vw;
  border-radius: 50%;
  border-bottom: 1.5vw solid #4546c8;
  border-left: 1.5vw solid #4546c8;
  border-right: 1.5vw solid transparent;
  border-top: 1.5vw solid transparent;
  -webkit-transform: rotateZ(-45deg);
  -ms-transform: rotate(-45deg);
  transform: rotateZ(-45deg);
}

.pajaro-2 {
  bottom: 1.5vw;
  right: 0;
  width: 1.8vw;
  height: 1.5vw;
  border-top-left-radius: 1vw;
  border-top-right-radius: 1vw;
  background-color: #4546c8;
}

.pajaro-2::before {
  content: '';
  position: absolute;
  right: 20%;
  top: 30%;
  width: .6vw;
  height: .6vw;
  background-color: #FEFEFC;
  border-radius: 50%;
}

.pajaro-2::after {
  content: '';
  position: absolute;
  right: 25%;
  top: 50%;
  width: .2vw;
  height: .2vw;
  background-color: #2C0870;
  border-radius: 50%;
}

.pajaro-3 {
  top: 1.5vw;
  left: 2.8vw;
  z-index: -1;
  border-bottom: .4vw solid transparent;
  border-left: 0.7vw solid #FEBD6A;
  border-right: 1vw solid transparent;
  border-top: .4vw solid transparent;
}

.suelo {
  position: absolute;
  bottom: 2.7vw;
  left: 50%;
  width: 46.25vw;
  height: 0.15vw;
  -webkit-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  transform: translateX(-50%);
  border-radius: 50%;
  background-image: -webkit-gradient(linear, left top, right top, from(#238396), color-stop(#178ba4), to(#238396));
  background-image: -webkit-linear-gradient(left, #238396, #178ba4, #238396);
  background-image: -o-linear-gradient(left, #238396, #178ba4, #238396);
  background-image: linear-gradient(left, #238396, #178ba4, #238396);
}

.bote {
  position: absolute;
  bottom: 0;
  left: 17.8vw;
  width: 4vw;
  height: 4.5vw;
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.5vw, #6AA5CA), color-stop(0.5vw, #398CB4), color-stop(0.6vw, #398CB4), color-stop(0.6vw, #6AA5CA), color-stop(6vw, #398CB4));
  background-image: -webkit-linear-gradient(top, #6AA5CA 0.5vw, #398CB4 0.5vw, #398CB4 0.6vw, #6AA5CA 0.6vw, #398CB4 6vw);
  background-image: -o-linear-gradient(top, #6AA5CA 0.5vw, #398CB4 0.5vw, #398CB4 0.6vw, #6AA5CA 0.6vw, #398CB4 6vw);
  background-image: linear-gradient(top, #6AA5CA 0.5vw, #398CB4 0.5vw, #398CB4 0.6vw, #6AA5CA 0.6vw, #398CB4 6vw);
}

.bote:nth-of-type(2) {
  bottom: -.1vw;
  left: 40vw;
  -webkit-transform: rotateZ(-90deg);
  -ms-transform: rotate(-90deg);
  transform: rotateZ(-90deg);
}

.bote:nth-of-type(2)::before {
  content: '';
  position: absolute;
  left: -2vw;
  top: -2vw;
  height: .2vw;
  width: 4vw;
  background: #f09b1f;
  border: none;
  -webkit-transform: rotateZ(90deg);
  -ms-transform: rotate(90deg);
  transform: rotateZ(90deg);
}

.bote::before {
  content: '';
  position: absolute;
  top: -1vw;
  right: -.1vw;
  width: 4vw;
  height: 3vw;
  border-top: 0.1vw solid transparent;
  border-left: 0.1vw solid transparent;
  border-bottom: 0.1vw solid #FEFEFC;
  border-right: 0.1vw solid #FEFEFC;
  border-radius: 50%;
  -webkit-transform: rotateZ(30deg);
  -ms-transform: rotate(30deg);
  transform: rotateZ(30deg);
}

.colores-i {
  position: absolute;
  width: 0.15vw;
  -webkit-transform-origin: bottom right;
  -ms-transform-origin: bottom right;
  transform-origin: bottom right;
}

.colores-1 {
  height: 1.3vw;
  top: -1.3vw;
  left: 0.7vw;
  -webkit-transform: rotateZ(-20deg);
  -ms-transform: rotate(-20deg);
  transform: rotateZ(-20deg);
  background-color: #116577;
}

.colores-2 {
  height: 1.8vw;
  top: -1.8vw;
  left: 1.4vw;
  -webkit-transform: rotateZ(-5deg);
  -ms-transform: rotate(-5deg);
  transform: rotateZ(-5deg);
  background-color: #FEBD6A;
}

.colores-3 {
  height: 2vw;
  top: -2vw;
  left: 2.7vw;
  -webkit-transform: rotateZ(10deg);
  -ms-transform: rotate(10deg);
  transform: rotateZ(10deg);
  background-color: #002E83;
}

.colores-4 {
  height: 1.5vw;
  top: -1.4vw;
  left: 3vw;
  -webkit-transform: rotateZ(35deg);
  -ms-transform: rotate(35deg);
  transform: rotateZ(35deg);
  background-color: #238396;
}

.colores-5 {
  height: 2.2vw;
  top: -2.15vw;
  left: 3.5vw;
  -webkit-transform: rotateZ(25deg);
  -ms-transform: rotate(25deg);
  transform: rotateZ(25deg);
  background-color: #238396;
}

.humano {
  position: absolute;
  top: 3vw;
  left: 5.5vw;
  width: 25vw;
  height: 35vw;
  z-index: 100;
}

.humano-i {
  position: absolute;
}

.humano-pi {
  width: 4.5vw;
  height: 15vw;
  bottom: 4vw;
  left: 9vw;
  -webkit-transform-origin: bottom left;
  -ms-transform-origin: bottom left;
  transform-origin: bottom left;
  -webkit-transform: rotateZ(40deg);
  -ms-transform: rotate(40deg);
  transform: rotateZ(40deg);
  border-top-right-radius: 2vw;
  background-image: -webkit-linear-gradient(170deg, transparent 2vw, #020750 2vw, #002E83 2.75vw);
  background-image: -o-linear-gradient(170deg, transparent 2vw, #020750 2vw, #002E83 2.75vw);
  background-image: linear-gradient(-80deg, transparent 2vw, #020750 2vw, #002E83 2.75vw);
}

.humano-pi::before {
  content: '';
  position: absolute;
  bottom: 0;
  border-top: 1.5vw solid transparent;
  border-bottom: 1.5vw solid transparent;
  border-left: 6vw solid #020750;
  border-right: 1vw solid transparent;
  -webkit-transform-origin: bottom left;
  -ms-transform-origin: bottom left;
  transform-origin: bottom left;
  -webkit-transform: rotateZ(30deg) skewX(30deg);
  -ms-transform: rotate(30deg) skewX(30deg);
  transform: rotateZ(30deg) skewX(30deg);
}

.humano-pi::after {
  content: '';
  position: absolute;
  bottom: 1vw;
  width: 3vw;
  height: 3vw;
  background-image: -webkit-linear-gradient(170deg, transparent 0.4vw, #2C0870 0.5vw, #020750 1.5vw);
  background-image: -o-linear-gradient(170deg, transparent 0.4vw, #2C0870 0.5vw, #020750 1.5vw);
  background-image: linear-gradient(-80deg, transparent 0.4vw, #2C0870 0.5vw, #020750 1.5vw);
}

.humano-pd {
  width: 4.5vw;
  height: 15vw;
  top: 10.9vw;
  left: 12.5vw;
  -webkit-transform-origin: bottom left;
  -ms-transform-origin: bottom left;
  transform-origin: bottom left;
  -webkit-transform: rotateZ(-63deg);
  -ms-transform: rotate(-63deg);
  transform: rotateZ(-63deg);
  border-top-left-radius: 3vw;
  border-top-right-radius: 2vw;
  background-image: -webkit-linear-gradient(10deg, transparent 2vw, #2C0870 2vw, #024799 2.75vw);
  background-image: -o-linear-gradient(10deg, transparent 2vw, #2C0870 2vw, #024799 2.75vw);
  background-image: linear-gradient(80deg, transparent 2vw, #2C0870 2vw, #024799 2.75vw);
}

.humano-pd::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  border-top: 1.5vw solid transparent;
  border-bottom: 1.5vw solid transparent;
  border-left: 1vw solid transparent;
  border-right: 6vw solid #020750;
  -webkit-transform-origin: bottom right;
  -ms-transform-origin: bottom right;
  transform-origin: bottom right;
  -webkit-transform: rotateZ(-30deg) skewX(-30deg);
  -ms-transform: rotate(-30deg) skewX(-30deg);
  transform: rotateZ(-30deg) skewX(-30deg);
}

.humano-pd::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 1vw;
  width: 3vw;
  height: 3vw;
  background-image: -webkit-linear-gradient(10deg, transparent 0.4vw, #2C0870 0.5vw, #020750 1.5vw);
  background-image: -o-linear-gradient(10deg, transparent 0.4vw, #2C0870 0.5vw, #020750 1.5vw);
  background-image: linear-gradient(80deg, transparent 0.4vw, #2C0870 0.5vw, #020750 1.5vw);
}

.humano-pdt {
  bottom: 15.5vw;
  width: 10vw;
  height: 5vw;
  border-top-left-radius: 3vw;
  border-bottom-left-radius: 2vw;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#020750), to(#024799));
  background-image: -webkit-linear-gradient(top, #020750, #024799);
  background-image: -o-linear-gradient(top, #020750, #024799);
  background-image: linear-gradient(top, #020750, #024799);
}

.humano-pdt::before {
  content: '';
  position: absolute;
  bottom: 2.1vw;
  right: -.4vw;
  width: 5vw;
  height: 0.125vw;
  background-color: #00256a;
  -webkit-transform-origin: top left;
  -ms-transform-origin: top left;
  transform-origin: top left;
  -webkit-transform: rotateZ(25deg);
  -ms-transform: rotate(25deg);
  transform: rotateZ(25deg);
}

.humano-pdt::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 3vw;
  height: 6vw;
  background-image: -webkit-linear-gradient(50deg, transparent 1.9vw, #f09b1f 1.9vw);
  background-image: -o-linear-gradient(50deg, transparent 1.9vw, #f09b1f 1.9vw);
  background-image: linear-gradient(40deg, transparent 1.9vw, #f09b1f 1.9vw);
  border-top-left-radius: 1.4vw;
}

.humano-mandila {
  top: 10.5vw;
  right: 13.5vw;
  width: 7vw;
  height: 13vw;
  -webkit-transform-origin: top right;
  -ms-transform-origin: top right;
  transform-origin: top right;
  -webkit-transform: rotateZ(-40deg);
  -ms-transform: rotate(-40deg);
  transform: rotateZ(-40deg);
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(70%, #f09b1f), to(#FEBD6A));
  background-image: -webkit-linear-gradient(top, #f09b1f 70%, #FEBD6A);
  background-image: -o-linear-gradient(top, #f09b1f 70%, #FEBD6A);
  background-image: linear-gradient(top, #f09b1f 70%, #FEBD6A);
  z-index: -2;
}

.humano-cuerpo {
  top: 4vw;
  left: 8vw;
  width: 11vw;
  height: 15vw;
  z-index: -3;
  border-top-left-radius: 7.4vw;
  background-image: -webkit-linear-gradient(170deg, transparent 1.9vw, #d10955 1.9vw, #FF006B);
  background-image: -o-linear-gradient(170deg, transparent 1.9vw, #d10955 1.9vw, #FF006B);
  background-image: linear-gradient(-80deg, transparent 1.9vw, #d10955 1.9vw, #FF006B);
  -webkit-transform-origin: bottom left;
  -ms-transform-origin: bottom left;
  transform-origin: bottom left;
  -webkit-transform: rotateZ(5deg);
  -ms-transform: rotate(5deg);
  transform: rotateZ(5deg);
  overflow: hidden;
  -webkit-box-shadow: inset 0.75vw 0.75vw 1vw #d10955;
  box-shadow: inset 0.75vw 0.75vw 1vw #d10955;
}

.humano-cuerpoa {
  position: absolute;
  top: -1.5vw;
  width: 3.75vw;
  height: 4vw;
  left: 6.8vw;
  border-radius: 50%;
  border: 0.25vw solid #FEFEFC;
  -webkit-box-shadow: inset 0.25vw -0.25vw 0.125vw #FF96AF;
  box-shadow: inset 0.25vw -0.25vw 0.125vw #FF96AF;
  background-color: #FFAEC0;
}

.humano-bd {
  top: 7vw;
  left: 10.7vw;
  width: 4.5vw;
  height: 9vw;
  -webkit-transform: top right;
  -ms-transform: top right;
  transform: top right;
  -webkit-transform: rotate(-25deg);
  -ms-transform: rotate(-25deg);
  transform: rotate(-25deg);
  border-top-left-radius: 4vw;
  border-top-right-radius: 4vw;
  background-image: -webkit-linear-gradient(115deg, transparent 1.9vw, #FF006B 1.9vw, #d10955);
  background-image: -o-linear-gradient(115deg, transparent 1.9vw, #FF006B 1.9vw, #d10955);
  background-image: linear-gradient(-25deg, transparent 1.9vw, #FF006B 1.9vw, #d10955);
  -webkit-animation: bd 1.75s ease infinite alternate;
  animation: bd 1.75s ease infinite alternate;
}

.humano-bd::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  -webkit-transform: translate(-50%) rotateZ(-24deg) skewX(-10deg);
  -ms-transform: translate(-50%) rotate(-24deg) skewX(-10deg);
  transform: translate(-50%) rotateZ(-24deg) skewX(-10deg);
  width: 130%;
  height: 1.25vw;
  background-image: -webkit-gradient(linear, left top, right top, from(#FEBD6A), color-stop(20%, #FEFEFC));
  background-image: -webkit-linear-gradient(left, #FEBD6A, #FEFEFC 20%);
  background-image: -o-linear-gradient(left, #FEBD6A, #FEFEFC 20%);
  background-image: linear-gradient(left, #FEBD6A, #FEFEFC 20%);
}

.humano-bd::after {
  content: '';
  position: absolute;
  top: 30%;
  right: 0;
  width: 0.125vw;
  height: 45%;
  background-color: #b9084b;
}

.humano-ad {
  left: 13vw;
  top: 14vw;
  width: 10vw;
  height: 3vw;
  border-top: 0.125vw solid #ffc8d4;
  background-image: -webkit-linear-gradient(100deg, transparent 1.5vw, #FFAEC0 1.5vw);
  background-image: -o-linear-gradient(100deg, transparent 1.5vw, #FFAEC0 1.5vw);
  background-image: linear-gradient(-10deg, transparent 1.5vw, #FFAEC0 1.5vw);
  z-index: -1;
  -webkit-animation: ad 1.75s ease infinite alternate;
  animation: ad 1.75s ease infinite alternate;
}

.humano-ad::before {
  content: '';
  position: absolute;
  width: 4vw;
  height: 3vw;
  background-image: -webkit-gradient(linear, left top, right top, from(#ff7d9c), to(#FFAEC0));
  background-image: -webkit-linear-gradient(left, #ff7d9c, #FFAEC0);
  background-image: -o-linear-gradient(left, #ff7d9c, #FFAEC0);
  background-image: linear-gradient(left, #ff7d9c, #FFAEC0);
  border-bottom-right-radius: 3vw;
}

.humano-md {
  top: -2.2vw;
  right: -.8vw;
  height: 3.5vw;
  width: 1vw;
  -webkit-transform: rotateZ(10deg);
  -ms-transform: rotate(10deg);
  transform: rotateZ(10deg);
  background-image: -webkit-gradient(linear, left top, right top, color-stop(1vw, #FFAEC0), to(#ff7d9c));
  background-image: -webkit-linear-gradient(left, #FFAEC0 1vw, #ff7d9c);
  background-image: -o-linear-gradient(left, #FFAEC0 1vw, #ff7d9c);
  background-image: linear-gradient(left, #FFAEC0 1vw, #ff7d9c);
  border-top-left-radius: 1vw;
}

.humano-md::before {
  content: '';
  position: absolute;
  left: -1.6vw;
  top: -.4vw;
  height: 3vw;
  width: 0.25vw;
  background-color: #020750;
  -webkit-transform: rotateZ(90deg);
  -ms-transform: rotate(90deg);
  transform: rotateZ(90deg);
}

.humano-mandilb {
  top: 10vw;
  left: 11.5vw;
  width: 7vw;
  height: 7.7vw;
  -webkit-transform: rotateZ(15deg);
  -ms-transform: rotate(15deg);
  transform: rotateZ(15deg);
  background-color: #f09b1f;
  z-index: -2;
}

.humano-mandilb::after, .humano-mandilb::before {
  content: '';
  position: absolute;
  top: -6vw;
  right: 0;
  width: 0.85vw;
  height: 6.5vw;
  background-color: #f09b1f;
}

.humano-mandilb::after {
  left: 1vw;
  top: -4.8vw;
  -webkit-transform: rotateZ(-20deg);
  -ms-transform: rotate(-20deg);
  transform: rotateZ(-20deg);
  border-top-left-radius: 0.5vw;
  -webkit-box-shadow: -0.15vw 1vw 1vw #d10955;
  box-shadow: -0.15vw 1vw 1vw #d10955;
}

.humano-bi {
  top: 5.3vw;
  right: 3vw;
  width: 3vw;
  height: 7.5vw;
  -webkit-transform: rotateZ(15deg);
  -ms-transform: rotate(15deg);
  transform: rotateZ(15deg);
  background-image: -webkit-gradient(linear, left top, right top, from(#a00741), color-stop(80%, #d10955));
  background-image: -webkit-linear-gradient(left, #a00741, #d10955 80%);
  background-image: -o-linear-gradient(left, #a00741, #d10955 80%);
  background-image: linear-gradient(left, #a007.........完整代码请登录后点击上方下载按钮下载查看

网友评论0