ars/templates/play.stpl

37 lines
1.3 KiB
Text
Raw Normal View History

2023-11-01 21:12:18 +01:00
<% if !htmx {%>
<!DOCTYPE html>
<html>
<head>
<title>zettoIT ARS</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="/static/pico.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<main class="container" hx-sse="connect:/<%= id %>/events?player=<%=player_id%> swap:message">
<% } %>
<% if let PlayerState::NotStarted = state { %>
<article>
<center>The Quiz hasn't started yet. Please wait for the first question.</center>
</article>
2023-11-02 22:46:38 +01:00
<% } else if let PlayerState::Answering{ inner_body } = state { %>
<%- inner_body %>
2023-11-01 21:12:18 +01:00
<% } else if let PlayerState::Waiting(_) = state{ %>
<article aria-busy="true">
You answered the current question. Please wait for the results.
</article>
2023-11-02 22:46:38 +01:00
<% } else if let PlayerState::Result{ inner_body } = state{ %>
<%- inner_body %>
2023-11-01 21:12:18 +01:00
<% } else if let PlayerState::Completed(correct) = state { %>
<article>
The Quiz finished. You can close this tab now. You answered <b><%= correct*100.0 %>%</b> correctly.
</article>
<% } %>
<% if !htmx { %>
</main>
<script src="/static/htmx.min.js"></script>
</body>
</html>
<% } %>