Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <title>Example</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; font-family: sans-serif; background-color: #f0f0f0; } .circular-loader { width: 60px; height: 60px; animation: rotate 2s linear infinite; } .circular-loader circle { stroke: #007bff; stroke-width: 4; stroke-dasharray: 1, 200; stroke-dashoffset: 0; stroke-linecap: round; fill: none; animation: dash 1.5s 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: -35; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124; } } @media (prefers-reduced-motion: reduce) { .circular-loader { /* Still rotate, but extremely slowly */ animation-duration: 10s; } .circular-loader circle { /* Disable the rapid dash stretching */ animation: none; stroke-dasharray: 60, 200; /* Create a static segment */ } } </style> <svg class="circular-loader" viewBox="25 25 50 50"> <circle cx="50" cy="50" r="20"></circle> </svg>