.pre-loader { display: flex; width: 100%; min-height: 100vh; justify-content: center; align-items: center; } .pre-loader .loader-item { width: 10px; height: 10px; background: #000; } .pre-loader .pre-loader-center { align-items: center; display: flex; flex-direction: column; } .pre-loader .pre-loader-wrapper { width: 50px; height: 50px; display: flex; flex-wrap: wrap; } @media (prefers-color-scheme: light) { .pre-loader .loader-item { background: #000; } } .pre-loader .loader-item:nth-child(0) { animation-delay: 0ms; animation-direction: reverse; } .pre-loader .loader-item:first-child { animation-delay: -50ms; animation-direction: alternate; } .pre-loader .loader-item:nth-child(2) { animation-delay: 0.2s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(3) { animation-delay: -0.6s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(4) { animation-delay: 0.4s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(5) { animation-delay: -0.5s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(6) { animation-delay: 0.3s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(7) { animation-delay: -1.4s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(8) { animation-delay: 2s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(9) { animation-delay: -0.9s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(10) { animation-delay: 1.5s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(11) { animation-delay: -0.55s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(12) { animation-delay: 1.2s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(13) { animation-delay: -0.65s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(14) { animation-delay: 0.7s; animation-direction: reverse; } .pre-loader .loader-item:nth-child(15) { animation-delay: -3.75s; animation-direction: alternate; } .pre-loader .loader-item:nth-child(16) { animation-delay: 1.6s; animation-direction: reverse; } .pre-loader .loader-item { animation: flickering 0.4s linear infinite alternate; } @keyframes flickering { 0% { opacity: 1; } 25% { opacity: 1; } 26% { opacity: 0; } to { opacity: 0; } } html.dark .pre-loader .loader-item { background: #fff; }