30
loading...
This website collects cookies to deliver better user experience
<!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">
<title>Find Your IP</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="main-items">
<div class="main-text">
<h1>Here Is Your IP :</h1>
<h2 class="ip"></h2>
<h1>Your ISP is :</h1>
<h2 class="isp"></h2>
<h1>Your Location :</h1>
<h2 class="location"></h2>
</div>
</div>
<script src="main.js"></script>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@1,500&display=swap');
body {
font-family: 'Fira Sans', sans-serif;
background-image: linear-gradient(90deg, rgba(2, 0, 36, 1) 0%, rgba(9, 9, 119, 1) 24%, rgba(9, 9, 121, 1) 35%, rgba(0, 212, 255, 1) 100%);
}
h1 {
color: rgb(42, 81, 209);
}
.main-text {
width: 25em;
background-color: aliceblue;
text-align: center;
border: 1em solid rgb(73, 167, 230);
border-radius: 2em;
}
.main-text h1 {
margin: .5em;
}
.main-items {
display: flex;
justify-content: center;
align-content: center;
margin-top: 7em;
}
fetch('Your URL provided by ipify')
.then(response => response.json())
.then(data => changeTheDom(data));
function changeTheDom(data) {
let IP = data.ip;
let dom1 = document.querySelector('.ip');
dom1.innerHTML = IP;
let ISP = data.isp;
let dom2 = document.querySelector('.isp');
dom2.innerHTML = ISP;
let dom3 = document.querySelector('.location');
dom3.innerHTML = data.location.city + ' , ' + data.location.region + ' , ' + data.location.country;
}