纯css 条纹动画效果
代码语言:html
所属分类:动画
代码描述:纯css 条纹动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { background: #fff; height: 100vh; overflow: hidden; display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; } .stripes { display: -webkit-box; display: flex; justify-content: space-around; -webkit-box-align: center; align-items: center; width: 100%; height: 100%; } .stripe { position: relative; margin: 0 1px; border-radius: 999px; -webkit-animation: motion 3s ease-in-out infinite alternate; animation: motion 3s ease-in-out infinite alternate; } .stripe::before { content: ''; position: absolute; bottom: calc(-100% - 1px); height: 100%; width: 100%; background: #000; border-radius: 999px; } .stripe::after { content: ''; position: absolute; bottom: calc(-200% - 2px); height: 100%; width: 100%; background: #000; border-radius: 999px; } .stripe:nth-child(1) { width: 13.1vw; height: 66%; background: #63d6ed; -webkit-animation-delay: 10ms; animation-delay: 10ms; } .stripe:nth-child(1)::before { background: #c7ffed; } .stripe:nth-child(1)::after { background: #63d6ed; } .stripe:nth-child(2) { width: 7.1vw; height: 69%; background: #32a1ca; -webkit-animation-delay: 20ms; animation-delay: 20ms; } .stripe:nth-child(2)::before { background: #96d3ca; } .stripe:nth-child(2)::after { background: #32a1ca; } .stripe:nth-child(3) { width: 18.1vw; height: 46%; background: #58a7c6; -webkit-animation-delay: 30ms; animation-delay: 30ms; } .stripe:nth-child(3)::before { background: #bcd9c6; } .stripe:nth-child(3)::after { background: #58a7c6; } .stripe:nth-child(4) { width: 19.1vw; height: 77%; background: #1af0a5; -webkit-animation-delay: 40ms; animation-delay: 40ms; } .stripe:nth-child(4)::before { background: #7effa5; } .stripe:nth-child(4)::after { background: #1af0a5; } .stripe:nth-child(5) { width: 5.1vw; height: 37%; background: #1fa6ee; -webkit-animation-delay: 50ms; animation-delay: 50ms; } .stripe:nth-child(5)::before { background: #83d8ee; } .stripe:nth-child(5)::after { background: #1fa6ee; } .stripe:nth-child(6) { width: 10.1vw; height: 70%; background: #1bc5f6; -webkit-animation-delay: 60ms; animation-delay: 60ms; } .stripe:nth-child(6)::before { background: #7ff7f6; } .stripe:nth-child(6)::after { background: #1bc5f6; } .stripe:nth-child(7) { width: 15.1vw; height: 32%; background: #0ad8ec; -webkit-animation-delay: 70ms; animation-delay: 70ms; } .stripe:nth-child(7)::before { background: #6effec; } .stripe:nth-child(7)::after { background: #0ad8ec; } .stripe:nth-child(8) { width: 15.1vw; height: 32%; background: #0cd7af; -webkit-animation-delay: 80ms; animation-delay: 80ms; } .stripe:nth-child(8)::before { background: #70ffaf; } .stripe:nth-child(8)::after { background: #0cd7af; } .stripe:nth-child(9) { width: 9.1vw; height: 53%; background: #48eeac; -webkit-animation-delay: 90ms; animation-delay: 90ms; } .stripe:nth-child(9)::before { background: #acffac; } .stripe:nth-child(9)::after { background: #48eeac; } .stripe:nth-child(10) { width: 20.1vw; height: 63%; background: #46b7f8; -webkit-animation-delay: 100ms; animation-delay: 100ms; } .stripe:nth-child(10)::before { background: #aae9f8; } .stripe:nth-child(10)::after { background: #46b7f8; } .stripe:nth-child(11) { width: 7.1vw; height: 65%; background: #4ed8ed; -webkit-animation-delay: 110ms; animation-delay: 110ms; } .stripe:nth-child(11)::before { background: #b2ffed; } .stripe:nth-child(11)::after { background: #4ed8ed; } .stripe:nth-child(12) { width: 11.1vw; height: 36%; background: #0fd3e1; -webkit-animation-delay: 120ms; animation-delay: 120ms; } .stripe:nth-child(12)::before { background: #73ffe1; } .stripe:nth-child(12)::after { background: #0fd3e1; } .stripe:nth-child(13) { width: 17.1vw; height: 43%; background: #2ced9f; -webkit-animation-delay: 130ms; animation-delay: 130ms; } .stripe:nth-child(13)::before { background: #90ff9f; } .stripe:nth-child(13)::after { background: #2ced9f; } .stripe:nth-child(14) { width: 2.1vw; height: 67%; background: #03f6d4; -webkit-animation-delay: 140ms; animation-delay: 140ms; } .stripe:nth-child(14)::before { background: #67ffd4; } .stripe:nth-child(14)::after { background: #03f6d4; } .stripe:nth-child(15) { width: 5.1vw; height: 78%; background: #42aea2; -webkit-animation-delay: 150ms; animation-delay: 150ms; } .stripe:nth-child(15)::before { background: #a6e0a2; } .stripe:nth-child(15)::after { background: #42aea2; } .stripe:nth-child(16) { width: 18.1vw; height: 61%; background: #2af9b4; -webkit-animation-delay: 160ms; animation-delay: 160ms; } .stripe:nth-child(16)::before { background: #8effb4; } .stripe:nth-child(16)::after { background: #2af9b4; } .stripe:nth-child(17) { width: 10.1vw; height: 80%; background: #1ebdc2; -webkit-animation-delay: 170ms; animation-delay: 170ms; } .stripe:nth-child(17)::before { background: #82efc2; } .stripe:nth-child(17)::after { background: #1ebdc2; } .stripe:nth-child(18) { width: 12.1vw; height: 75%; background: #3ddef5; -webkit-animation-delay: 180ms; animation-delay: 180ms; } .stripe:nth-child(18)::before { background: #a1fff5; } .stripe:nth-child(18)::after { background: #3ddef5; } .stripe:nth-child(19) { width: 1.1vw; height: 47%; background: #59e2b1; -webkit-animation-delay: 190ms; animation-delay: 190ms; } .stripe:nth-child(19)::before { background: #bdffb1; } .stripe:nth-child(19)::after { background: #59e2b1; } .stripe:nth-child(20) { width: 13.1vw; height: 40%; background: #21afbb; -webkit-animation-delay: 200ms; animation-delay: 200ms; } .stripe:nth-child(20)::before { background: #85e1bb; } .stripe:nth-child(20)::after { background: #21afbb; } .stripe:nth-child(21) { width: 15.1vw; height: 67%; background: #37aebe; -webkit-animation-delay: 210ms; animation-delay: 210ms; } .stripe:nth-child(21)::before { background: #9be0be; } .stripe:nth-child(21)::after { background: #37aebe; } .stripe:nth-child(22) { width: 13.1vw; height: 45%; background: #42faec; -webkit-animation-delay: 220ms; animation-delay: 220ms; } .stripe:nth-child(22)::before { background: #a6ffec; } .stripe:nth-child(22)::after { background: #42faec; } .stripe:nth-child(23) { width: 5.1vw; height: 32%; background: #5cd2d6; -webkit-animation-delay: 230ms; animation-delay: 230ms; } .stripe:nth-child(23)::before { background: #c0ffd6; } .stripe:nth-child(23)::after { background: #5cd2d6; } .stripe:nth-child(24) { width: 7.1vw; height: 78%; background: #1ab4f3; -webkit-animation-delay: 240ms; animation-delay: 240ms; } .stripe:nth-child(24)::before { background: #7ee6f3; } .stripe:nth-child(24)::after { background: #1ab4f3; } .stripe:nth-child(25) { width: 13.1vw; height: 78%; background: #0bd7c2; -webkit-animation-delay: 250ms; animation-delay: 250ms; } .stripe:nth-child(25)::before { background: #6fffc2; } .stripe:nth-child(25)::after { background: #0bd7c2; } .stripe:nth-child(26) { width: 8.1vw; height: 36%; background: #09faec; -webkit-animation-delay: 260ms; animation-delay: 260ms; } .stripe:nth-child(26)::before { background: #6dffec; } .stripe:nth-child(26)::after { background: #09faec; } .stripe:nth-child(27) { width: 10.1vw; height: 66%; background: #61c2a8; -webkit-animation-delay: 270ms; animation-delay: 270ms; } .stripe:nth-child(27)::before { background: #c5f4a8; } .stripe:nth-child(27)::after { background: #61c2a8; } .stripe:nth-child(28) { width: 5.1vw; height: 32%; background: #29b7d6; -webkit-animation-delay: 280ms; animation-delay: 280ms; } .stripe:nth-child(28)::before { background: #8de9d6; } .stripe:nth-child(28)::after { background: #29b7d6; } .stripe:nth-child(29) { width: 6.1vw; height: 35%; background: #34b2c6; -webkit-animation-delay: 290ms; animation-delay: 290ms; } .stripe:nth-child(29)::before { background: #98e4c6; } .stripe:nth-child(29)::after { background: #34b2c6; } .stripe:nth-child(30) { width: 15.1vw; height: 38%; background: #53a6e9; -webkit-animation-delay: 300ms; animation-delay: 300ms; } .stripe:nth-child(30)::before { background: #b7d8e9; } .stripe:nth-child(30)::after { background: #53a6e9; } .stripe:nth-child(31) { width: 7.1vw; height: 50%; background: #45f1ff; -webkit-animation-delay: 310ms; animation-delay: 310ms; } .stripe:nth-child(31)::before { background: #a9ffff; } .stripe:nth-child(31)::after { background: #45f1ff; } .stripe:nth-child(32) { width: 8.1vw; height: 70%; background: #4a9fb9; -webkit-animation-delay: 320ms; animation-delay: 320ms; } .stripe:nth-child(32)::before { background: #aed1b9; } .stripe:nth-child(32)::after { background: #4a9fb9; } .stripe:nth-child(33) { width: 7.1vw; height: 48%; background: #3da8b6; -webkit-animation-delay: 330ms; animation-delay: 330ms; } .stripe:nth-child(33)::before { background: #a1dab6; } .stripe:nth-child(33)::after { background: #3da8b6; } .stripe:nth-child(34) { width: 18.1vw; height: 79%; background: #1ee49f; -webkit-animation-delay: 340ms; animation-delay: 340ms; } .stripe:nth-child(34)::before { background: #82ff9f; } .stripe:nth-child(34)::after { background: #1ee49f; } .stripe:nth-child(35) { width: 6.1vw; height: 70%; background: #0ff5aa; -webkit-animation-delay: 350ms; animation-delay: 350ms; } .stripe:nth-child(35)::before { background: #73ffaa; } .stripe:nth-child(35)::after { background: #0ff5aa; } .stripe:nth-child(36) { width: 1.1vw; height: 74%; background:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0