ars/templates/view.stpl

54 lines
1.8 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">
2023-11-05 19:54:47 +01:00
<link rel="stylesheet" href="/static/zettoit-style/zettoit.css">
2023-11-01 21:12:18 +01:00
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2023-11-05 19:54:47 +01:00
<style>
.qrcode svg{
filter: invert();
width: 100%;
height: auto;
}
</style>
2023-11-01 21:12:18 +01:00
</head>
<body>
2023-11-01 21:15:55 +01:00
<script src="/static/chart.js"></script>
2023-11-01 21:12:18 +01:00
<main class="container" hx-sse="connect:/<%= id %>/view/events swap:message">
<% } %>
2023-11-02 22:46:38 +01:00
<% if let ViewerState::Answering{ inner_body } = state { %>
<%- inner_body %>
2023-11-01 21:12:18 +01:00
2023-11-02 22:46:38 +01:00
<button hx-post="" class="outline">Show correct Answer</button>
2023-11-01 21:12:18 +01:00
2023-11-02 22:46:38 +01:00
<% } else if let ViewerState::Result{ last_question, inner_body} = state { %>
2023-11-01 21:12:18 +01:00
2023-11-02 22:46:38 +01:00
<%- inner_body %>
2023-11-01 21:12:18 +01:00
2023-11-02 22:46:38 +01:00
<% if last_question { %>
<button hx-post="" class="outline">End Quiz</button>
<% } else { %>
<button hx-post="" class="outline">Next Question</button>
<% } %>
2023-11-01 21:12:18 +01:00
<% } else if let ViewerState::NotStarted((player, qrcode, url)) = state { %>
</article>
2023-11-05 19:54:47 +01:00
<center class="qrcode"><%- qrcode %></center>
<center>or visit <%= url %></center>
2023-11-01 21:12:18 +01:00
<button hx-post="" class="outline">Start Quiz with <b><%= player %></b> Players</button>
</article>
<% } else {%>
<article>
The Quiz finished. You can close this tab now.
</article>
<% } %>
<% if !htmx { %>
</main>
2023-11-05 19:54:47 +01:00
<a class="watermark" href="https://git2.zettoit.eu/zettoit"><img src="/static/zettoit-style/zettoit.svg" alt="zettoIT Logo"></a>
2023-11-01 21:12:18 +01:00
<script src="/static/htmx.min.js"></script>
</body>
</html>
<% } %>