-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
349fa55
commit 6454432
Showing
9 changed files
with
936 additions
and
182 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="robots" content="noindex" /> | ||
<link rel="stylesheet" href="/main.css" /> | ||
<title>404 not found</title> | ||
</head> | ||
|
||
<body> | ||
<div class="stack">404 not found</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta | ||
name="root-dns-name" | ||
id="root-dns-name" | ||
data-dns-name="{{root_dns_name}}" | ||
/> | ||
<link rel="stylesheet" href="/main.css" /> | ||
<meta | ||
name="description" | ||
content="A simple, fast website to return your IPv4 and IPv6 addresses. No logs are kept. Free and open to all." | ||
/> | ||
<meta property="og:title" content="GiveIP" /> | ||
<meta property="og:url" content="https://{{root_dns_name}}/" /> | ||
<meta | ||
property="og:description" | ||
content="A simple, fast website to return your IPv4 and IPv6 addresses. No logs are kept. Free and open to all." | ||
/> | ||
<link rel="canonical" href="https://{{root_dns_name}}/" /> | ||
<noscript> | ||
<meta http-equiv="refresh" content="0; url='/raw'" /> | ||
</noscript> | ||
{% if ipv4 %} | ||
<title id="title">Your public IP is {{ipv4}}</title> | ||
{% else %} | ||
<title id="title">What's my IP?</title> | ||
{% endif %} | ||
</head> | ||
|
||
<body> | ||
<div class="stack"> | ||
{% if ipv4 %} | ||
<div id="ip4txt"> | ||
Your public IPv4 is: <code id="ip4">{{ipv4}}</code> | ||
</div> | ||
{% else %} | ||
<div id="ip4txt" hidden> | ||
Your public IPv4 is: <code id="ip4">(none)</code> | ||
</div> | ||
{% endif %} {% if ipv6 %} | ||
<div id="ip6txt"> | ||
Your public IPv6 is: <code id="ip6">{{ipv6}}</code> | ||
</div> | ||
{% else %} | ||
<div id="ip6txt" hidden> | ||
Your public IPv6 is: <code id="ip6">(none)</code> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
<script src="/main.js"></script> | ||
<!-- Cloudflare Web Analytics --> | ||
<script | ||
defer | ||
src="https://static.cloudflareinsights.com/beacon.min.js" | ||
data-cf-beacon='{"token": "872609be4c924b219e5de38a6e0b26a0"}' | ||
></script> | ||
<!-- End Cloudflare Web Analytics --> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.stack { | ||
display: inline; | ||
font-size: max(5vh, 3vw); | ||
font-family: Arial, Verdana, Helvetica, sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const root_dns_name = document.getElementById("root-dns-name").dataset.dnsName; | ||
const v4_endpoint = `https://v4.${root_dns_name}/raw`; | ||
const v6_endpoint = `https://v6.${root_dns_name}/raw`; | ||
const ip4 = document.getElementById("ip4"); | ||
const ip6 = document.getElementById("ip6"); | ||
const ip4txt = document.getElementById("ip4txt"); | ||
const ip6txt = document.getElementById("ip6txt"); | ||
if (ip4txt.hidden) { | ||
fetch(v4_endpoint) | ||
.then((req) => req.text()) | ||
.then((resp) => { | ||
ip4.innerText = resp; | ||
ip4txt.hidden = false; | ||
document.getElementById("title").innerText = `Your IP is ${resp}`; | ||
}) | ||
.catch((failed) => { | ||
console.log("Request failed:" + failed); | ||
}); | ||
} | ||
if (ip6txt.hidden) { | ||
fetch(v6_endpoint) | ||
.then((req) => req.text()) | ||
.then((resp) => { | ||
ip6.innerText = resp; | ||
ip6txt.hidden = false; | ||
}) | ||
.catch((failed) => { | ||
console.log("Request failed:" + failed); | ||
}); | ||
} |
Oops, something went wrong.