Skip to content

Commit

Permalink
new: add website
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Nov 19, 2023
1 parent 80a26c0 commit d1d26b8
Show file tree
Hide file tree
Showing 4 changed files with 636 additions and 0 deletions.
55 changes: 55 additions & 0 deletions html/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>

<head>
<title>Hiddify Convertor</title>
<!-- Include Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>

<body>
<div class="container mt-4">
<h1 class="mb-4">Hiddify Convertor</h1>

<div class="form-group">
<label for="inputTextArea">Input:</label>
<textarea class="form-control" id="inputTextArea" placeholder="ss://a:b@yahoo.com:443" rows="3"></textarea>
</div>

<button id="callButton" class="btn btn-primary">Convert</button>

<div class="form-group mt-4">
<label for="outputTextArea">Output:</label>
<textarea class="form-control" id="outputTextArea" rows="3" readonly></textarea>
</div>

<button id="copyButton" class="btn btn-secondary">Copy Output</button>
</div>

<script src="wasm_exec.js"></script>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("web.wasm"), go.importObject).then((result) => {
go.run(result.instance);
});

document.getElementById("callButton").addEventListener("click", () => {
const input = document.getElementById("inputTextArea").value;
const result = callGoFunction(input); // Modify this function to accept input
document.getElementById("outputTextArea").value = result;
});

document.getElementById("copyButton").addEventListener("click", () => {
const outputTextArea = document.getElementById("outputTextArea");
outputTextArea.select();
document.execCommand("copy");
});
</script>

<!-- Include Bootstrap JS and Popper.js -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>

</html>
Loading

0 comments on commit d1d26b8

Please sign in to comment.