~starkingdoms/starkingdoms

ref: 371c2735ced761acbe1ab4457b9885976972a8be starkingdoms/crates/unified/index.html -rw-r--r-- 3.1 KiB
371c2735 — core Revert "netcode: unreliable updates" 8 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<html>
  <head>
    <meta content="text/html; charset=utf8" http-equiv="content-type" />
    <title>starkingdoms</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono&display=swap');

:root {
    --rosewater-color: #f5e0dc;
    --flamingo-color: #f2cdcd;
    --pink-color: #f5c2e7;
    --mauve-color: #cba6f7;
    --red-color: #f38ba8;
    --maroon-color: #eba0ac;
    --peach-color: #fab387;
    --yellow-color: #f9e2af;
    --green-color: #a6e3a1;
    --teal-color: #94e2d5;
    --sky-color: #89dceb;
    --sapphire-color: #74c7ec;
    --blue-color: #89b4fa;
    --lavender-color: #b4befe;
    --text-color: #cdd6f4;
    --subtext-1-color: #bac2de;
    --subtext-0-color: #a6adc8;
    --overlay-2-color: #9399b2;
    --overlay-1-color: #7f849c;
    --overlay-0-color: #6c7086;
    --surface-2-color: #585b70;
    --surface-1-color: #45475a;
    --surface-0-color: #313244;
    --base-color: #1e1e2e;
    --mantle-color: #181825;
    --crust-color: #11111b;
}

body {
    background-color: var(--crust-color);
    color: var(--text-color);
}

#server-box {
    position: absolute;
    left: 20px;
    top: 20px;
    padding: 40px;
    border-radius: 20px;
    background-color: var(--mantle-color);
}
#game-title {
    font-size: 40pt;
    font-weight: bold;
}
.label {
    font-family: Fira Mono;
    display: block;
}
#url-label {
    margin-top: 10px;
}
.text-input {
    display: block;
    background-color: var(--base-color);
    border-style: none;
    color: var(--text-color);
    font-family: Fira Mono;
    padding: 2px 4px;
    width: 100%;
}
#button-bar {
    display: flex;
    flex-direction: horizontal;
    padding-top: 20px;
    gap: 160px;
    justify-content: center;
}
#play {
    background-color: var(--surface-2-color);
    border-style: none;
    padding: 2px 6px;
    color: var(--text-color);
    font-family: Fira Mono;
}
#play:hover {
    background-color: var(--surface-1-color);
}
#play:active {
    background-color: var(--surface-0-color);
}
#ship-editor {
    background-color: var(--blue-color);
    border-style: none;
    font-family: Fira Mono;
    padding: 2px 6px;
    color: var(--crust-color);
}
#ship-editor:active {
    background-color: var(--lavender-color);
}
</style>
  </head>
  <body>
    <div id="menu">
        <div id="server-box">
            <span id="game-title">Starkingdoms</span>
            <label id="username-label" class="label" for="url">Username: </label>
            <input id="username" class="text-input" type="text" />
            <label id="url-label" class="label" for="url">Server: </label>
            <input id="url" class="text-input" type="text" />
            <div id="button-bar">
                <button id="play">Play</button>
                <button id="ship-editor">Ship Editor</button>
            </div>
        </div>
    </div>

    <script type="module">
      import init, { play } from './web/starkingdoms.js';
      async function run() {
        await init();

        let url = document.getElementById('url').value;
        document.getElementById('menu').remove();

        play(url);
      }

      document.getElementById('play').addEventListener('click', run);
    </script>
  </body>
</html>