Color-Mix CSS Loader
Home
Snippets
Color-Mix CSS Loader
HTML
CSS
JS
<div class="holder"> <div class="b" id="b1"></div> <div class="b" id="b2"></div> <div class="b" id="b3"></div> <div class="b" id="b4"></div> </div>
body { background: #0e0f0e; display: grid; place-items: center; height: 100vh; margin: 0; } .holder { position: relative; transform: rotate(45deg); border: 1.5px solid #fff; width: 120px; height: 120px; isolation: isolate; box-shadow: 0 0 2px 2px rgba(0,0,0,0.125), inset 0 0 1px 1px rgba(0,0,0,0.125); animation: holderStep 1.85s linear infinite alternate; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); } #b1, #b2, #b3, #b4 { position: absolute; width: 60px; height: 60px; opacity: 0.85; } #b1 { top: 3.75px; left: 3.75px; animation: m1 1s .75s linear infinite alternate, colorShift 4s 1s linear infinite; } #b2 { top: 3.75px; right: 3.75px; animation: m2 1s 1.75s linear infinite alternate, colorShift 4s 2s linear infinite; } #b4 { bottom: 3.75px; right: 3.75px; animation: m4 1s 2.75s linear infinite alternate, colorShift 4s 3s linear infinite; } #b3 { bottom: 3.75px; left: 3.75px; animation: m3 1s 3.75s linear infinite alternate, colorShift 4s 4s linear infinite; } @keyframes holderStep { 0% { transform: rotate(45deg); } 100% { transform: rotate(-90deg); } } @keyframes m1 { to { top: 31.25px; left: 31.25px; } } @keyframes m2 { to { top: 31.25px; right: 31.25px; } } @keyframes m3 { to { bottom: 31.25px; left: 31.25px; } } @keyframes m4 { to { bottom: 31.25px; right: 31.25px; } } @keyframes colorShift { 0% { background: color-mix(in srgb, #f07 60%, #fff 25%); } 50% { background: color-mix(in srgb, #07f 60%, #fff 25%); } 100% { background: color-mix(in srgb, #0c6 60%, #fff 25%); } }
//javascript
Ad #1
Ad #2
Scroll to Top