div+css实现纪念碑谷游戏场景效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现纪念碑谷游戏场景效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --bs: 40px; } * { box-sizing: border-box; } body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(to bottom, #b4bba2, #2ab2aa); } .bird, .girl { position: absolute; width: 40px; height: 60px; z-index: 10; } .bird .inner, .girl .inner { display: flex; justify-content: center; position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .bird .body, .girl .body { position: relative; height: 0; width: 0; border: 12px solid transparent; border-bottom: 26px solid #1c3765; } .bird .body::after, .girl .body::after { z-index: -1; content: ""; position: absolute; width: 24px; height: 10px; background: #1c3765; transform: translate(-50%, 21px); border-radius: 50%; box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 0.05); } .bird .leg, .girl .leg { z-index: -1; position: absolute; height: 12px; width: 3px; background-color: #1c3765; border-radius: 4px; } .bird .leg::before, .girl .leg::before { position: absolute; content: ""; background-color: #1c3765; width: 5px; height: 4px; right: 0px; top: 10px; transform: rotate(-30deg); border-radius: 50%; } .bird .leg.l, .girl .leg.l { left: 13px; bottom: 9px; } .bird .leg.r, .girl .leg.r { left: 20px; bottom: 6px; } .bird .neck, .girl .neck { position: absolute; height: 5px; width: 5px; background: #1c3765; border-radius: 5px; top: 16px; } .bird .head, .girl .head { position: absolute; width: 18px; height: 18px; border-radius: 50%; background-color: #1c3765; top: 2px; } .bird { top: 160px; left: 270px; } .bird .head { transform: rotate(-25deg); } .bird .head .eye { top: 5px; left: 7px; position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid white; z-index: 2; transform-origin: center; -webkit-animation: blink 10s linear infinite; animation: blink 10s linear infinite; } .bird .head::before, .bird .head::after { content: ""; position: absolute; width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-right: 25px solid #1c3765; right: 9px; top: 0; transform-origin: right center; transform: rotate(0deg); } .bird .head::before { -webkit-animation: chirp-top 10s ease-in-out infinite; animation: chirp-top 10s ease-in-out infinite; } .bird .head::after { -webkit-animation: chirp-bot 10s ease-in-out infinite; animation: chirp-bot 10s ease-in-out infinite; } .bird .leg { transform-origin: top center; -webkit-animation: leg-swing 10s ease infinite; animation: leg-swing 10s ease infinite; } .bird .leg.r { -webkit-animation-delay: 0.1s; animation-delay: 0.1s; } .girl { --col: #d32c3b; top: 440px; left: 365px; } .girl .head { overflow: hidden; background-color: var(--col); } .girl .head::after { content: ""; position: absolute; width: 15px; height: 15px; background-color: white; border-radius: 10px; top: 5px; l.........完整代码请登录后点击上方下载按钮下载查看
网友评论0