forked from STI/Astroport.ONE
UPLANET : UMAPNS now have a navigator App (umap.html is the template)
This commit is contained in:
parent
7dd90e385e
commit
38659ad19a
|
@ -145,7 +145,7 @@ if [[ "${EMAIL}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
|
|||
|
||||
else
|
||||
|
||||
echo "BAD EMAIL $LAT $LON - DEFAULT OPEN UMAP IPNS LINK -"
|
||||
echo "BAD EMAIL $LAT $LON - OPEN UMAP IPNS LINK -"
|
||||
(echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${REDIR}'\" /> '" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 0
|
||||
|
||||
fi
|
||||
|
|
|
@ -89,6 +89,7 @@ mkdir ~/.zen/tmp/${MOATS}
|
|||
|
||||
##############################################################
|
||||
##############################################################
|
||||
if [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/geolinks.json ]]; then
|
||||
##############################################################
|
||||
## CALCULATE SURROUNDING UMAPS
|
||||
##############################################################
|
||||
|
@ -187,6 +188,24 @@ mkdir ~/.zen/tmp/${MOATS}
|
|||
SWUMAPNS=$(ipfs key import ${SEWALLET} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/SEWALLET.priv)
|
||||
ipfs key rm ${SEWALLET}
|
||||
|
||||
jq -n \
|
||||
--arg north "${myIPFS}/ipns/${NUMAPNS}" \
|
||||
--arg south "${myIPFS}/ipns/${SUMAPNS}" \
|
||||
--arg east "${myIPFS}/ipns/${EUMAPNS}" \
|
||||
--arg west "${myIPFS}/ipns/${WUMAPNS}" \
|
||||
--arg northeast "${myIPFS}/ipns/${NEUMAPNS}" \
|
||||
--arg northwest "${myIPFS}/ipns/${NWUMAPNS}" \
|
||||
--arg southeast "${myIPFS}/ipns/${SEMAPNS}" \
|
||||
--arg southwest "${myIPFS}/ipns/${SWMAPNS}" \
|
||||
'{north: $north, south: $south, east: $east, west: $west, northeast: $northeast, northwest: $northwest, southeast: $southeast, southwest: $southwest}' \
|
||||
> ~/.zen/tmp/${MOATS}/${UMAP}/geolinks.json
|
||||
|
||||
fi
|
||||
|
||||
### SET navigator.html ## MAKE EVOLVE template/umap.html
|
||||
cp ${MY_PATH}/../templates/umap.html ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html
|
||||
cat ~/.zen/tmp/${MOATS}/${UMAP}/navigator_map.html | sed "s~Umap~Usat~g" > ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Usat.html
|
||||
|
||||
##############################################################
|
||||
############################ PUBLISHING UMAP
|
||||
##############################################################
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-image: url('image.png');
|
||||
background-image: url('Umap.jpg');
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
|
@ -47,15 +47,33 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="north" class="arrow" onclick="alert('North Arrow Clicked')">↑</div>
|
||||
<div id="south" class="arrow" onclick="alert('South Arrow Clicked')">↓</div>
|
||||
<div id="east" class="arrow" onclick="alert('East Arrow Clicked')">→</div>
|
||||
<div id="west" class="arrow" onclick="alert('West Arrow Clicked')">←</div>
|
||||
<div id="northeast" class="arrow" onclick="alert('Northeast Arrow Clicked')">↗</div>
|
||||
<div id="northwest" class="arrow" onclick="alert('Northwest Arrow Clicked')">↖</div>
|
||||
<div id="southeast" class="arrow" onclick="alert('Southeast Arrow Clicked')">↘</div>
|
||||
<div id="southwest" class="arrow" onclick="alert('Southwest Arrow Clicked')">↙</div>
|
||||
<div id="north" class="arrow" title="GO NORTH" onclick="redirectTo('north')">↑</div>
|
||||
<div id="south" class="arrow" title="GO SOUTH" onclick="redirectTo('south')">↓</div>
|
||||
<div id="east" class="arrow" title="GO EAST" onclick="redirectTo('east')">→</div>
|
||||
<div id="west" class="arrow" title="GO WEST" onclick="redirectTo('west')">←</div>
|
||||
<div id="northeast" class="arrow" title="GO NORTH EAST" onclick="redirectTo('northeast')">↗</div>
|
||||
<div id="northwest" class="arrow" title="GO NORTHWEST" onclick="redirectTo('northwest')">↖</div>
|
||||
<div id="southeast" class="arrow" title="GO SOUTH EAST" onclick="redirectTo('southeast')">↘</div>
|
||||
<div id="southwest" class="arrow" title="GO SOUTH WEST" onclick="redirectTo('southwest')">↙</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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue