| <!DOCTYPE html>
|
| <html lang="en">
|
| <head>
|
| <meta charset="UTF-8">
|
| <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| <title>Speed Test UI</title>
|
| <script src="https://cdn.tailwindcss.com"></script>
|
| <style>
|
| body {
|
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| }
|
|
|
| #progress {
|
| transform: rotate(-90deg);
|
| transform-origin: center;
|
| transition: stroke-dasharray 1s ease-in-out;
|
| }
|
|
|
| .glow {
|
| box-shadow: 0 0 30px #3b82f6, 0 0 60px #3b82f6;
|
| }
|
| </style>
|
| </head>
|
| <body class="bg-[#0f172a] h-screen flex items-center justify-center">
|
|
|
|
|
| <div class="relative w-[600px] h-[400px] bg-[#1e293b] rounded-xl shadow-xl glow">
|
|
|
| <div class="flex items-center justify-center h-full">
|
| <div class="relative">
|
| <svg class="w-64 h-64" viewBox="0 0 36 36">
|
| <path class="text-gray-700" fill="none" stroke="currentColor" stroke-width="4" d="M18 2a16 16 0 0 1 0 32 16 16 0 0 1 0-32"></path>
|
| <path id="progress" fill="none" stroke="#3b82f6" stroke-width="4" stroke-linecap="round" stroke-dasharray="0, 100" d="M18 2a16 16 0 0 1 0 32 16 16 0 0 1 0-32"></path>
|
| </svg>
|
| <div class="absolute inset-0 flex items-center justify-center text-white text-5xl font-bold" id="speed">0</div>
|
| <div class="absolute bottom-5 left-10 text-white">
|
| <span class="text-sm">Ping</span>
|
| <div class="text-lg" id="ping">-- ms</div>
|
| </div>
|
| <div class="absolute bottom-5 right-10 text-white">
|
| <span class="text-sm">Download</span>
|
| <div class="text-lg" id="download">-- Mbps</div>
|
| </div>
|
| </div>
|
| </div>
|
|
|
|
|
| <div class="absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t from-blue-600 opacity-75 animate-pulse"></div>
|
| </div>
|
|
|
| <script>
|
|
|
| const speedElement = document.getElementById('speed');
|
| const pingElement = document.getElementById('ping');
|
| const downloadElement = document.getElementById('download');
|
| const progressElement = document.getElementById('progress');
|
|
|
| let speed = 0;
|
| let progress = 0;
|
|
|
| function animateSpeed() {
|
| const targetSpeed = Math.floor(Math.random() * 150) + 50;
|
| const ping = Math.floor(Math.random() * 50) + 10;
|
| const download = (targetSpeed - Math.random() * 10).toFixed(2);
|
|
|
| let interval = setInterval(() => {
|
| if (speed >= targetSpeed) {
|
| clearInterval(interval);
|
| } else {
|
| speed += 2;
|
| progress = (speed / 200) * 100;
|
| speedElement.textContent = speed;
|
| progressElement.style.strokeDasharray = `${progress}, 100`;
|
| }
|
| }, 50);
|
|
|
| setTimeout(() => {
|
| pingElement.textContent = `${ping} ms`;
|
| downloadElement.textContent = `${download} Mbps`;
|
| }, 2000);
|
| }
|
|
|
|
|
| document.addEventListener('DOMContentLoaded', () => {
|
| animateSpeed();
|
| });
|
| </script>
|
|
|
| </body>
|
| </html>
|
|
|