You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.5 KiB
HTML
90 lines
2.5 KiB
HTML
<!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">
|
|
function sendtostation (mycontent) {
|
|
|
|
var query = 'qrcode='+ mycontent;
|
|
var myURL = 'http://astroport.localhost:1234/?' + query;
|
|
console.log(fullURL)
|
|
|
|
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)
|
|
|
|
setTimeout(function() {
|
|
// let two = await fetch(redirectURL);
|
|
// document.mydiv.innerHTML = await two.text(); // Replaces body with response
|
|
window.open( redirectURL, "AstroTab");
|
|
}, 5000);
|
|
|
|
} 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>
|