migrate to $scramjet object from __scramjet

This commit is contained in:
Percs 2024-07-14 05:34:55 -05:00
parent 146c202ae2
commit cf9e5a3418
13 changed files with 77 additions and 67 deletions

View file

@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="prefetch" href="/scram/scramjet.worker.js" type="module">
<link rel="prefetch" href="/scram/scramjet.shared.js" type="module">
<link rel="prefetch" href="/scram/scramjet.worker.js">
<link rel="prefetch" href="/scram/scramjet.shared.js">
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&amp;family=Inter+Tight:ital,wght@0,100..900;1,100..900&amp;family=Inter:wght@100..900&amp;display=swap&amp;" rel="stylesheet">
<style>
body, html, #app {
@ -22,8 +22,8 @@
<body>
<script src="https://unpkg.com/dreamland"></script>
<script src="/baremux/index.js" defer></script>
<script src="/scram/scramjet.codecs.js"></script>
<script src="/scram/scramjet.config.js"></script>
<script src="/scram/scramjet.codecs.js" defer></script>
<script src="/scram/scramjet.config.js" defer></script>
<script src="ui.js" defer></script>
</body>
</html>

View file

@ -1,5 +1,5 @@
navigator.serviceWorker.register("./sw.js", {
scope: __scramjet$config.prefix
scope: $scramjet.config.prefix
})
const connection = new BareMux.BareMuxConnection("/baremux/worker.js")
const flex = css`display: flex;`;
@ -88,7 +88,7 @@ function App() {
<button on:click=${() => window.open(this.urlencoded)}>open in fullscreen</button>
</div>
</div>
<input class="bar" bind:value=${use(store.url)} on:input=${(e) => (store.url = e.target.value)} on:keyup=${(e) => e.keyCode == 13 && console.log(this.urlencoded = __scramjet$config.prefix + __scramjet$config.codec.encode(e.target.value))}></input>
<input class="bar" bind:value=${use(store.url)} on:input=${(e) => (store.url = e.target.value)} on:keyup=${(e) => e.keyCode == 13 && console.log(this.urlencoded = $scramjet.config.prefix + $scramjet.config.codec.encode(e.target.value))}></input>
<iframe src=${use(this.urlencoded)}></iframe>
</div>
`