Astroport.ONE/www/index_ONE.html

90 lines
2.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>Astroport.ONE - SAVE PLANET EARTH - IPFS / La<3BOX / IRL GAMING made by LaSTI /</title>
<meta charset="UTF-8">
<link rel="icon" type="image/x-icon" href="https://ipfs.copylaradio.com/ipfs/QmNwECbSL6xihpS2QLpts8a8Boekk3rEVGeySuzg83jTDA/favicon.ico">
<link rel="stylesheet" href="/ipfs/QmVuJCKVp57b3HzwDRAoURonaFwWTwvoqq2Am2JoSQhdPz/index_fichiers/demo.css">
<script type="text/javascript" src="/ipfs/QmVuJCKVp57b3HzwDRAoURonaFwWTwvoqq2Am2JoSQhdPz/index_fichiers/jquery-3.6.3.min.js"></script>
<script type="text/javascript" src="/ipfs/QmVuJCKVp57b3HzwDRAoURonaFwWTwvoqq2Am2JoSQhdPz/index_fichiers/instascan.min.js"></script>
</head>
<body>
<h1>SCANNEZ QRCODE (<a href="https://cesium.app" target=_blank>CESIUM</a>)</h1>
<div class="subtitle">Passeport TERRE</div>
<div id="showoff">
<div id="description">
<center>
<video id="preview" style="transform: scaleX(-1);width: 240px;height: 240px;" autoplay="autoplay" class="active"></video>
<script type="text/javascript">
2023-03-01 03:19:05 +01:00
function sendtostation (mycontent) {
2023-03-01 03:19:05 +01:00
var query = 'qrcode='+ mycontent;
var myURL = 'http://astroport.localhost:1234/?' + query;
console.log(fullURL)
2023-03-01 03:19:05 +01:00
async function fetchAstroport(myURL) {
try {
2023-03-01 03:19:05 +01:00
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]
2023-03-01 03:19:05 +01:00
console.log(redirectURL)
2023-03-01 03:19:05 +01:00
setTimeout(function() {
// let two = await fetch(redirectURL);
// document.mydiv.innerHTML = await two.text(); // Replaces body with response
window.open( redirectURL, "AstroTab");
}, 5000);
2023-03-01 03:19:05 +01:00
} 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);
sendtostation(content);
});
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>
<h2> - Activez votre Capsule IPFS - </h2>
</center>
</div>
</div>
</body></html>