2023-09-10 13:39:19 +02:00
|
|
|
<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="/ipfs/QmQRq211EMmQJ7QE44FrVZt8EMF7JJWnayDXHyKzes4pX1">
|
2023-11-21 23:47:59 +01:00
|
|
|
<title>ENTRANCE SCANNER</title>
|
2023-09-10 13:39:19 +02:00
|
|
|
|
|
|
|
<script src="/ipfs/Qmae5v9zydax9u6C9ceDijURu5PYdd5avmv4NkenCw7RFv/astro.js"></script>
|
|
|
|
|
|
|
|
<script src="/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/jquery-3.6.3.min.js"></script>
|
|
|
|
<script src="/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/instascan.min.js"></script>
|
|
|
|
<link rel="stylesheet" href="/ipfs/QmaCh8mywWfxkXF3JziFzqZS6yZFo3eNS5fSfnzJqdSQvX/decoration.css" type="text/css" />
|
|
|
|
<link rel="stylesheet" href="/ipfs/QmaCh8mywWfxkXF3JziFzqZS6yZFo3eNS5fSfnzJqdSQvX/layout.css" type="text/css" />
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
background-color: black;
|
|
|
|
display: flex;
|
|
|
|
background-image: url("/ipfs/QmQspubjs9XymRC1f6ka7kJUb66WyXhuymW3vCqm2nN4GB");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: 100% 100%;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
font-family: sans-serif;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Apply styles to an inner container for the image */
|
|
|
|
.demo {
|
|
|
|
background-image: url("/ipfs/QmQP9qz4R5Y9ycSQ36CXKE44SptpzRxZ2o9AKympj6Cikc");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: contain; /* Keep the image aspect ratio and fit it within the container */
|
|
|
|
width: 80%; /* Adjust the width of the container as needed */
|
|
|
|
height: 80%; /* Adjust the height of the container as needed */
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
#showoff {
|
|
|
|
width: 80%;
|
|
|
|
|
|
|
|
-webkit-touch-callout: none;
|
|
|
|
-webkit-user-select: none;
|
|
|
|
-khtml-user-select: none;
|
|
|
|
-moz-user-select: none;
|
|
|
|
-ms-user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add these styles to your existing CSS */
|
|
|
|
/* Adjust the top and right positions to align with the camera */
|
|
|
|
#qrcode-container {
|
|
|
|
position: absolute;
|
|
|
|
top: 20px; /* Adjust the top position as needed */
|
|
|
|
left: 20px; /* Adjust the left position as needed */
|
|
|
|
}
|
|
|
|
|
|
|
|
#form-container {
|
|
|
|
position: absolute;
|
|
|
|
top: 20px; /* Adjust the top position as needed */
|
|
|
|
left: 280px; /* Adjust the right position to align with the camera */
|
|
|
|
|
|
|
|
padding: 20px; /* Add padding to create a background effect */
|
|
|
|
text-align: right;
|
|
|
|
width: 22%; /* Adjust the width of the form container as needed */
|
|
|
|
}
|
|
|
|
|
|
|
|
#console {
|
|
|
|
background: rgba(0, 0, 0, 0.7); /* Adjust the background color and opacity as needed */
|
|
|
|
color: white;
|
|
|
|
width: 100%;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
padding: 10px;
|
|
|
|
visibility: hidden;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ainfo {
|
|
|
|
position: absolute;
|
|
|
|
top: 10px; /* Adjust the top position as needed */
|
|
|
|
right: 10px; /* Adjust the right position as needed */
|
|
|
|
}
|
|
|
|
|
|
|
|
#container {
|
|
|
|
top: 40px;
|
|
|
|
right: 0px;
|
|
|
|
position: absolute;
|
|
|
|
display: inline-block;
|
|
|
|
width: 300px;
|
|
|
|
height: 400px;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div id="demo">
|
|
|
|
<div id="showoff">
|
|
|
|
<div id="qrcode-container">
|
|
|
|
<video id="preview" style="transform: scaleX(-1);width: 240px;height: 240px;" autoplay="autoplay" class="active"></video>
|
|
|
|
</div>
|
|
|
|
<div id="form-container">
|
|
|
|
<!-- Your form content here -->
|
|
|
|
<!--
|
|
|
|
<h1><button id="ainfo" onclick="javascript:var x = document.getElementById('console'); if (x.style.visibility === 'hidden') {x.style.visibility = 'visible';} else {x.style.visibility = 'hidden';}">0/1</button></h1>
|
|
|
|
-->
|
|
|
|
<div id="container">
|
|
|
|
<input type="hidden" id="PASS" value="PASS"/>
|
|
|
|
<p><input type="hidden" id="g1pub" value="2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH"/></p>
|
|
|
|
<div id="appname">
|
|
|
|
<label>
|
2023-10-19 17:36:02 +02:00
|
|
|
<input type="radio" id="q1" name="appname" value="login">
|
2023-09-10 13:39:19 +02:00
|
|
|
<b>LOGIN</b>
|
|
|
|
</label>
|
|
|
|
<label>
|
2023-11-17 03:28:00 +01:00
|
|
|
<input type="radio" id="q2" name="appname" value="logout">
|
2023-09-10 13:39:19 +02:00
|
|
|
<b>LOGOUT</b>
|
|
|
|
</label>
|
2023-11-17 03:28:00 +01:00
|
|
|
<label>
|
|
|
|
<input type="radio" id="q2" name="appname" value="flipper" checked="checked">
|
2023-11-21 23:47:59 +01:00
|
|
|
<b>FLIPPER</b>
|
2023-11-17 03:28:00 +01:00
|
|
|
</label>
|
2023-09-10 13:39:19 +02:00
|
|
|
</div>
|
|
|
|
<strong><div id="resu"></div></strong>
|
2023-10-19 17:36:02 +02:00
|
|
|
<p> <h2>Scan AstroID</h2> </p>
|
2023-09-10 13:39:19 +02:00
|
|
|
<h1><div id="countdown">___</div></h1>
|
|
|
|
|
|
|
|
<p><a href="https://opencollective.com/monnaie-libre/" target="funding">- (^‿‿^) -</a></p>
|
2023-10-19 17:36:02 +02:00
|
|
|
<!--
|
|
|
|
<br>or enter<br>
|
|
|
|
<form id="formlink" action="http://127.0.0.1:1234" method="GET" enctype="application/x-www-form-urlencoded">
|
|
|
|
SECRET 1 : (EMAIL) <input name='salt' value='0'>
|
|
|
|
SECRET 2 : (8 DIGIT PASS)<input name='pepper' value='0'>
|
|
|
|
<br>
|
|
|
|
LOGIN : <input type="radio" id="s1" name="login" value="login">
|
|
|
|
LOGOUT : <input type="radio" id="s2" name="logout" value="logout" checked="checked">
|
|
|
|
<input type='submit' value='OK'>
|
|
|
|
</form>
|
|
|
|
-->
|
2023-09-10 13:39:19 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="console"><a href="_STATION_" target="aframe">CONSOLE</a>
|
|
|
|
<iframe name="aframe" id="aframe" src="_STATION_" width="100%" height="40px"></iframe>
|
2023-11-21 23:47:59 +01:00
|
|
|
<h1>ENTRANCE SCANNER</h1>
|
2023-09-10 13:39:19 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2023-11-13 00:37:35 +01:00
|
|
|
// Extract the hostname (e.g., "https://ipfs.domain.tld" or "http://ipfs.localhost:8080")
|
|
|
|
var currentURL = new URL(window.location.href);
|
|
|
|
var hostname = currentURL.hostname;
|
|
|
|
var port = currentURL.port;
|
|
|
|
var protocol = currentURL.protocol.split(":")[0];
|
|
|
|
|
|
|
|
// Check and replace the port if it's 8080
|
|
|
|
if (port === "8080") {
|
|
|
|
port = "1234";
|
|
|
|
}
|
2023-11-17 03:28:00 +01:00
|
|
|
|
2023-11-13 00:37:35 +01:00
|
|
|
var zHost = hostname.replace("ipfs", "astroport");
|
|
|
|
|
2023-09-10 13:39:19 +02:00
|
|
|
// Create the "station" variable with the specified format
|
2023-11-13 00:37:35 +01:00
|
|
|
var station = protocol + "://" + zHost + (port ? (":" + port) : "");
|
|
|
|
|
|
|
|
console.log(station)
|
|
|
|
|
2023-09-10 13:39:19 +02:00
|
|
|
|
2023-10-19 17:36:02 +02:00
|
|
|
|
2023-09-10 13:39:19 +02:00
|
|
|
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 target='aframe' href='"+redirectURL+"'>OK</a>";
|
|
|
|
window.open( redirectURL, "AstroTab");
|
|
|
|
} else {
|
|
|
|
elem.innerHTML = timeLeft + " s";
|
|
|
|
timeLeft--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
console.log('Fetch error:' + err); // Error handling
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('STATION:' + station);
|
|
|
|
|
|
|
|
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
|
|
|
|
|
|
|
|
scanner.addListener('scan', function (content) {
|
|
|
|
alert(content);
|
|
|
|
if (content.startsWith('~~~~~')) {
|
|
|
|
// GET APPNAME
|
|
|
|
var appname = document.querySelector('input[name="appname"]:checked').value;
|
|
|
|
|
|
|
|
if ( appname == 'login' || appname == 'logout' ) {
|
2023-10-19 17:36:02 +02:00
|
|
|
// var amount = prompt("Saisir EMAIL:");
|
|
|
|
var amount = "UPlanet";
|
2023-09-10 13:39:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// GET PASS TO DECODE PGP
|
2023-11-17 21:56:30 +01:00
|
|
|
var pass = prompt("Saisir PASS:");
|
2023-09-10 13:39:19 +02:00
|
|
|
|
|
|
|
// PREVIOUS G1PUB SCAN
|
|
|
|
var g1pub = document.getElementById("g1pub").value;
|
|
|
|
|
|
|
|
var myU = station + '/?qrcode=' + content +'&pass=' + pass + '&' + appname + '=' + amount + '&g1pub=' + g1pub ;
|
|
|
|
console.log(myU);
|
|
|
|
|
2023-11-17 21:56:30 +01:00
|
|
|
if ( appname == 'login' || appname == 'logout' || appname == 'flipper' ) {
|
2023-09-10 13:39:19 +02:00
|
|
|
homeAstroportStation(myU, 'tab', 5000)
|
|
|
|
} else {
|
|
|
|
homeAstroportStation(myU, 'aframe', 12000)
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// COPY QRCODE IN g1pub input
|
|
|
|
document.getElementById("g1pub").value = content;
|
|
|
|
// document.getElementById("resu").innerHTML = content;
|
|
|
|
var myU = station + '/?qrcode=' + content;
|
|
|
|
console.log(myU);
|
2023-11-17 21:56:30 +01:00
|
|
|
homeAstroportStation(myU, 'aframe', 7000)
|
2023-09-10 13:39:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
let cookies = document.cookie;
|
|
|
|
console.log('COOKIE:' + cookies);
|
|
|
|
|
|
|
|
const el = document.getElementById('console');
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
el.style.visibility = 'visible';
|
|
|
|
}, 3000); // 👈️ delay in milliseconds
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|