Skip to content
Open
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
18 changes: 15 additions & 3 deletions host.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,25 @@
<title>WebFuck Host</title>
</head>
<body>
<h2>WebFuck Loader</h2>
<input type="file" id="wfFile" accept=".wf">
<button onclick="runWebFuck()">Run</button>

<script src="libwebfuck.js"></script>
<script>
async function main(){
let wf = await loadWebFuck("webfuck.wf");
async function runWebFuck(){
const fileInput = document.getElementById('wfFile');
if (!fileInput.files.length) {
alert('Please select a .wf file');
return;
}

const file = fileInput.files[0];
const text = await file.text();

let wf = new WebFuckModule(file.name, text);
wf.call();
}
main();
</script>
</body>
</html>