Fuck web assembly for now, it crash on mobile...
This commit is contained in:
parent
35d498c6e1
commit
203a44dc34
BIN
static/jade-v1.wasm
Executable file
BIN
static/jade-v1.wasm
Executable file
Binary file not shown.
@ -18,23 +18,96 @@
|
||||
|
||||
<script async src="https://js.stripe.com/v3/pricing-table.js"></script>
|
||||
|
||||
<script src="wasm_exec.js"></script>
|
||||
<script>
|
||||
const go = new Go();
|
||||
const wasmModule = WebAssembly.instantiateStreaming(fetch('jade.wasm'),
|
||||
go.importObject);
|
||||
|
||||
WebAssembly.instantiateStreaming(fetch('jade.wasm'),
|
||||
go.importObject).then((result) => {
|
||||
go.run(result.instance);
|
||||
});
|
||||
</script>
|
||||
<!-- highlight.js -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css">
|
||||
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script>
|
||||
<script>hljs.highlightAll();</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body hx-ext="sse" sse-connect="/sse">
|
||||
|
||||
{{embed}}
|
||||
|
||||
<script>
|
||||
function generateMessagePlaceholder(content) {
|
||||
marked.setOptions({
|
||||
highlight: function (code, lang) {
|
||||
const language = hljs.getLanguage(lang) ? lang : 'plaintext';
|
||||
return hljs.highlight(code, { language }).value;
|
||||
}
|
||||
});
|
||||
|
||||
// Convert the markdown content to HTML
|
||||
const htmlContent = marked(content);
|
||||
|
||||
let userString = `
|
||||
<div class="message-user mt-3 message-placeholder">
|
||||
<div class="columns is-mobile">
|
||||
<div class="column is-narrow" id="icon-column">
|
||||
<figure class="image is-48x48 message-icon" style="flex-shrink: 0;">
|
||||
<img src="icons/bouvai2.png" alt="User Image">
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
<div class="column" id="content-column" style="width: 100px;">
|
||||
<div class="is-flex is-align-items-start">
|
||||
<div class="message-content" style="width: 100%; overflow-y: hidden;">
|
||||
<div class="message-header">
|
||||
<p>
|
||||
You
|
||||
</p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<div class="content" style="overflow-x: auto; width: 100%;">
|
||||
${htmlContent}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="is-flex is-justify-content mt-2">
|
||||
<div style="height: 30px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
let botString = `
|
||||
<div class="message-bot mt-3 message-placeholder">
|
||||
<div class="columns is-mobile">
|
||||
<div class="column is-narrow" id="icon-column">
|
||||
<figure class="image is-48x48 message-icon" style="flex-shrink: 0;">
|
||||
<img src="icons/bouvai2.png" alt="User Image">
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
<div class="column" style="width: 100px;">
|
||||
<div class="is-flex is-align-items-start">
|
||||
<div class="message-content">
|
||||
<div class='message-header'>
|
||||
<p>
|
||||
Waiting...
|
||||
</p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<div class="content">
|
||||
<br>
|
||||
<img src="/puff.svg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
return userString + botString;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
function copyToClipboardCode(button) {
|
||||
// Get the code element next to the button
|
||||
|
Loading…
x
Reference in New Issue
Block a user