Skip to content

Commit

Permalink
Merge pull request #26 from abiral2057/geoapi
Browse files Browse the repository at this point in the history
Added @abiral2057 's file in participants. Used Geo Location API
  • Loading branch information
manjilkoirala authored Oct 13, 2023
2 parents 948af82 + 2896042 commit 8531755
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 0 deletions.
1 change: 1 addition & 0 deletions bootcamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1 class="text-3xl font-bold text-heading">
<li><a href="./participants/manjilkoirala/clipboardApp/index.html">manjilkoirala</a></li>
<li><a href="./participants/rashilakhadka/rashilakhadka.html">rashilakhadka</a></li>
<li><a href="./participants/ankman007/index.html">ankman007</a></li>
<li><a href="./participants/abiral/index.html">abiral</a></li>
</ul>
</nav>
</div>
Expand Down
32 changes: 32 additions & 0 deletions participants/abiral/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function findMe(){
const status = document.querySelector("#status");
const coordinate = document.querySelector('#coordinate');
const coordinatedetail = document.querySelector('#coordinatedetail');


coordinate.href="";
coordinate.textContent="";

function success(position){
const latitude = position.coords.latitude;
const longitude = position.coords.longitude;

status.textContent="Success";
coordinate.href =`https://www.google.com/maps/@${latitude},${longitude},163m/data=!3m1!1e3?entry=ttu`
coordinate.textContent =`Click Here`;

coordinatedetail.textContent = `Latitude : ${latitude} , Longitude : ${longitude}`;

}
function error(){
status.textContent = "Unable to Find your Location";
}
if(!navigator.geolocation){
status.textContent="Geolocation NOT SUPPORTED";

}
else{
status.textContent = "Searching .... .";
navigator.geolocation.getCurrentPosition(success,error);
}
}
Binary file added participants/abiral/earth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions participants/abiral/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Using GeoAPI -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GeoLocation API</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="app.js" type="text/javascript"></script>
</head>
<body>
<div class="location-title">
<h1 id="locationtitle">GEOLOCATION API</h1>
<img id="animearth" src="earth.gif" alt="Rotating Earth">
</div>

<div class="location-body">
<button id="search" onclick="findMe()">Find your Location <span><img class="placeholder" src="placeholder.png"></span></button>
<h3 id="status">Check Status</h3>
<p id="coordinatedetail">Please Click Button to Get your Location </p>
<span id="text"><a id="coordinate" target="_blank"></a></span>
</div>

</body>
</html>
Binary file added participants/abiral/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions participants/abiral/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

.location-title{

display: flex;
justify-content: center;
}
#animearth{
width: 120px;
height: 120px;
}

#locationtitle{
margin-top: 40px;
}

.location-body{
display: flex;
align-content: center;
align-items: center;
justify-content: space-evenly;
flex-wrap: wrap;
flex-direction: column;
}
#search{
outline: none;
font-weight: 600;
color: cadetblue;
font-size: 20px;
outline-color: none;
border-radius: 4px;
}
.placeholder{
width: 20px;
}
body{
margin-top: 150px;
}

0 comments on commit 8531755

Please sign in to comment.