@buley/hexgrid-3d 3.1.0 → 3.2.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/dist/HexGridEnhanced.d.ts +15 -0
- package/dist/HexGridEnhanced.d.ts.map +1 -0
- package/dist/HexGridEnhanced.js +1 -0
- package/dist/Snapshot.d.ts +594 -0
- package/dist/Snapshot.d.ts.map +1 -0
- package/dist/Snapshot.js +757 -0
- package/dist/adapters/DashAdapter.d.ts +18 -0
- package/dist/adapters/DashAdapter.d.ts.map +1 -0
- package/dist/adapters/DashAdapter.js +42 -0
- package/dist/adapters.d.ts +53 -0
- package/dist/adapters.d.ts.map +1 -0
- package/dist/adapters.js +14 -0
- package/dist/algorithms/AdvancedStatistics.d.ts +52 -0
- package/dist/algorithms/AdvancedStatistics.d.ts.map +1 -0
- package/dist/algorithms/AdvancedStatistics.js +307 -0
- package/dist/algorithms/BayesianStatistics.d.ts +86 -0
- package/dist/algorithms/BayesianStatistics.d.ts.map +1 -0
- package/dist/algorithms/BayesianStatistics.js +263 -0
- package/dist/algorithms/FlowField.d.ts +55 -0
- package/dist/algorithms/FlowField.d.ts.map +1 -0
- package/dist/algorithms/FlowField.js +80 -0
- package/dist/algorithms/FlowField3D.d.ts +166 -0
- package/dist/algorithms/FlowField3D.d.ts.map +1 -0
- package/dist/algorithms/FlowField3D.js +327 -0
- package/dist/algorithms/FluidEngineFactory.d.ts +15 -0
- package/dist/algorithms/FluidEngineFactory.d.ts.map +1 -0
- package/dist/algorithms/FluidEngineFactory.js +41 -0
- package/dist/algorithms/FluidSimulation.d.ts +41 -0
- package/dist/algorithms/FluidSimulation.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulation.js +74 -0
- package/dist/algorithms/FluidSimulation3D.d.ts +137 -0
- package/dist/algorithms/FluidSimulation3D.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulation3D.js +464 -0
- package/dist/algorithms/FluidSimulation3DGPU.d.ts +41 -0
- package/dist/algorithms/FluidSimulation3DGPU.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulation3DGPU.js +328 -0
- package/dist/algorithms/FluidSimulationWebNN.d.ts +56 -0
- package/dist/algorithms/FluidSimulationWebNN.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulationWebNN.js +84 -0
- package/dist/algorithms/GraphAlgorithms.d.ts +48 -0
- package/dist/algorithms/GraphAlgorithms.d.ts.map +1 -0
- package/dist/algorithms/GraphAlgorithms.js +122 -0
- package/dist/algorithms/OutlierDetection.d.ts +49 -0
- package/dist/algorithms/OutlierDetection.d.ts.map +1 -0
- package/dist/algorithms/OutlierDetection.js +284 -0
- package/dist/algorithms/ParticleSystem.d.ts +36 -0
- package/dist/algorithms/ParticleSystem.d.ts.map +1 -0
- package/dist/algorithms/ParticleSystem.js +59 -0
- package/dist/algorithms/ParticleSystem3D.d.ts +206 -0
- package/dist/algorithms/ParticleSystem3D.d.ts.map +1 -0
- package/dist/algorithms/ParticleSystem3D.js +371 -0
- package/dist/algorithms/index.d.ts +16 -0
- package/dist/algorithms/index.d.ts.map +1 -0
- package/{src/algorithms/index.ts → dist/algorithms/index.js} +0 -2
- package/dist/compat.d.ts +24 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +88 -0
- package/dist/components/HexGrid.d.ts +5 -0
- package/dist/components/HexGrid.d.ts.map +1 -0
- package/dist/components/HexGrid.js +39 -0
- package/dist/components/NarrationOverlay.d.ts +16 -0
- package/dist/components/NarrationOverlay.d.ts.map +1 -0
- package/dist/components/NarrationOverlay.js +132 -0
- package/{src/components/index.ts → dist/components/index.d.ts} +1 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +1 -0
- package/dist/features.d.ts +54 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +74 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +0 -9
- package/dist/lib/narration.d.ts +12 -0
- package/dist/lib/narration.d.ts.map +1 -0
- package/dist/lib/narration.js +8 -0
- package/dist/lib/stats-tracker.d.ts +7 -0
- package/dist/lib/stats-tracker.d.ts.map +1 -0
- package/dist/lib/stats-tracker.js +22 -0
- package/dist/lib/theme-colors.d.ts +7 -0
- package/dist/lib/theme-colors.d.ts.map +1 -0
- package/dist/lib/theme-colors.js +10 -0
- package/dist/math/HexCoordinates.d.ts +140 -0
- package/dist/math/HexCoordinates.d.ts.map +1 -0
- package/dist/math/HexCoordinates.js +741 -0
- package/dist/math/Matrix4.d.ts +9 -0
- package/dist/math/Matrix4.d.ts.map +1 -0
- package/dist/math/Matrix4.js +19 -0
- package/dist/math/Quaternion.d.ts +11 -0
- package/dist/math/Quaternion.d.ts.map +1 -0
- package/dist/math/Quaternion.js +23 -0
- package/dist/math/SpatialIndex.d.ts +34 -0
- package/dist/math/SpatialIndex.d.ts.map +1 -0
- package/dist/math/SpatialIndex.js +75 -0
- package/dist/math/Vector3.d.ts +110 -0
- package/dist/math/Vector3.d.ts.map +1 -0
- package/dist/math/Vector3.js +426 -0
- package/dist/math/index.d.ts +11 -0
- package/dist/math/index.d.ts.map +1 -0
- package/{src/math/index.ts → dist/math/index.js} +0 -1
- package/dist/note-adapter.d.ts +44 -0
- package/dist/note-adapter.d.ts.map +1 -0
- package/dist/note-adapter.js +86 -0
- package/dist/ontology-adapter.d.ts +13 -0
- package/dist/ontology-adapter.d.ts.map +1 -0
- package/dist/ontology-adapter.js +65 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/uiStore.d.ts +18 -0
- package/dist/stores/uiStore.d.ts.map +1 -0
- package/dist/stores/uiStore.js +77 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types.d.ts +126 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/utils/image-utils.d.ts +13 -0
- package/dist/utils/image-utils.d.ts.map +1 -0
- package/dist/utils/image-utils.js +23 -0
- package/dist/wasm/HexGridWasmWrapper.d.ts +131 -0
- package/dist/wasm/HexGridWasmWrapper.d.ts.map +1 -0
- package/dist/wasm/HexGridWasmWrapper.js +610 -0
- package/dist/wasm/index.d.ts +7 -0
- package/dist/wasm/index.d.ts.map +1 -0
- package/{src/wasm/index.ts → dist/wasm/index.js} +0 -1
- package/dist/webgpu/WebGPUContext.d.ts +20 -0
- package/dist/webgpu/WebGPUContext.d.ts.map +1 -0
- package/dist/webgpu/WebGPUContext.js +60 -0
- package/dist/webnn/WebNNContext.d.ts +38 -0
- package/dist/webnn/WebNNContext.d.ts.map +1 -0
- package/dist/webnn/WebNNContext.js +66 -0
- package/dist/workers/hexgrid-math.d.ts +79 -0
- package/dist/workers/hexgrid-math.d.ts.map +1 -0
- package/dist/workers/hexgrid-math.js +136 -0
- package/dist/workers/hexgrid-worker.worker.d.ts +35 -0
- package/dist/workers/hexgrid-worker.worker.d.ts.map +1 -0
- package/dist/workers/hexgrid-worker.worker.js +2014 -0
- package/package.json +20 -7
- package/.eslintrc.json +0 -28
- package/build_log.txt +0 -500
- package/build_src_log.txt +0 -8
- package/examples/basic-usage.tsx +0 -52
- package/public/hexgrid-worker.js +0 -2475
- package/rust/Cargo.toml +0 -41
- package/rust/src/lib.rs +0 -740
- package/rust/src/math.rs +0 -574
- package/rust/src/spatial.rs +0 -245
- package/rust/src/statistics.rs +0 -496
- package/site/.eslintrc.json +0 -3
- package/site/DEPLOYMENT.md +0 -196
- package/site/INDEX.md +0 -127
- package/site/QUICK_START.md +0 -86
- package/site/README.md +0 -85
- package/site/SITE_SUMMARY.md +0 -180
- package/site/next.config.js +0 -12
- package/site/package.json +0 -26
- package/site/src/app/docs/page.tsx +0 -272
- package/site/src/app/examples/page.tsx +0 -151
- package/site/src/app/globals.css +0 -160
- package/site/src/app/layout.tsx +0 -39
- package/site/src/app/page.tsx +0 -235
- package/site/tsconfig.json +0 -29
- package/site/vercel.json +0 -6
- package/src/HexGridEnhanced.ts +0 -16
- package/src/Snapshot.ts +0 -1607
- package/src/adapters/DashAdapter.ts +0 -57
- package/src/adapters.ts +0 -63
- package/src/algorithms/AdvancedStatistics.ts +0 -362
- package/src/algorithms/BayesianStatistics.ts +0 -348
- package/src/algorithms/FlowField.ts +0 -150
- package/src/algorithms/FlowField3D.ts +0 -573
- package/src/algorithms/FluidEngineFactory.ts +0 -44
- package/src/algorithms/FluidSimulation.ts +0 -115
- package/src/algorithms/FluidSimulation3D.ts +0 -664
- package/src/algorithms/FluidSimulation3DGPU.ts +0 -408
- package/src/algorithms/FluidSimulationWebNN.ts +0 -141
- package/src/algorithms/GraphAlgorithms.ts +0 -191
- package/src/algorithms/OutlierDetection.ts +0 -425
- package/src/algorithms/ParticleSystem.ts +0 -95
- package/src/algorithms/ParticleSystem3D.ts +0 -567
- package/src/compat.ts +0 -96
- package/src/components/HexGrid.tsx +0 -61
- package/src/components/NarrationOverlay.tsx +0 -309
- package/src/features.ts +0 -125
- package/src/lib/narration.ts +0 -17
- package/src/lib/stats-tracker.ts +0 -25
- package/src/lib/theme-colors.ts +0 -12
- package/src/math/HexCoordinates.ts +0 -863
- package/src/math/Matrix4.ts +0 -25
- package/src/math/Quaternion.ts +0 -37
- package/src/math/SpatialIndex.ts +0 -114
- package/src/math/Vector3.ts +0 -540
- package/src/note-adapter.ts +0 -132
- package/src/ontology-adapter.ts +0 -84
- package/src/stores/uiStore.ts +0 -85
- package/src/types/index.ts +0 -3
- package/src/types/shared-utils.d.ts +0 -10
- package/src/types/wgsl.d.ts +0 -4
- package/src/types.ts +0 -164
- package/src/utils/image-utils.ts +0 -28
- package/src/wasm/HexGridWasmWrapper.ts +0 -801
- package/src/webgpu/WebGPUContext.ts +0 -71
- package/src/webgpu/shaders/fluid_sim.wgsl +0 -140
- package/src/webnn/WebNNContext.ts +0 -99
- package/src/workers/hexgrid-math.ts +0 -182
- package/src/workers/hexgrid-worker.worker.ts +0 -2781
- package/tsconfig.json +0 -26
- /package/{src/stores/index.ts → dist/stores/index.js} +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { FluidEngineFactory, FluidEngine } from '../algorithms/FluidEngineFactory';
|
|
4
|
-
import { HexGridProps } from '../types';
|
|
5
|
-
|
|
6
|
-
export function HexGrid(props: HexGridProps): React.JSX.Element {
|
|
7
|
-
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
8
|
-
const [engine, setEngine] = useState<FluidEngine | null>(null);
|
|
9
|
-
const [error, setError] = useState<string | null>(null);
|
|
10
|
-
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
// Initialize Fluid Engine
|
|
13
|
-
const initEngine = async () => {
|
|
14
|
-
try {
|
|
15
|
-
const fluidEngine = await FluidEngineFactory.create({
|
|
16
|
-
width: 64,
|
|
17
|
-
height: 64,
|
|
18
|
-
depth: 64,
|
|
19
|
-
viscosity: 0.0001,
|
|
20
|
-
diffusion: 0.00001
|
|
21
|
-
});
|
|
22
|
-
setEngine(fluidEngine);
|
|
23
|
-
} catch (err: unknown) {
|
|
24
|
-
console.error("Failed to init fluid engine", err);
|
|
25
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
initEngine();
|
|
30
|
-
|
|
31
|
-
return () => {
|
|
32
|
-
// Cleanup if engine has cleanup method
|
|
33
|
-
if (engine && 'clear' in engine) {
|
|
34
|
-
engine.clear();
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
if (error) {
|
|
40
|
-
return <div className="text-red-500">Error initializing simulation: {error}</div>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div className="hexgrid-container" style={{ width: '100%', height: '100%', position: 'relative' }}>
|
|
45
|
-
{/* Visualization Canvas */}
|
|
46
|
-
<canvas
|
|
47
|
-
ref={canvasRef}
|
|
48
|
-
width={800}
|
|
49
|
-
height={600}
|
|
50
|
-
style={{ width: '100%', height: '100%' }}
|
|
51
|
-
/>
|
|
52
|
-
|
|
53
|
-
{/* Status Overlay */}
|
|
54
|
-
<div style={{ position: 'absolute', top: 10, left: 10, background: 'rgba(0,0,0,0.5)', color: 'white', padding: '5px', pointerEvents: 'none' }}>
|
|
55
|
-
Engine: {engine ? engine.constructor.name : 'Initializing...'}
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export default HexGrid;
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Narration Overlay Component
|
|
3
|
-
*
|
|
4
|
-
* Displays play-by-play narration messages with sparklines in a NOC dashboard style.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useEffect, useRef } from 'react';
|
|
8
|
-
import { NarrationMessage } from '@/lib/narration';
|
|
9
|
-
import { StatsTracker } from '@/lib/stats-tracker';
|
|
10
|
-
import { getAccentRgba, getAccentHex } from '@/lib/theme-colors';
|
|
11
|
-
|
|
12
|
-
export interface NarrationOverlayProps {
|
|
13
|
-
messages: NarrationMessage[];
|
|
14
|
-
statsTracker: StatsTracker | null;
|
|
15
|
-
isVisible: boolean;
|
|
16
|
-
onClose: () => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const NarrationOverlay: React.FC<NarrationOverlayProps> = ({
|
|
20
|
-
messages,
|
|
21
|
-
statsTracker,
|
|
22
|
-
isVisible,
|
|
23
|
-
onClose,
|
|
24
|
-
}) => {
|
|
25
|
-
const messagesEndRef = useRef<HTMLDivElement>(null);
|
|
26
|
-
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
|
27
|
-
|
|
28
|
-
// Auto-scroll to latest message
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (messagesEndRef.current && scrollContainerRef.current) {
|
|
31
|
-
scrollContainerRef.current.scrollTop =
|
|
32
|
-
scrollContainerRef.current.scrollHeight;
|
|
33
|
-
}
|
|
34
|
-
}, [messages]);
|
|
35
|
-
|
|
36
|
-
// Always render the overlay so fade-out can animate smoothly.
|
|
37
|
-
// Toggle visibility via styles.
|
|
38
|
-
|
|
39
|
-
const currentStats = statsTracker?.getCurrentStats();
|
|
40
|
-
const allTimeRecords = statsTracker?.getAllTimeRecords();
|
|
41
|
-
const leaderboard = statsTracker?.getLeaderboard(10);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
style={{
|
|
46
|
-
position: 'fixed',
|
|
47
|
-
right: 12,
|
|
48
|
-
top: 80,
|
|
49
|
-
width: 400,
|
|
50
|
-
maxHeight: 'calc(100vh - 100px)',
|
|
51
|
-
background: 'rgba(0, 0, 0, 0.85)',
|
|
52
|
-
border: `1px solid ${getAccentRgba(0.3)}`,
|
|
53
|
-
borderRadius: 8,
|
|
54
|
-
padding: '12px',
|
|
55
|
-
zIndex: 10000,
|
|
56
|
-
display: 'flex',
|
|
57
|
-
flexDirection: 'column',
|
|
58
|
-
fontFamily: "'Courier New', monospace",
|
|
59
|
-
fontSize: 12,
|
|
60
|
-
color: getAccentHex(),
|
|
61
|
-
boxShadow: `0 0 20px ${getAccentRgba(0.2)}`,
|
|
62
|
-
// Fade transition
|
|
63
|
-
transition: 'opacity 220ms ease, transform 220ms ease',
|
|
64
|
-
opacity: isVisible ? 1 : 0,
|
|
65
|
-
transform: isVisible ? 'translateY(0px)' : 'translateY(-6px)',
|
|
66
|
-
pointerEvents: isVisible ? ('auto' as const) : ('none' as const),
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
{/* Header */}
|
|
70
|
-
<div
|
|
71
|
-
style={{
|
|
72
|
-
display: 'flex',
|
|
73
|
-
justifyContent: 'space-between',
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
marginBottom: 8,
|
|
76
|
-
}}
|
|
77
|
-
>
|
|
78
|
-
<div style={{ fontWeight: 'bold', fontSize: 14 }}>
|
|
79
|
-
Play-by-Play Narration
|
|
80
|
-
</div>
|
|
81
|
-
<button
|
|
82
|
-
onClick={onClose}
|
|
83
|
-
style={{
|
|
84
|
-
background: 'transparent',
|
|
85
|
-
border: '1px solid rgba(0, 255, 255, 0.3)',
|
|
86
|
-
color: '#00ffff',
|
|
87
|
-
cursor: 'pointer',
|
|
88
|
-
padding: '4px 8px',
|
|
89
|
-
borderRadius: 4,
|
|
90
|
-
fontSize: 11,
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
×
|
|
94
|
-
</button>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
{/* Stats Dashboard (Collapsible) */}
|
|
98
|
-
{currentStats && (
|
|
99
|
-
<details style={{ marginBottom: 8, fontSize: 11 }}>
|
|
100
|
-
<summary
|
|
101
|
-
style={{ cursor: 'pointer', color: '#00ffff', marginBottom: 4 }}
|
|
102
|
-
>
|
|
103
|
-
Stats Dashboard
|
|
104
|
-
</summary>
|
|
105
|
-
<div
|
|
106
|
-
style={{
|
|
107
|
-
padding: '8px',
|
|
108
|
-
background: 'rgba(0, 255, 255, 0.05)',
|
|
109
|
-
borderRadius: 4,
|
|
110
|
-
}}
|
|
111
|
-
>
|
|
112
|
-
<div
|
|
113
|
-
style={{
|
|
114
|
-
display: 'flex',
|
|
115
|
-
justifyContent: 'space-between',
|
|
116
|
-
marginBottom: 4,
|
|
117
|
-
}}
|
|
118
|
-
>
|
|
119
|
-
<span>Generation:</span>
|
|
120
|
-
<span style={{ fontVariantNumeric: 'tabular-nums' }}>
|
|
121
|
-
{currentStats.generation}
|
|
122
|
-
</span>
|
|
123
|
-
</div>
|
|
124
|
-
<div
|
|
125
|
-
style={{
|
|
126
|
-
display: 'flex',
|
|
127
|
-
justifyContent: 'space-between',
|
|
128
|
-
marginBottom: 4,
|
|
129
|
-
}}
|
|
130
|
-
>
|
|
131
|
-
<span>Active Memes:</span>
|
|
132
|
-
<span style={{ fontVariantNumeric: 'tabular-nums' }}>
|
|
133
|
-
{currentStats.activeMemesCount}
|
|
134
|
-
</span>
|
|
135
|
-
</div>
|
|
136
|
-
<div
|
|
137
|
-
style={{
|
|
138
|
-
display: 'flex',
|
|
139
|
-
justifyContent: 'space-between',
|
|
140
|
-
marginBottom: 4,
|
|
141
|
-
}}
|
|
142
|
-
>
|
|
143
|
-
<span>Total Hexes:</span>
|
|
144
|
-
<span style={{ fontVariantNumeric: 'tabular-nums' }}>
|
|
145
|
-
{currentStats.totalHexesInfected}
|
|
146
|
-
</span>
|
|
147
|
-
</div>
|
|
148
|
-
<div
|
|
149
|
-
style={{
|
|
150
|
-
display: 'flex',
|
|
151
|
-
justifyContent: 'space-between',
|
|
152
|
-
marginBottom: 4,
|
|
153
|
-
}}
|
|
154
|
-
>
|
|
155
|
-
<span>Birth/Death Ratio:</span>
|
|
156
|
-
<span style={{ fontVariantNumeric: 'tabular-nums' }}>
|
|
157
|
-
{currentStats.populationStability.toFixed(2)}
|
|
158
|
-
</span>
|
|
159
|
-
</div>
|
|
160
|
-
{allTimeRecords && (
|
|
161
|
-
<div
|
|
162
|
-
style={{
|
|
163
|
-
marginTop: 8,
|
|
164
|
-
paddingTop: 8,
|
|
165
|
-
borderTop: '1px solid rgba(0, 255, 255, 0.2)',
|
|
166
|
-
}}
|
|
167
|
-
>
|
|
168
|
-
<div
|
|
169
|
-
style={{ fontSize: 10, color: '#00ffff', marginBottom: 4 }}
|
|
170
|
-
>
|
|
171
|
-
All-Time Records:
|
|
172
|
-
</div>
|
|
173
|
-
<div style={{ fontSize: 10, marginBottom: 2 }}>
|
|
174
|
-
Highest Territory: {allTimeRecords.highestTerritory.value}
|
|
175
|
-
</div>
|
|
176
|
-
<div style={{ fontSize: 10, marginBottom: 2 }}>
|
|
177
|
-
Longest Streak: {allTimeRecords.longestSurvivalStreak.value}
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
)}
|
|
181
|
-
</div>
|
|
182
|
-
</details>
|
|
183
|
-
)}
|
|
184
|
-
|
|
185
|
-
{/* Leaderboard (Collapsible) */}
|
|
186
|
-
{leaderboard && leaderboard.length > 0 && (
|
|
187
|
-
<details style={{ marginBottom: 8, fontSize: 11 }}>
|
|
188
|
-
<summary
|
|
189
|
-
style={{ cursor: 'pointer', color: '#00ffff', marginBottom: 4 }}
|
|
190
|
-
>
|
|
191
|
-
Top 10 Leaderboard
|
|
192
|
-
</summary>
|
|
193
|
-
<div
|
|
194
|
-
style={{
|
|
195
|
-
padding: '8px',
|
|
196
|
-
background: 'rgba(0, 255, 255, 0.05)',
|
|
197
|
-
borderRadius: 4,
|
|
198
|
-
}}
|
|
199
|
-
>
|
|
200
|
-
{leaderboard.map((entry: any, i: number) => (
|
|
201
|
-
<div
|
|
202
|
-
key={entry.photoId}
|
|
203
|
-
style={{
|
|
204
|
-
display: 'flex',
|
|
205
|
-
justifyContent: 'space-between',
|
|
206
|
-
marginBottom: 2,
|
|
207
|
-
fontSize: 10,
|
|
208
|
-
color: i < 3 ? '#00ff00' : '#00ffff',
|
|
209
|
-
}}
|
|
210
|
-
>
|
|
211
|
-
<span>
|
|
212
|
-
{i + 1}. {entry.photoId.slice(0, 20)}...
|
|
213
|
-
</span>
|
|
214
|
-
<span style={{ fontVariantNumeric: 'tabular-nums' }}>
|
|
215
|
-
{entry.territory} hexes
|
|
216
|
-
</span>
|
|
217
|
-
</div>
|
|
218
|
-
))}
|
|
219
|
-
</div>
|
|
220
|
-
</details>
|
|
221
|
-
)}
|
|
222
|
-
|
|
223
|
-
{/* Messages Feed */}
|
|
224
|
-
<div
|
|
225
|
-
ref={scrollContainerRef}
|
|
226
|
-
style={{
|
|
227
|
-
flex: 1,
|
|
228
|
-
overflowY: 'auto',
|
|
229
|
-
maxHeight: '400px',
|
|
230
|
-
padding: '8px',
|
|
231
|
-
background: 'rgba(0, 0, 0, 0.3)',
|
|
232
|
-
borderRadius: 4,
|
|
233
|
-
}}
|
|
234
|
-
>
|
|
235
|
-
{messages.length === 0 ? (
|
|
236
|
-
<div
|
|
237
|
-
style={{
|
|
238
|
-
color: 'rgba(0, 255, 255, 0.5)',
|
|
239
|
-
fontStyle: 'italic',
|
|
240
|
-
textAlign: 'center',
|
|
241
|
-
padding: '20px',
|
|
242
|
-
}}
|
|
243
|
-
>
|
|
244
|
-
No narration yet. Evolution in progress...
|
|
245
|
-
</div>
|
|
246
|
-
) : (
|
|
247
|
-
messages.map((msg, index) => (
|
|
248
|
-
<div
|
|
249
|
-
key={`${msg.generation}-${index}`}
|
|
250
|
-
style={{
|
|
251
|
-
marginBottom: 8,
|
|
252
|
-
padding: '6px',
|
|
253
|
-
background:
|
|
254
|
-
msg.priority >= 8
|
|
255
|
-
? 'rgba(255, 165, 0, 0.1)'
|
|
256
|
-
: 'rgba(0, 255, 255, 0.05)',
|
|
257
|
-
borderRadius: 4,
|
|
258
|
-
borderLeft: `2px solid ${
|
|
259
|
-
msg.priority >= 8 ? '#ffaa00' : '#00ffff'
|
|
260
|
-
}`,
|
|
261
|
-
fontSize: 11,
|
|
262
|
-
lineHeight: 1.4,
|
|
263
|
-
}}
|
|
264
|
-
>
|
|
265
|
-
<div
|
|
266
|
-
style={{
|
|
267
|
-
display: 'flex',
|
|
268
|
-
justifyContent: 'space-between',
|
|
269
|
-
marginBottom: 2,
|
|
270
|
-
}}
|
|
271
|
-
>
|
|
272
|
-
<span style={{ color: 'rgba(0, 255, 255, 0.7)', fontSize: 10 }}>
|
|
273
|
-
Gen {msg.generation}
|
|
274
|
-
</span>
|
|
275
|
-
<span style={{ color: 'rgba(0, 255, 255, 0.5)', fontSize: 9 }}>
|
|
276
|
-
{new Date(msg.timestamp).toLocaleTimeString()}
|
|
277
|
-
</span>
|
|
278
|
-
</div>
|
|
279
|
-
<div style={{ fontFamily: "'Courier New', monospace" }}>
|
|
280
|
-
{msg.text}
|
|
281
|
-
{msg.sparkline && (
|
|
282
|
-
<div
|
|
283
|
-
style={{
|
|
284
|
-
marginTop: 4,
|
|
285
|
-
fontFamily: "'Courier New', monospace",
|
|
286
|
-
fontSize: 14,
|
|
287
|
-
color:
|
|
288
|
-
msg.eventType === 'slam_dunk' ||
|
|
289
|
-
msg.eventType === 'on_fire'
|
|
290
|
-
? '#00ff00'
|
|
291
|
-
: msg.eventType === 'decline' ||
|
|
292
|
-
msg.eventType === 'missed_shot'
|
|
293
|
-
? '#ff4444'
|
|
294
|
-
: '#00ffff',
|
|
295
|
-
letterSpacing: '2px',
|
|
296
|
-
}}
|
|
297
|
-
>
|
|
298
|
-
{msg.sparkline}
|
|
299
|
-
</div>
|
|
300
|
-
)}
|
|
301
|
-
</div>
|
|
302
|
-
</div>
|
|
303
|
-
))
|
|
304
|
-
)}
|
|
305
|
-
<div ref={messagesEndRef} />
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
);
|
|
309
|
-
};
|
package/src/features.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Feature flags for HexGrid 3D
|
|
3
|
-
*
|
|
4
|
-
* Allows enabling/disabling features at runtime for different client environments
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export interface HexGridFeatureFlags {
|
|
8
|
-
/** Enable/disable play-by-play narration overlay */
|
|
9
|
-
enableNarration?: boolean;
|
|
10
|
-
|
|
11
|
-
/** Enable/disable statistics tracking and display */
|
|
12
|
-
enableStats?: boolean;
|
|
13
|
-
|
|
14
|
-
/** Enable/disable debug panel */
|
|
15
|
-
enableDebugPanel?: boolean;
|
|
16
|
-
|
|
17
|
-
/** Enable/disable camera controls UI */
|
|
18
|
-
enableCameraControls?: boolean;
|
|
19
|
-
|
|
20
|
-
/** Enable/disable worker-based rendering */
|
|
21
|
-
enableWorker?: boolean;
|
|
22
|
-
|
|
23
|
-
/** Enable/disable texture/image loading */
|
|
24
|
-
enableTextures?: boolean;
|
|
25
|
-
|
|
26
|
-
/** Enable/disable evolution/animation system */
|
|
27
|
-
enableEvolution?: boolean;
|
|
28
|
-
|
|
29
|
-
/** Enable/disable autoplay functionality */
|
|
30
|
-
enableAutoplay?: boolean;
|
|
31
|
-
|
|
32
|
-
/** Enable/disable user interactions (clicks, drags) */
|
|
33
|
-
enableInteractions?: boolean;
|
|
34
|
-
|
|
35
|
-
/** Enable/disable keyboard shortcuts */
|
|
36
|
-
enableKeyboardShortcuts?: boolean;
|
|
37
|
-
|
|
38
|
-
/** Enable/disable performance telemetry */
|
|
39
|
-
enableTelemetry?: boolean;
|
|
40
|
-
|
|
41
|
-
/** Enable/disable sheen/visual effects */
|
|
42
|
-
enableVisualEffects?: boolean;
|
|
43
|
-
|
|
44
|
-
/** Enable/disable leaderboard system */
|
|
45
|
-
enableLeaderboard?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Default feature flags - all features enabled
|
|
50
|
-
*/
|
|
51
|
-
export const DEFAULT_FEATURE_FLAGS: Required<HexGridFeatureFlags> = {
|
|
52
|
-
enableNarration: true,
|
|
53
|
-
enableStats: true,
|
|
54
|
-
enableDebugPanel: true,
|
|
55
|
-
enableCameraControls: true,
|
|
56
|
-
enableWorker: true,
|
|
57
|
-
enableTextures: true,
|
|
58
|
-
enableEvolution: true,
|
|
59
|
-
enableAutoplay: true,
|
|
60
|
-
enableInteractions: true,
|
|
61
|
-
enableKeyboardShortcuts: true,
|
|
62
|
-
enableTelemetry: true,
|
|
63
|
-
enableVisualEffects: true,
|
|
64
|
-
enableLeaderboard: true,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Minimal feature flags - only core visualization
|
|
69
|
-
*/
|
|
70
|
-
export const MINIMAL_FEATURE_FLAGS: Required<HexGridFeatureFlags> = {
|
|
71
|
-
enableNarration: false,
|
|
72
|
-
enableStats: false,
|
|
73
|
-
enableDebugPanel: false,
|
|
74
|
-
enableCameraControls: false,
|
|
75
|
-
enableWorker: true,
|
|
76
|
-
enableTextures: true,
|
|
77
|
-
enableEvolution: false,
|
|
78
|
-
enableAutoplay: false,
|
|
79
|
-
enableInteractions: true,
|
|
80
|
-
enableKeyboardShortcuts: false,
|
|
81
|
-
enableTelemetry: false,
|
|
82
|
-
enableVisualEffects: false,
|
|
83
|
-
enableLeaderboard: false,
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Performance-focused feature flags
|
|
88
|
-
*/
|
|
89
|
-
export const PERFORMANCE_FEATURE_FLAGS: Required<HexGridFeatureFlags> = {
|
|
90
|
-
enableNarration: false,
|
|
91
|
-
enableStats: true,
|
|
92
|
-
enableDebugPanel: false,
|
|
93
|
-
enableCameraControls: true,
|
|
94
|
-
enableWorker: true,
|
|
95
|
-
enableTextures: true,
|
|
96
|
-
enableEvolution: true,
|
|
97
|
-
enableAutoplay: false,
|
|
98
|
-
enableInteractions: true,
|
|
99
|
-
enableKeyboardShortcuts: true,
|
|
100
|
-
enableTelemetry: false,
|
|
101
|
-
enableVisualEffects: false,
|
|
102
|
-
enableLeaderboard: false,
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Merge user-provided flags with defaults
|
|
107
|
-
*/
|
|
108
|
-
export function mergeFeatureFlags(
|
|
109
|
-
userFlags?: Partial<HexGridFeatureFlags>
|
|
110
|
-
): Required<HexGridFeatureFlags> {
|
|
111
|
-
return {
|
|
112
|
-
...DEFAULT_FEATURE_FLAGS,
|
|
113
|
-
...userFlags,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Check if a feature is enabled
|
|
119
|
-
*/
|
|
120
|
-
export function isFeatureEnabled(
|
|
121
|
-
flags: HexGridFeatureFlags,
|
|
122
|
-
feature: keyof HexGridFeatureFlags
|
|
123
|
-
): boolean {
|
|
124
|
-
return flags[feature] !== false;
|
|
125
|
-
}
|
package/src/lib/narration.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface NarrationMessage {
|
|
2
|
-
generation: number;
|
|
3
|
-
timestamp: string;
|
|
4
|
-
priority: number;
|
|
5
|
-
text: string;
|
|
6
|
-
eventType?: string;
|
|
7
|
-
sparkline?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class NarrationManager {
|
|
11
|
-
static getInstance(): any {
|
|
12
|
-
return {
|
|
13
|
-
subscribe: () => () => {},
|
|
14
|
-
getState: () => ({})
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
package/src/lib/stats-tracker.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export class StatsTracker {
|
|
2
|
-
static getInstance(): StatsTracker {
|
|
3
|
-
return new StatsTracker();
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
getCurrentStats(): any {
|
|
7
|
-
return {
|
|
8
|
-
generation: 1,
|
|
9
|
-
activeMemesCount: 10,
|
|
10
|
-
totalHexesInfected: 100,
|
|
11
|
-
populationStability: 0.5
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
getAllTimeRecords(): any {
|
|
16
|
-
return {
|
|
17
|
-
highestTerritory: { value: 100 },
|
|
18
|
-
longestSurvivalStreak: { value: 50 }
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
getLeaderboard(limit: number): any[] {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
}
|
package/src/lib/theme-colors.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const ThemeColors = {
|
|
2
|
-
primary: '#000000',
|
|
3
|
-
secondary: '#ffffff'
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export function getAccentRgba(alpha: number = 1): string {
|
|
7
|
-
return `rgba(0, 255, 255, ${alpha})`;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function getAccentHex(): string {
|
|
11
|
-
return '#00ffff';
|
|
12
|
-
}
|