div+css实现可爱卡通小幼鸟第一次展翅飞翔起飞动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现可爱卡通小幼鸟第一次展翅飞翔起飞动画效果代码

代码标签: div css 可爱 卡通 第一次 展翅 飞翔 起飞 动画

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

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

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
*,
*::after,
*::before {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #fff167;
  --color-eye: #363536;
  --color-mouth-1: #fec373;
  --color-mouth-2: #fcb954;
  --color-leg: #fcb954;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-image: radial-gradient(at center, #f8fafc 30%, #f1f5f9 70%);
}

.art {
  animation: _fly 4s linear infinite;
  position: absolute;
}
.art__circle {
  position: absolute;
  width: 20vmax;
  height: 20vmax;
  border-radius: 50%;
  background-image: radial-gradient(at center, #5a5c6a 0%, #202d3a 81.3%);
  animation: circle-ans 4s linear infinite;
}
.art__head {
  --wh: 16vmin;
  width: var(--wh);
  height: var(--wh);
  border-radius: 50%;
  background-color: var(--color-primary);
  position: relative;
}
.art__head::after, .art__head::before {
  content: "";
  position: absolute;
  width: 8vmin;
  height: 7vmin;
  border-radius: 100vmin 2vmin 100vmin 2vmin;
  bottom: 11%;
  background-color: var(--color-primary);
}
.art__head::after {
  left: -1vmin;
  rotate: -60deg;
  animation: left-ans 4s linear infinite;
}
.art__head::before {
  right: -1vmin;
  rotate: -40deg;
  animation: right-ans 4s linear infinite;
}
.art__eye {
  --w: 2.5vmin;
  --h: 2.5vmin;
  width: var(--w);
  height: var(--h);
  background-color: var(--color-eye);
  border-radius: 50%;
  animation: eyes-blink 4s infinite steps(2);
}
.art__eye--wrapper {
  display: flex;
  gap: 3vmin;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 1;
  animation: left-and-right-rotate 4s linear infinite;
}
.art__mouth-helper {
  position: absolute;
  left: 50%;
  bottom: 32%;
  z-index: 1;
  animation: left-and-right-rotate 4s linear infinite;
}
.art__mouth {
  translate: -50% 0;
  width: 2vmin;
  height: 2vmin;
  background-image: linear-gradient(-45deg, var(--color-mouth-2) 50%, var(--color-mouth-1) 50%);
  transform: scaleY(0.6) rotate(45deg);
}
.art__leg {
  position: absolute;
  left: 35%;
  bottom: -1vmin;
  width: 0.8vmin;
  height: 3vmin;
  background-color: var(--color-leg);
  box-shadow: 4vmin 0 0 var(--color-leg);
  z-index: -1;
  animation: leg-ans 4s linear infinite;
}

@keyframes eyes-blink {
  0%, 49% {
    transform: scaleY(0);
  }
  34%, .........完整代码请登录后点击上方下载按钮下载查看

网友评论0