{% extends "base.jinja2" %}

{% block title %}Loginween Register{% endblock %}

{% block nav %}
<li class="nav-item">
    <a class="nav-link" href="/login">Login</a>
</li>
<li class="nav-item">
    <a class="nav-link active" aria-current="page" href="/register">Register</a>
</li>
<li class="nav-item">
    <a class="nav-link" href="/countdown">Countdown</a>
</li>
{% endblock %}

{% block body %}
<form id="register_form" method="post" target="/register">
    <div class="position-absolute top-50 start-50 translate-middle text-center">
        <h1>Draw a carving to register!</h1>
        <input type="hidden" name="pattern" id="pattern_field">
        <canvas id="pumpkin_canvas" width="600" height="600" class="my-3"></canvas>
        <div class="input-group mb-3">
            <input id="username_field" name="username" type="text" class="form-control" placeholder="Username" aria-label="Username">
        </div>
        <div class="buttons">
            <button type="submit" class="btn btn-primary me-2" id="registerBtn">Register</button>
            <button type="button" id="lightBtn" class="btn btn-warning me-2">Light!</button>
            <button type="button" id="clearBtn" class="btn btn-danger">Clear</button>
        </div>
    </div>
</form>

<script>
setup_pumpkin("pumpkin_canvas", "clearBtn", "lightBtn", "register_form", "pattern_field", {{ grid_size }})
</script>
{% endblock body %}