Astroport.ONE/templates/umap.html

80 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UPlanet Navigation Page</title>
<style>
body {
margin: 0;
padding: 0;
background-image: url('Umap.jpg');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
height: 100vh;
}
#container {
width: 100%;
height: 100%;
position: relative;
}
.arrow {
width: 50px;
height: 50px;
position: absolute;
cursor: pointer;
background-color: rgba(0, 0, 0, 0.7); /* Add a semi-transparent background color */
color: white; /* Set arrow color to white */
font-size: 24px; /* Increase arrow font size */
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%; /* Make the arrows circular */
}
#north { top: 20px; left: calc(50% - 25px); }
#south { bottom: 20px; left: calc(50% - 25px); }
#east { top: calc(50% - 25px); right: 20px; }
#west { top: calc(50% - 25px); left: 20px; }
#northeast { top: 20px; right: 20px; }
#northwest { top: 20px; left: 20px; }
#southeast { bottom: 20px; right: 20px; }
#southwest { bottom: 20px; left: 20px; }
</style>
</head>
<body>
<div id="container">
<div id="north" class="arrow" title="GO NORTH" onclick="redirectTo('north')">&#8593;</div>
<div id="south" class="arrow" title="GO SOUTH" onclick="redirectTo('south')">&#8595;</div>
<div id="east" class="arrow" title="GO EAST" onclick="redirectTo('east')">&#8594;</div>
<div id="west" class="arrow" title="GO WEST" onclick="redirectTo('west')">&#8592;</div>
<div id="northeast" class="arrow" title="GO NORTH EAST" onclick="redirectTo('northeast')">&#8599;</div>
<div id="northwest" class="arrow" title="GO NORTHWEST" onclick="redirectTo('northwest')">&#8598;</div>
<div id="southeast" class="arrow" title="GO SOUTH EAST" onclick="redirectTo('southeast')">&#8600;</div>
<div id="southwest" class="arrow" title="GO SOUTH WEST" onclick="redirectTo('southwest')">&#8601;</div>
</div>
<script>
// Function to handle redirection based on direction
function redirectTo(direction) {
fetch('geolinks.json') // Fetch the JSON file
.then(response => response.json()) // Parse the JSON response
.then(data => {
const url = data[direction]; // Get the URL for the specified direction
if (url) {
window.location.href = url; // Redirect to the URL
} else {
alert('No URL found for this direction.');
}
})
.catch(error => {
console.error('Error fetching JSON:', error);
});
}
</script>
</body>
</html>