File 8
File 8
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Progress Circle Loader</title>
<link href="https://fonts.googleapis.com/css2?
family=Poppins:wght@600&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
font-family: 'Poppins', sans-serif;
}
.progress-container {
position: relative;
width: 160px;
height: 160px;
}
.progress-ring {
width: 160px;
height: 160px;
border-radius: 50%;
border: 8px solid lightgray;
position: absolute;
}
.progress-fill {
width: 160px;
height: 160px;
border-radius: 50%;
border: 8px solid red;
clip-path: polygon(50% 50%, 100% 0, 100% 100%, 0 100%, 0 0);
transform: rotate(0deg);
position: absolute;
}
.progress-text {
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
font-weight: bold;
color: #333;
}
</style>
</head>
<body>
<div class="progress-container">
<div class="progress-ring"></div>
<div class="progress-fill" id="progressFill"></div>
<div class="progress-text" id="progressText">0%</div>
</div>
<script>
let progress = 0;
const progressText = document.getElementById("progressText");
const progressFill = document.getElementById("progressFill");
function updateProgress() {
if (progress <= 100) {
progressText.innerText = `${progress}%`;
progressFill.style.transform = `rotate(${progress * 3.6}deg)`;
progress++;
setTimeout(updateProgress, 50);
}
}
updateProgress();
</script>
</body>
</html>