div+css实现奶牛掉坑里404动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现奶牛掉坑里404动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Cabin+Sketch:wght@400;700&display=swap'> <style> *, *:after, *:before { box-sizing: border; } :root { font-size: 0.75vw; --bg:#FF8A65; --anime-speed: 0.2s; } body { height: 100vh; font-family: arial; background: var(--bg); overflow: hidden; } .cow { width: 30rem; aspect-ratio: 2/1; border-radius: 4rem/15%; background-color: #fefefe; position: absolute; top: 40%; z-index: 10; transform-origin: 100% 150%; left: 38%; transform: translateY(15rem) rotate(90deg); animation: jmb var(--anime-speed) linear, move calc(var(--anime-speed) * 10) linear; } .cow:before { content: ""; position: absolute; left: 11%; top: 0; width: 40%; height: 60%; color: #000; background: currentcolor; border-radius: 0 0 100% 50%; box-shadow: 9rem -2rem 0 -2rem, 15rem -3rem 0 -3rem; } .cow:after { content: ""; position: absolute; left: 20%; bottom: 6%; color: #000; background: currentcolor; box-shadow: 8rem -4rem 0 -1rem; width: 5rem; aspect-ratio: 1/1; border-radius: 43% 57% 51% 49%/51% 55% 45% 49%; } .cow .head { position: absolute; top: 0; left: 100%; z-index: 1; } .cow .head .face { width: 11rem; aspect-ratio: 12.5/7.5; background: #fff; box-shadow: -2rem 4.5rem #000 inset; border-radius: 10% 100% 50% 45%/44% 72% 26% 25%; transform: rotateX(180deg) rotate(-55deg) translate(-25%, -55%); position: relative; z-index: 10; } .cow .head:after, .cow .head:before { content: ""; position: absolute; top: -3.5rem; left: -5.5rem; transform: rotate(-25deg); background: #000; width: 4rem; height: 5rem; z-index: 20; box-shadow: 0.2rem 0.1rem 0 0.2rem #fff inset; border-radius: 0% 100% 38% 62%/41% 73% 27% 59%; } .cow .head:before { z-index: 2; top: -4rem; left: -5rem; transform: rotate(-5deg); } .cow .leg { position: absolute; top: 95%; background: #FFF; width: 1.5rem; height: 3rem; transform-origin: top center; } .cow .leg:after { content: ""; position: absolute; left: 0; top: 90%; width: 100%; height: 2.5rem; background: #FFF; border-bottom: 1.5rem sol.........完整代码请登录后点击上方下载按钮下载查看
网友评论0