33 lines
1.2 KiB
HTML
33 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<title>StarKingdoms.TK</title>
|
|
<link rel="stylesheet" href="/static/css/stylemain.css"></link>
|
|
<link rel="favicon" href="/static/img/favicon.ico"></link>
|
|
<meta charset="utf-8">
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="chatbox">
|
|
<div id="chats">
|
|
<p>hello: blsdkjf</p>
|
|
</div>
|
|
<input id="chat-value" type="text" placeholder="chat text goes here" />
|
|
<button id="chat-submit">submit</button>
|
|
</div>
|
|
|
|
<script type="module">
|
|
// If you're getting build errors here | you need to run `just build_client_bundle` first, to compile client code
|
|
// v
|
|
import init, { rust_init, send_chat } from "./dist/client.js";
|
|
init().then(() => {
|
|
rust_init("ws://localhost:3000/ws", "core");
|
|
|
|
document.getElementById("chat-submit").addEventListener("click", e => {
|
|
send_chat(document.getElementById("chat-value").value);
|
|
})
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |