<html>
{% render 'header.liquid' %}
<link rel="stylesheet" href="/css/waitingRoom.css">
</head>
<body>
<main>
Bonjour {{ pseudo }}, on attend un·e adversaire !
</main>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/jquery.redirect.js"></script>
<script>
    const socket = io();
    socket.emit("wait", { pseudo :"{{ pseudo }}"});
    socket.on('both_here', function(arg) {
        console.log(arg);
        jQuery(function($){
            $.redirect("/game", {room: arg, pseudo: "{{ pseudo }}"}, "POST", "_SELF"); 
        });
     });
</script>
</body>
<html>