Google Material Design Circular Spinner
Home
Snippets
Google Material Design Circular Spinner
HTML
CSS
JS
<div class="google-loader-container"> <svg class="spinner" viewBox="0 0 50 50"> <circle class="spinner-path" cx="25" cy="25" r="20" fill="none" stroke-width="5px"> </circle> </svg> </div>
:root { --g-blue: #4285f4; --g-red: #ea4335; --g-yellow: #fbbc05; --g-green: #34a853; } body { margin: 0; background-color: #ffffff; height: 100vh; display: flex; justify-content: center; align-items: center; } .google-loader-container { width: 100px; height: 100px; } .spinner { animation: rotate 2s linear infinite; width: 100%; height: 100%; } .spinner-path { stroke-dasharray: 1, 200; stroke-dashoffset: 0; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite, colors 5.6s ease-in-out infinite; } @keyframes rotate { 100% { transform: rotate(360deg); } } @keyframes dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } } @keyframes colors { 0%, 100% { stroke: var(--g-blue); } 25% { stroke: var(--g-red); } 50% { stroke: var(--g-yellow); } 75% { stroke: var(--g-green); } }
//javascript
Ad #1
Ad #2
Scroll to Top