216 views
1.loader { 2 --s: 5px; 3 /* control the size */ 4 width: calc(10*var(--s)); 5 display: grid; 6 aspect-ratio: 1; 7 border-radius: 50%; 8 -webkit-mask: radial-gradient(50% 50%,#0000 calc(99% - 2*var(--s)),#000 calc(101% - 2*var(--s))); 9 animation: r 4s linear infinite; 10} 11 12.loader:before { 13 content: ""; 14 /* adjust the colors below */ 15 background: conic-gradient(from 25deg,#f8a201 25%,#fa2402 0 50%,#fdb3b0 0 75%,#02dde1 0); 16 -webkit-mask: repeating-conic-gradient(#0000 0 25deg,#000 23% 25%), 17 radial-gradient(var(--s) at var(--s) 50%,#000 97%,#0000) 18 left/calc(100% - 2*var(--s)) 100% repeat-x, 19 radial-gradient(var(--s) at 50% var(--s),#000 97%,#0000) 20 top /100% calc(100% - 2*var(--s)) repeat-y; 21} 22 23@keyframes r { 24 to { 25 transform: rotate(1turn) 26 } 27} 28
MIT License