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