feat(runtime): make techdemo interactions declarative

req: examples/005

req: htmx_equivalents/002

req: dx/008

req: form/002
This commit is contained in:
slhx agent
2026-05-11 08:11:06 +02:00
parent 0de4c82a16
commit 2db7ed7a3c
6 changed files with 27 additions and 24 deletions
-15
View File
@@ -366,21 +366,6 @@ fn shell(body: String) -> String {
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>slhx Techdemo</title>
<script src="/slhx.js" defer></script>
<script>
function slhxTechdemoLaunch(button) {{
const form = button.closest('form');
const data = new URLSearchParams(new FormData(form));
data.set('__h', button.getAttribute('data-hid'));
fetch('/', {{
method: 'POST',
headers: {{ 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'Accept': 'application/slhx' }},
body: data
}})
.then((response) => response.arrayBuffer())
.then((buffer) => window.slhx.applyBatch(buffer, button.closest('[data-slhx-root]')));
return false;
}}
</script>
<style>
:root {{ color-scheme: dark; --bg:#070814; --panel:rgba(255,255,255,.08); --line:rgba(255,255,255,.16); --text:#f7f7ff; --muted:#aeb3d8; --hot:#ff4fd8; --cyan:#44e7ff; --lime:#b8ff5a; --amber:#ffd166; }}
* {{ box-sizing:border-box; min-width:0; }}