event target

This commit is contained in:
velzie 2024-08-31 11:29:09 -04:00
parent 5f7a9d4bd4
commit 08ccb4f56e
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
6 changed files with 48 additions and 5 deletions

View file

@ -153,6 +153,10 @@ function App() {
const frame = scramjet.createFrame();
frame.addEventListener("urlchange", (e) => {
this.url = e.url;
});
return html`
<div>
<h1>Percury Unblocker</h1>
@ -185,7 +189,11 @@ function App() {
</div>
<div class=${[flex, "nav"]} style="width: 60%">
<button on:click=${() => frame.back()}>&lt;-</button>
<input class="bar" style="flex: 1" bind:value=${use(store.url)} on:input=${(e) => (store.url = e.target.value)} on:keyup=${(e) => e.keyCode == 13 && frame.go(e.target.value)}></input>
<input class="bar" style="flex: 1" bind:value=${use(this.url)} on:input=${(
e
) => {
this.url = e.target.value;
}} on:keyup=${(e) => e.keyCode == 13 && frame.go(e.target.value) && (store.url = this.url)}></input>
<button on:click=${() => frame.forward()}>-&gt;</button>
</div>
${frame.frame}