@bloopjs/web 0.0.56 → 0.0.57

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.
@@ -6,13 +6,24 @@ export const styles = /*css*/ `
6
6
 
7
7
  /* Layout */
8
8
  .fullscreen {
9
- width: 100%;
10
- height: 100%;
9
+ width: 100vw;
10
+ height: 100vh;
11
11
  margin: 0;
12
12
  padding: 0;
13
13
  overflow: hidden;
14
14
  }
15
15
 
16
+ .fullscreen .canvas-container {
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+
21
+ .fullscreen canvas {
22
+ width: 100%;
23
+ height: 100%;
24
+ display: block;
25
+ }
26
+
16
27
  .layout {
17
28
  display: grid;
18
29
  grid-template-areas:
@@ -26,6 +37,225 @@ export const styles = /*css*/ `
26
37
  padding: 1rem;
27
38
  }
28
39
 
40
+ /* Letterboxed layout - using equal vw/vh percentages keeps game at viewport aspect ratio */
41
+ .layout-letterboxed {
42
+ display: grid;
43
+ grid-template-areas:
44
+ "top-bar top-bar top-bar"
45
+ "left-bar game right-bar"
46
+ "bottom-bar bottom-bar bottom-bar";
47
+ grid-template-columns: 2vw 1fr 2vw;
48
+ grid-template-rows: 2vh 1fr 2vh;
49
+ width: 100vw;
50
+ height: 100vh;
51
+ background: #1a1a1a;
52
+ overflow: hidden;
53
+ overscroll-behavior: none;
54
+ }
55
+
56
+ .top-bar {
57
+ grid-area: top-bar;
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: space-between;
61
+ background: #111;
62
+ color: #aaa;
63
+ font-family: monospace;
64
+ font-size: 12px;
65
+ padding: 0;
66
+ }
67
+
68
+ .top-bar-side-label {
69
+ width: 2vw;
70
+ text-align: center;
71
+ font-size: 9px;
72
+ text-transform: uppercase;
73
+ letter-spacing: 0.5px;
74
+ color: #666;
75
+ }
76
+
77
+ .top-bar-center {
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ gap: 24px;
82
+ flex: 1;
83
+ }
84
+
85
+ .top-bar-item {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 6px;
89
+ }
90
+
91
+ .top-bar-label {
92
+ opacity: 0.6;
93
+ }
94
+
95
+ .top-bar-value {
96
+ color: #fff;
97
+ font-weight: 500;
98
+ }
99
+
100
+ .left-bar {
101
+ grid-area: left-bar;
102
+ display: flex;
103
+ flex-direction: column;
104
+ align-items: center;
105
+ justify-content: flex-end;
106
+ background: #111;
107
+ padding: 4px 0;
108
+ }
109
+
110
+ .right-bar {
111
+ grid-area: right-bar;
112
+ display: flex;
113
+ flex-direction: column;
114
+ align-items: center;
115
+ justify-content: flex-end;
116
+ background: #111;
117
+ padding: 4px 0;
118
+ }
119
+
120
+ .vertical-bar {
121
+ width: 12px;
122
+ flex: 1;
123
+ background: #333;
124
+ border-radius: 2px;
125
+ position: relative;
126
+ overflow: hidden;
127
+ }
128
+
129
+ .vertical-bar-fill {
130
+ position: absolute;
131
+ bottom: 0;
132
+ left: 0;
133
+ right: 0;
134
+ background: #4a9eff;
135
+ border-radius: 2px;
136
+ transition: height 0.1s ease-out;
137
+ }
138
+
139
+
140
+ .bottom-bar {
141
+ grid-area: bottom-bar;
142
+ display: flex;
143
+ align-items: center;
144
+ background: #111;
145
+ padding: 0 8px;
146
+ gap: 8px;
147
+ }
148
+
149
+ .playbar-controls {
150
+ display: flex;
151
+ align-items: center;
152
+ gap: 2px;
153
+ flex-shrink: 0;
154
+ }
155
+
156
+ .playbar-btn {
157
+ width: 1.5vh;
158
+ height: 1.5vh;
159
+ min-width: 18px;
160
+ min-height: 18px;
161
+ border: none;
162
+ background: transparent;
163
+ color: #888;
164
+ font-size: 10px;
165
+ cursor: pointer;
166
+ border-radius: 2px;
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: center;
170
+ transition: background 0.15s, color 0.15s;
171
+ position: relative;
172
+ }
173
+
174
+ .playbar-btn:hover {
175
+ background: #333;
176
+ color: #fff;
177
+ }
178
+
179
+ .playbar-btn:hover .tooltip {
180
+ opacity: 1;
181
+ visibility: visible;
182
+ }
183
+
184
+ .tooltip {
185
+ position: absolute;
186
+ bottom: calc(100% + 4px);
187
+ left: 50%;
188
+ transform: translateX(-50%);
189
+ background: #222;
190
+ color: #ccc;
191
+ padding: 4px 8px;
192
+ border-radius: 4px;
193
+ font-size: 10px;
194
+ white-space: nowrap;
195
+ opacity: 0;
196
+ visibility: hidden;
197
+ transition: opacity 0.15s;
198
+ pointer-events: none;
199
+ z-index: 10;
200
+ }
201
+
202
+ .tooltip-left {
203
+ left: 0;
204
+ transform: none;
205
+ }
206
+
207
+ .tooltip kbd {
208
+ background: #444;
209
+ padding: 1px 4px;
210
+ border-radius: 2px;
211
+ margin-left: 4px;
212
+ font-family: monospace;
213
+ }
214
+
215
+ .seek-bar {
216
+ flex: 1;
217
+ height: 16px;
218
+ background: #222;
219
+ border-radius: 4px;
220
+ position: relative;
221
+ cursor: pointer;
222
+ overflow: hidden;
223
+ }
224
+
225
+ .seek-bar-fill {
226
+ position: absolute;
227
+ top: 0;
228
+ left: 0;
229
+ bottom: 0;
230
+ background: linear-gradient(to right, #4a2070, #7b3fa0);
231
+ border-radius: 4px;
232
+ transition: width 0.1s ease-out;
233
+ }
234
+
235
+ .seek-bar-position {
236
+ position: absolute;
237
+ top: 0;
238
+ bottom: 0;
239
+ width: 2px;
240
+ background: #fff;
241
+ }
242
+
243
+ .letterboxed-game {
244
+ grid-area: game;
245
+ overflow: hidden;
246
+ }
247
+
248
+ .letterboxed-game .canvas-container {
249
+ width: 100%;
250
+ height: 100%;
251
+ }
252
+
253
+ .letterboxed-game canvas {
254
+ width: 100%;
255
+ height: 100%;
256
+ display: block;
257
+ }
258
+
29
259
  .game {
30
260
  grid-area: game;
31
261
  border-radius: 8px;