Update buttons to open links in the browser

This commit is contained in:
Daniel LaForce 2024-08-02 14:54:30 -06:00
parent c87028905f
commit 51e17a2dee
1 changed files with 20 additions and 43 deletions

View File

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSMS Claims and Neighbors</title>
<style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSMS Claims and Neighbors</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
@ -44,51 +44,28 @@
}
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CC1B9CQ691"></script>
<script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CC1B9CQ691"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-CC1B9CQ691');
function trackButtonClick(label) {
gtag('event', 'click', {
'event_category': 'Button',
'event_label': label
});
}
function isMobile() {
return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
}
function openGoogleMaps() {
trackButtonClick('Google Maps');
const url = isMobile() ? 'comgooglemaps://?daddr=39.034084596004874,-105.30166849999999&zoom=15' : 'https://rebrand.ly/csmsgoogle';
window.location.href = url;
}
function openGaiaGPS() {
trackButtonClick('Gaia GPS');
const url = isMobile() ? 'gaiagps://public/VVXcZPvEfvAbvRWi5F0DQPNT' : 'https://rebrand.ly/csmsgaia';
window.location.href = url;
}
</script>
</head>
<body>
<div class="header">
<h1>CSMS Claims and Neighbors</h1>
</div>
<div class="map-container">
<iframe src="https://www.google.com/maps/d/embed?mid=1CH09O8Gp7sQ6H2GdybFvRdLB-1vElVc&ehbc=2E312F" style="border:none; overflow-y: hidden; background-color:white; flex: 1;"></iframe>
<iframe src="https://www.gaiagps.com/public/VVXcZPvEfvAbvRWi5F0DQPNT/?embed=True" style="border:none; overflow-y: hidden; background-color:white; flex: 1;"></iframe>
</div>
<div class="buttons">
<button onclick="openGoogleMaps()">View on Google Maps</button>
<button onclick="openGaiaGPS()">View on Gaia GPS</button>
</div>
<div data-netlify-deploy-id="66ad3357ef8ab60008fe7cdb" data-netlify-site-id="d4c63ad8-dc16-4a45-a20f-aa2b8ba2eb40" data-vcs="github" style="position:fixed">
<script async src="/.netlify/scripts/cdp"></script>
</div>
<div class="header">
<h1>CSMS Claims and Neighbors</h1>
</div>
<div class="map-container">
<iframe src="https://www.google.com/maps/d/embed?mid=1CH09O8Gp7sQ6H2GdybFvRdLB-1vElVc&ehbc=2E312F" style="border:none; overflow-y: hidden; background-color:white; flex: 1;"></iframe>
<iframe src="https://www.gaiagps.com/public/VVXcZPvEfvAbvRWi5F0DQPNT/?embed=True" style="border:none; overflow-y: hidden; background-color:white; flex: 1;"></iframe>
</div>
<div class="buttons">
<button onclick="window.location.href='https://rebrand.ly/csmsgoogle'">View on Google Maps</button>
<button onclick="window.location.href='https://rebrand.ly/csmsgaia'">View on Gaia GPS</button>
</div>
<div data-netlify-deploy-id="66ad3357ef8ab60008fe7cdb" data-netlify-site-id="d4c63ad8-dc16-4a45-a20f-aa2b8ba2eb40" data-vcs="github" style="position:fixed">
<script async src="/.netlify/scripts/cdp"></script>
</div>
</body>
</html>