Spaces:
Sleeping
Sleeping
File size: 2,192 Bytes
f6d50b1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connection Test</title>
<style>
body {
font-family: sans-serif;
padding: 20px;
text-align: center;
}
.status {
margin: 20px;
padding: 10px;
border-radius: 5px;
}
.success {
background: #d4edda;
color: #155724;
}
.error {
background: #f8d7da;
color: #721c24;
}
button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Voice Detection Site Connection Test</h1>
<p>Click the button below to test if your browser can reach the live site.</p>
<button onclick="checkSite()">Test Connection</button>
<div id="result" class="status" style="display:none;"></div>
<script>
async function checkSite() {
const resultDiv = document.getElementById('result');
resultDiv.style.display = 'block';
resultDiv.innerHTML = 'Testing connection...';
resultDiv.className = 'status';
try {
// Try to fetch the main page
const response = await fetch('https://ranar118-voice-detection.hf.space/', {
method: 'GET',
mode: 'no-cors' // Use no-cors to avoid CORS errors for simple connectivity check
});
resultDiv.innerHTML = '<strong>✅ Connection Successful!</strong><br>Your browser can reach the site.<br><br><a href="https://ranar118-voice-detection.hf.space/" target="_blank">Click here to open the site</a>';
resultDiv.className = 'status success';
} catch (error) {
resultDiv.innerHTML = '<strong>❌ Connection Failed</strong><br>Error: ' + error.message + '<br><br>Possible connection issue or firewall blocking the site.';
resultDiv.className = 'status error';
}
}
</script>
</body>
</html> |