You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.3 KiB
97 lines
2.3 KiB
<html> |
|
|
|
<head> |
|
|
|
<meta name="pagedata" content='{"username": "{{ .Username}}"}' /> |
|
<style> |
|
body { |
|
margin: 0; |
|
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji"; |
|
padding: 12px 0 0; |
|
} |
|
|
|
canvas { |
|
margin: 0 auto 10px; |
|
width: 1024px; |
|
display: block; |
|
border: 1px solid #000; |
|
} |
|
|
|
.chat { |
|
width: 1024px; |
|
margin: 0 auto; |
|
border: 1px solid #000; |
|
padding: 8px; |
|
box-sizing: border-box; |
|
display: flex; |
|
} |
|
|
|
#msg { |
|
display: flex; |
|
flex-grow: 1; |
|
margin-right: 8px; |
|
} |
|
|
|
#send { |
|
height: 30px; |
|
} |
|
|
|
.header { |
|
width: 1024px; |
|
margin: 0 auto 12px; |
|
justify-content: flex-end; |
|
display: flex; |
|
} |
|
|
|
.login:link, |
|
.login:visited { |
|
color: #ffffff; |
|
background-color: #310f69; |
|
border-radius: 12px; |
|
padding: 8px; |
|
} |
|
|
|
.controls { |
|
width: 1024px; |
|
height: 30px; |
|
margin: 0 auto; |
|
font-size: 12px; |
|
text-align: right; |
|
} |
|
|
|
.pill { |
|
border: 1px solid #000000; |
|
border-radius: 8px; |
|
padding: 5px; |
|
|
|
} |
|
</style> |
|
</head> |
|
|
|
<body> |
|
<div class="header"> |
|
{{ if eq .Username ""}} |
|
<a href="/auth/twitch" class="login">Login with Twitch</a> |
|
{{ else }} |
|
Logged In as {{ .Username}} |
|
{{ end }} |
|
</div> |
|
<button id="leave">Leave Game</button> |
|
<canvas id="canvas" width="1024" height="400"></canvas> |
|
<div class="controls"> |
|
<span class="pill">a - move left</span> |
|
<span class="pill">d - move right</span> |
|
<span class="pill">s - crouch</span> |
|
<span class="pill">w - jump</span> |
|
<span class="pill">space - attack</span> |
|
|
|
</div> |
|
<div class="chat"> |
|
<input type="text" id="msg" placeholder="Type in a message to chat" /> |
|
<button type="button" id="send">Send</button> |
|
</div> |
|
<script src="/static/script.js" type="module"></script> |
|
|
|
</body> |
|
|
|
</html>
|
|
|