div+css实现小球蹦蹦床loading加载动画效果代码
代码语言:html
所属分类:加载滚动
代码描述:div+css实现小球蹦蹦床loading加载动画效果代码
代码标签: div css 小球 蹦 蹦床 loading 加载 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap"); body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #80c0a1; font-family: "Archivo Black", "Arial Black", sans-serif; overflow: hidden; } .loader { margin-top: 3rem; position: relative; } .loader__trampoline { position: relative; width: 12rem; height: 4rem; border-radius: 50%; background: radial-gradient(ellipse at 50% 50%, #000038, #576078 35%); background-size: 200% 200%; background-position: 50% 50%; border: 0.2rem solid #bdc3c6; box-shadow: 0 1.2rem 1rem 0 rgba(0, 0, 56, 0.5); } .loader__trampoline:before, .loader__trampoline:after { content: ""; position: absolute; width: 0.2rem; height: 1rem; background-color: #bdc3c6; } .loader__trampoline:before { bottom: 0; left: 0.8rem; } .loader__trampoline:after { bottom: 0; right: 0.8rem; } .loader__jumper { position: absolute; top: 0; left: 5rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: radial-gradient(circle at 70% 70%, #eb80b1, #000038 500%); overflow: hidden; } .loader__jumper-face { width: 100%; height: 100%; } .loader__jumper-eyes { position: absolute; top: 35%; left: 20%; display: flex; justify-content: space-between; width: 60%; height: 0.3rem; } .loader__jumper-eyes:before, .loader__jumper-eyes:after { content: ""; width: 0.3rem; height: 0.3rem; border-radius: 50%; background: radial-gradient(circle at 70% 30%, #fff 15%, #000038 15%, #000038); } .loader__jumper-mouth { position: absolute; top: 60%; left: calc(35% - 0.1rem); width: 30%; height: 0.1rem; border-radius: 0 0 1rem 1rem; border: 0.1rem solid #000038; border-top: none; } .loader__text { color: #fff; text-align: center; text-transform: uppercase; padding-top: 2rem; } .loader__trampoline { animation: bounce-trampoline; animation-duration: 10s; animation-timing-function: cubic-bezier(0.52, -0.01, 0.14, 1); animation-iteration-count: infinite; } @keyframes bounce-trampoline { 5% { transform: translateY(0.1rem); box-shadow: 0 1.1rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 50% 45%; } 10%, 15% { transform: translateY(-0.1rem); box-shadow: 0 1.3rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 50% 50%; } 25% { transform: translateY(0.1rem); box-shadow: 0 1.1rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 45% 45%; } 30%, 35% { transform: translateY(-0.1rem); box-shadow: 0 1.3rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 50% 50%; } 45% { transform: translateY(0.1rem); box-shadow: 0 1.1rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 60% 45%; } 50%, 55% { transform: translateY(-0.1rem); box-shadow: 0 1.3rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 50% 50%; } 65% { transform: translateY(0.1rem); box-shadow: 0 1.1rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 40% 40%; } 70%, 75% { transform: translateY(-0.1rem); box-shadow: 0 1.3rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 50% 50%; } 85% { transform: translateY(0.1rem); box-shadow: 0 1.1rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 60% 35%; } 95% { transform: translateY(0.1rem); box-shadow: 0 1.1rem 1rem 0 rgba(0, 0, 56, 0.5); background-position: 48% 50%; } 100% { transform: none; background-position: 50% 50%; } } .loader__jumper { animation: bounce.........完整代码请登录后点击上方下载按钮下载查看
网友评论0