style: formatted Controller.svelte

This commit is contained in:
Laureηt 2021-11-10 21:54:06 +01:00
parent 46ba71a1d6
commit 35549d251c
No known key found for this signature in database
GPG key ID: D88C6B294FD40994

View file

@ -1,45 +1,60 @@
<script>
const websocket = new WebSocket('ws://localhost:6789/')
const websocket = new WebSocket("ws://localhost:6789/");
const sendAction = (key) => () => {
websocket.send(JSON.stringify({ action: key }))
}
websocket.send(JSON.stringify({ action: key }));
};
</script>
<table class="buttons">
<tr>
<td colspan="2" style="padding-bottom: 1rem;"
><button id="l" on:click={sendAction('l')}>L</button></td
>
<td colspan="2" style="padding-bottom: 1rem;">
<button id="l" on:click={sendAction("l")}>L</button>
</td>
<td />
<td colspan="2" style="padding-bottom: 1rem; text-align: right;"
><button id="r" on:click={sendAction('r')}>R</button></td
>
<td colspan="2" style="padding-bottom: 1rem; text-align: right;">
<button id="r" on:click={sendAction("r")}>R</button>
</td>
</tr>
<tr>
<td />
<td><button id="up" on:click={sendAction('up')}> </button></td>
<td>
<button id="up" on:click={sendAction("up")}> </button>
</td>
<td />
<td
><button id="select" on:click={sendAction('select')}> select </button></td
>
<td><button id="start" on:click={sendAction('start')}> start </button></td>
<td>
<button id="select" on:click={sendAction("select")}> select </button>
</td>
<td>
<button id="start" on:click={sendAction("start")}> start </button>
</td>
</tr>
<tr>
<td><button id="left" on:click={sendAction('left')}> &lt; </button></td>
<td>
<button id="left" on:click={sendAction("left")}> &lt; </button>
</td>
<td />
<td style="padding-right: 3rem;"
><button id="right" on:click={sendAction('right')}> > </button></td
>
<td style="padding-right: 3rem;">
<button id="right" on:click={sendAction("right")}> > </button>
</td>
<td />
<td />
</tr>
<tr>
<td />
<td><button id="down" on:click={sendAction('down')}> </button></td>
<td>
<button id="down" on:click={sendAction("down")}> </button>
</td>
<td />
<td><button id="a" on:click={sendAction('a')}>A</button></td>
<td><button id="b" on:click={sendAction('b')}>B</button></td>
<td>
<button id="a" on:click={sendAction("a")}>A</button>
</td>
<td>
<button id="b" on:click={sendAction("b")}>B</button>
</td>
</tr>
</table>