~starkingdoms/starkingdoms

starkingdoms/web/src/routes/+page.svelte -rw-r--r-- 866 bytes
39d56abc — core feat: pain, suffering, and despair 16 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script lang="ts">
    import { browser } from "$app/environment";

    let username = $state('');
    let url = $state('ws://localhost:5151');

    let isPlaying = $state(false);

    async function launch() {
        isPlaying = true;
        let module = await import('$lib/bundle/starkingdoms-opt.js');
        await module.default();
        module.play(url);
    }
</script>

{#if !isPlaying}
    <h1 class="font-semibold text-2xl">StarKingdoms</h1>
    <label for="username">Username</label>
    <input id="username" type="text" bind:value={username} >
    <label for="url">URL</label>
    <input id="url" type="text" bind:value={url} >
    <button onclick={launch}>bonk</button>
{/if}

<style>
    :global(canvas) {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
    }
</style>