css绘制男子带狗狗骑自行车飞驰动画效果

代码语言:html

所属分类:动画

代码描述:css绘制男子带狗狗骑自行车飞驰动画效果

代码标签: 带狗 狗骑 自行车 飞驰 动画 效果

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


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

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

/* Generic */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  background-color: #EFE1DB;
}

.main {
  position: relative;
  width: 60vw;
  height: 45vw;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  overflow: hidden;
}

/* Component */
.lines {
  width: 100%;
  height: 100%;
  transform: rotateZ(10deg);
}

.line-a,
.line-b,
.line-c,
.line-d {
  position: absolute;
  height: .175vw;
  border-radius: 50%;
  background-color: #FFF6EF;
}

.line-a {
  width: 12vw;
  bottom: 20vw;
  left: 7vw;
  animation: line-a .15s infinite linear;
}

.line-b {
  width: 10vw;
  bottom: 18vw;
  left: 6vw;
  animation: line-b .2s infinite linear;
}

.line-c {
  width: 6vw;
  bottom: 12vw;
  left: 12vw;
  animation: line-c .1s infinite linear;
}

.line-d {
  width: 6vw;
  bottom: 26vw;
  left: 15vw;
  animation: line-d .135s infinite linear;
}

/**/
.shadows {
  position: absolute;
  top: 13.5vw;
  left: 20.3vw;
  width: 27vw;
  height: 19vw;
  transform-origin: top left;
  transform: rotateZ(10deg);
  z-index: -5;
}

.shadow-a,
.shadow-b,
.shadow-c,
.shadow-d {
  position: absolute;
  border-radius: 50%;
}

.shadow-a {
  bottom: -.5vw;
  width: 150%;
  left: -25%;
  height: 1vw;
  background-color: rgba(109, 84, 80, 0.5);
  animation: shadow-a .15s infinite linear;
}

.shadow-b {
  bottom: -1.5vw;
  width: 100%;
  right: -25%;
  height: .45vw;
  background-color: rgba(109, 84, 80, 0.5);
  animation: shadow-b .175s infinite linear;
}

.shadow-c {
  bottom: -4vw;
  left: 100%;
  border-top: 2vw solid rgba(109, 84, 80, 0.5);
  border-right: 2vw solid rgba(109, 84, 80, 0.5);
  border-bottom: 2vw solid transparent;
  border-left: 2vw solid transparent;
  transform-origin: bottom left;
  transform: rotateZ(-45deg);
  opacity: 0;
  animation: shadow-c .45s infinite linear;
}
.shadow-c::before {
  content: '';
  position: absolute;
  left: 2vw;
  top: 2vw;
  border-top: 1vw solid rgba(109, 84, 80, 0.75);
  border-right: 1vw solid rgba(109, 84, 80, 0.75);
  border-bottom: 1vw solid transparent;
  border-left: 1vw solid transparent;
  border-radius: 50%;
}

.shadow-d {
  bottom: -2vw;
  left: 100%;
  border-top: 1.5vw solid rgba(109, 84, 80, 0.75);
  border-right: 1.5vw solid rgba(109, 84, 80, 0.75);
  border-bottom: 1.5vw solid transparent;
  border-left: 1.5vw solid transparent;
  transform-origin: bottom left;
  transform: rotateZ(-45deg);
  animation: shadow-c 1s infinite linear;
}

