css布局实现小鸟合成动画效果代码

代码语言:html

所属分类:动画

代码描述:css布局实现小鸟合成动画效果代码

代码标签: 小鸟 合成 动画 效果

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


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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
* {
    margin: 0;
    padding: 0;
}

:root {
    --body: #ff533e;
    --mouth: #000000;
    --feather: #939393;
    --beak-top: #e9581a;
    --beak-down: #aa4c21;
    --leg: #00adef;
}

body {
    background: #e3edf7;
    font-family: sans-serif;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 400px;
    height: 400px;
    position: relative;
}

 .body,  .mouth,  .feather,  .tail, .beak, .mouth::before, .mouth::after, .leg, .leg::after, .leg::before {
    position: absolute;
}
 .body,  .mouth, .feather, .beak, .mouth::before, .mouth::after  {
    border-radius: 50%;
}

.body {
    top: 26px;
    left: 50px;
    height: 180px;
    width: 200px;
    transform: rotate(-17deg);
    background: linear-gradient(to bottom, transparent 0%, transparent 20%, var(--body) 20%);
    z-index: 2;
}

.mouth {    
    background:  var(--mouth);
    top: 20px;
    left: -175px;
    width: 100px;
    height: 100px;
    transform: rotate(-17deg);
    z-index: 5;
    animation: animate-mouth 1.5s forwards;
    animation-delay: 2s;
}

@keyframes animate-mouth {
    100% {
        left: 175px;
    }
}
.mouth::before {
    content: "";
    width: 30px;
    height: 30px;
    background: white;
    position: absolute;
    top: 20px;
    left: 40px;
}
.mouth::after {
    content: "";
    width: 10px;
    height: 10px;
    background: black;
    position: absolute;
    top: 30px;
    left: 55px;
    animation: animate-eye 1s infinite;
    animation-delay: 4s;
}

@keyframes animate-eye {
    50% {
        height: 5px;
    }
}


.feather {
    z-index: 4;
    left: 44px;
    top: -206px;
    width: 150px;
    height: 150px;
    background: linear-gradient(to bottom, transparent 0%, transparent 50%, var(--feather) 50%);
    transform: rotate(-17deg);.........完整代码请登录后点击上方下载按钮下载查看

网友评论0