纯css实现漏斗加载动画效果
代码语言:html
所属分类:加载滚动
代码描述:纯css实现漏斗加载动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> html, body { margin: 0; padding: 0; } .container { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(45deg, #499bea 0%, #20ffe5 100%); } .loading-icon { height: 100px; width: 100px; border-radius: 100%; } .circle-bg { border-radius: 100%; background: linear-gradient(45deg, #499bea 0%, #20ffe5 100%); } .inner-circle { height: 90px; width: 90px; transform: rotate(90deg); position: absolute; top: 50%; left: 50%; margin-top: -45px; margin-left: -45px; border-radius: 100%; animation: hourglass-rotate 4s ease-in-out infinite alternate; } @keyframes hourglass-rotate { 0% { transform: rotate(0); } 35% { transform: rotate(0); } 65% { transform: rotate(180deg); } 100% { transform: rotate(180deg); } } circle.rotate { transform: rotate(-90deg); transform-origin: 50% 50%; stroke-width: 20px; stroke: rgba(255, 255, 255, 0.25); fill: transparent; stroke-dasharray: 600; stroke-dashoffset: 600; animation: anim-circle-border 2s ease-in-out infinite alternate; } @keyframes anim-circle-border { 0% { stroke-dashoffset: 600; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -600; } } .hourglass-inner { position: absolute; width: 100%; height: 100%; } .hourglass-inner::before, .hourglass-inner::after { content: ""; position: absolute; width: 26px; height: 9px; left: 32px; background: #c8ffc8; border-radius: 3px 3px 350px 350px; top: 28px; } .hourglass-inner::before { animation: sand-down-before 8s ease-in-out infinite; animation-delay: 4s; } .hourglass-inner::after { border-radius: 350px 350px 0px 0px; top: 53px; animation: sand-down-before 8s ease-in-out infinite; } .hourglass-inner b { position: absolute; background: #c8ffc8; width: 3px; height: 20px; top: 35px; left: 49%; } .hourglass-inner b::before, .hourglass-inner b::after { content: ""; width: 0; height: 0; left: .........完整代码请登录后点击上方下载按钮下载查看
网友评论0