Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions public/takopi.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>codehex - Takopi WebAssembly Demo</title>
<meta name="description" content="codehex homepage">
<meta name="author" content="codehex">
</head>
<body>
<!-- loading... -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/black/pace-theme-corner-indicator.min.css" />
<script src="/wasm_exec.js"></script>
<script>
if (!WebAssembly.instantiateStreaming) {
WebAssembly.instantiateStreaming = async (resp, importObject) => {
const source = await (await resp).arrayBuffer();
return await WebAssembly.instantiate(source, importObject);
};
}
(async function () {
try {
const go = new Go();
const response = await fetch("/wasm/takopi.wasm");
const buffer = await response.arrayBuffer();
const result = await WebAssembly.instantiate(buffer, go.importObject);
go.run(result.instance);
} catch (err) {
console.error("error:", err);
}
})();
</script>

<div id="center">
<h1>takopi WebAssembly Demo</h1>
<form class="frm" oninput="takopi()">
<div id="box">
<textarea
id="inp"
class="txar"
rows="5"
name="s"
placeholder="ここに日本語を書くっピ!"
></textarea>
</div>
</form>

<div id="message"></div>
<br />
<a href="https://github.com/Code-Hex/takopi" target="_blank">source code</a>
</div>

<script
type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"
></script>
<script>
function takopi() {
var s = document.getElementById("inp").value;
ret = takopilize(s);
$("#message").empty();
$("#message").append("<p>" + ret + "</p>");
}
</script>
</body>
</html>
Binary file added public/wasm/takopi.wasm
Binary file not shown.
Loading