Add index.html
This commit is contained in:
parent
e1188a853d
commit
78b9ed11a0
1 changed files with 148 additions and 0 deletions
148
index.html
Normal file
148
index.html
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="nl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<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" />
|
||||
|
||||
<meta name="description" content="IP Weergave Website" />
|
||||
<meta name="robots" content="max-image-preview:large" />
|
||||
<link rel="canonical" href="https://ip.pixelhosting.nl/" />
|
||||
<meta property="og:locale" content="nl_NL" />
|
||||
<meta property="og:site_name" content="IP Weergave" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="IP Weergave" />
|
||||
<meta property="og:description" content="IP Weergave Website." />
|
||||
<meta property="og:url" content="https://pixelhosting.nl/" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="IP Weergave" />
|
||||
<meta name="twitter:description" content="IP Weergave Website" />
|
||||
|
||||
<title>IP Adres Weergave</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Arial', sans-serif;
|
||||
background-color: #f4f4f9;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.container {
|
||||
background-color: white;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||
width: 90%;
|
||||
max-width: 600px;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2.2em;
|
||||
color: #5e5e5e;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.result {
|
||||
font-size: 1.3em;
|
||||
margin-top: 20px;
|
||||
color: #555;
|
||||
background-color: #e6e6e6;
|
||||
padding: 15px;
|
||||
border-radius: 6px;
|
||||
font-weight: bold;
|
||||
word-wrap: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
.loading {
|
||||
color: #888;
|
||||
font-style: italic;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
h1 {
|
||||
font-size: 1.8em;
|
||||
}
|
||||
.result {
|
||||
font-size: 1.1em;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<h1>Jouw Publieke IP Adressen</h1>
|
||||
<div class="result" id="ipOutput6">
|
||||
<span class="loading">Je IPv6-adres wordt opgehaald...</span>
|
||||
</div>
|
||||
<div class="result" id="ipOutput4">
|
||||
<span class="loading">Je IPv4-adres wordt opgehaald...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Functie om het IPv4-adres op te halen en weer te geven
|
||||
async function fetchIP4Address() {
|
||||
const ipOutput4 = document.getElementById('ipOutput4');
|
||||
ipOutput4.innerHTML = '<span class="loading">Bezig met ophalen van IPv4...</span>';
|
||||
|
||||
try {
|
||||
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
|
||||
async function fetchIP6Address() {
|
||||
const ipOutput6 = document.getElementById('ipOutput6');
|
||||
ipOutput6.innerHTML = '<span class="loading">Bezig met ophalen van IPv6...</span>';
|
||||
|
||||
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 = () => {
|
||||
fetchIP4Address();
|
||||
fetchIP6Address();
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue