From 2a7323f67e284e34f95fd4603bd8b4b8ec4577fe Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 30 Dec 2023 18:38:43 +0100 Subject: [PATCH] better information catching from Astroport --- earth/astro.js | 90 +++++++++++++++++++++++++++++++++++++ earth/index.html | 22 ++++++++- earth/map_render.html | 27 +++++++---- earth/maps/sector0_miz.jpg | Bin 0 -> 385669 bytes earth/scan/pinMeBB.css | 70 +++++++++++++++++++++++++++++ earth/scan/pinMeBB.js | 85 +++++++++++++++++++++++++++++++++++ 6 files changed, 285 insertions(+), 9 deletions(-) create mode 100644 earth/astro.js create mode 100644 earth/maps/sector0_miz.jpg create mode 100644 earth/scan/pinMeBB.css create mode 100644 earth/scan/pinMeBB.js diff --git a/earth/astro.js b/earth/astro.js new file mode 100644 index 0000000..e0f4376 --- /dev/null +++ b/earth/astro.js @@ -0,0 +1,90 @@ + + +// Include
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
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 "parent": + window.parent.location.href = redirectURL; + break; + case "aframe": + document.getElementById("aframe").src = redirectURL; + break; + case "ainfo": + ainfo(redirectURL); + break; + default: + window.location.href = redirectURL; + + } + + if (document.getElementById("countdown").innerHTML !== '') { + document.getElementById("countdown").innerHTML = "OK"; + } + + } else { + + elem.innerHTML = timeLeft + " s"; + timeLeft--; + + } + } + + + } catch (err) { + console.log('Fetch error:' + err + myURL ); // Error handling + } +} + + + + +//
+ +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) +} + diff --git a/earth/index.html b/earth/index.html index 2717252..8fe3b6c 100644 --- a/earth/index.html +++ b/earth/index.html @@ -20,7 +20,26 @@ + + +