css实现小人跑步嘚瑟动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现小人跑步嘚瑟动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --main-color: rgb(0, 128, 0); --main-color-dark: rgb(0, 100, 0); --unit: 0.85vw; --time: 1.5s; } body { height: 100vh; margin: 0; display: grid; place-items: center; background-color: #5ec96b; background-image: linear-gradient(0deg, #5ec96b 0%, #e9e9e9 100%); } .ground { position: absolute; bottom: calc(6 * var(--unit)); width: calc(64 * var(--unit)); height: calc(4 * var(--unit)); background-color: var(--main-color); border-radius: calc(2 * var(--unit)); } .dude { position: absolute; bottom: calc(20 * var(--unit)); } .upper-body { position: relative; left: 0; bottom: 0; width: calc(28 * var(--unit)); height: calc(36 * var(--unit)); -webkit-animation-name: shuffle; animation-name: shuffle; -webkit-animation-duration: calc(0.5 * var(--time)); animation-duration: calc(0.5 * var(--time)); -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; -webkit-animation-delay: calc(-0.25 * var(--time)); animation-delay: calc(-0.25 * var(--time)); } .melon { position: absolute; right: 0; top: 0; width: calc(8 * var(--unit)); height: calc(8 * var(--unit)); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0