diamon-engine 0.1.0

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/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "diamon-engine",
3
+ "version": "0.1.0",
4
+ "description": "Diamon 3D engine runtime and editor workbench.",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "main": "./dist/package/index.js",
8
+ "module": "./dist/package/index.js",
9
+ "types": "./dist/package/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/package/types/index.d.ts",
13
+ "import": "./dist/package/index.js"
14
+ },
15
+ "./engine3d": {
16
+ "types": "./dist/package/types/engine3d/index.d.ts",
17
+ "import": "./dist/package/engine3d.js"
18
+ },
19
+ "./workbench": {
20
+ "types": "./dist/package/types/workbench/index.d.ts",
21
+ "import": "./dist/package/workbench.js"
22
+ },
23
+ "./styles.css": "./src/styles.css",
24
+ "./package.json": "./package.json"
25
+ },
26
+ "files": [
27
+ "dist/package",
28
+ "src/styles.css",
29
+ "README.md"
30
+ ],
31
+ "sideEffects": [
32
+ "./src/styles.css"
33
+ ],
34
+ "scripts": {
35
+ "dev": "vite --host 0.0.0.0",
36
+ "build": "npm run build:app && npm run build:package",
37
+ "build:app": "tsc && vite build",
38
+ "build:package": "vite build --config vite.package.config.ts && tsc -p tsconfig.package.json",
39
+ "check": "tsc --noEmit",
40
+ "pack:dry": "npm pack --dry-run",
41
+ "prepare": "npm run build:package",
42
+ "preview": "vite preview --host 0.0.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/three": "^0.184.1",
46
+ "typescript": "^5.9.3",
47
+ "vite": "^7.2.4"
48
+ },
49
+ "dependencies": {
50
+ "three": "^0.184.0"
51
+ }
52
+ }
package/src/styles.css ADDED
@@ -0,0 +1,460 @@
1
+ :root {
2
+ color-scheme: dark;
3
+ font-family:
4
+ Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
5
+ sans-serif;
6
+ font-size: 16px;
7
+ line-height: 1.35;
8
+ color: #eef7f2;
9
+ background: #0f1110;
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ * {
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ html,
21
+ body,
22
+ #app {
23
+ width: 100%;
24
+ min-width: 320px;
25
+ height: 100%;
26
+ margin: 0;
27
+ }
28
+
29
+ body {
30
+ min-height: 100vh;
31
+ overflow: hidden;
32
+ background: #0f1110;
33
+ }
34
+
35
+ button,
36
+ input,
37
+ select,
38
+ textarea {
39
+ font: inherit;
40
+ }
41
+
42
+ button {
43
+ border: 0;
44
+ }
45
+
46
+ .app-shell {
47
+ display: grid;
48
+ grid-template-columns: 300px minmax(0, 1fr) 340px;
49
+ width: 100vw;
50
+ height: 100vh;
51
+ min-height: 0;
52
+ background: #0f1110;
53
+ }
54
+
55
+ .left-panel,
56
+ .right-panel {
57
+ display: grid;
58
+ min-width: 0;
59
+ min-height: 0;
60
+ gap: 12px;
61
+ overflow-y: auto;
62
+ padding: 18px;
63
+ background: #171b18;
64
+ }
65
+
66
+ .left-panel {
67
+ border-right: 1px solid rgba(238, 247, 242, 0.12);
68
+ }
69
+
70
+ .right-panel {
71
+ border-left: 1px solid rgba(238, 247, 242, 0.12);
72
+ }
73
+
74
+ .panel-header p {
75
+ margin: 0 0 6px;
76
+ color: #1ec7a6;
77
+ font-size: 0.72rem;
78
+ font-weight: 800;
79
+ text-transform: uppercase;
80
+ }
81
+
82
+ .panel-header h1 {
83
+ margin: 0 0 4px;
84
+ color: #fff8df;
85
+ font-size: 1.35rem;
86
+ line-height: 1.1;
87
+ letter-spacing: 0;
88
+ }
89
+
90
+ .panel-section {
91
+ min-width: 0;
92
+ padding: 12px;
93
+ border: 1px solid rgba(238, 247, 242, 0.12);
94
+ border-radius: 8px;
95
+ background: rgba(255, 255, 255, 0.035);
96
+ }
97
+
98
+ .section-title {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: space-between;
102
+ gap: 10px;
103
+ min-width: 0;
104
+ margin-bottom: 10px;
105
+ }
106
+
107
+ .section-title h2 {
108
+ margin: 0;
109
+ color: #fff8df;
110
+ font-size: 0.9rem;
111
+ letter-spacing: 0;
112
+ }
113
+
114
+ .section-title span {
115
+ min-width: 0;
116
+ overflow: hidden;
117
+ color: #9fb1a8;
118
+ font-size: 0.78rem;
119
+ text-overflow: ellipsis;
120
+ white-space: nowrap;
121
+ }
122
+
123
+ .section-title button,
124
+ .file-button,
125
+ .toolbar-button {
126
+ flex: 0 0 auto;
127
+ min-height: 30px;
128
+ padding: 0 10px;
129
+ border-radius: 7px;
130
+ color: #0d1512;
131
+ background: #f5c95f;
132
+ cursor: pointer;
133
+ }
134
+
135
+ .section-title button:hover,
136
+ .file-button:hover,
137
+ .toolbar-button:hover {
138
+ background: #ffdc7d;
139
+ }
140
+
141
+ .file-button {
142
+ position: relative;
143
+ display: inline-flex;
144
+ align-items: center;
145
+ }
146
+
147
+ .file-button input {
148
+ position: absolute;
149
+ inset: 0;
150
+ opacity: 0;
151
+ cursor: pointer;
152
+ }
153
+
154
+ .stage {
155
+ position: relative;
156
+ min-width: 0;
157
+ min-height: 0;
158
+ overflow: hidden;
159
+ background: #07100f;
160
+ }
161
+
162
+ .engine-canvas {
163
+ display: block;
164
+ width: 100%;
165
+ height: 100%;
166
+ outline: none;
167
+ touch-action: none;
168
+ }
169
+
170
+ .hud {
171
+ position: absolute;
172
+ z-index: 2;
173
+ display: flex;
174
+ align-items: center;
175
+ gap: 8px;
176
+ color: #f5fff9;
177
+ pointer-events: none;
178
+ }
179
+
180
+ .hud-top {
181
+ top: 14px;
182
+ left: 14px;
183
+ right: 14px;
184
+ justify-content: flex-start;
185
+ overflow-x: auto;
186
+ }
187
+
188
+ .hud-top > div,
189
+ .hud-bottom {
190
+ padding: 8px 10px;
191
+ border: 1px solid rgba(238, 247, 242, 0.16);
192
+ border-radius: 8px;
193
+ background: rgba(7, 16, 15, 0.78);
194
+ box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
195
+ backdrop-filter: blur(12px);
196
+ }
197
+
198
+ .hud-top > div {
199
+ min-width: 82px;
200
+ }
201
+
202
+ .label {
203
+ display: block;
204
+ margin-bottom: 2px;
205
+ color: #98aaa1;
206
+ font-size: 0.68rem;
207
+ }
208
+
209
+ .hud strong {
210
+ font-size: 1rem;
211
+ }
212
+
213
+ .hud-bottom {
214
+ right: 14px;
215
+ bottom: 14px;
216
+ pointer-events: auto;
217
+ }
218
+
219
+ .hud-bottom strong {
220
+ min-width: 8em;
221
+ font-size: 0.95rem;
222
+ }
223
+
224
+ #resetButton {
225
+ width: 58px;
226
+ height: 34px;
227
+ border-radius: 8px;
228
+ color: #0d1512;
229
+ background: #f5c95f;
230
+ cursor: pointer;
231
+ }
232
+
233
+ #resetButton:hover {
234
+ background: #ffdb7a;
235
+ }
236
+
237
+ .workbench-toolbar {
238
+ position: absolute;
239
+ z-index: 2;
240
+ left: 14px;
241
+ right: 120px;
242
+ bottom: 14px;
243
+ display: flex;
244
+ gap: 7px;
245
+ overflow-x: auto;
246
+ scrollbar-width: thin;
247
+ }
248
+
249
+ .workbench-toolbar button {
250
+ flex: 0 0 auto;
251
+ height: 34px;
252
+ padding: 0 10px;
253
+ border: 1px solid rgba(238, 247, 242, 0.16);
254
+ border-radius: 8px;
255
+ color: #0d1512;
256
+ background: #1ec7a6;
257
+ cursor: pointer;
258
+ }
259
+
260
+ .workbench-toolbar button:hover {
261
+ background: #33dfbe;
262
+ }
263
+
264
+ .scene-tree,
265
+ .resource-list,
266
+ .log-list {
267
+ display: grid;
268
+ gap: 6px;
269
+ max-height: 220px;
270
+ overflow: auto;
271
+ }
272
+
273
+ .tree-row,
274
+ .resource-row,
275
+ .log-row {
276
+ display: grid;
277
+ grid-template-columns: minmax(0, 1fr) auto;
278
+ align-items: center;
279
+ gap: 8px;
280
+ min-height: 32px;
281
+ padding: 6px 8px;
282
+ border: 1px solid rgba(238, 247, 242, 0.1);
283
+ border-radius: 7px;
284
+ color: #dce9e1;
285
+ background: rgba(255, 255, 255, 0.035);
286
+ font-size: 0.8rem;
287
+ }
288
+
289
+ .tree-row {
290
+ cursor: pointer;
291
+ }
292
+
293
+ .tree-row:hover,
294
+ .tree-row.is-selected {
295
+ border-color: rgba(30, 199, 166, 0.55);
296
+ background: rgba(30, 199, 166, 0.12);
297
+ }
298
+
299
+ .tree-row.is-hidden {
300
+ opacity: 0.55;
301
+ }
302
+
303
+ .tree-name,
304
+ .resource-name {
305
+ min-width: 0;
306
+ overflow: hidden;
307
+ text-overflow: ellipsis;
308
+ white-space: nowrap;
309
+ }
310
+
311
+ .tree-meta,
312
+ .resource-kind,
313
+ .log-time {
314
+ color: #8da098;
315
+ font-size: 0.72rem;
316
+ white-space: nowrap;
317
+ }
318
+
319
+ .property-panel {
320
+ display: grid;
321
+ gap: 8px;
322
+ }
323
+
324
+ .property-grid {
325
+ display: grid;
326
+ grid-template-columns: repeat(3, minmax(0, 1fr));
327
+ gap: 7px;
328
+ }
329
+
330
+ .property-field {
331
+ display: grid;
332
+ gap: 4px;
333
+ }
334
+
335
+ .property-field.full {
336
+ grid-column: 1 / -1;
337
+ }
338
+
339
+ .property-field label {
340
+ color: #9fb1a8;
341
+ font-size: 0.72rem;
342
+ }
343
+
344
+ .property-field input,
345
+ .property-field select,
346
+ #sceneData {
347
+ width: 100%;
348
+ min-width: 0;
349
+ border: 1px solid rgba(238, 247, 242, 0.14);
350
+ border-radius: 7px;
351
+ color: #eef7f2;
352
+ background: #101310;
353
+ }
354
+
355
+ .property-field input,
356
+ .property-field select {
357
+ height: 32px;
358
+ padding: 0 8px;
359
+ }
360
+
361
+ .property-field input[type="checkbox"] {
362
+ width: 20px;
363
+ height: 20px;
364
+ }
365
+
366
+ .property-actions {
367
+ display: flex;
368
+ flex-wrap: wrap;
369
+ gap: 6px;
370
+ }
371
+
372
+ .property-actions button {
373
+ min-height: 30px;
374
+ padding: 0 10px;
375
+ border-radius: 7px;
376
+ color: #0d1512;
377
+ background: #1ec7a6;
378
+ cursor: pointer;
379
+ }
380
+
381
+ .property-actions button:hover {
382
+ background: #33dfbe;
383
+ }
384
+
385
+ .metrics {
386
+ display: grid;
387
+ gap: 4px;
388
+ margin: 0;
389
+ }
390
+
391
+ .metrics div {
392
+ display: flex;
393
+ align-items: center;
394
+ justify-content: space-between;
395
+ min-height: 28px;
396
+ border-bottom: 1px solid rgba(238, 247, 242, 0.1);
397
+ }
398
+
399
+ .metrics dt {
400
+ color: #9fb1a8;
401
+ font-size: 0.78rem;
402
+ }
403
+
404
+ .metrics dd {
405
+ margin: 0;
406
+ color: #fff8df;
407
+ font-size: 0.9rem;
408
+ font-weight: 800;
409
+ }
410
+
411
+ #sceneData {
412
+ height: 120px;
413
+ resize: vertical;
414
+ padding: 8px;
415
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
416
+ font-size: 0.72rem;
417
+ }
418
+
419
+ .log-list {
420
+ max-height: 150px;
421
+ }
422
+
423
+ .log-row {
424
+ grid-template-columns: auto minmax(0, 1fr);
425
+ }
426
+
427
+ @media (max-width: 1120px) {
428
+ body {
429
+ overflow: auto;
430
+ }
431
+
432
+ .app-shell {
433
+ grid-template-columns: 1fr;
434
+ grid-template-rows: auto minmax(520px, 72vh) auto;
435
+ height: auto;
436
+ min-height: 100vh;
437
+ }
438
+
439
+ .left-panel,
440
+ .right-panel {
441
+ max-height: none;
442
+ border: 0;
443
+ }
444
+ }
445
+
446
+ @media (max-width: 560px) {
447
+ .hud-top {
448
+ gap: 6px;
449
+ }
450
+
451
+ .hud-top > div {
452
+ min-width: 74px;
453
+ padding: 7px;
454
+ }
455
+
456
+ .workbench-toolbar {
457
+ right: 14px;
458
+ bottom: 62px;
459
+ }
460
+ }