Astroport.ONE/www/G1PalPay/index.html

264 lines
8.1 KiB
HTML

<html>
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="icon" type="image/x-icon" href="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/favicon.ico">
<title>♥Box Ğ1Station - Astroport Ŋ1 - </title>
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/demo.css">
<script src="http://127.0.0.1:8080/ipfs/QmYD4y1pXHVnGxxFcn2LWo84ytwmWdNbkyUeFnPCbrpUQy/openpgp.min.js"></script>
<script src="http://127.0.0.1:8080/ipfs/Qmae5v9zydax9u6C9ceDijURu5PYdd5avmv4NkenCw7RFv/astro.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/jquery-3.6.3.min.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/instascan.min.js"></script>
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmaCh8mywWfxkXF3JziFzqZS6yZFo3eNS5fSfnzJqdSQvX/decoration.css" type="text/css" />
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmaCh8mywWfxkXF3JziFzqZS6yZFo3eNS5fSfnzJqdSQvX/layout.css" type="text/css" />
<style>
body {
background-image:url("http://127.0.0.1:8080/ipfs/QmSFgatcq3q898J56epa8SyGbH651vRBFnv93kQSwfoi83/background.014.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0;
margin: 0;
font-family: sans-serif;
}
html {
height: 100%
}
header {
opacity: 0.8;
}
input[type=submit] {
width: 12em; height: 4em;
}
input[type=checkbox] {
width: 2em; height: 2em;
}
input {
width: 26em; height: 2em;
}
#aframe {
background: white;
color: black;
}
#yellow {
background: black;
color: white;
position: absolute;
bottom: 2%;
left: 2%;
width: 800px;
visibility: hidden;
}
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: 15px;
padding-left: 20px;
}
#showoff {
float: right;
width: 30%;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#container {
top: 120px;
right: 0px;
position: absolute;
display: inline-block;
width: 400px;
height: 400px;
}
</style>
</head>
<body>
<div id="demo">
<div id="description">
<header>
<h1><a href="http://astroport.localhost:1234"><span>♥Box</span> Ğ1Station</a></h1><br>
</header>
<h3>Oubliez la crise !</h3>
<h2>Utilisez la Monnaie Libre.</h2>
<h3>Explorez le Monde Autrement...</h3>
</div>
</div>
<div id="showoff">
<div id="container">
<video id="preview" style="transform: scaleX(-1);width: 240px;height: 240px;" autoplay="autoplay" class="active"></video>
<strong><div id="countdown"></div></strong>
<div id="appname">
<input type="radio" id="r0" name="appname" value="login"> Login
<input type="radio" id="r1" name="appname" value="read"> Messagerie
<input type="radio" id="r2" name="appname" value="history"> Historique
<input type="radio" id="r3" name="appname" value="pay"> Payer
<input type="radio" id="r3" name="appname" value="balance" checked="checked"> Balance
</div>
<strong><div id="resu"></div></strong>
<p> <strong>Scanner QRCODE</strong> </p>
<p>1. <b>G1PUB</b> destinataire</p>
<p>2. <b>G1PASS</b> opérateur</p>
<p>fonctionne
<br>avec "<a target="" href="https://cesium.app/fr/fonctionnalites">G1BILLET</a>" et <a target="cesium" href="https://cesium.app/fr/telechargement">G1PASS</a>
<br>avec un "<a target="cesium" href="https://cesium.app/fr/fonctionnalites">Portefeuille</a>" <a target="cesium" href="https://cesium.app/fr/telechargement">Cesium</a>
<br>...
</p>
</div>
</div>
<script type="text/javascript">
async function fetchAstroport(myURL) {
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(redirectURL)
// start countdown
var timeLeft = 20;
var elem = document.getElementById("countdown");
var timerId = setInterval(countdown, 1000);
function countdown() {
if (timeLeft == -1) {
clearTimeout(timerId);
elem.innerHTML = "<a href='"+redirectURL+"' target='aframe'>OK</a>";
window.open( redirectURL, "AstroTab");
} else {
elem.innerHTML = timeLeft + " s";
timeLeft--;
}
}
} catch (err) {
console.log('Fetch error:' + err); // Error handling
}
}
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
scanner.addListener('scan', function (content) {
alert(content);
if (content.startsWith('~~~~~')) {
// DESTINATION OF PREVIOUS SCAN
if (document.getElementById("resu").innerHTML !== '') {
var mypub = document.getElementById("resu").innerHTML.value;
} else {
// OR IF NONE Fred ;)
var mypub = "DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech"
}
// GET PASS THAT DECODE PGP
var pass = prompt("Saisir PASS:");
// GET APPNAME
var appname = document.querySelector('input[name="appname"]:checked').value;
// DEFAULT PAY
if ( appname == 'pay') {
var amount = prompt("Saisir MONTANT Ğ1:");
}
if ( appname == 'login') {
var amount = prompt("Saisir EMAIL:");
} else {
var amount = mypub;
}
if ( appname == 'pay') {
alert('PAY TO ' + mypub + ' = ' + amount);
}
var myU = 'http://astroport.localhost:1234/?qrcode=' + content +'&pass=' + pass + '&' + appname + '=' + amount + '&g1pub=' + mypub ;
console.log(myU);
homeAstroportStation(myU, 'aframe', 10000)
} else {
document.getElementById("resu").innerHTML = content;
var myU = 'http://astroport.localhost:1234/?qrcode=' + content;
console.log(myU);
homeAstroportStation(myU, 'aframe', 10000)
}
// fetchAstroport(myU)
});
Instascan.Camera.getCameras().then(function (cameras) {
if (cameras.length > 0) {
scanner.start(cameras[0]);
} else {
console.error('No cameras found.');
}
}).catch(function (e) {
console.error(e);
});
</script>
<h1><button id="ainfo" onclick="javascript:var x = document.getElementById('yellow'); if (x.style.visibility === 'hidden') {x.style.visibility = 'visible';} else {x.style.visibility = 'hidden';}">0/1</button></h1>
<div id="yellow" ><a href="_STATION_" target="aframe">MENU</a>
<iframe name="aframe" id="aframe" src="_STATION_" width="100%" height="320px"></iframe>
</div>
<script>
let cookies = document.cookie;
console.log(cookies);
const el = document.getElementById('yellow');
setTimeout(() => {
el.style.visibility = 'visible';
}, 3000); // 👈️ delay in milliseconds
</script>
</body></html>