UNPKG

aiom_pack

Version:

Framework for interdependent (mcmc-like) behavioral experiments

60 lines (59 loc) 2 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Instruction</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.3.4/axios.min.js"></script> <link rel="icon" type="image/png" href="/pkg-static/images/favicon.png"/> <link rel="stylesheet" href="/pkg-static/css/style.css"> <script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <style> .container { text-align: center; width: 80%; padding: 20px; background-color: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; align-items: center; max-height: 90vh; overflow-y: auto; } p { font-size: medium; line-height: 1.8; text-align: left; } </style> </head> <body> <div class="container"> <h1>Instruction - Part 1</h1> <p id="instruction"> Loading instruction... </p><br> <button onclick="beginExperiment()">Begin</button> <div id="response"></div> </div> <script> function beginExperiment() { if (Cookies.get('team_id')) { window.location.href = 'waitingroom'; } else { window.location.href = 'experiment'; } } $(document).ready(function() { $("#instruction").load(`${ENV.instruction_text}`, function(response, status, xhr) { if (status == "error") { $("#instruction").html("Sorry, there was an error loading the instruction."); } }); }); </script> </body> </html>