Extend Your Desired Reality

This commit is contained in:
fred 2023-03-13 18:51:36 +01:00
parent fba77af447
commit d634c9c673
5 changed files with 277 additions and 0 deletions

File diff suppressed because one or more lines are too long

63
tools/COINScheck.sh Executable file
View File

@ -0,0 +1,63 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
#~ COINScheck.sh
#~ Indiquez une clef publique G1.
#~ Il verifie le montant présent dans le cache
#~ ou le raffraichi quand il est plus ancien que 24H
################################################################################
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/my.sh"
################################################################################
G1PUB="$1"
## TESTING G1PUB VALIDITY
[[ $G1PUB == "" ]] && echo "PLEASE ENTER WALLET G1PUB" && exit 1
echo $(date)
ASTROTOIPFS=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py ${G1PUB} 2>/dev/null)
[[ ! ${ASTROTOIPFS} ]] \
&& echo "INVALID G1PUB : ${G1PUB}" \
&& exit 1
echo "TW ? $myIPFS/ipns/${ASTROTOIPFS}"
#######################################################
## CLEANING DAY+1 COINS CACHE FILES
find ~/.zen/game/players/ -mtime +1 -type f -name "COINS" -exec rm -f '{}'
find ~/.zen/tmp/ -mtime +1 -type f -name "${G1PUB}.COINS" -exec rm -f '{}'
#######################################################
## IDENTIFY IF "ASTROPORT" or "COUCOU" PLAYER
echo "ASTROPATH ? "
ASTROPATH=$(grep $G1PUB ~/.zen/game/players/*/.g1pub | cut -d ':' -f 1 | rev | cut -d '/' -f 2- | rev 2>/dev/null)
echo $ASTROPATH
if [[ -d $ASTROPATH ]]; then
COINSFILE=$ASTROPATH/ipfs/G1SSB/COINS
else
COINSFILE=~/.zen/tmp/coucou/${G1PUB}.COINS
fi
echo "ACTUAL $COINSFILE CONTAINS"
CURCOINS=$(cat $COINSFILE 2>/dev/null)
echo "$CURCOINS G1"
## NO or NULL RESULT in CACHE : REFRESHING
if [[ $CURCOINS == "" || $CURCOINS == "null" ]]; then
(
echo "CACHING ${G1PUB}"
CURCOINS=$(~/.zen/Astroport.ONE/tools/timeout.sh -t 180 ${MY_PATH}/jaklis/jaklis.py balance -p ${G1PUB} | cut -d '.' -f 1)
echo "REFRESH $COINSFILE TO $CURCOINS G1"
echo "$CURCOINS" > "$COINSFILE"
) &
fi
echo $CURCOINS
exit 0

View File

@ -0,0 +1,83 @@
<!-- homeAstroportStation function API Twist -->
// Include <div id="ainfo"></div> in your HTML
async function ainfo(zURL){
try {
let two = await fetch(zURL); // Gets a promise
var miam = await two.text();
console.log(miam)
document.getElementById("ainfo").innerHTML = two.text(); // Replaces id='ainfo' with response
} catch (err) {
console.log('Fetch error:' + err); // Error handling
}
}
// Include <div id="countdown"></div> in your HTML
async function homeAstroportStation(myURL, option = '', duration = 3000) {
try {
let one = await fetch(myURL); // Gets a promise
var doc = await one.text();
var regex = /url='([^']+)/i; // Get response PORT
var redirectURL = doc.match(regex)[1]
console.log(option + " ... Teleportation ... in" + duration + " ms ... " + redirectURL)
// start countdown
var timeLeft = Math.floor(duration / 1000);
var elem = document.getElementById("countdown");
var timerId = setInterval(countdown, 1000);
function countdown() {
if (timeLeft == -1) {
clearTimeout(timerId);
switch(option) {
case "tab":
window.open( redirectURL, "AstroTab");
break;
case "page":
window.location.replace(redirectURL);
break;
case "aframe":
document.getElementById("aframe").src = redirectURL;
break;
case "ainfo":
ainfo(redirectURL);
break;
default:
window.location.href = redirectURL;
}
} else {
elem.innerHTML = timeLeft + " s";
timeLeft--;
}
}
} catch (err) {
console.log('Fetch error:' + err); // Error handling
}
}
// <center><div id="countdown"></div></center>
function promptUser(inout) {
let salt = prompt("Secret 1");
let pepper = prompt("Secret 2");
let email = prompt("Email");
let resultUt = '/?salt=' + salt + '&pepper=' + pepper + '&' + inout + '=' + email;
console.log(resultUt)
homeAstroportStation( resultUt,'', 12000)
}

View File

@ -0,0 +1,129 @@
body {
background: black;
margin: 0;
padding: 0;
color: #DDD;
text-align: center;
padding-bottom: 20px;
}
h1 {
margin-top: 10px;
font-size: 40px;
margin-bottom: 10px;
}
.subtitle {
font-size: 20px;
margin-bottom: 20px;
color: #777;
}
a {
color: white;
}
#demo {
overflow: hidden;
}
#description {
text-align: left;
float: left;
width: 49%;
max-width: 500px;
padding-top: 50px;
padding-left: 20px;
}
#showoff {
float: left;
width: 49%;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#container {
position: relative;
display: inline-block;
width: 400px;
height: 400px;
}
#sphere, #flights, #glow-shadows, #locations, #drag {
position: absolute;
top: 0px;
left: 0px;
width: 400px;
height: 400px;
}
#glow-shadows {
top: 1px;
left: 1px;
}
.location {
position: absolute;
width: 10px;
height: 10px;
left: 10px;
top: 10px;
border: 2px solid white;
margin-left: -5px;
margin-top: -5px;
border-radius: 50%;
cursor: pointer;
}
.location:hover {
width: 15px;
height: 15px;
margin-left: -7.5px;
margin-top: -7.5px;
}
.flight:hover {
width: 36px;
height: 37.5px;
margin-left: -18px;
margin-top: -18.75px;
}
.choose_example {
width: 35%;
margin-left: 32.5%;
}
#example_code {
width: 100%;
height: 200px;
background-color: black;
color: white;
border: 0px;
resize: none;
display: none;
}
.code {
margin-top: 10px;
}
.social {
display: inline-block;
}
.social.twitter {
vertical-align: -3px;
}
.social.google {
vertical-align: -7px;
}

1
www/G1PalPay/_STATION_ Normal file
View File

@ -0,0 +1 @@
HELLO THERE