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; } } .mout.........完整代码请登录后点击上方下载按钮下载查看
网友评论0