-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (45 loc) · 2.59 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
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="https://youprogrammer.com/wp-content/uploads/2017/10/ip-address-change.png" type="image/x-icon">
<meta name="theme-color" content="#923E09">
<meta name="description" content="Know your IP address">
<meta property="og:image" content="https://youprogrammer.com/wp-content/uploads/2017/10/ip-address-change.png">
<meta property="og:title" content="Know your IP information">
<meta property="og:url" content="https://ipinfo.rahulahire.com">
<meta property="og:site_name" content="Know your IP information">
<meta name="twitter:title" content="Know your IP information">
<meta name="twitter:description" content="Know your IP address">
<meta name="twitter:image" content="https://youprogrammer.com/wp-content/uploads/2017/10/ip-address-change.png">
<meta name="twitter:card" content="Know your IP information">
<meta name="twitter:image:alt" content="Know your IP information">
<title>Know your IP information</title>
</head>
<body style="margin: 0; padding: 0; height: 100vh; width:100%; background-color: #006875;">
<h1 style="margin: auto; font-family: Arial, Helvetica, sans-serif; color: white;">Test</h1>
<pre style="word-wrap: break-word;">
<code id="ip" class="json" style="color: white;font-weight: bold; "></code>
</pre>
<button id="btn" style="background: black;color: white; font-size: 1.2rem; width: 250px;height: 50px; border-radius: 50px; outline: none; border: 0; cursor: pointer;">Get your IP address info</button>
<script src="https://cdn.jsdelivr.net/npm/simply-beautiful@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js" integrity="sha512-bZS47S7sPOxkjU/4Bt0zrhEtWx0y0CRkhEp8IckzK+ltifIIE9EMIMTuT/mEzoIMewUINruDBIR/jJnbguonqQ==" crossorigin="anonymous"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
const box = document.getElementById('ip');
const btn = document.getElementById('btn');
const beautify = SimplyBeautiful();
btn.addEventListener('click', ()=>{
axios.get('https://ipapi.co/json').then((res) => {
const data = beautify.json(JSON.stringify(res.data))
console.log(data)
box.innerHTML = data
}).catch((err) => {
console.warn(err)
})
})
</script>
</body>
</html>