Peradventure/views/index.etlua

28 lines
820 B
Plaintext

<!-- views/index.etlua -->
<!DOCTYPE HTML>
<script src="/static/htmx.min.js"></script>
<% if not isPopulated then %>
<div id="clickable">
<button hx-post="/clickme" hx-target="#clickable">Start</button>
</div>
<% end %>
<article style="text-align: center;">
<h3>Log In / Create Game</h3>
<p>Player will be created if player name does not already exist. Names may not contain whitespace.</p>
<form>
<div class="grid">
<input type="text" name="playername">
<input type="submit" hx-post="/character-create" hx-trigger="click" value="Execute" hx-target="#replace">
</div>
</form>
<div>
<p id="replace"></p>
</div>
</article>
<a href="/game">Play Now</a>
</main>
<!-- TODO: On player create use Model to make new game_ref and append game_ref to self_session -->