Update index.html
This commit is contained in:
parent
0f5770eac5
commit
224f969376
1 changed files with 212 additions and 152 deletions
364
index.html
364
index.html
|
|
@ -3,71 +3,147 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="icon" href="https://pixelhosting.nl/wp-content/uploads/2022/12/cropped-Pixelhosting-logo-favicon-192x192.png" sizes="192x192" />
|
<link rel="icon" href="/favicon.png" sizes="192x192" />
|
||||||
|
<meta name="description" content="IP Weergave Website" />
|
||||||
<meta name="description" content="IP Weergave Website" />
|
<link rel="canonical" href="https://ip.pixelhosting.nl/" />
|
||||||
<meta name="robots" content="max-image-preview:large" />
|
<meta property="og:locale" content="nl_NL" />
|
||||||
<link rel="canonical" href="https://ip.pixelhosting.nl/" />
|
<meta property="og:site_name" content="IP Weergave" />
|
||||||
<meta property="og:locale" content="nl_NL" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:site_name" content="IP Weergave" />
|
<meta property="og:title" content="IP Weergave" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:description" content="IP Weergave Website." />
|
||||||
<meta property="og:title" content="IP Weergave" />
|
<meta property="og:url" content="https://pixelhosting.nl/" />
|
||||||
<meta property="og:description" content="IP Weergave Website." />
|
<meta name="twitter:card" content="summary" />
|
||||||
<meta property="og:url" content="https://pixelhosting.nl/" />
|
<meta name="twitter:title" content="IP Weergave" />
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:description" content="IP Weergave Website" />
|
||||||
<meta name="twitter:title" content="IP Weergave" />
|
|
||||||
<meta name="twitter:description" content="IP Weergave Website" />
|
|
||||||
|
|
||||||
<title>IP Adres Weergave</title>
|
<title>IP Adres Weergave</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: 'Arial', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
background-color: #f4f4f9;
|
background-color: #F0F8FF;
|
||||||
color: #333;
|
color: #2c3e50;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-sizing: border-box;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.container {
|
.container {
|
||||||
background-color: white;
|
background-color: #ffffff;
|
||||||
padding: 30px;
|
padding: 40px;
|
||||||
border-radius: 8px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2.2em;
|
font-size: 2.5em;
|
||||||
color: #5e5e5e;
|
color: #34495e;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
.result {
|
.data-group {
|
||||||
font-size: 1.3em;
|
background-color: #f8f9fa;
|
||||||
margin-top: 20px;
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-top: 25px;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.data-title {
|
||||||
|
font-size: 1.5em;
|
||||||
|
color: #34495e;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.data-item {
|
||||||
|
font-size: 1.1em;
|
||||||
color: #555;
|
color: #555;
|
||||||
background-color: #e6e6e6;
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
word-wrap: break-word;
|
display: flex;
|
||||||
white-space: normal;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
.loading {
|
.data-label {
|
||||||
color: #888;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.data-value {
|
||||||
|
font-weight: normal;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
.data-icon {
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin-right: 8px;
|
||||||
|
color: #07AAF9;
|
||||||
|
}
|
||||||
|
.copy-button {
|
||||||
|
background-color: #07AAF9;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1em;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
.copy-button:hover {
|
||||||
|
background-color: #0588c8;
|
||||||
|
}
|
||||||
|
.loading {
|
||||||
|
color: #7f8c8d;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.copy-success-message {
|
||||||
|
position: fixed;
|
||||||
|
top: -60px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background-color: #28a745;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 25px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: bold;
|
||||||
|
z-index: 1000;
|
||||||
|
transition: top 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
.copy-success-message.show {
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
h1 {
|
.container {
|
||||||
font-size: 1.8em;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
.result {
|
h1 {
|
||||||
font-size: 1.1em;
|
font-size: 2em;
|
||||||
padding: 10px;
|
}
|
||||||
|
.data-group {
|
||||||
|
padding: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.data-item {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.data-label,
|
||||||
|
.data-value {
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
white-space: normal;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.data-label {
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -76,132 +152,116 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>Jouw Publieke IP Adressen</h1>
|
<h1>Jouw Publieke IP Adressen</h1>
|
||||||
<div class="result" id="ipOutput6">
|
|
||||||
<span class="loading">Je IPv6-adres wordt opgehaald...</span>
|
<div class="data-group">
|
||||||
|
<h2 class="data-title">Jouw IPv6-gegevens</h2>
|
||||||
|
<div class="data-item">
|
||||||
|
<span class="data-label"><span class="data-icon">🌐</span>Jouw IPv6-adres:</span>
|
||||||
|
<span class="data-value loading" id="ipOutput6-text">Wordt opgehaald...</span>
|
||||||
|
</div>
|
||||||
|
<div class="data-item">
|
||||||
|
<span class="data-label"><span class="data-icon">⚡</span>Jouw IPv6-latency:</span>
|
||||||
|
<span class="data-value loading" id="latencyOutput6-text">Wordt opgehaald...</span>
|
||||||
|
</div>
|
||||||
|
<button class="copy-button" id="copyBtn6" style="display: none;">Kopieer IP</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="result" id="ipOutput6ms">
|
|
||||||
<span class="loading">Je IPv6 latency wordt opgehaald...</span>
|
<div class="data-group">
|
||||||
</div>
|
<h2 class="data-title">Jouw IPv4-gegevens</h2>
|
||||||
<div class="result" id="ipOutput4">
|
<div class="data-item">
|
||||||
<span class="loading">Je IPv4-adres wordt opgehaald...</span>
|
<span class="data-label"><span class="data-icon">🌐</span>Jouw IPv4-adres:</span>
|
||||||
</div>
|
<span class="data-value loading" id="ipOutput4-text">Wordt opgehaald...</span>
|
||||||
<div class="result" id="ipOutput4ms">
|
</div>
|
||||||
<span class="loading">Je IPv4 latency wordt opgehaald...</span>
|
<div class="data-item">
|
||||||
|
<span class="data-label"><span class="data-icon">⚡</span>Jouw IPv4-latency:</span>
|
||||||
|
<span class="data-value loading" id="latencyOutput4-text">Wordt opgehaald...</span>
|
||||||
|
</div>
|
||||||
|
<button class="copy-button" id="copyBtn4" style="display: none;">Kopieer IP</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="copy-success-message" class="copy-success-message"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Functie om de latency v4 op te halen en weer te geven
|
let ipv4_address = null;
|
||||||
async function fetch4MS() {
|
let ipv6_address = null;
|
||||||
const ipOutput4 = document.getElementById('ipOutput4ms');
|
|
||||||
ipOutput4.innerHTML = '<span class="loading">Je IPv4 latency wordt opgehaald...</span>';
|
|
||||||
|
|
||||||
try {
|
async function fetchIPAndLatency(version) {
|
||||||
const response = await fetch('https://ip-v4.pixelhosting.nl/latency.php');
|
const ipTextElement = document.getElementById(`ipOutput${version}-text`);
|
||||||
|
const latencyTextElement = document.getElementById(`latencyOutput${version}-text`);
|
||||||
|
const copyBtn = document.getElementById(`copyBtn${version}`);
|
||||||
|
const ipUrl = `https://ip-v${version}.pixelhosting.nl/ip-api.php`;
|
||||||
|
const latencyUrl = `https://ip-v${version}.pixelhosting.nl/latency-api.php`;
|
||||||
|
|
||||||
if (!response.ok) {
|
try {
|
||||||
throw new Error(`HTTP-fout! status: ${response.status}`);
|
const ipResponse = await fetch(ipUrl);
|
||||||
|
const ipData = await ipResponse.json();
|
||||||
|
if (ipData.ip) {
|
||||||
|
const ipAddress = ipData.ip;
|
||||||
|
ipTextElement.textContent = ipAddress;
|
||||||
|
copyBtn.style.display = 'block';
|
||||||
|
if (version === 4) {
|
||||||
|
ipv4_address = ipAddress;
|
||||||
|
copyBtn.onclick = () => copyToClipboard(ipv4_address);
|
||||||
|
} else {
|
||||||
|
ipv6_address = ipAddress;
|
||||||
|
copyBtn.onclick = () => copyToClipboard(ipv6_address);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ipTextElement.textContent = `Geen IPv${version}-adres gevonden.`;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ipTextElement.textContent = `Fout bij ophalen van IPv${version}-adres.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
try {
|
||||||
|
let totalLatency = 0;
|
||||||
|
const numTests = 5;
|
||||||
|
|
||||||
if (data.latency_ms) {
|
for (let i = 0; i < numTests; i++) {
|
||||||
ipOutput4ms.textContent = `Jouw Ipv4 latency is: ${data.latency_ms} MS`;
|
const startTime = performance.now();
|
||||||
console.log(`Jouw Ipv4 latency is: ${data.latency_ms} MS`)
|
await fetch(latencyUrl, { cache: 'no-store' });
|
||||||
} else {
|
const endTime = performance.now();
|
||||||
ipOutput4ms.textContent = 'No IPv4 latency found.';
|
totalLatency += (endTime - startTime);
|
||||||
|
}
|
||||||
|
const averageLatency = Math.round(totalLatency / numTests);
|
||||||
|
latencyTextElement.textContent = `${averageLatency} MS`;
|
||||||
|
} catch (error) {
|
||||||
|
latencyTextElement.textContent = `Fout.`;
|
||||||
|
console.error(`Foutdetails (IPv${version}-latency):`, error);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
ipOutput4ms.textContent = 'No IPv4 latency found.';
|
|
||||||
console.error('Foutdetails (IPv4ms):', error);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Functie om de latency v6 op te halen en weer te geven
|
function showCopyMessage(text) {
|
||||||
async function fetch6MS() {
|
const messageBox = document.getElementById('copy-success-message');
|
||||||
const ipOutput6 = document.getElementById('ipOutput6ms');
|
|
||||||
ipOutput6.innerHTML = '<span class="loading">Je IPv6 latency wordt opgehaald...</span>';
|
messageBox.style.display = 'block';
|
||||||
|
messageBox.textContent = `Gekopieerd: ${text}`;
|
||||||
try {
|
messageBox.classList.add('show');
|
||||||
const response = await fetch('https://ip-v6.pixelhosting.nl/latency.php');
|
|
||||||
|
setTimeout(() => {
|
||||||
if (!response.ok) {
|
messageBox.classList.remove('show');
|
||||||
throw new Error(`HTTP-fout! status: ${response.status}`);
|
}, 3000);
|
||||||
}
|
|
||||||
|
setTimeout(() => {
|
||||||
const data = await response.json();
|
messageBox.style.display = 'none';
|
||||||
|
}, 3500);
|
||||||
if (data.latency_ms) {
|
|
||||||
ipOutput6ms.textContent = `Jouw Ipv6 latency is: ${data.latency_ms} MS`;
|
|
||||||
console.log(`Jouw Ipv6 latency is: ${data.latency_ms} MS`)
|
|
||||||
} else {
|
|
||||||
ipOutput6ms.textContent = 'No IPv6 latency found.';
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
ipOutput6ms.textContent = 'No IPv6 latency found.';
|
|
||||||
console.error('Foutdetails (IPv6ms):', error);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Functie om het IPv4-adres op te halen en weer te geven
|
function copyToClipboard(text) {
|
||||||
async function fetchIP4Address() {
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
const ipOutput4 = document.getElementById('ipOutput4');
|
showCopyMessage(text);
|
||||||
ipOutput4.innerHTML = '<span class="loading">Bezig met ophalen van IPv4...</span>';
|
}).catch(err => {
|
||||||
|
console.error('Kopiëren mislukt: ', err);
|
||||||
try {
|
alert("Kopiëren mislukt. Probeer handmatig.");
|
||||||
const response = await fetch('https://ip-v4.pixelhosting.nl/ip-api.php');
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`HTTP-fout! status: ${response.status}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (data.ip) {
|
|
||||||
ipOutput4.textContent = `Jouw IPv4-adres is: ${data.ip}`;
|
|
||||||
console.log(`${data.ip}`)
|
|
||||||
} else {
|
|
||||||
ipOutput4.textContent = 'Geen IPv4-adres gevonden.';
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
ipOutput4.textContent = 'Er lijkt geen IPv4-adres gevonden te zijn.';
|
|
||||||
console.error('Foutdetails (IPv4):', error);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Functie om het IPv6-adres op te halen en weer te geven
|
window.onload = () => {
|
||||||
async function fetchIP6Address() {
|
document.getElementById('copy-success-message').style.display = 'none';
|
||||||
const ipOutput6 = document.getElementById('ipOutput6');
|
fetchIPAndLatency(4);
|
||||||
ipOutput6.innerHTML = '<span class="loading">Bezig met ophalen van IPv6...</span>';
|
fetchIPAndLatency(6);
|
||||||
|
};
|
||||||
try {
|
|
||||||
const response = await fetch('https://ip-v6.pixelhosting.nl/ip-api.php');
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`HTTP-fout! status: ${response.status}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (data.ip) {
|
|
||||||
ipOutput6.textContent = `Jouw IPv6-adres is: ${data.ip}`;
|
|
||||||
console.log(`${data.ip}`)
|
|
||||||
} else {
|
|
||||||
ipOutput6.textContent = 'Geen IPv6-adres gevonden.';
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
ipOutput6.textContent = 'Er lijkt geen IPv6-adres gevonden te zijn.';
|
|
||||||
console.error('Foutdetails (IPv6):', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Roep beide functies aan bij het laden van de pagina
|
|
||||||
window.onload = () => {
|
|
||||||
fetch4MS();
|
|
||||||
fetch6MS();
|
|
||||||
fetchIP4Address();
|
|
||||||
fetchIP6Address();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue