-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
426dec6
commit ddfdbaa
Showing
1 changed file
with
57 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,72 @@ | ||
<body> | ||
<div class="centered"> | ||
<h2>Christopher W Moriarty</h2> | ||
<div class="centered"> | ||
<h2>Christopher W Moriarty</h2> | ||
|
||
<body> | ||
<div class="centered"> | ||
<h2>Christopher W Moriarty</h2> | ||
<a href="Chris%20Moriarty%20-%20Resume.pdf">resume</a><br> | ||
<a href="https://github.com/cwmoriarty">github</a><br> | ||
<a href="https://www.linkedin.com/in/cwmoriarty/">linkedin</a><br> | ||
<br> | ||
email: <tt>cwmⓐcwmoriarty.com</tt> | ||
</div> | ||
|
||
<div class="libleft"> | ||
<small>🌎 <span id="distance">0</span> miles away</small> | ||
</div> | ||
<div class="centered"> | ||
<h2>Christopher W Moriarty</h2> | ||
<a href="Chris%20Moriarty%20-%20Resume.pdf">resume</a><br> | ||
<a href="https://github.com/cwmoriarty">github</a><br> | ||
<a href="https://www.linkedin.com/in/cwmoriarty/">linkedin</a><br> | ||
<br> | ||
email: <tt>cwmⓐcwmoriarty.com</tt> | ||
</div> | ||
|
||
<div class="libleft"> | ||
<small><span id="flag">🌎</span> <span id="distance">0</span> miles away</small> | ||
</div> | ||
|
||
</body> | ||
|
||
|
||
|
||
<script type="text/javascript"> | ||
R = 3959 // Radius of Earth in miles | ||
fetch('https://ipapi.co/json').then(response => response.json()).then(data => { | ||
dLat = (atob("NDIuNTU=") - data.latitude) * Math.PI / 180 // Radians keep me safe. | ||
dLon = (atob("LTcwLjg3") - data.longitude) * Math.PI / 180 | ||
|
||
a = | ||
Math.sin(dLat / 2) * Math.sin(dLat / 2) + | ||
Math.cos(data.latitude * Math.PI / 180) * Math.cos(42.55 * Math.PI / 180) * | ||
Math.sin(dLon / 2) * Math.sin(dLon / 2); | ||
c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); | ||
distance = (R * c).toFixed(1); // Distance in miles | ||
<script type="text/javascript"> | ||
//Distance calculation | ||
R = 3959 | ||
fetch('https://ipapi.co/json').then(response => response.json()).then(data => { | ||
dLat = (atob("NDIuNTU=") - data.latitude) * Math.PI / 180 // Radians keep me safe. | ||
dLon = (atob("LTcwLjg3") - data.longitude) * Math.PI / 180 | ||
|
||
a = | ||
Math.sin(dLat / 2) * Math.sin(dLat / 2) + | ||
Math.cos(data.latitude * Math.PI / 180) * Math.cos(42.55 * Math.PI / 180) * | ||
Math.sin(dLon / 2) * Math.sin(dLon / 2) | ||
c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) | ||
distance = (R * c).toFixed(0); | ||
|
||
|
||
//Flag Emoji | ||
codePoints = data.country_code.toUpperCase().split('').map(char => 127397 + char.charCodeAt()) | ||
flagEmoji= String.fromCodePoint(...codePoints) | ||
|
||
|
||
document.getElementById("distance").innerHTML = distance; | ||
document.getElementById("flag").innerHTML = flagEmoji; | ||
|
||
//distance=42; | ||
console.log(data.latitude); | ||
document.getElementById("distance").innerHTML = distance; | ||
}) | ||
.catch(error => { | ||
console.error("Error fetching IP data:", error); | ||
}); | ||
</script> | ||
console.log(flagEmoji) | ||
}) | ||
.catch(error => { | ||
console.error("Error fetching IP data:", error); | ||
}); | ||
</script> | ||
|
||
|
||
|
||
|
||
<style type="text/css"> | ||
body { font-family: Helvetica, Geneva, sans-serif; } | ||
a { color: black; } | ||
.centered { | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
margin-top: -125px; | ||
margin-left: -87px; | ||
} | ||
.libleft { | ||
position: fixed; | ||
left:30; | ||
bottom:0; | ||
} | ||
</style> | ||
body { font-family: Helvetica, Geneva, sans-serif; } | ||
a { color: black; } | ||
.centered { | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
margin-top: -125px; | ||
margin-left: -87px; | ||
} .libleft { | ||
position: fixed; | ||
left:30; | ||
bottom:0; | ||
} | ||
</style> | ||
|
||
|