@bloopjs/web 0.0.48 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +8 -1
- package/dist/App.d.ts.map +1 -1
- package/dist/debugui/DebugUi.d.ts +22 -0
- package/dist/debugui/DebugUi.d.ts.map +1 -0
- package/dist/debugui/components/DebugToggle.d.ts +6 -0
- package/dist/debugui/components/DebugToggle.d.ts.map +1 -0
- package/dist/debugui/components/Logs.d.ts +2 -0
- package/dist/debugui/components/Logs.d.ts.map +1 -0
- package/dist/debugui/components/Root.d.ts +7 -0
- package/dist/debugui/components/Root.d.ts.map +1 -0
- package/dist/debugui/components/Stats.d.ts +2 -0
- package/dist/debugui/components/Stats.d.ts.map +1 -0
- package/dist/debugui/hooks/useAutoScroll.d.ts +6 -0
- package/dist/debugui/hooks/useAutoScroll.d.ts.map +1 -0
- package/dist/debugui/mod.d.ts +3 -0
- package/dist/debugui/mod.d.ts.map +1 -0
- package/dist/debugui/state.d.ts +33 -0
- package/dist/debugui/state.d.ts.map +1 -0
- package/dist/debugui/styles.d.ts +2 -0
- package/dist/debugui/styles.d.ts.map +1 -0
- package/dist/mod.d.ts +2 -1
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +1747 -13
- package/dist/mod.js.map +18 -5
- package/package.json +7 -5
- package/src/App.ts +41 -2
- package/src/debugui/DebugUi.ts +111 -0
- package/src/debugui/components/DebugToggle.tsx +25 -0
- package/src/debugui/components/Logs.tsx +57 -0
- package/src/debugui/components/Root.tsx +54 -0
- package/src/debugui/components/Stats.tsx +68 -0
- package/src/debugui/hooks/useAutoScroll.ts +62 -0
- package/src/debugui/mod.ts +2 -0
- package/src/debugui/state.ts +127 -0
- package/src/debugui/styles.ts +200 -0
- package/src/mod.ts +2 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export const styles = /*css*/ `
|
|
2
|
+
/* Reset for shadow DOM */
|
|
3
|
+
* {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Layout */
|
|
8
|
+
.fullscreen {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.layout {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-areas:
|
|
19
|
+
"game stats"
|
|
20
|
+
"logs logs";
|
|
21
|
+
grid-template-columns: calc(50% - 0.5rem) calc(50% - 0.5rem);
|
|
22
|
+
grid-template-rows: calc(50% - 0.5rem) calc(50% - 0.5rem);
|
|
23
|
+
gap: 1rem;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
padding: 1rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.game {
|
|
30
|
+
grid-area: game;
|
|
31
|
+
border-radius: 8px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.stats {
|
|
36
|
+
grid-area: stats;
|
|
37
|
+
background-color: #f0f0f0;
|
|
38
|
+
padding: 1rem;
|
|
39
|
+
border-radius: 8px;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.logs {
|
|
44
|
+
grid-area: logs;
|
|
45
|
+
background-color: #f0f0f0;
|
|
46
|
+
padding: 1rem;
|
|
47
|
+
border-radius: 8px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Canvas container */
|
|
52
|
+
.canvas-container {
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.canvas-container canvas {
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
max-height: 100%;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Debug toggle button */
|
|
66
|
+
.debug-toggle {
|
|
67
|
+
position: fixed;
|
|
68
|
+
bottom: 16px;
|
|
69
|
+
right: 16px;
|
|
70
|
+
width: 40px;
|
|
71
|
+
height: 40px;
|
|
72
|
+
border-radius: 50%;
|
|
73
|
+
border: none;
|
|
74
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
75
|
+
color: white;
|
|
76
|
+
font-size: 18px;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
z-index: 1000;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
transition: background-color 0.2s;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.debug-toggle:hover {
|
|
86
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Stats panel */
|
|
90
|
+
.stats-panel {
|
|
91
|
+
background: rgba(0, 0, 0, 0.7);
|
|
92
|
+
color: white;
|
|
93
|
+
padding: 12px;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
font-family: monospace;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
max-width: 100%;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.stats-panel h3 {
|
|
102
|
+
margin: 0 0 8px 0;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.stats-panel table {
|
|
111
|
+
width: 100%;
|
|
112
|
+
border-collapse: collapse;
|
|
113
|
+
table-layout: fixed;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.stats-panel tr {
|
|
117
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.stats-panel tr:last-child {
|
|
121
|
+
border-bottom: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.stats-panel td {
|
|
125
|
+
padding: 4px 0;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.stats-panel td:first-child {
|
|
132
|
+
opacity: 0.7;
|
|
133
|
+
width: 60%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.stats-panel td:last-child {
|
|
137
|
+
text-align: right;
|
|
138
|
+
font-weight: 600;
|
|
139
|
+
width: 40%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.stats-panel p {
|
|
143
|
+
margin: 0;
|
|
144
|
+
opacity: 0.7;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Logs panel */
|
|
148
|
+
.logs-list {
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
overflow: auto;
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.logs-list li {
|
|
157
|
+
margin: 0 0 24px 0;
|
|
158
|
+
list-style: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.logs-list h3 {
|
|
162
|
+
font-size: 16px;
|
|
163
|
+
font-weight: 500;
|
|
164
|
+
margin: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.logs-list .ws {
|
|
168
|
+
color: darkolivegreen;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.logs-list .webrtc {
|
|
172
|
+
color: darkmagenta;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.logs-list .rollback {
|
|
176
|
+
color: darkblue;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.logs-list .local {
|
|
180
|
+
color: #333;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.logs-list .content {
|
|
184
|
+
font-size: 16px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.logs-list p {
|
|
188
|
+
margin: 4px 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.logs-list pre {
|
|
192
|
+
margin: 0;
|
|
193
|
+
white-space: pre-wrap;
|
|
194
|
+
word-break: break-word;
|
|
195
|
+
background-color: oldlace;
|
|
196
|
+
padding: 8px;
|
|
197
|
+
border-radius: 4px;
|
|
198
|
+
border: 1px inset lavender;
|
|
199
|
+
}
|
|
200
|
+
`;
|
package/src/mod.ts
CHANGED