@almadar/ui 2.16.0 → 2.16.1

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.
@@ -313,3 +313,195 @@
313
313
  width: 100%;
314
314
  }
315
315
  }
316
+
317
+ /* components/organisms/game/GameCanvas3D.css */
318
+ .game-canvas-3d {
319
+ position: relative;
320
+ width: 100%;
321
+ height: 100%;
322
+ overflow: hidden;
323
+ background: #1a1a2e;
324
+ border-radius: 8px;
325
+ }
326
+ .game-canvas-3d canvas {
327
+ display: block;
328
+ width: 100%;
329
+ height: 100%;
330
+ }
331
+ .game-canvas-3d--loading {
332
+ display: flex;
333
+ align-items: center;
334
+ justify-content: center;
335
+ background:
336
+ linear-gradient(
337
+ 135deg,
338
+ #1a1a2e 0%,
339
+ #16213e 100%);
340
+ }
341
+ .game-canvas-3d__loading {
342
+ padding: 20px 40px;
343
+ background: rgba(255, 255, 255, 0.1);
344
+ border-radius: 8px;
345
+ color: #ffffff;
346
+ font-size: 16px;
347
+ animation: pulse 1.5s ease-in-out infinite;
348
+ }
349
+ .game-canvas-3d--error {
350
+ display: flex;
351
+ align-items: center;
352
+ justify-content: center;
353
+ background:
354
+ linear-gradient(
355
+ 135deg,
356
+ #2e1a1a 0%,
357
+ #3e1616 100%);
358
+ }
359
+ .game-canvas-3d__error {
360
+ padding: 20px 40px;
361
+ background: rgba(255, 0, 0, 0.2);
362
+ border: 1px solid rgba(255, 0, 0, 0.3);
363
+ border-radius: 8px;
364
+ color: #ff6b6b;
365
+ font-size: 14px;
366
+ }
367
+ .game-canvas-3d__coordinates {
368
+ position: absolute;
369
+ bottom: 20px;
370
+ left: 20px;
371
+ padding: 8px 16px;
372
+ background: rgba(0, 0, 0, 0.7);
373
+ border-radius: 4px;
374
+ color: #ffffff;
375
+ font-family: monospace;
376
+ font-size: 12px;
377
+ pointer-events: none;
378
+ z-index: 10;
379
+ }
380
+ .game-canvas-3d__tile-info {
381
+ position: absolute;
382
+ top: 20px;
383
+ left: 20px;
384
+ padding: 12px 16px;
385
+ background: rgba(0, 0, 0, 0.8);
386
+ border-radius: 6px;
387
+ color: #ffffff;
388
+ pointer-events: none;
389
+ z-index: 10;
390
+ min-width: 120px;
391
+ }
392
+ .tile-info__type {
393
+ font-weight: 600;
394
+ font-size: 14px;
395
+ text-transform: capitalize;
396
+ margin-bottom: 4px;
397
+ }
398
+ .tile-info__terrain {
399
+ font-size: 12px;
400
+ color: #aaaaaa;
401
+ }
402
+ @keyframes pulse {
403
+ 0%, 100% {
404
+ opacity: 1;
405
+ }
406
+ 50% {
407
+ opacity: 0.5;
408
+ }
409
+ }
410
+ .game-canvas-3d[data-camera-mode=isometric]::before {
411
+ content: "Isometric";
412
+ position: absolute;
413
+ top: 20px;
414
+ right: 20px;
415
+ padding: 6px 12px;
416
+ background: rgba(0, 0, 0, 0.6);
417
+ border-radius: 4px;
418
+ color: #ffffff;
419
+ font-size: 11px;
420
+ text-transform: uppercase;
421
+ letter-spacing: 1px;
422
+ pointer-events: none;
423
+ }
424
+ .game-canvas-3d[data-camera-mode=perspective]::before {
425
+ content: "Perspective";
426
+ position: absolute;
427
+ top: 20px;
428
+ right: 20px;
429
+ padding: 6px 12px;
430
+ background: rgba(0, 0, 0, 0.6);
431
+ border-radius: 4px;
432
+ color: #ffffff;
433
+ font-size: 11px;
434
+ text-transform: uppercase;
435
+ letter-spacing: 1px;
436
+ pointer-events: none;
437
+ }
438
+ .game-canvas-3d[data-camera-mode=top-down]::before {
439
+ content: "Top Down";
440
+ position: absolute;
441
+ top: 20px;
442
+ right: 20px;
443
+ padding: 6px 12px;
444
+ background: rgba(0, 0, 0, 0.6);
445
+ border-radius: 4px;
446
+ color: #ffffff;
447
+ font-size: 11px;
448
+ text-transform: uppercase;
449
+ letter-spacing: 1px;
450
+ pointer-events: none;
451
+ }
452
+ .game-canvas-3d[data-overlay=hidden] .game-canvas-3d__coordinates,
453
+ .game-canvas-3d[data-overlay=hidden] .game-canvas-3d__tile-info,
454
+ .game-canvas-3d[data-overlay=hidden]::before {
455
+ display: none;
456
+ }
457
+ .game-canvas-3d[data-orientation=rotated] {
458
+ }
459
+ .game-canvas-3d canvas {
460
+ cursor: crosshair;
461
+ }
462
+ .game-canvas-3d canvas:active {
463
+ cursor: grabbing;
464
+ }
465
+ @media (max-width: 768px) {
466
+ .game-canvas-3d__coordinates,
467
+ .game-canvas-3d__tile-info {
468
+ font-size: 10px;
469
+ padding: 6px 10px;
470
+ }
471
+ .game-canvas-3d::before {
472
+ font-size: 9px;
473
+ padding: 4px 8px;
474
+ }
475
+ }
476
+ .game-canvas-3d:focus {
477
+ outline: 2px solid #4488ff;
478
+ outline-offset: 2px;
479
+ }
480
+ .game-canvas-3d canvas {
481
+ transition: opacity 0.3s ease;
482
+ }
483
+ .game-canvas-3d__context-menu {
484
+ position: absolute;
485
+ background: rgba(0, 0, 0, 0.9);
486
+ border: 1px solid rgba(255, 255, 255, 0.1);
487
+ border-radius: 6px;
488
+ padding: 8px 0;
489
+ min-width: 150px;
490
+ z-index: 100;
491
+ }
492
+ .game-canvas-3d__context-menu-item {
493
+ padding: 8px 16px;
494
+ color: #ffffff;
495
+ cursor: pointer;
496
+ font-size: 13px;
497
+ transition: background 0.15s ease;
498
+ }
499
+ .game-canvas-3d__context-menu-item:hover {
500
+ background: rgba(255, 255, 255, 0.1);
501
+ }
502
+ .game-canvas-3d__context-menu-item--danger {
503
+ color: #ff6b6b;
504
+ }
505
+ .game-canvas-3d__context-menu-item--danger:hover {
506
+ background: rgba(255, 0, 0, 0.2);
507
+ }
@@ -19,5 +19,9 @@ export { useRaycaster, type UseRaycasterOptions, type UseRaycasterReturn, type R
19
19
  export { useGameCanvas3DEvents, type UseGameCanvas3DEventsOptions, type UseGameCanvas3DEventsReturn, type GameCanvas3DEventConfig, } from './hooks/useGameCanvas3DEvents';
20
20
  export { AssetLoader, assetLoader, type LoadedModel, } from './loaders/AssetLoader';
21
21
  export { TileRenderer, UnitRenderer, FeatureRenderer, FeatureRenderer3D, preloadFeatures, type TileRendererProps, type UnitRendererProps, type FeatureRendererProps, type FeatureRenderer3DProps, type UnitAnimationState, } from './renderers';
22
+ export { GameCanvas3D, type GameCanvas3DProps } from '../GameCanvas3D';
23
+ export { GameCanvas3DBattleTemplate, type GameCanvas3DBattleTemplateProps } from '../../../templates/GameCanvas3DBattleTemplate';
24
+ export { GameCanvas3DCastleTemplate, type GameCanvas3DCastleTemplateProps } from '../../../templates/GameCanvas3DCastleTemplate';
25
+ export { GameCanvas3DWorldMapTemplate, type GameCanvas3DWorldMapTemplateProps } from '../../../templates/GameCanvas3DWorldMapTemplate';
22
26
  export { gridToWorld, worldToGrid, raycastToPlane, raycastToObjects, gridDistance, gridManhattanDistance, getNeighbors, isInBounds, getCellsInRadius, createGridHighlight, normalizeMouseCoordinates, type Grid3DConfig, type GridCoordinate, } from './utils/grid3D';
23
27
  export { isInFrustum, filterByFrustum, getVisibleIndices, calculateLODLevel, updateInstanceLOD, cullInstancedMesh, SpatialHashGrid, type CullingOptions, type LODLevel, type LODConfig, } from './utils/culling';