-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
38 lines (36 loc) · 1.05 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>What is my IP?</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
h1 {
font-size: 10vw;
}
</style>
</head>
<body>
<a href="https://github.com/bruh0422/myip" style="position: absolute; top: 10px; right: 10px;">
<img src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png" style="border-radius: 50%;" alt="GitHub" width="50" height="50">
</a>
<h1>127.0.0.1</h1>
<script>
async function getIP() {
try {
const response = await fetch('https://api.ipify.org?format=json');
const data = await response.json();
console.log(`Lol your IP is actually ${data.ip}`);
} catch (error) {}
}
getIP();
</script>
</body>
</html>