Language Translator Tool
Language Translator Tool
Translation will appear here...
SpeedTest Checker Tool
SpeedTest Checker Tool
Check your internet speed in real-time
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(to bottom, #0072ff, #00c6ff);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
text-align: center;
max-width: 600px;
padding: 20px;
background: rgba(0, 0, 0, 0.7);
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
h1 {
font-size: 2rem;
margin-bottom: 10px;
}
p {
margin-bottom: 20px;
}
.test-box {
margin-bottom: 20px;
}
button {
padding: 10px 20px;
font-size: 1rem;
color: #fff;
background: #28a745;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background: #218838;
}
.results {
display: flex;
justify-content: space-around;
margin-top: 20px;
}
.result {
text-align: center;
}
.result h3 {
margin-bottom: 5px;
font-size: 1.2rem;
}
.result p {
font-size: 1.5rem;
font-weight: bold;
color: #28a745;
}
canvas {
margin-top: 20px;
}
document.getElementById("start-test").addEventListener("click", async () => {
const downloadSpeed = await simulateDownloadSpeed();
const uploadSpeed = await simulateUploadSpeed();
const ping = simulatePing();
// Update UI
document.getElementById("download-speed").innerText = `${downloadSpeed} Mbps`;
document.getElementById("upload-speed").innerText = `${uploadSpeed} Mbps`;
document.getElementById("ping").innerText = `${ping} ms`;
// Update Chart
updateChart(downloadSpeed, uploadSpeed, ping);
});
// Simulate download speed
async function simulateDownloadSpeed() {
return new Promise((resolve) => {
setTimeout(() => {
const speed = (Math.random() * 100 + 50).toFixed(2); // Random speed between 50-150 Mbps
resolve(speed);
}, 2000);
});
}
// Simulate upload speed
async function simulateUploadSpeed() {
return new Promise((resolve) => {
setTimeout(() => {
const speed = (Math.random() * 50 + 10).toFixed(2); // Random speed between 10-60 Mbps
resolve(speed);
}, 2000);
});
}
// Simulate ping
function simulatePing() {
return Math.floor(Math.random() * 50 + 10); // Random ping between 10-60 ms
}
// Chart.js integration
const ctx = document.getElementById("speedChart").getContext("2d");
const speedChart = new Chart(ctx, {
type: "bar",
data: {
labels: ["Download Speed", "Upload Speed", "Ping"],
datasets: [
{
label: "Speed Test Results",
data: [0, 0, 0],
backgroundColor: ["#007bff", "#28a745", "#ffc107"],
},
],
},
options: {
scales: {
y: {
beginAtZero: true,
},
},
},
});
// Update chart with results
function updateChart(downloadSpeed, uploadSpeed, ping) {
speedChart.data.datasets[0].data = [downloadSpeed, uploadSpeed, ping];
speedChart.update();
}