feat: add loading spinner when starting a new game

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-31 21:28:08 +02:00
parent 8942e7f608
commit 3edde1c7db

View File

@@ -29,10 +29,17 @@
</div> </div>
{% else %} {% else %}
<div class="game-start-container"> <div class="game-start-container">
<form method="post" action="{{ path('app_game_start') }}"> <form method="post" action="{{ path('app_game_start') }}" id="start-form">
<input type="hidden" name="_token" value="{{ csrf_token('game_start') }}"> <input type="hidden" name="_token" value="{{ csrf_token('game_start') }}">
<button type="submit" class="btn btn-primary btn-start">Commencer une partie</button> <button type="submit" class="btn btn-primary btn-start">Commencer une partie</button>
</form> </form>
<div class="start-loader" id="start-loader"></div>
<script>
document.getElementById('start-form').addEventListener('submit', function () {
this.style.display = 'none';
document.getElementById('start-loader').style.display = 'block';
});
</script>
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}