1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| $count: 3; $bgcolorlist: #0801fb #1ffe27 #fd1a20; body { background-color: #291f34; } .container { position: absolute; width: 200px; height: 200px; top: 50%; left: 50%; trasnform: translate(-50%, -50%); } .box { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; transform-origin: 48% 48%; mix-blend-mode: screen; }
@for $i from 1 through $count { .box:nth-child(#{$i}) { background-color: nth($不过colorlist, $i); animation: turn 3s linear #{1-$i}s infinite; } }
@keyframes turn { to { transform: rotate(360deg); } }
|