--ignore=.git --ignore-rules-path=.gitignore

This commit is contained in:
fred 2024-05-01 18:23:50 +02:00
parent d722a04332
commit a103be6d5f
3 changed files with 121 additions and 100 deletions

View File

@ -138,7 +138,9 @@ console.log(station)
<h1>♥ U Planet ♥</h1>
<button onclick="homeAstroportStation(station+'/?qrcode=station', '', 21654)">Ẑen Station</button>
<div id="countdown"></div>
<br><a href="login/">LOGIN</a>
<!--
<br><a href="login/">SCAN</a>
-->
<div id="container">
<br><br>
@ -148,31 +150,24 @@ console.log(station)
<div id="flights"></div>
<div id="locations"></div>
</div>
<div class="choose_example">
Planet : <select id="example">
<!--
<option value="simple">Simple earth</option>
<option value="simple_tilted">Simple tilted earth</option>
-->
<option value="simple_mars">New</option>
<!--
<option value="flights">Earth with locations and flights</option>
-->
<option value="locations" selected >Earth</option>
</select>
</div>
<h2></h2>
<form id="addressForm">
<label for="address">Address: </label>
<input type="text" id="address" size=30 required>
<button type="button" onclick="getCoordinates()">Go</button>
<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">VISIO ROOM</a>
<a target="pad" href="/ipfs/QmcSkcJ2j7GAsC2XhVqGSNAKVRpXgxfjjvDbhD5YxrncZY/?room=UPLANET">MEETING ROOM</a>
</h2>
<p id="result">- <a href="mailto:support@qo-op.com">support</a> -</p>
<p id="result">- <a href="mailto:support@qo-op.com">contact</a> -</p>
<!--
<div class="code">
@ -187,26 +182,26 @@ console.log(station)
<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) {
<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 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);
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 !== '' ) {
if (sectorIPNS !== '' ) {
const buttonContainer = document.createElement('div');
buttonContainer.id = 'button-container'
buttonContainer.style.position = 'absolute';
@ -232,13 +227,16 @@ console.log(station)
// Append the button to the button container
buttonContainer.appendChild(button);
document.body.appendChild(buttonContainer);
}
}
function getCoordinates() {
function getCoordinates() {
const addressInput = document.getElementById('address');
const address = addressInput.value;
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, '+');
@ -247,13 +245,11 @@ console.log(station)
.then(response => response.json())
.then(data => {
if (data.length > 0) {
const latitude = data[0].lat;
const longitude = data[0].lon;
const lat = parseFloat(data[0].lat).toFixed(2);
const lon = parseFloat(data[0].lon).toFixed(2);
window.location.replace(`map_render.html?southWestLat=${lat}&southWestLon=${lon}&deg=0.01`);
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}&deg=0.1`);
} else {
document.getElementById('result').innerText = 'Coordinates not found. Clic on surrounding dots to zoom in.';
document.getElementById('result').innerText = 'Coordinates not found. Click on surrounding dots to zoom in.';
}
})
.catch(error => {
@ -261,12 +257,29 @@ console.log(station)
document.getElementById('result').innerText = 'An error occurred while fetching coordinates.';
});
}
// Add event listener for the "Enter" key
document.getElementById('address').addEventListener('keypress', function (e) {
}
// 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}&deg=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>

View File

@ -61,7 +61,7 @@
<div id="coordinates-display"></div> <!-- Coordinates display element -->
<div id="map" style="width: 100%; height: 100vh;"></div>
</div>
<button id="upper-layer-button">UP</button>
<button id="upper-layer-button">⬆️</button>
<script src="leaflet.js"></script>
<script>
@ -229,7 +229,10 @@ document.getElementById('upper-layer-button').addEventListener('click', function
window.location.href = 'welcome.html';
} else {
const newDeg = deg * 10;
const url = `map_render.html?southWestLat=${southWestLat}&southWestLon=${southWestLon}&deg=${newDeg}`;
const decalage = 2.5 * deg;
const adjustedSouthWestLat = (parseFloat(southWestLat) - decalage).toFixed(2);
const adjustedSouthWestLon = (parseFloat(southWestLon) - decalage).toFixed(2);
const url = `map_render.html?southWestLat=${adjustedSouthWestLat}&southWestLon=${adjustedSouthWestLon}&deg=${newDeg}`;
window.location.href = url;
}
});

View File

@ -7,13 +7,14 @@
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
echo '
############################################################### ipfs
## __ __ ___ ____ ____ ___ _ _____ ____ ____ _____ ____
## | \/ |_ _/ ___| _ \ / _ \ | | | ____| _ \ / ___| ____| _ \
## | |\/| || | | | |_) | | | | | | | _| | | | | | _| _| | |_) |
## | | | || | |___| _ <| |_| | | |___| |___| |_| | |_| | |___| _ <
## |_| |_|___\____|_| \_\\___/ |_____|_____|____/ \____|_____|_| \_\ me
'
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
@ -21,26 +22,30 @@ OLD=$(cat ${MY_PATH}/.chain)
[[ -z ${OLD} ]] \
&& GENESYS=$(ipfs add -rwHq ${MY_PATH}/* | tail -n 1) \
&& echo ${GENESYS} > ${MY_PATH}/.chain \
&& echo "### - (^‿‿^) - " >> ${MY_PATH}/README.md \
&& echo /ipfs/${GENESYS} >> ${MY_PATH}/README.md \
&& echo "CHAIN BLOC ZERO : ${GENESYS}" \
## TIMESTAMP SHIFTING
## TIMESTAMP CHAIN SHIFTING
cp ${MY_PATH}/.chain \
${MY_PATH}/.chain.$(cat ${MY_PATH}/.moats)
TW=$(ipfs add -rwHq ${MY_PATH}/* | tail -n 1)
IPFSME=$(ipfs add -rwHq --ignore=.git --ignore-rules-path=.gitignore ${MY_PATH}/* | tail -n 1)
[[ ${TW} == ${OLD} ]] && echo "No change." && exit 1
[[ ${IPFSME} == ${OLD} ]] && echo "No change." && exit 0
echo ${TW} > ${MY_PATH}/.chain
## CHAIN UPGRADE
echo ${IPFSME} > ${MY_PATH}/.chain
echo ${MOATS} > ${MY_PATH}/.moats
sed -i "s~${OLD}~${TW}~g" ${MY_PATH}/README.md
## README UPGRADE
sed -i "s~${OLD}~${IPFSME}~g" ${MY_PATH}/README.md
echo '# ENTER COMMENT FOR THIS COMMIT'
## AUTO GIT
echo '# ENTER COMMENT FOR YOUR COMMIT :'
git add .
read COMMENT \
&& git commit -m "$COMMENT : https://ipfs.copylaradio.com/ipfs/${TW}/earth" \
&& git commit -m "$COMMENT : https://ipfs.copylaradio.com/ipfs/${IPFSME}" \
&& git push
exit 0