initial commit

This commit is contained in:
root
2024-06-03 16:43:53 +03:00
commit 21e3fd0797
1535 changed files with 60499 additions and 0 deletions

57
yash/html/script.js Normal file
View File

@@ -0,0 +1,57 @@
const x = document.getElementById("demo");
const inplat = document.getElementById("lat");
const inplong = document.getElementById("long");
let lat;
let lon;
inplat.value = "";
inplong.value = "";
getLocation();
//checkbox label listener
const cblabel = document.querySelector(".button")
const cb = document.getElementById("button");
cb.checked = false;
cb.addEventListener("change", ()=>{
animation();
})
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;
lat = (Math.round(lat * 1000000000) / 1000000000).toFixed(9);
lon = (Math.round(lon * 1000000000) / 1000000000).toFixed(9);
console.log("in showposition()")
x.innerHTML = "Latitude: " + lat +
"<br>Longitude: " + lon;
inplat.value = lat;
inplong.value = lon;
cblabel.classList.toggle("disabled");
}
function animation(){
setTimeout(function() {
//your code to be executed after x seconds
document.getElementById("submitbtn").click();
cb.checked= false;
}, 3500);
}