/**/
.bicy {
  position: absolute;
  top: 13.5vw;
  left: 17.3vw;
  width: 27vw;
  height: 19vw;
  transform-origin: bottom left;
  transform: rotateZ(10deg);
  animation: bicy .15s infinite linear;
  /**/
  /**/
  /**/
}
.bicy__wheel-l, .bicy__wheel-r {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 0;
  width: 10.8vw;
  height: 10.8vw;
  border: 0.4vw solid #432316;
  border-radius: 50%;
  box-shadow: inset 0.3vw 0.3vw 0 #E9A589, inset -0.3vw -0.3vw 0 #FFF6EF, inset -0.3vw 0.3vw 0 #E9A589, inset 0.3vw -0.3vw 0 #FFF6EF;
}
.bicy__wheel-l::before, .bicy__wheel-l::after, .bicy__wheel-r::before, .bicy__wheel-r::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  border-top: 0.115vw solid #FFF6EF;
  border-bottom: 0.115vw solid #FFF6EF;
  border-left: .115vw solid transparent;
  border-right: .115vw solid transparent;
  animation: wheel .25s infinite linear;
}
.bicy__wheel-l::after, .bicy__wheel-r::after {
  width: 50%;
  height: 50%;
  border-top: .115vw solid transparent;
  animation: wheel .25s infinite linear;
}
.bicy__wheel-l {
  left: 0;
  z-index: -1;
}
.bicy__wheel-r {
  right: 0;
}
.bicy__fender {
  position: absolute;
  width: 115%;
  height: 125%;
  border-radius: 50%;
  border-top: 0.5vw solid #00665A;
}
.bicy__ac {
  position: absolute;
  width: 10.7vw;
  height: 3vw;
  bottom: 4vw;
  left: 4vw;
}
.bicy__ac::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 99%;
  height: 1.5vw;
  border: 0.3vw solid #3F3E3E;
  border-top: .3vw solid transparent;
  border-bottom-left-radius: 4vw;
  border-bottom-right-radius: 4vw;
}
.bicy__ac::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 3vw;
  height: 3vw;
  border-radius: 50%;
  border-left: 0.4vw solid #3F3E3E;
  border-bottom: 0.4vw solid #3F3E3E;
  z-index: -1;
}
.bicy__ac-top {
  position: absolute;
  width: 100%;
  height: 2vw;
  border-top-left-radius: 2vw;
  border-top-right-radius: 2vw;
  background-image: linear-gradient(-65deg, #009281 0, #009281 6vw, #FFF6EF 6vw, #FFF6EF 6.3vw, #009281 6.3vw, #009281 6.5vw, #FFF6EF 6.5vw, #FFF6EF 7.5vw, #009281 7.5vw, #009281 8vw, #FFF6EF 8vw);
}
.bicy__ac-top::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 2vw;
  border-top-left-radius: 2vw;
  border-top-right-radius: 1vw;
  background-image: linear-gradient(to top, rgba(0, 0, 0, 0.1) 50%, transparent 50%);
}
.bicy__part-a, .bicy__part-b, .bicy__part-c {
  position: absolute;
  bottom: 5.8vw;
  left: 4.25vw;
  width: .7vw;
  height: 7.8vw;
  transform-origin: bottom left;
  transform: rotateZ(37deg);
  background-image: linear-gradient(to right, #FFF6EF 0.25vw, #FEDBC5 0.25vw);
}
.bicy__part-a {
  z-index: -1;
}
.bicy__part-b {
  left: 13vw;
  height: 8.2vw;
  background-image: linear-gradient(to right, #7ADACC 0.25vw, #009281 0.25vw);
  z-index: -1;
}
.bicy__part-c {
  left: 13.2vw;
  bottom: 9vw;
  height: 6.4vw;
}
.bicy__part-c::before {
  content: '';
  position: absolute;
  width: 3vw;
  height: .7vw;
  bottom: 0;
  right: .1vw;
  transform-origin: bottom right;
  transform: rotateZ(-37deg);
  background-image: linear-gradient(to bottom, #FFF6EF 0.25vw, #FEDBC5 0.25vw);
}
.bicy__part-d {
  display: flex;
  justify-content: center;
  position: absolute;
  bottom: 5.8vw;
  left: 12vw;
  width: .9vw;
  height: 9.5vw;
  transform-origin: bottom left;
  transform: rotateZ(-30deg);
  background-image: linear-gradient(to left, #FFF6EF 0.4vw, #FEDBC5 0.4vw);
  z-index: -1;
}
.bicy__part-d::before {
  content: '';
  position: absolute;
  top: -3.5vw;
  width: .5vw;
  height: 3.5vw;
  background-image: linear-gradient(to right, #A2A1A0 0.3vw, #d5d5d5 0.3vw);
}
.bicy__part-d::after {
  content: '';
  position: absolute;
  width: 3vw;
  height: .9vw;
  top: -4.7vw;
  border-radius: 1vw;
  transform-origin: bottom left;
  transform: rotateZ(30deg) skewX(-20deg);
  background-image: linear-gradient(to bottom, #009281, #00665A);
}
.bicy__part-e {
  position: absolute;
  width: .5vw;
  height: 7.2vw;
  right: 5.2vw;
  bottom: 5vw;
  transform-origin: bottom right;
  transform: rotateZ(8deg);
  background-image: linear-gradient(to right, #009281 0.25vw, #7ADACC 0.25vw);
}
.bicy__part-f {
  display: flex;
  justify-content: center;
  position: absolute;
  width: .5vw;
  height: 9.2vw;
  right: 5.2vw;
  bottom: 5vw;
  transform-origin: bottom right;
  transform: rotateZ(-25deg);
  background-image: linear-gradient(to right, #009281 0.25vw, #7ADACC 0.25vw);
}
.bicy__part-f::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 1.5vw;
  top: -1.5vw;
  background-image: linear-gradient(to left, #FFF6EF 0.25vw, #FEDBC5 0.25vw);
}
.bicy__part-f::after {
  content: '';
  position: absolute;
  width: 80%;
  height: 1.9vw;
  top: -3.4vw;
  background-image: linear-gradient(to left, #d5d5d5 0.25vw, #A2A1A0 0.25vw);
}
.bicy__part-g {
  position: absolute;
  right: 10vw;
  bottom: 16.3vw;
  width: 1.75vw;
  height: 1.75vw;
  transform: rotateZ(25deg) skewY(10deg);
  border-top: 0.2vw solid #d5d5d5;
  border-right: 0.2vw solid #d5d5d5;
  box-shadow: inset -0.1vw 0.1vw 0 #A2A1A0;
}
.bicy__part-g::before {
  content: '';
  position: absolute;
  width: 2.5vw;
  height: .5vw;
  transform: rotateZ(-60deg) skewY(0deg) translateY(-1vw) translateX(-1vw);
  border-radius: 1.5vw;
  background-image: linear-gradient(to bottom, #009281, #00665A);
}
.bicy__basket {
  position: absolute;
  bottom: 12vw;
  right: 4vw;
  width: 3vw;
  height: 3.5vw;
  background-color: #B96C5C;
  border-top: 0.25vw solid #EBB6A1;
  box-shadow: inset 0 0.25vw 0 #883E30;
}
.bicy__basket-a {
  position: absolute;
  width: 125%;
  bottom: 0;
  border-bottom: 0.25vw solid #883E30;
  z-index: 5;
}
.bicy__basket-a::before {
  content: '';
  position: absolute;
  width: 2vw;
  height: 3vw;
  left: -.5vw;
  top: -2.8vw;
  background-image: linear-gradient(70deg, #883E30 1.35vw, transparent 1.35vw);
}
.bicy__basket-a::after {
  content: '';
  position: absolute;
  width: 2vw;
  height: 2.8vw;
  right: .15vw;
  top: -2.75vw;
  background-image: linear-gradient(-70deg, #EBB6A1 1.35vw, transparent 1.35vw);
}
.bicy__basket::before {
  content: '';
  position: absolute;
  top: -.25vw;
  left: -1.75vw;
  width: 1.75vw;
  height: 3.5vw;
  border-top: 0.25vw solid #EBB6A1;
  background-image: linear-gradient(70deg, transparent 1vw, #883E30 1vw);
}
.bicy__basket::after {
  content: '.........完整代码请登录后点击上方下载按钮下载查看

网友评论0