fixphrase.com/index.php

126 lines
4.3 KiB
PHP
Raw Normal View History

2021-05-23 00:05:57 -06:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FixPhrase</title>
<link rel="stylesheet" href="js/maplibre-gl/dist/mapbox-gl.css" />
<script src="https://static.netsyms.net/jquery/jquery.min.js"></script>
<script src="js/maplibre-gl/dist/mapbox-gl.js"></script>
<script src="js/map_maplibre.js"></script>
<script src="js/map.js"></script>
<style>
body {
height: 100vh;
width: 100vw;
padding: 0;
margin: 0;
}
#mapbox {
width: 100vw;
flex-grow: 9999;
}
#mapbox .mapboxgl-user-location-dot, #mapbox .mapboxgl-user-location-accuracy-circle {
pointer-events: none;
}
#wordbox {
width: 500px;
max-width: 75vw;
font-size: 110%;
}
#header {
display: flex;
justify-content: space-between;
align-items: center;
flex-grow: 1;
padding: 1em;
flex-wrap: wrap;
}
#header h1 {
padding: 0;
margin: 0;
margin-right: 1em;
}
#page-container {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: stretch;
}
.clicktext {
display: none;
}
@media (pointer:fine) {
.taptext {
display: none;
}
.clicktext {
display: initial;
}
}
</style>
2021-05-24 19:02:15 -06:00
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "https://analytics.netsyms.net/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '35']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
2021-05-23 00:05:57 -06:00
</head>
<body>
<div id="page-container">
<div id="header">
<h1>FixPhrase</h1>
<div><input type="text" placeholder="FixPhrase Words" id="wordbox"/> <button onclick="dolookup();">Find</button></div>
2021-05-23 00:09:03 -06:00
<div>Locate any place on Earth with just four words. <a href="https://source.netsyms.com/Netsyms/fixphrase.com/src/branch/master/FixPhrase.lib.php">Free and open source</a>.
2021-05-23 00:05:57 -06:00
<span class="taptext">Tap</span><span class="clicktext">Click</span> the map to
get the unique phrase for that spot. Type a phrase into the search box to
pinpoint it on the map.</div>
</div>
<div id="mapbox"></div>
</div>
<script>
window.onload = function () {
createMap();
};
function dolookup() {
$.getJSON("lookup.php", {
words: $("#wordbox").val()
}, function (resp) {
if (resp.status == "OK") {
new mapboxgl.Popup()
.setLngLat({lat: resp.coords[0], lng: resp.coords[1]})
.setHTML("<b>" + resp.words + "</b><br>" + resp.coords[0] + ", " + resp.coords[1])
.addTo(map);
map.animateMapIn(resp.coords[0], resp.coords[1], 18);
} else {
alert(resp.msg);
}
});
}
</script>
</body>
</html>