Circular Progress
Home
Snippets
Circular Progress
HTML
CSS
JS
<body> <div class="progress-container" id="progress"> <div class="progress-inner" id="progress-text">0%</div> </div> <div class="input-container"> <input type="range" id="progress-range" min="0" max="100" value="0"> </div> </body>
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Arial', sans-serif; } body { background-color: #0d1117; display: flex; justify-content: center; align-items: center; height: 100vh; flex-direction: column; gap: 30px; } .progress-container { position: relative; width: 200px; height: 200px; border-radius: 50%; background: conic-gradient(#00ff80 0deg, #444 0deg); display: flex; justify-content: center; align-items: center; transition: background 0.5s; } .progress-inner { width: 150px; height: 150px; background-color: #0d1117; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #00ffff; font-size: 30px; font-weight: bold; } .input-container { width: 350px; text-align: center; } input[type="range"] { width: 80%; -webkit-appearance: none; background: none; } input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: #444; border-radius: 3px; } input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; background: #00ffff; border-radius: 50%; cursor: pointer; margin-top: -5px; }
const progressContainer = document.getElementById('progress'); const progressText = document.getElementById('progress-text'); const rangeInput = document.getElementById('progress-range'); rangeInput.addEventListener('input', () => { const value = rangeInput.value; progressText.textContent = `${value}%`; progressContainer.style.background = `conic-gradient(#00ff80 ${value * 3.6}deg, #444 0deg)`; });
Ad #1
Ad #2
Scroll to Top