287 lines
9.3 KiB
HTML
287 lines
9.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>UPlanet - Public Goods For A Better Tomorrow - 0.01° x 0.01° - </title>
|
|
<meta charset="UTF-8">
|
|
<link rel="icon" type="image/x-icon" href="favicon.ring.ico">
|
|
<link rel="stylesheet" href="jquery-ui.min.css">
|
|
|
|
<script type="text/javascript" src="requestanimationframe.polyfill.js"></script>
|
|
|
|
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
|
|
|
|
<script type="text/javascript" src="jquery-ui.0.min.js"></script>
|
|
<script type="text/javascript" src="sphere-hacked.js"></script>
|
|
|
|
|
|
<script type="text/javascript" src="jquery.earth-3d.js"></script>
|
|
|
|
<script type="text/javascript" src="world.js"></script>
|
|
|
|
<script type="text/javascript" src="demo.js"></script>
|
|
|
|
<script src="astro.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// Extract the hostname (e.g., "https://ipfs.domain.tld" or "http://ipfs.localhost:8080")
|
|
var currentURL = new URL(window.location.href);
|
|
var hostname = currentURL.hostname;
|
|
var port = currentURL.port;
|
|
var protocol = currentURL.protocol.split(":")[0];
|
|
// Check and replace the port if it's 8080
|
|
if (port === "8080") {
|
|
port = "1234";
|
|
}
|
|
var zHost = hostname.replace("ipfs", "astroport");
|
|
// Create the "station" variable with the specified format
|
|
var station = protocol + "://" + zHost + (port ? (":" + port) : "");
|
|
console.log(station)
|
|
|
|
|
|
examples['simple_mars'] = function() {
|
|
$('#sphere').earth3d({
|
|
texture: 'maps/sector0_miz.jpg', // texture used on sphere
|
|
dragElement: $('#locations') // where do we catch the mouse drag
|
|
});
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
body {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-family: sans-serif;
|
|
}
|
|
|
|
.slidecontainer {
|
|
width: 80%;
|
|
margin: 0 auto;
|
|
text-align: center;
|
|
}
|
|
|
|
.gif-container {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
}
|
|
|
|
.gif-container img {
|
|
margin: 10px;
|
|
max-width: 200px;
|
|
}
|
|
|
|
.slider {
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
|
|
.slider #prev {
|
|
float: left;
|
|
font-size: 40px;
|
|
}
|
|
|
|
.slider #next {
|
|
float: right;
|
|
font-size: 40px;
|
|
}
|
|
|
|
#glow-shadows.earth {
|
|
background: url(maps/earth-glow-shadows.png);
|
|
}
|
|
|
|
#glow-shadows.mars {
|
|
background: url(maps/mars-glow-shadows.png);
|
|
}
|
|
|
|
.flight {
|
|
position: absolute;
|
|
width: 24px;
|
|
height: 25px;
|
|
left: 10px;
|
|
top: 10px;
|
|
background: url(maps/plain.png);
|
|
background-size: 100% 100%;
|
|
margin-left: -12px;
|
|
margin-top: -12.5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.button {
|
|
background-color: #3498db;
|
|
color: #fff;
|
|
padding: 10px 20px;
|
|
border: none;
|
|
cursor: pointer;
|
|
}
|
|
#console {
|
|
visibility: hidden;
|
|
background: rgba(0, 0, 0, 0.9); /* Adjust the background color and opacity as needed */
|
|
color: white;
|
|
width: 100%;
|
|
height: 80%;
|
|
position: absolute;
|
|
bottom: 50px;
|
|
left: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
</style>
|
|
|
|
<link rel="stylesheet" href="earth.css">
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<h1>♥ U Planet ♥</h1>
|
|
<button onclick="homeAstroportStation(station+'/?qrcode=station', '', 21654)">Ẑen Station</button>
|
|
<div id="countdown"></div>
|
|
<!--
|
|
<br><a href="login/">SCAN</a>
|
|
-->
|
|
|
|
<div id="container">
|
|
<br><br>
|
|
<br><br>
|
|
<div id="sphere"></div>
|
|
<div id="glow-shadows" class="earth"></div>
|
|
<div id="flights"></div>
|
|
<div id="locations"></div>
|
|
</div>
|
|
<div class="choose_example">
|
|
Planet : <select id="example">
|
|
<option value="simple_mars">New</option>
|
|
<option value="locations" selected >Earth</option>
|
|
</select>
|
|
</div>
|
|
|
|
<form id="addressForm">
|
|
<h1><label for="address">⌂</label></h1>
|
|
<input type="text" id="address" size=26 required><br>
|
|
<button type="button" onclick="getCoordinates()">¯\_༼qO͡〰op༽_/¯</button>
|
|
</form>
|
|
|
|
<h2>
|
|
<a target="pad" href="/ipfs/QmcSkcJ2j7GAsC2XhVqGSNAKVRpXgxfjjvDbhD5YxrncZY/?room=UPLANET">MEETING ROOM</a>
|
|
</h2>
|
|
|
|
<p id="result">- <a href="mailto:support@qo-op.com">contact</a> -</p>
|
|
|
|
<!--
|
|
<div class="code">
|
|
<a href="#" onclick="$('#example_code').show(); $(this).hide().siblings('a').show(); return false;">Show code</a>
|
|
<a href="#" style="display: none;" onclick="$('#example_code').hide(); $(this).hide().siblings('a').show(); return false;">Hide code</a>
|
|
<textarea id="example_code" onclick="this.focus();this.select();"></textarea>
|
|
</div>
|
|
-->
|
|
<button style="position: fixed; top: 10px; left: 10px;" onclick="document.getElementById('console').style.visibility = (document.getElementById('console').style.visibility === 'visible' ? 'hidden' : 'visible');">(?)</button>
|
|
|
|
<div id="console"> <a href="https://pad.p2p.legal/p/UPlanet_HELP" target="aframe"><img width=20 src="/ipfs/QmY1BbaSHLj5vmtB6QmFenqma6qajkky3QRBJEMWaZnA49" ></a> ___<a href="https://chaton.g1sms.fr" target="aframe">Dragons</a> are keeping <a href="https://zen.g1sms.fr" target="aframe">Ẑen UPlanet(*)</a> ___ <button onclick="document.getElementById('console').style.visibility = 'hidden';"> X </button>
|
|
<iframe name="aframe" id="aframe" src="https://pad.p2p.legal/p/UPlanet_HELP" width="100%" height="100%"></iframe>
|
|
</div>
|
|
|
|
<script>
|
|
// Function to extract URL parameters
|
|
function getUrlParameter(name) {
|
|
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
|
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
|
|
const results = regex.exec(location.search);
|
|
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
|
}
|
|
const defaultIPNS = '';
|
|
const defaultIPFS = '';
|
|
const defaultPUB = '';
|
|
|
|
const myIPFS = getUrlParameter('ipfs') || defaultIPFS;
|
|
const myPUBKEY = getUrlParameter('g1pub') || defaultPUB;
|
|
const sectorIPNS = getUrlParameter('ipns') || defaultIPNS;
|
|
console.log('myIPFS: /ipfs/', myIPFS);
|
|
console.log('myPUBKEY: /g1pub/', myPUBKEY);
|
|
console.log('sectorIPNS: /ipns/', sectorIPNS);
|
|
|
|
if (sectorIPNS !== '' ) {
|
|
const buttonContainer = document.createElement('div');
|
|
buttonContainer.id = 'button-container'
|
|
buttonContainer.style.position = 'absolute';
|
|
buttonContainer.style.bottom = '0px';
|
|
buttonContainer.style.left = '0px';
|
|
buttonContainer.style.width = '200px';
|
|
buttonContainer.style.height = '150px';
|
|
buttonContainer.style.zIndex = '1001';
|
|
buttonContainer.style.display = 'flex';
|
|
buttonContainer.style.flexDirection = 'column';
|
|
buttonContainer.style.alignItems = 'center';
|
|
buttonContainer.style.justifyContent = 'center';
|
|
|
|
const button = document.createElement('button');
|
|
button.innerText = 'EXPLORE';
|
|
button.className = 'button';
|
|
|
|
// Add an event listener to the button
|
|
button.addEventListener('click', function() {
|
|
window.open( '/ipns/'+ sectorIPNS, "AstroTab");
|
|
});
|
|
|
|
// Append the button to the button container
|
|
buttonContainer.appendChild(button);
|
|
document.body.appendChild(buttonContainer);
|
|
}
|
|
|
|
function getCoordinates() {
|
|
const addressInput = document.getElementById('address');
|
|
const address = addressInput.value.trim(); // Trim to remove leading/trailing spaces
|
|
|
|
if (address === '') {
|
|
// If address is empty, proceed to retrieve geolocation
|
|
getLocation();
|
|
} else {
|
|
// Replace spaces with '+' for the URL
|
|
const formattedAddress = address.replace(/ /g, '+');
|
|
|
|
// Make a request to the Nominatim API
|
|
fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${formattedAddress}`)
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
if (data.length > 0) {
|
|
const latitude = (parseFloat(data[0].lat) - 0.025).toFixed(2);
|
|
const longitude = (parseFloat(data[0].lon) - 0.025).toFixed(2);
|
|
window.location.replace(`map_render.html?southWestLat=${latitude}&southWestLon=${longitude}°=0.1`);
|
|
} else {
|
|
document.getElementById('result').innerText = 'Coordinates not found. Click on surrounding dots to zoom in.';
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.error('Error:', error);
|
|
document.getElementById('result').innerText = 'An error occurred while fetching coordinates.';
|
|
});
|
|
}
|
|
}
|
|
|
|
// Add event listener for the "Enter" key
|
|
document.getElementById('address').addEventListener('keypress', function (e) {
|
|
if (e.key === 'Enter') {
|
|
getCoordinates();
|
|
}
|
|
});
|
|
|
|
function getLocation() {
|
|
if (navigator.geolocation) {
|
|
navigator.geolocation.getCurrentPosition(function(position) {
|
|
const latitude = (position.coords.latitude - 0.025).toFixed(1);
|
|
const longitude = (position.coords.longitude - 0.025).toFixed(1);
|
|
window.location.replace(`map_render.html?southWestLat=${latitude}&southWestLon=${longitude}°=0.1`);
|
|
}, function(error) {
|
|
console.error('Error getting geolocation:', error);
|
|
document.getElementById('result').innerText = 'Geolocation not available. Enter an address to proceed.';
|
|
});
|
|
} else {
|
|
document.getElementById('result').innerText = 'Geolocation is not supported by this browser. Enter an address to proceed.';
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|
|
</body></html>
|