css实现多彩圆圈动态动画效果代码
代码语言:html
所属分类:加载滚动
代码描述:css实现多彩圆圈动态动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> #btn--yp { box-sizing: content-box; position: fixed; z-index: 9; bottom: 1em; right: 1em; border: solid 1em transparent; width: 4.625em; height: 3.25em; font: 16px/ 1.25 trebuchet ms, sans-serif; text-indent: 200vw; text-shadow: none; filter: grayscale(1) drop-shadow(0 0 1px #e8e0e0); transition: .5s; white-space: nowrap; } #btn--yp:before { box-sizing: inherit; position: absolute; left: 0; bottom: 100%; margin: 1em -.5em; padding: .5em; width: 100%; border-radius: 5px; background: #e8e0e0; color: #000; text-align: center; text-decoration: none; text-indent: 0vw; white-space: normal; animation: float 1s ease-in-out infinite alternate; content: attr(data-txt); } #btn--yp:hover, #btn--yp:focus { outline: none; filter: grayscale(0) drop-shadow(0 0 1px crimson); } @keyframes float { to { transform: translateY(0.75em); } } body { display: grid; margin: 0; height: 100vh; background: #000; } div { grid-area: 1/1; } .dot { display: grid; place-self: center; transform: rotate(calc(var(--k)*1turn)) translate(calc(0.5em/var(--tan))); } @keyframes a { to { transform: scale(0); } } .lyr { --t: calc((1 + var(--c))*1s); padding: 0.5em; border-radius: 50%; background: hsl(calc(var(--c)/var(--m)*360), 100%, 50%); mix-blend-mode: screen; animation: a var(--t) ease-in-out calc(var(--k)*-2*var(--t)) infinite alternate; } </style> </head> <body translate="no"> <style> body { --tan: 0.087; --m: 3 } .lyr:nth-child(1) { --c: 0 } .lyr:nth-child(2) { --c: 1 } .lyr:nth-child(3) { --c: 2 } </style> <div class="dot" style="--k: 0"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.028"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.056"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.083"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.111"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.139"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.167"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.194"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.222"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.25"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.278"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.306"> <div class="lyr"></div> <div class="lyr"></div> <div class="lyr"></div> </div> <div class="dot" style="--k: 0.333"> <div class="lyr"></div> <div class="lyr"></div> <div class=.........完整代码请登录后点击上方下载按钮下载查看
网友评论0