123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <link type="text/css" rel="stylesheet" href="../css/material-icons.css" />
- <link type="text/css" rel="stylesheet" href="../css/materialize.min.css" media="screen,projection" />
- <link type="text/css" rel="stylesheet" href="../css/style.min.css" media="screen,projection" />
- <link rel="icon" href="../img/favicon.ico" />
- <title>Scan - Microfolie Lens</title>
- </head>
- <body class="grey lighten-3">
- <!-- Header -->
- <header class="navbar-fixed">
- <nav class="red">
- <div class="nav-wrapper">
- <span class="brand-logo center mtop-half hide-on-med-and-down"><img src="../img/logo.png"
- title="Logo Microfolie" class="responsive-img" style="max-width: 128px;" /></span>
- <span class="brand-logo center hide-on-large-only">Microfolie Lens</span>
- <div class="left mleft-2 hide-on-med-and-down">
- <span>
- <h5>Microfolie Lens</h5>
- </span>
- </div>
- </div>
- </nav>
- </header>
- <div class="mtop-5 hide-on-med-and-down"></div>
- <!-- Main -->
- <main class="container">
- <div class="row">
- <div class="col s12 center-align">
- <h3 id="title">QR Code Scanner</h3>
- </div>
- </div>
- <div class="row">
- <div class="col s12 center-align">
- <video id="qr-preview"></video>
- </div>
- </div>
- <div class="row">
- <div class="col s12 center-align">
- <p id="result"></p>
- </div>
- </div>
- </main>
- <!-- Modals -->
- <div id="ok-modal" class="modal">
- <div class="modal-content" style="overflow: hidden;">
- <div class="row">
- <div class="col offset-m1 m3 s12">
- <i class="material-icons green-text" style="font-size: 8em;">check_circle</i>
- </div>
- <div class="col m7 s12 mtop-3">
- <h4>Votre code a bien été scanné</h4>
- </div>
- </div>
- </div>
- </div>
- <!-- Modals -->
- <div id="err-modal" class="modal">
- <div class="modal-content" style="overflow: hidden;">
- <div class="row">
- <div class="col offset-m1 m3 s12">
- <i class="material-icons red-text" style="font-size: 8em;">error</i>
- </div>
- <div class="col m7 s12 mtop-3">
- <h4 id="error-text">Error message</h4>
- </div>
- </div>
- </div>
- </div>
- <!-- Script -->
- <script type="text/javascript" src="../js/jquery.min.js"></script>
- <script type="text/javascript" src="../js/materialize.min.js"></script>
- <script type="text/javascript" src="../js/script.js"></script>
- <!-- Script pour cette page-->
- <script type="text/javascript" src="../js/instascan.min.js"></script>
- <script type="text/javascript">
- // Lecteur cookie espace
- const espace = getCookie("microfolies.lens.espace");
- // Changement nom titre
- if (espace !== undefined) {
- $('#title').html(espace.capitalize());
- }
- //Scanner QRcode
- const scanner = new Instascan.Scanner({ video: document.getElementById('qr-preview') });
- scanner.addListener('scan', function (content) {
- const result = espace ? content + "/" + espace : content;
- $('#result').html(result);
- M.Modal.getInstance($('#ok-modal')).open();
- });
- Instascan.Camera.getCameras().then(function (cameras) {
- if (cameras.length > 0) {
- scanner.start(cameras[0]);
- }
- else {
- console.error('No cameras found.');
- }
- }).catch(err => {
- console.error(err);
- });
- </script>
- </body>
- </html>
|