@timmeck/brain 1.9.0 → 2.0.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/README.md +19 -0
- package/brain.log +1164 -0
- package/{src/cli/commands/dashboard.ts → dashboard.html} +688 -807
- package/dist/api/server.d.ts +4 -18
- package/dist/api/server.js +4 -173
- package/dist/api/server.js.map +1 -1
- package/dist/brain.d.ts +1 -0
- package/dist/brain.js +6 -1
- package/dist/brain.js.map +1 -1
- package/dist/cli/colors.d.ts +4 -25
- package/dist/cli/colors.js +3 -89
- package/dist/cli/colors.js.map +1 -1
- package/dist/cli/commands/peers.d.ts +2 -0
- package/dist/cli/commands/peers.js +38 -0
- package/dist/cli/commands/peers.js.map +1 -0
- package/dist/db/connection.d.ts +1 -2
- package/dist/db/connection.js +1 -18
- package/dist/db/connection.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/ipc/__tests__/protocol.test.d.ts +1 -0
- package/dist/ipc/__tests__/protocol.test.js +117 -0
- package/dist/ipc/__tests__/protocol.test.js.map +1 -0
- package/dist/ipc/client.d.ts +1 -16
- package/dist/ipc/client.js +1 -100
- package/dist/ipc/client.js.map +1 -1
- package/dist/ipc/protocol.d.ts +1 -8
- package/dist/ipc/protocol.js +1 -28
- package/dist/ipc/protocol.js.map +1 -1
- package/dist/ipc/router.js +8 -0
- package/dist/ipc/router.js.map +1 -1
- package/dist/ipc/server.d.ts +1 -22
- package/dist/ipc/server.js +1 -163
- package/dist/ipc/server.js.map +1 -1
- package/dist/mcp/http-server.d.ts +1 -7
- package/dist/mcp/http-server.js +6 -117
- package/dist/mcp/http-server.js.map +1 -1
- package/dist/mcp/server.js +5 -61
- package/dist/mcp/server.js.map +1 -1
- package/dist/signals/__tests__/fingerprint.test.d.ts +1 -0
- package/dist/signals/__tests__/fingerprint.test.js +118 -0
- package/dist/signals/__tests__/fingerprint.test.js.map +1 -0
- package/dist/types/ipc.types.d.ts +1 -11
- package/dist/utils/__tests__/hash.test.d.ts +1 -0
- package/dist/utils/__tests__/hash.test.js +32 -0
- package/dist/utils/__tests__/hash.test.js.map +1 -0
- package/dist/utils/__tests__/paths.test.d.ts +1 -0
- package/dist/utils/__tests__/paths.test.js +75 -0
- package/dist/utils/__tests__/paths.test.js.map +1 -0
- package/dist/utils/events.d.ts +4 -8
- package/dist/utils/events.js +2 -14
- package/dist/utils/events.js.map +1 -1
- package/dist/utils/hash.d.ts +1 -1
- package/dist/utils/hash.js +1 -4
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/logger.d.ts +3 -2
- package/dist/utils/logger.js +8 -35
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/paths.d.ts +2 -1
- package/dist/utils/paths.js +4 -13
- package/dist/utils/paths.js.map +1 -1
- package/package.json +2 -1
- package/BRAIN_PLAN.md +0 -3324
- package/reddit_post.md +0 -45
- package/src/api/server.ts +0 -395
- package/src/brain.ts +0 -313
- package/src/cli/colors.ts +0 -116
- package/src/cli/commands/config.ts +0 -169
- package/src/cli/commands/doctor.ts +0 -124
- package/src/cli/commands/explain.ts +0 -83
- package/src/cli/commands/export.ts +0 -31
- package/src/cli/commands/import.ts +0 -199
- package/src/cli/commands/insights.ts +0 -65
- package/src/cli/commands/learn.ts +0 -24
- package/src/cli/commands/modules.ts +0 -53
- package/src/cli/commands/network.ts +0 -67
- package/src/cli/commands/projects.ts +0 -42
- package/src/cli/commands/query.ts +0 -120
- package/src/cli/commands/start.ts +0 -105
- package/src/cli/commands/status.ts +0 -75
- package/src/cli/commands/stop.ts +0 -34
- package/src/cli/ipc-helper.ts +0 -22
- package/src/cli/update-check.ts +0 -63
- package/src/code/analyzer.ts +0 -117
- package/src/code/fingerprint.ts +0 -87
- package/src/code/matcher.ts +0 -129
- package/src/code/parsers/generic.ts +0 -29
- package/src/code/parsers/python.ts +0 -54
- package/src/code/parsers/typescript.ts +0 -65
- package/src/code/registry.ts +0 -60
- package/src/code/scorer.ts +0 -120
- package/src/config.ts +0 -135
- package/src/dashboard/server.ts +0 -142
- package/src/db/connection.ts +0 -22
- package/src/db/migrations/001_core_schema.ts +0 -120
- package/src/db/migrations/002_learning_schema.ts +0 -38
- package/src/db/migrations/003_code_schema.ts +0 -53
- package/src/db/migrations/004_synapses_schema.ts +0 -57
- package/src/db/migrations/005_fts_indexes.ts +0 -78
- package/src/db/migrations/006_synapses_phase3.ts +0 -17
- package/src/db/migrations/007_feedback.ts +0 -13
- package/src/db/migrations/008_git_integration.ts +0 -38
- package/src/db/migrations/009_embeddings.ts +0 -8
- package/src/db/migrations/index.ts +0 -70
- package/src/db/repositories/antipattern.repository.ts +0 -66
- package/src/db/repositories/code-module.repository.ts +0 -142
- package/src/db/repositories/error.repository.ts +0 -189
- package/src/db/repositories/insight.repository.ts +0 -99
- package/src/db/repositories/notification.repository.ts +0 -66
- package/src/db/repositories/project.repository.ts +0 -93
- package/src/db/repositories/rule.repository.ts +0 -108
- package/src/db/repositories/solution.repository.ts +0 -154
- package/src/db/repositories/synapse.repository.ts +0 -163
- package/src/db/repositories/terminal.repository.ts +0 -101
- package/src/embeddings/engine.ts +0 -238
- package/src/hooks/post-tool-use.ts +0 -92
- package/src/hooks/post-write.ts +0 -129
- package/src/index.ts +0 -63
- package/src/ipc/client.ts +0 -118
- package/src/ipc/protocol.ts +0 -35
- package/src/ipc/router.ts +0 -133
- package/src/ipc/server.ts +0 -176
- package/src/learning/confidence-scorer.ts +0 -80
- package/src/learning/decay.ts +0 -46
- package/src/learning/learning-engine.ts +0 -170
- package/src/learning/pattern-extractor.ts +0 -90
- package/src/learning/rule-generator.ts +0 -74
- package/src/main.rs:10:5 +0 -0
- package/src/matching/error-matcher.ts +0 -166
- package/src/matching/fingerprint.ts +0 -34
- package/src/matching/similarity.ts +0 -61
- package/src/matching/tfidf.ts +0 -74
- package/src/matching/tokenizer.ts +0 -41
- package/src/mcp/auto-detect.ts +0 -93
- package/src/mcp/http-server.ts +0 -140
- package/src/mcp/server.ts +0 -73
- package/src/mcp/tools.ts +0 -328
- package/src/parsing/error-parser.ts +0 -28
- package/src/parsing/parsers/compiler.ts +0 -93
- package/src/parsing/parsers/generic.ts +0 -28
- package/src/parsing/parsers/go.ts +0 -97
- package/src/parsing/parsers/node.ts +0 -69
- package/src/parsing/parsers/python.ts +0 -62
- package/src/parsing/parsers/rust.ts +0 -50
- package/src/parsing/parsers/shell.ts +0 -42
- package/src/parsing/types.ts +0 -47
- package/src/research/gap-analyzer.ts +0 -135
- package/src/research/insight-generator.ts +0 -123
- package/src/research/research-engine.ts +0 -116
- package/src/research/synergy-detector.ts +0 -126
- package/src/research/template-extractor.ts +0 -130
- package/src/research/trend-analyzer.ts +0 -127
- package/src/services/analytics.service.ts +0 -226
- package/src/services/code.service.ts +0 -271
- package/src/services/error.service.ts +0 -266
- package/src/services/git.service.ts +0 -132
- package/src/services/notification.service.ts +0 -41
- package/src/services/prevention.service.ts +0 -159
- package/src/services/research.service.ts +0 -98
- package/src/services/solution.service.ts +0 -174
- package/src/services/synapse.service.ts +0 -59
- package/src/services/terminal.service.ts +0 -81
- package/src/synapses/activation.ts +0 -80
- package/src/synapses/decay.ts +0 -38
- package/src/synapses/hebbian.ts +0 -69
- package/src/synapses/pathfinder.ts +0 -81
- package/src/synapses/synapse-manager.ts +0 -113
- package/src/types/code.types.ts +0 -52
- package/src/types/config.types.ts +0 -103
- package/src/types/error.types.ts +0 -67
- package/src/types/ipc.types.ts +0 -8
- package/src/types/mcp.types.ts +0 -53
- package/src/types/research.types.ts +0 -28
- package/src/types/solution.types.ts +0 -30
- package/src/types/synapse.types.ts +0 -50
- package/src/utils/events.ts +0 -45
- package/src/utils/hash.ts +0 -5
- package/src/utils/logger.ts +0 -48
- package/src/utils/paths.ts +0 -19
- package/tests/e2e/test_code_intelligence.py +0 -1015
- package/tests/e2e/test_error_memory.py +0 -451
- package/tests/e2e/test_full_integration.py +0 -534
- package/tests/fixtures/code-modules/modules.ts +0 -83
- package/tests/fixtures/errors/go.ts +0 -9
- package/tests/fixtures/errors/node.ts +0 -24
- package/tests/fixtures/errors/python.ts +0 -21
- package/tests/fixtures/errors/rust.ts +0 -25
- package/tests/fixtures/errors/shell.ts +0 -15
- package/tests/fixtures/solutions/solutions.ts +0 -27
- package/tests/helpers/setup-db.ts +0 -52
- package/tests/integration/code-flow.test.ts +0 -86
- package/tests/integration/error-flow.test.ts +0 -83
- package/tests/integration/ipc-flow.test.ts +0 -166
- package/tests/integration/learning-cycle.test.ts +0 -82
- package/tests/integration/synapse-flow.test.ts +0 -117
- package/tests/unit/code/analyzer.test.ts +0 -58
- package/tests/unit/code/fingerprint.test.ts +0 -51
- package/tests/unit/code/scorer.test.ts +0 -55
- package/tests/unit/learning/confidence-scorer.test.ts +0 -60
- package/tests/unit/learning/decay.test.ts +0 -45
- package/tests/unit/learning/pattern-extractor.test.ts +0 -50
- package/tests/unit/matching/error-matcher.test.ts +0 -69
- package/tests/unit/matching/fingerprint.test.ts +0 -47
- package/tests/unit/matching/similarity.test.ts +0 -65
- package/tests/unit/matching/tfidf.test.ts +0 -71
- package/tests/unit/matching/tokenizer.test.ts +0 -83
- package/tests/unit/parsing/parsers.test.ts +0 -113
- package/tests/unit/research/gap-analyzer.test.ts +0 -45
- package/tests/unit/research/trend-analyzer.test.ts +0 -45
- package/tests/unit/synapses/activation.test.ts +0 -80
- package/tests/unit/synapses/decay.test.ts +0 -27
- package/tests/unit/synapses/hebbian.test.ts +0 -96
- package/tests/unit/synapses/pathfinder.test.ts +0 -72
- package/tsconfig.json +0 -18
|
@@ -1,807 +1,688 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<
|
|
187
|
-
<
|
|
188
|
-
<
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
.
|
|
317
|
-
.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
.
|
|
326
|
-
.
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
<
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
grad.addColorStop(0, colors[0] + Math.round(Math.min(0.7,alpha)*255).toString(16).padStart(2,'0'));
|
|
690
|
-
grad.addColorStop(1, colors[1] + Math.round(Math.min(0.7,alpha)*255).toString(16).padStart(2,'0'));
|
|
691
|
-
ctx.strokeStyle = grad;
|
|
692
|
-
ctx.lineWidth = 0.5 + e.weight * 2.5;
|
|
693
|
-
ctx.beginPath();
|
|
694
|
-
ctx.moveTo(e.source.x, e.source.y);
|
|
695
|
-
ctx.lineTo(e.target.x, e.target.y);
|
|
696
|
-
ctx.stroke();
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
// Nodes with ambient glow + pulse on hubs
|
|
700
|
-
for (const n of nodes) {
|
|
701
|
-
const r = getNodeRadius(n);
|
|
702
|
-
const color = NODE_COLORS[n.type] || DEFAULT_COLOR;
|
|
703
|
-
const isHover = n === hovered || n === dragging;
|
|
704
|
-
const isHub = n.connections >= 5;
|
|
705
|
-
|
|
706
|
-
// Ambient glow for all nodes
|
|
707
|
-
const glowSize = isHover ? 30 : (isHub ? 15 + Math.sin(frame * 0.03 + n.x) * 5 : 8);
|
|
708
|
-
ctx.shadowColor = color;
|
|
709
|
-
ctx.shadowBlur = glowSize;
|
|
710
|
-
|
|
711
|
-
// Outer ring for hubs
|
|
712
|
-
if (isHub || isHover) {
|
|
713
|
-
const pulseR = r + 3 + (isHub ? Math.sin(frame * 0.04 + n.y) * 2 : 0);
|
|
714
|
-
ctx.strokeStyle = color;
|
|
715
|
-
ctx.globalAlpha = isHover ? 0.6 : 0.25;
|
|
716
|
-
ctx.lineWidth = 1.5;
|
|
717
|
-
ctx.beginPath();
|
|
718
|
-
ctx.arc(n.x, n.y, pulseR, 0, Math.PI * 2);
|
|
719
|
-
ctx.stroke();
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
// Core node
|
|
723
|
-
ctx.globalAlpha = isHover ? 1 : 0.85;
|
|
724
|
-
ctx.fillStyle = color;
|
|
725
|
-
ctx.beginPath();
|
|
726
|
-
ctx.arc(n.x, n.y, r, 0, Math.PI * 2);
|
|
727
|
-
ctx.fill();
|
|
728
|
-
|
|
729
|
-
// Inner highlight (glossy effect)
|
|
730
|
-
ctx.globalAlpha = 0.3;
|
|
731
|
-
ctx.fillStyle = '#ffffff';
|
|
732
|
-
ctx.beginPath();
|
|
733
|
-
ctx.arc(n.x - r * 0.25, n.y - r * 0.25, r * 0.4, 0, Math.PI * 2);
|
|
734
|
-
ctx.fill();
|
|
735
|
-
|
|
736
|
-
ctx.globalAlpha = 1;
|
|
737
|
-
ctx.shadowBlur = 0;
|
|
738
|
-
|
|
739
|
-
// Labels
|
|
740
|
-
if (isHover || n.connections >= 4) {
|
|
741
|
-
const label = n.type === 'project' ? n.id.replace('project:','P') : n.id.split(':')[0];
|
|
742
|
-
ctx.fillStyle = '#e8eaf6';
|
|
743
|
-
ctx.font = (isHover ? 'bold 12px' : '10px') + ' Inter, system-ui, sans-serif';
|
|
744
|
-
ctx.textAlign = 'center';
|
|
745
|
-
ctx.globalAlpha = isHover ? 1 : 0.7;
|
|
746
|
-
ctx.fillText(isHover ? n.id : label, n.x, n.y - r - 8);
|
|
747
|
-
ctx.globalAlpha = 1;
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
simulate();
|
|
751
|
-
requestAnimationFrame(draw);
|
|
752
|
-
}
|
|
753
|
-
draw();
|
|
754
|
-
|
|
755
|
-
// Interaction
|
|
756
|
-
const tooltip = document.getElementById('graph-tooltip');
|
|
757
|
-
function getNodeAt(mx, my) {
|
|
758
|
-
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
759
|
-
const n = nodes[i], r = getNodeRadius(n);
|
|
760
|
-
if (Math.hypot(mx - n.x, my - n.y) <= r + 4) return n;
|
|
761
|
-
}
|
|
762
|
-
return null;
|
|
763
|
-
}
|
|
764
|
-
function getPos(e) {
|
|
765
|
-
const rect = canvas.getBoundingClientRect();
|
|
766
|
-
return { x: e.clientX - rect.left, y: e.clientY - rect.top };
|
|
767
|
-
}
|
|
768
|
-
canvas.addEventListener('mousemove', function(e) {
|
|
769
|
-
const p = getPos(e);
|
|
770
|
-
if (dragging) {
|
|
771
|
-
dragging.x = p.x + dragOff.x;
|
|
772
|
-
dragging.y = p.y + dragOff.y;
|
|
773
|
-
dragging.vx = 0; dragging.vy = 0;
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
const n = getNodeAt(p.x, p.y);
|
|
777
|
-
hovered = n;
|
|
778
|
-
canvas.style.cursor = n ? 'pointer' : 'grab';
|
|
779
|
-
if (n) {
|
|
780
|
-
const conns = graphEdges.filter(e => e.source === n || e.target === n);
|
|
781
|
-
const types = {};
|
|
782
|
-
conns.forEach(c => { types[c.type] = (types[c.type]||0)+1; });
|
|
783
|
-
const typeStr = Object.entries(types).map(([t,c]) => t+': '+c).join(', ');
|
|
784
|
-
tooltip.innerHTML = '<strong>' + n.id + '</strong><br>' + conns.length + ' connections<br><span style="color:var(--text3);font-size:.75rem">' + typeStr + '</span>';
|
|
785
|
-
tooltip.style.display = 'block';
|
|
786
|
-
tooltip.style.left = (p.x + 15) + 'px';
|
|
787
|
-
tooltip.style.top = (p.y - 10) + 'px';
|
|
788
|
-
} else {
|
|
789
|
-
tooltip.style.display = 'none';
|
|
790
|
-
}
|
|
791
|
-
});
|
|
792
|
-
canvas.addEventListener('mousedown', function(e) {
|
|
793
|
-
const p = getPos(e);
|
|
794
|
-
const n = getNodeAt(p.x, p.y);
|
|
795
|
-
if (n) {
|
|
796
|
-
dragging = n;
|
|
797
|
-
dragOff = { x: n.x - p.x, y: n.y - p.y };
|
|
798
|
-
canvas.style.cursor = 'grabbing';
|
|
799
|
-
}
|
|
800
|
-
});
|
|
801
|
-
canvas.addEventListener('mouseup', function() { dragging = null; });
|
|
802
|
-
canvas.addEventListener('mouseleave', function() { dragging = null; hovered = null; tooltip.style.display = 'none'; });
|
|
803
|
-
})();
|
|
804
|
-
</script>
|
|
805
|
-
</body>
|
|
806
|
-
</html>`;
|
|
807
|
-
}
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="de">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Brain — Dashboard</title>
|
|
7
|
+
<style>
|
|
8
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
|
|
9
|
+
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
10
|
+
:root{
|
|
11
|
+
--bg:#04060e;--bg2:rgba(10,12,24,.7);--bg3:rgba(20,24,50,.6);--bg4:rgba(30,35,70,.5);
|
|
12
|
+
--glass:rgba(15,18,40,.55);--glass-border:rgba(100,120,255,.12);--glass-hover:rgba(100,120,255,.2);
|
|
13
|
+
--text:#e8eaf6;--text2:#8b8fb0;--text3:#4a4d6e;
|
|
14
|
+
--blue:#5b9cff;--red:#ff5577;--green:#3dffa0;
|
|
15
|
+
--purple:#b47aff;--orange:#ffb347;--cyan:#47e5ff;
|
|
16
|
+
--accent:linear-gradient(135deg,#b47aff,#5b9cff,#47e5ff);
|
|
17
|
+
--radius:16px;--radius-sm:10px;
|
|
18
|
+
}
|
|
19
|
+
html{scroll-behavior:smooth}
|
|
20
|
+
body{font-family:'Inter',system-ui,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;min-height:100vh;overflow-x:hidden}
|
|
21
|
+
|
|
22
|
+
/* Neural canvas background */
|
|
23
|
+
#neural-bg{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;pointer-events:none}
|
|
24
|
+
|
|
25
|
+
/* Ambient glow orbs */
|
|
26
|
+
.orb{position:fixed;border-radius:50%;filter:blur(120px);opacity:.12;pointer-events:none;z-index:0}
|
|
27
|
+
.orb-1{width:600px;height:600px;background:var(--purple);top:-200px;left:-100px;animation:orb-float 20s ease-in-out infinite}
|
|
28
|
+
.orb-2{width:500px;height:500px;background:var(--blue);bottom:-150px;right:-100px;animation:orb-float 25s ease-in-out infinite reverse}
|
|
29
|
+
.orb-3{width:400px;height:400px;background:var(--cyan);top:40%;left:50%;animation:orb-float 18s ease-in-out infinite 5s}
|
|
30
|
+
@keyframes orb-float{0%,100%{transform:translate(0,0) scale(1)}33%{transform:translate(60px,-40px) scale(1.1)}66%{transform:translate(-40px,60px) scale(.9)}}
|
|
31
|
+
|
|
32
|
+
.container{max-width:1400px;margin:0 auto;padding:0 28px;position:relative;z-index:1}
|
|
33
|
+
|
|
34
|
+
/* Reveal animations */
|
|
35
|
+
.reveal{opacity:0;transform:translateY(30px);transition:opacity .6s ease,transform .6s ease}
|
|
36
|
+
.reveal.visible{opacity:1;transform:translateY(0)}
|
|
37
|
+
.reveal-delay-1{transition-delay:.1s}.reveal-delay-2{transition-delay:.2s}
|
|
38
|
+
.reveal-delay-3{transition-delay:.3s}.reveal-delay-4{transition-delay:.4s}
|
|
39
|
+
.reveal-delay-5{transition-delay:.5s}
|
|
40
|
+
|
|
41
|
+
section{margin-bottom:56px}
|
|
42
|
+
|
|
43
|
+
/* Header */
|
|
44
|
+
header{padding:60px 0 24px;text-align:center;position:relative}
|
|
45
|
+
.logo{display:flex;align-items:center;justify-content:center;gap:20px;margin-bottom:12px}
|
|
46
|
+
.logo-icon{
|
|
47
|
+
width:68px;height:68px;border-radius:18px;
|
|
48
|
+
background:linear-gradient(135deg,var(--purple),var(--blue),var(--cyan));
|
|
49
|
+
display:flex;align-items:center;justify-content:center;font-size:32px;
|
|
50
|
+
box-shadow:0 0 60px rgba(170,102,255,.35),0 0 120px rgba(90,150,255,.15);
|
|
51
|
+
animation:icon-breathe 4s ease-in-out infinite;
|
|
52
|
+
position:relative;
|
|
53
|
+
}
|
|
54
|
+
.logo-icon::after{
|
|
55
|
+
content:'';position:absolute;inset:-3px;border-radius:20px;
|
|
56
|
+
background:linear-gradient(135deg,var(--purple),var(--cyan));
|
|
57
|
+
opacity:.4;filter:blur(8px);z-index:-1;animation:icon-breathe 4s ease-in-out infinite reverse;
|
|
58
|
+
}
|
|
59
|
+
@keyframes icon-breathe{0%,100%{box-shadow:0 0 60px rgba(170,102,255,.35),0 0 120px rgba(90,150,255,.15)}50%{box-shadow:0 0 80px rgba(170,102,255,.5),0 0 160px rgba(90,150,255,.25)}}
|
|
60
|
+
.logo h1{font-size:2.8rem;font-weight:900;letter-spacing:-1px;background:linear-gradient(135deg,#fff 0%,var(--blue) 50%,var(--purple) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
|
|
61
|
+
.tagline{color:var(--text2);font-size:1.05rem;font-weight:300;letter-spacing:.5px}
|
|
62
|
+
|
|
63
|
+
/* Activity indicator */
|
|
64
|
+
.activity{display:inline-flex;align-items:center;gap:10px;margin-top:16px;padding:8px 20px;border-radius:30px;background:var(--glass);border:1px solid var(--glass-border);backdrop-filter:blur(20px)}
|
|
65
|
+
.activity-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 12px var(--green);animation:pulse-dot 2s ease-in-out infinite}
|
|
66
|
+
@keyframes pulse-dot{0%,100%{opacity:1;box-shadow:0 0 12px var(--green)}50%{opacity:.5;box-shadow:0 0 20px var(--green)}}
|
|
67
|
+
.activity-text{font-size:.8rem;color:var(--text2);font-weight:500}
|
|
68
|
+
.activity-bar{width:80px;height:4px;border-radius:2px;background:var(--bg4);overflow:hidden}
|
|
69
|
+
.activity-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,var(--green),var(--cyan));transition:width 1.5s ease}
|
|
70
|
+
|
|
71
|
+
/* Nav */
|
|
72
|
+
nav{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;padding:20px 0;margin-bottom:40px}
|
|
73
|
+
nav a{
|
|
74
|
+
color:var(--text2);text-decoration:none;padding:8px 18px;border-radius:24px;font-size:.85rem;font-weight:500;
|
|
75
|
+
transition:all .3s ease;border:1px solid transparent;backdrop-filter:blur(10px);
|
|
76
|
+
}
|
|
77
|
+
nav a:hover{color:var(--text);background:var(--glass);border-color:var(--glass-border);transform:translateY(-1px)}
|
|
78
|
+
nav a.research{
|
|
79
|
+
background:var(--glass);color:var(--cyan);border-color:rgba(71,229,255,.25);font-weight:600;
|
|
80
|
+
box-shadow:0 0 20px rgba(71,229,255,.1);animation:nav-glow 3s ease-in-out infinite alternate;
|
|
81
|
+
}
|
|
82
|
+
@keyframes nav-glow{0%{box-shadow:0 0 20px rgba(71,229,255,.1)}100%{box-shadow:0 0 35px rgba(71,229,255,.2)}}
|
|
83
|
+
|
|
84
|
+
/* Stats */
|
|
85
|
+
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:18px}
|
|
86
|
+
.stat-card{
|
|
87
|
+
background:var(--glass);border:1px solid var(--glass-border);border-radius:var(--radius);
|
|
88
|
+
padding:28px 22px;text-align:center;position:relative;overflow:hidden;
|
|
89
|
+
transition:all .35s ease;backdrop-filter:blur(20px);
|
|
90
|
+
}
|
|
91
|
+
.stat-card:hover{transform:translateY(-4px);border-color:var(--glass-hover);box-shadow:0 20px 60px rgba(0,0,0,.3)}
|
|
92
|
+
.stat-card::before{content:'';position:absolute;top:0;left:0;right:0;height:2px}
|
|
93
|
+
.stat-card::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:radial-gradient(ellipse at 50% 0%,rgba(255,255,255,.03),transparent 70%);pointer-events:none}
|
|
94
|
+
.stat-card.blue::before{background:linear-gradient(90deg,transparent,var(--blue),transparent)}
|
|
95
|
+
.stat-card.purple::before{background:linear-gradient(90deg,transparent,var(--purple),transparent)}
|
|
96
|
+
.stat-card.red::before{background:linear-gradient(90deg,transparent,var(--red),transparent)}
|
|
97
|
+
.stat-card.green::before{background:linear-gradient(90deg,transparent,var(--green),transparent)}
|
|
98
|
+
.stat-card.orange::before{background:linear-gradient(90deg,transparent,var(--orange),transparent)}
|
|
99
|
+
.stat-card.cyan::before{background:linear-gradient(90deg,transparent,var(--cyan),transparent)}
|
|
100
|
+
.stat-number{font-size:2.6rem;font-weight:900;letter-spacing:-2px}
|
|
101
|
+
.stat-card.blue .stat-number{color:var(--blue)}.stat-card.purple .stat-number{color:var(--purple)}
|
|
102
|
+
.stat-card.red .stat-number{color:var(--red)}.stat-card.green .stat-number{color:var(--green)}
|
|
103
|
+
.stat-card.orange .stat-number{color:var(--orange)}.stat-card.cyan .stat-number{color:var(--cyan)}
|
|
104
|
+
.stat-label{color:var(--text2);font-size:.82rem;margin-top:6px;font-weight:500;letter-spacing:.3px;text-transform:uppercase}
|
|
105
|
+
|
|
106
|
+
/* Section titles */
|
|
107
|
+
.section-title{font-size:1.5rem;font-weight:700;margin-bottom:24px;display:flex;align-items:center;gap:12px}
|
|
108
|
+
.section-title .icon{font-size:1.2rem;width:38px;height:38px;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;backdrop-filter:blur(10px)}
|
|
109
|
+
|
|
110
|
+
/* Language chart */
|
|
111
|
+
.lang-chart{max-width:650px}
|
|
112
|
+
.lang-row{display:flex;align-items:center;gap:14px;margin-bottom:10px}
|
|
113
|
+
.lang-name{width:100px;text-align:right;font-size:.85rem;color:var(--text2);font-weight:500}
|
|
114
|
+
.lang-bar-bg{flex:1;height:28px;background:var(--bg3);border-radius:6px;overflow:hidden;border:1px solid var(--glass-border)}
|
|
115
|
+
.lang-bar{height:100%;background:var(--accent);border-radius:6px;width:0;transition:width 1.2s cubic-bezier(.22,1,.36,1)}
|
|
116
|
+
.lang-count{width:50px;font-size:.85rem;color:var(--text2);font-weight:600}
|
|
117
|
+
|
|
118
|
+
/* Insight tabs */
|
|
119
|
+
.tab-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px}
|
|
120
|
+
.tab-btn{
|
|
121
|
+
padding:10px 20px;border-radius:24px;border:1px solid var(--glass-border);
|
|
122
|
+
background:var(--glass);color:var(--text2);cursor:pointer;font-size:.85rem;font-weight:500;
|
|
123
|
+
transition:all .3s ease;backdrop-filter:blur(10px);font-family:inherit;
|
|
124
|
+
}
|
|
125
|
+
.tab-btn:hover{border-color:var(--glass-hover);color:var(--text);transform:translateY(-1px)}
|
|
126
|
+
.tab-btn.active{border-color:rgba(71,229,255,.35);color:var(--cyan);background:rgba(71,229,255,.08);box-shadow:0 0 20px rgba(71,229,255,.1)}
|
|
127
|
+
.tab-btn .count{background:var(--bg4);padding:2px 8px;border-radius:12px;font-size:.72rem;margin-left:6px;font-weight:600}
|
|
128
|
+
.tab-panel{display:none}.tab-panel.active{display:block}
|
|
129
|
+
.insight-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(380px,1fr));gap:14px}
|
|
130
|
+
.insight-card{
|
|
131
|
+
background:var(--glass);border:1px solid var(--glass-border);border-radius:var(--radius-sm);
|
|
132
|
+
padding:18px;border-left:3px solid var(--text3);transition:all .25s ease;backdrop-filter:blur(20px);
|
|
133
|
+
}
|
|
134
|
+
.insight-card:hover{transform:translateX(6px);border-color:var(--glass-hover);box-shadow:0 8px 30px rgba(0,0,0,.2)}
|
|
135
|
+
.insight-card.cyan{border-left-color:var(--cyan)}.insight-card.orange{border-left-color:var(--orange)}
|
|
136
|
+
.insight-card.green{border-left-color:var(--green)}.insight-card.red{border-left-color:var(--red)}
|
|
137
|
+
.insight-card.purple{border-left-color:var(--purple)}.insight-card.blue{border-left-color:var(--blue)}
|
|
138
|
+
.insight-header{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
|
|
139
|
+
.insight-card p{color:var(--text2);font-size:.85rem;line-height:1.5}
|
|
140
|
+
.prio{font-size:.68rem;padding:3px 10px;border-radius:12px;text-transform:uppercase;font-weight:700;letter-spacing:.5px}
|
|
141
|
+
.prio-critical{background:rgba(255,85,119,.15);color:var(--red);border:1px solid rgba(255,85,119,.25)}
|
|
142
|
+
.prio-high{background:rgba(255,179,71,.15);color:var(--orange);border:1px solid rgba(255,179,71,.25)}
|
|
143
|
+
.prio-medium{background:rgba(91,156,255,.15);color:var(--blue);border:1px solid rgba(91,156,255,.25)}
|
|
144
|
+
.prio-low{background:rgba(139,143,176,.1);color:var(--text2);border:1px solid rgba(139,143,176,.2)}
|
|
145
|
+
.empty{color:var(--text3);font-style:italic;padding:24px}
|
|
146
|
+
|
|
147
|
+
/* Graph */
|
|
148
|
+
.graph-container{position:relative;background:var(--glass);border:1px solid var(--glass-border);border-radius:var(--radius);overflow:hidden;backdrop-filter:blur(20px)}
|
|
149
|
+
#synapse-graph{width:100%;height:650px;display:block;cursor:grab}
|
|
150
|
+
#synapse-graph:active{cursor:grabbing}
|
|
151
|
+
.graph-legend{display:flex;gap:16px;flex-wrap:wrap;padding:12px 20px;border-top:1px solid var(--glass-border);font-size:.8rem;color:var(--text2)}
|
|
152
|
+
.legend-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:middle}
|
|
153
|
+
.graph-tooltip{position:absolute;display:none;background:var(--bg2);border:1px solid var(--glass-border);border-radius:8px;padding:8px 14px;font-size:.8rem;color:var(--text);pointer-events:none;z-index:10;backdrop-filter:blur(20px);box-shadow:0 8px 30px rgba(0,0,0,.3)}
|
|
154
|
+
|
|
155
|
+
/* Footer */
|
|
156
|
+
footer{text-align:center;padding:40px 0;border-top:1px solid var(--glass-border)}
|
|
157
|
+
footer p{color:var(--text3);font-size:.8rem}
|
|
158
|
+
footer code{background:var(--glass);padding:3px 10px;border-radius:6px;font-size:.78rem;border:1px solid var(--glass-border)}
|
|
159
|
+
|
|
160
|
+
/* Responsive */
|
|
161
|
+
@media(max-width:600px){.stats-grid{grid-template-columns:1fr 1fr}.insight-grid{grid-template-columns:1fr}.logo h1{font-size:2rem}}
|
|
162
|
+
</style>
|
|
163
|
+
</head>
|
|
164
|
+
<body>
|
|
165
|
+
|
|
166
|
+
<canvas id="neural-bg"></canvas>
|
|
167
|
+
<div class="orb orb-1"></div>
|
|
168
|
+
<div class="orb orb-2"></div>
|
|
169
|
+
<div class="orb orb-3"></div>
|
|
170
|
+
|
|
171
|
+
<div class="container">
|
|
172
|
+
<header class="reveal">
|
|
173
|
+
<div class="logo">
|
|
174
|
+
<div class="logo-icon">🧠</div>
|
|
175
|
+
<h1>Brain</h1>
|
|
176
|
+
</div>
|
|
177
|
+
<p class="tagline">Adaptive Code Intelligence</p>
|
|
178
|
+
<div class="activity">
|
|
179
|
+
<span class="activity-dot"></span>
|
|
180
|
+
<span class="activity-text">Neural Activity</span>
|
|
181
|
+
<div class="activity-bar"><div class="activity-fill" style="width:0%" data-target="91"></div></div>
|
|
182
|
+
<span class="activity-text" style="color:var(--cyan);font-weight:700">91%</span>
|
|
183
|
+
</div>
|
|
184
|
+
</header>
|
|
185
|
+
|
|
186
|
+
<nav class="reveal reveal-delay-1">
|
|
187
|
+
<a href="#stats">Stats</a>
|
|
188
|
+
<a href="#languages">Languages</a>
|
|
189
|
+
<a href="#network">🔬 Network</a>
|
|
190
|
+
<a href="#research" class="research">💡 Research</a>
|
|
191
|
+
</nav>
|
|
192
|
+
|
|
193
|
+
<section id="stats" class="reveal reveal-delay-2">
|
|
194
|
+
<div class="section-title"><div class="icon" style="background:rgba(91,156,255,.1)">📊</div> Neural Status</div>
|
|
195
|
+
<div class="stats-grid">
|
|
196
|
+
<div class="stat-card blue"><div class="stat-number">18.160</div><div class="stat-label">Modules</div></div>
|
|
197
|
+
<div class="stat-card purple"><div class="stat-number">37.277</div><div class="stat-label">Synapses</div></div>
|
|
198
|
+
<div class="stat-card cyan"><div class="stat-number">5031</div><div class="stat-label">Insights</div></div>
|
|
199
|
+
<div class="stat-card red"><div class="stat-number">0</div><div class="stat-label">Errors</div></div>
|
|
200
|
+
<div class="stat-card green"><div class="stat-number">0</div><div class="stat-label">Solutions</div></div>
|
|
201
|
+
<div class="stat-card orange"><div class="stat-number">0</div><div class="stat-label">Rules</div></div>
|
|
202
|
+
</div>
|
|
203
|
+
</section>
|
|
204
|
+
|
|
205
|
+
<section id="languages" class="reveal reveal-delay-3">
|
|
206
|
+
<div class="section-title"><div class="icon" style="background:rgba(180,122,255,.1)">💻</div> Languages</div>
|
|
207
|
+
<div class="lang-chart"><div class="lang-row"><span class="lang-name">python</span><div class="lang-bar-bg"><div class="lang-bar" data-width="100"></div></div><span class="lang-count">10344</span></div>
|
|
208
|
+
<div class="lang-row"><span class="lang-name">c</span><div class="lang-bar-bg"><div class="lang-bar" data-width="52"></div></div><span class="lang-count">5402</span></div>
|
|
209
|
+
<div class="lang-row"><span class="lang-name">typescript</span><div class="lang-bar-bg"><div class="lang-bar" data-width="18"></div></div><span class="lang-count">1865</span></div>
|
|
210
|
+
<div class="lang-row"><span class="lang-name">javascript</span><div class="lang-bar-bg"><div class="lang-bar" data-width="4"></div></div><span class="lang-count">416</span></div>
|
|
211
|
+
<div class="lang-row"><span class="lang-name">cpp</span><div class="lang-bar-bg"><div class="lang-bar" data-width="1"></div></div><span class="lang-count">107</span></div>
|
|
212
|
+
<div class="lang-row"><span class="lang-name">shell</span><div class="lang-bar-bg"><div class="lang-bar" data-width="0"></div></div><span class="lang-count">20</span></div>
|
|
213
|
+
<div class="lang-row"><span class="lang-name">rust</span><div class="lang-bar-bg"><div class="lang-bar" data-width="0"></div></div><span class="lang-count">6</span></div></div>
|
|
214
|
+
</section>
|
|
215
|
+
|
|
216
|
+
<section id="network" class="reveal reveal-delay-4">
|
|
217
|
+
<div class="section-title"><div class="icon" style="background:rgba(71,229,255,.1)">🔬</div> Synapse Network</div>
|
|
218
|
+
<div class="graph-container">
|
|
219
|
+
<canvas id="synapse-graph"></canvas>
|
|
220
|
+
<div class="graph-legend">
|
|
221
|
+
<span><span class="legend-dot" style="background:#ff5577"></span> error</span>
|
|
222
|
+
<span><span class="legend-dot" style="background:#3dffa0"></span> solution</span>
|
|
223
|
+
<span><span class="legend-dot" style="background:#b47aff"></span> code_module</span>
|
|
224
|
+
<span><span class="legend-dot" style="background:#ffb347"></span> project</span>
|
|
225
|
+
<span><span class="legend-dot" style="background:#5b9cff"></span> rule</span>
|
|
226
|
+
<span style="margin-left:auto;color:var(--text3);font-size:.72rem">edges: co_occurs / solves / uses_module / depends_on</span>
|
|
227
|
+
</div>
|
|
228
|
+
<div id="graph-tooltip" class="graph-tooltip"></div>
|
|
229
|
+
</div>
|
|
230
|
+
</section>
|
|
231
|
+
|
|
232
|
+
<section id="research" class="reveal reveal-delay-5">
|
|
233
|
+
<div class="section-title"><div class="icon" style="background:rgba(71,229,255,.1)">🔬</div> Research Insights</div>
|
|
234
|
+
<div class="tab-bar">
|
|
235
|
+
<button class="tab-btn active" data-tab="templates">🎨 Templates <span class="count">5031</span></button>
|
|
236
|
+
<button class="tab-btn" data-tab="suggestions">💡 Suggestions <span class="count">5031</span></button>
|
|
237
|
+
<button class="tab-btn" data-tab="trends">📈 Trends <span class="count">0</span></button>
|
|
238
|
+
<button class="tab-btn" data-tab="gaps">⚠️ Gaps <span class="count">0</span></button>
|
|
239
|
+
<button class="tab-btn" data-tab="synergies">⚡ Synergies <span class="count">0</span></button>
|
|
240
|
+
<button class="tab-btn" data-tab="warnings">🚨 Warnings <span class="count">0</span></button>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="tab-panel active" id="tab-templates"><div class="insight-grid"><div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: alert.tsx</strong></div><p>"alert.tsx" exists in 4 projects as adaptations (avg reusability 52%). Generalize into parameterized template.</p></div>
|
|
243
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: button.tsx</strong></div><p>"button.tsx" exists in 8 projects as adaptations (avg reusability 71%). Generalize into parameterized template.</p></div>
|
|
244
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: config.py</strong></div><p>"config.py" exists in 5 projects as adaptations (avg reusability 74%). Generalize into parameterized template.</p></div>
|
|
245
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: footer.tsx</strong></div><p>"footer.tsx" exists in 8 projects as adaptations (avg reusability 78%). Generalize into parameterized template.</p></div>
|
|
246
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: index.ts</strong></div><p>"index.ts" exists in 12 projects as adaptations (avg reusability 63%). Generalize into parameterized template.</p></div>
|
|
247
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: input.tsx</strong></div><p>"input.tsx" exists in 7 projects as adaptations (avg reusability 64%). Generalize into parameterized template.</p></div>
|
|
248
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: layout.tsx</strong></div><p>"layout.tsx" exists in 12 projects as adaptations (avg reusability 77%). Generalize into parameterized template.</p></div>
|
|
249
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: main.py</strong></div><p>"main.py" exists in 4 projects as adaptations (avg reusability 81%). Generalize into parameterized template.</p></div>
|
|
250
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: page.tsx</strong></div><p>"page.tsx" exists in 12 projects as adaptations (avg reusability 77%). Generalize into parameterized template.</p></div>
|
|
251
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: postcss.config.js</strong></div><p>"postcss.config.js" exists in 4 projects as adaptations (avg reusability 53%). Generalize into parameterized template.</p></div>
|
|
252
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: route.ts</strong></div><p>"route.ts" exists in 11 projects as adaptations (avg reusability 76%). Generalize into parameterized template.</p></div>
|
|
253
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: run.py</strong></div><p>"run.py" exists in 4 projects as adaptations (avg reusability 76%). Generalize into parameterized template.</p></div>
|
|
254
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: sidebar.tsx</strong></div><p>"sidebar.tsx" exists in 4 projects as adaptations (avg reusability 81%). Generalize into parameterized template.</p></div>
|
|
255
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: tailwind.config.js</strong></div><p>"tailwind.config.js" exists in 4 projects as adaptations (avg reusability 56%). Generalize into parameterized template.</p></div>
|
|
256
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: use-debounce.ts</strong></div><p>"use-debounce.ts" exists in 4 projects as adaptations (avg reusability 87%). Generalize into parameterized template.</p></div>
|
|
257
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: use-local-storage.ts</strong></div><p>"use-local-storage.ts" exists in 4 projects as adaptations (avg reusability 74%). Generalize into parameterized template.</p></div>
|
|
258
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: use-media-query.ts</strong></div><p>"use-media-query.ts" exists in 4 projects as adaptations (avg reusability 81%). Generalize into parameterized template.</p></div>
|
|
259
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: auth.ts</strong></div><p>"auth.ts" exists in 7 projects as adaptations (avg reusability 67%). Generalize into parameterized template.</p></div>
|
|
260
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: badge.tsx</strong></div><p>"badge.tsx" exists in 5 projects as adaptations (avg reusability 75%). Generalize into parameterized template.</p></div>
|
|
261
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: client.ts</strong></div><p>"client.ts" exists in 6 projects as adaptations (avg reusability 69%). Generalize into parameterized template.</p></div>
|
|
262
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: db.ts</strong></div><p>"db.ts" exists in 4 projects as adaptations (avg reusability 73%). Generalize into parameterized template.</p></div>
|
|
263
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: error.tsx</strong></div><p>"error.tsx" exists in 4 projects as adaptations (avg reusability 71%). Generalize into parameterized template.</p></div>
|
|
264
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: not-found.tsx</strong></div><p>"not-found.tsx" exists in 4 projects as adaptations (avg reusability 76%). Generalize into parameterized template.</p></div>
|
|
265
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: select.tsx</strong></div><p>"select.tsx" exists in 5 projects as adaptations (avg reusability 54%). Generalize into parameterized template.</p></div>
|
|
266
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: textarea.tsx</strong></div><p>"textarea.tsx" exists in 4 projects as adaptations (avg reusability 63%). Generalize into parameterized template.</p></div>
|
|
267
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: utils.ts</strong></div><p>"utils.ts" exists in 7 projects as adaptations (avg reusability 75%). Generalize into parameterized template.</p></div>
|
|
268
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: middleware.ts</strong></div><p>"middleware.ts" exists in 5 projects as adaptations (avg reusability 78%). Generalize into parameterized template.</p></div>
|
|
269
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: providers.tsx</strong></div><p>"providers.tsx" exists in 5 projects as adaptations (avg reusability 80%). Generalize into parameterized template.</p></div>
|
|
270
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: progress.tsx</strong></div><p>"progress.tsx" exists in 4 projects as adaptations (avg reusability 52%). Generalize into parameterized template.</p></div>
|
|
271
|
+
<div class="insight-card cyan"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: tailwind.config.ts</strong></div><p>"tailwind.config.ts" exists in 4 projects as adaptations (avg reusability 88%). Generalize into parameterized template.</p></div></div></div>
|
|
272
|
+
<div class="tab-panel" id="tab-suggestions"><div class="insight-grid"><div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: alert.tsx</strong></div><p>"alert.tsx" exists in 4 projects as adaptations (avg reusability 52%). Generalize into parameterized template.</p></div>
|
|
273
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: button.tsx</strong></div><p>"button.tsx" exists in 8 projects as adaptations (avg reusability 71%). Generalize into parameterized template.</p></div>
|
|
274
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: config.py</strong></div><p>"config.py" exists in 5 projects as adaptations (avg reusability 74%). Generalize into parameterized template.</p></div>
|
|
275
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: footer.tsx</strong></div><p>"footer.tsx" exists in 8 projects as adaptations (avg reusability 78%). Generalize into parameterized template.</p></div>
|
|
276
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: index.ts</strong></div><p>"index.ts" exists in 12 projects as adaptations (avg reusability 63%). Generalize into parameterized template.</p></div>
|
|
277
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: input.tsx</strong></div><p>"input.tsx" exists in 7 projects as adaptations (avg reusability 64%). Generalize into parameterized template.</p></div>
|
|
278
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: layout.tsx</strong></div><p>"layout.tsx" exists in 12 projects as adaptations (avg reusability 77%). Generalize into parameterized template.</p></div>
|
|
279
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: main.py</strong></div><p>"main.py" exists in 4 projects as adaptations (avg reusability 81%). Generalize into parameterized template.</p></div>
|
|
280
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: page.tsx</strong></div><p>"page.tsx" exists in 12 projects as adaptations (avg reusability 77%). Generalize into parameterized template.</p></div>
|
|
281
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: postcss.config.js</strong></div><p>"postcss.config.js" exists in 4 projects as adaptations (avg reusability 53%). Generalize into parameterized template.</p></div>
|
|
282
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: route.ts</strong></div><p>"route.ts" exists in 11 projects as adaptations (avg reusability 76%). Generalize into parameterized template.</p></div>
|
|
283
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: run.py</strong></div><p>"run.py" exists in 4 projects as adaptations (avg reusability 76%). Generalize into parameterized template.</p></div>
|
|
284
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: sidebar.tsx</strong></div><p>"sidebar.tsx" exists in 4 projects as adaptations (avg reusability 81%). Generalize into parameterized template.</p></div>
|
|
285
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: tailwind.config.js</strong></div><p>"tailwind.config.js" exists in 4 projects as adaptations (avg reusability 56%). Generalize into parameterized template.</p></div>
|
|
286
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: use-debounce.ts</strong></div><p>"use-debounce.ts" exists in 4 projects as adaptations (avg reusability 87%). Generalize into parameterized template.</p></div>
|
|
287
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: use-local-storage.ts</strong></div><p>"use-local-storage.ts" exists in 4 projects as adaptations (avg reusability 74%). Generalize into parameterized template.</p></div>
|
|
288
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: use-media-query.ts</strong></div><p>"use-media-query.ts" exists in 4 projects as adaptations (avg reusability 81%). Generalize into parameterized template.</p></div>
|
|
289
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: auth.ts</strong></div><p>"auth.ts" exists in 7 projects as adaptations (avg reusability 67%). Generalize into parameterized template.</p></div>
|
|
290
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: badge.tsx</strong></div><p>"badge.tsx" exists in 5 projects as adaptations (avg reusability 75%). Generalize into parameterized template.</p></div>
|
|
291
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: client.ts</strong></div><p>"client.ts" exists in 6 projects as adaptations (avg reusability 69%). Generalize into parameterized template.</p></div>
|
|
292
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: db.ts</strong></div><p>"db.ts" exists in 4 projects as adaptations (avg reusability 73%). Generalize into parameterized template.</p></div>
|
|
293
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: error.tsx</strong></div><p>"error.tsx" exists in 4 projects as adaptations (avg reusability 71%). Generalize into parameterized template.</p></div>
|
|
294
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: not-found.tsx</strong></div><p>"not-found.tsx" exists in 4 projects as adaptations (avg reusability 76%). Generalize into parameterized template.</p></div>
|
|
295
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: select.tsx</strong></div><p>"select.tsx" exists in 5 projects as adaptations (avg reusability 54%). Generalize into parameterized template.</p></div>
|
|
296
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: textarea.tsx</strong></div><p>"textarea.tsx" exists in 4 projects as adaptations (avg reusability 63%). Generalize into parameterized template.</p></div>
|
|
297
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: utils.ts</strong></div><p>"utils.ts" exists in 7 projects as adaptations (avg reusability 75%). Generalize into parameterized template.</p></div>
|
|
298
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: middleware.ts</strong></div><p>"middleware.ts" exists in 5 projects as adaptations (avg reusability 78%). Generalize into parameterized template.</p></div>
|
|
299
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: providers.tsx</strong></div><p>"providers.tsx" exists in 5 projects as adaptations (avg reusability 80%). Generalize into parameterized template.</p></div>
|
|
300
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: progress.tsx</strong></div><p>"progress.tsx" exists in 4 projects as adaptations (avg reusability 52%). Generalize into parameterized template.</p></div>
|
|
301
|
+
<div class="insight-card orange"><div class="insight-header"><span class="prio prio-75">75</span><strong>Template candidate: tailwind.config.ts</strong></div><p>"tailwind.config.ts" exists in 4 projects as adaptations (avg reusability 88%). Generalize into parameterized template.</p></div></div></div>
|
|
302
|
+
<div class="tab-panel" id="tab-trends"><div class="insight-grid"><p class="empty">Keine Insights in dieser Kategorie.</p></div></div>
|
|
303
|
+
<div class="tab-panel" id="tab-gaps"><div class="insight-grid"><p class="empty">Keine Insights in dieser Kategorie.</p></div></div>
|
|
304
|
+
<div class="tab-panel" id="tab-synergies"><div class="insight-grid"><p class="empty">Keine Insights in dieser Kategorie.</p></div></div>
|
|
305
|
+
<div class="tab-panel" id="tab-warnings"><div class="insight-grid"><p class="empty">Keine Insights in dieser Kategorie.</p></div></div>
|
|
306
|
+
</section>
|
|
307
|
+
|
|
308
|
+
<footer class="reveal reveal-delay-5">
|
|
309
|
+
<p>Brain v1.0 — <code>brain dashboard</code></p>
|
|
310
|
+
</footer>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<script>
|
|
314
|
+
// --- Neural Network Canvas ---
|
|
315
|
+
(function(){
|
|
316
|
+
const canvas = document.getElementById('neural-bg');
|
|
317
|
+
const ctx = canvas.getContext('2d');
|
|
318
|
+
let W, H, nodes = [], mouse = {x:-1000,y:-1000};
|
|
319
|
+
|
|
320
|
+
function resize(){
|
|
321
|
+
W = canvas.width = window.innerWidth;
|
|
322
|
+
H = canvas.height = window.innerHeight;
|
|
323
|
+
}
|
|
324
|
+
resize();
|
|
325
|
+
window.addEventListener('resize', resize);
|
|
326
|
+
document.addEventListener('mousemove', e => { mouse.x = e.clientX; mouse.y = e.clientY; });
|
|
327
|
+
|
|
328
|
+
const NODE_COUNT = Math.min(80, Math.floor(window.innerWidth / 18));
|
|
329
|
+
const CONNECT_DIST = 180;
|
|
330
|
+
const MOUSE_DIST = 200;
|
|
331
|
+
|
|
332
|
+
for(let i = 0; i < NODE_COUNT; i++){
|
|
333
|
+
nodes.push({
|
|
334
|
+
x: Math.random() * W,
|
|
335
|
+
y: Math.random() * H,
|
|
336
|
+
vx: (Math.random() - 0.5) * 0.4,
|
|
337
|
+
vy: (Math.random() - 0.5) * 0.4,
|
|
338
|
+
r: Math.random() * 2 + 1,
|
|
339
|
+
pulse: Math.random() * Math.PI * 2,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function draw(){
|
|
344
|
+
ctx.clearRect(0, 0, W, H);
|
|
345
|
+
|
|
346
|
+
// Draw connections
|
|
347
|
+
for(let i = 0; i < nodes.length; i++){
|
|
348
|
+
for(let j = i + 1; j < nodes.length; j++){
|
|
349
|
+
const dx = nodes[i].x - nodes[j].x;
|
|
350
|
+
const dy = nodes[i].y - nodes[j].y;
|
|
351
|
+
const dist = Math.sqrt(dx*dx + dy*dy);
|
|
352
|
+
if(dist < CONNECT_DIST){
|
|
353
|
+
const alpha = (1 - dist / CONNECT_DIST) * 0.15;
|
|
354
|
+
ctx.strokeStyle = 'rgba(91,156,255,' + alpha + ')';
|
|
355
|
+
ctx.lineWidth = 0.5;
|
|
356
|
+
ctx.beginPath();
|
|
357
|
+
ctx.moveTo(nodes[i].x, nodes[i].y);
|
|
358
|
+
ctx.lineTo(nodes[j].x, nodes[j].y);
|
|
359
|
+
ctx.stroke();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Mouse interaction
|
|
364
|
+
const mdx = nodes[i].x - mouse.x;
|
|
365
|
+
const mdy = nodes[i].y - mouse.y;
|
|
366
|
+
const mDist = Math.sqrt(mdx*mdx + mdy*mdy);
|
|
367
|
+
if(mDist < MOUSE_DIST){
|
|
368
|
+
const alpha = (1 - mDist / MOUSE_DIST) * 0.4;
|
|
369
|
+
ctx.strokeStyle = 'rgba(180,122,255,' + alpha + ')';
|
|
370
|
+
ctx.lineWidth = 1;
|
|
371
|
+
ctx.beginPath();
|
|
372
|
+
ctx.moveTo(nodes[i].x, nodes[i].y);
|
|
373
|
+
ctx.lineTo(mouse.x, mouse.y);
|
|
374
|
+
ctx.stroke();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Draw nodes
|
|
379
|
+
const time = Date.now() * 0.001;
|
|
380
|
+
for(const n of nodes){
|
|
381
|
+
const glow = 0.4 + Math.sin(time * 1.5 + n.pulse) * 0.3;
|
|
382
|
+
ctx.fillStyle = 'rgba(91,156,255,' + glow + ')';
|
|
383
|
+
ctx.beginPath();
|
|
384
|
+
ctx.arc(n.x, n.y, n.r, 0, Math.PI * 2);
|
|
385
|
+
ctx.fill();
|
|
386
|
+
|
|
387
|
+
n.x += n.vx;
|
|
388
|
+
n.y += n.vy;
|
|
389
|
+
if(n.x < 0 || n.x > W) n.vx *= -1;
|
|
390
|
+
if(n.y < 0 || n.y > H) n.vy *= -1;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
requestAnimationFrame(draw);
|
|
394
|
+
}
|
|
395
|
+
draw();
|
|
396
|
+
})();
|
|
397
|
+
|
|
398
|
+
// --- Reveal on scroll ---
|
|
399
|
+
const observer = new IntersectionObserver(entries => {
|
|
400
|
+
entries.forEach(e => { if(e.isIntersecting) e.target.classList.add('visible'); });
|
|
401
|
+
}, {threshold: 0.1});
|
|
402
|
+
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
|
|
403
|
+
|
|
404
|
+
// --- Tab switching ---
|
|
405
|
+
document.querySelectorAll('.tab-btn').forEach(btn => {
|
|
406
|
+
btn.addEventListener('click', () => {
|
|
407
|
+
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
|
408
|
+
document.querySelectorAll('.tab-panel').forEach(p => p.classList.remove('active'));
|
|
409
|
+
btn.classList.add('active');
|
|
410
|
+
document.getElementById('tab-' + btn.dataset.tab).classList.add('active');
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
// --- Animate stat numbers ---
|
|
415
|
+
const numObserver = new IntersectionObserver(entries => {
|
|
416
|
+
entries.forEach(e => {
|
|
417
|
+
if(!e.isIntersecting) return;
|
|
418
|
+
const el = e.target;
|
|
419
|
+
if(el.dataset.animated) return;
|
|
420
|
+
el.dataset.animated = '1';
|
|
421
|
+
const target = parseInt(el.textContent.replace(/\D/g,''), 10);
|
|
422
|
+
if(isNaN(target) || target === 0) return;
|
|
423
|
+
const duration = 1200;
|
|
424
|
+
const start = performance.now();
|
|
425
|
+
function tick(now){
|
|
426
|
+
const t = Math.min((now - start) / duration, 1);
|
|
427
|
+
const ease = 1 - Math.pow(1 - t, 3);
|
|
428
|
+
el.textContent = Math.round(target * ease).toLocaleString();
|
|
429
|
+
if(t < 1) requestAnimationFrame(tick);
|
|
430
|
+
}
|
|
431
|
+
requestAnimationFrame(tick);
|
|
432
|
+
});
|
|
433
|
+
}, {threshold: 0.5});
|
|
434
|
+
document.querySelectorAll('.stat-number').forEach(el => numObserver.observe(el));
|
|
435
|
+
|
|
436
|
+
// --- Animate language bars ---
|
|
437
|
+
setTimeout(() => {
|
|
438
|
+
document.querySelectorAll('.lang-bar').forEach(bar => {
|
|
439
|
+
bar.style.width = bar.dataset.width + '%';
|
|
440
|
+
});
|
|
441
|
+
}, 300);
|
|
442
|
+
|
|
443
|
+
// --- Activity bar ---
|
|
444
|
+
setTimeout(() => {
|
|
445
|
+
document.querySelectorAll('.activity-fill').forEach(el => {
|
|
446
|
+
el.style.width = el.dataset.target + '%';
|
|
447
|
+
});
|
|
448
|
+
}, 500);
|
|
449
|
+
|
|
450
|
+
// --- Synapse Force-Directed Graph (Premium) ---
|
|
451
|
+
(function(){
|
|
452
|
+
const edges = [{"s":"code_module:16396","t":"project:32","type":"uses_module","w":0.9999999999976071},{"s":"code_module:11809","t":"project:32","type":"uses_module","w":0.9999999997734227},{"s":"code_module:10773","t":"project:32","type":"uses_module","w":0.9999999589029372},{"s":"code_module:10770","t":"project:32","type":"uses_module","w":0.9999998491798466},{"s":"code_module:16403","t":"project:32","type":"uses_module","w":0.9999997110759625},{"s":"code_module:10777","t":"project:32","type":"uses_module","w":0.9999996600893677},{"s":"code_module:10761","t":"project:32","type":"uses_module","w":0.9999925457292852},{"s":"code_module:10764","t":"project:32","type":"uses_module","w":0.9999878619650481},{"s":"code_module:10659","t":"project:32","type":"uses_module","w":0.9999621369230813},{"s":"code_module:11811","t":"project:32","type":"uses_module","w":0.9999621369230813},{"s":"code_module:11906","t":"project:32","type":"uses_module","w":0.9999383463025951},{"s":"code_module:10776","t":"project:32","type":"uses_module","w":0.9999146661627615},{"s":"code_module:10710","t":"project:32","type":"uses_module","w":0.9998818908827148},{"s":"code_module:11808","t":"project:32","type":"uses_module","w":0.9998076790274208},{"s":"code_module:16419","t":"project:32","type":"uses_module","w":0.9997338118026586},{"s":"code_module:16461","t":"project:32","type":"uses_module","w":0.9997338118026586},{"s":"code_module:11806","t":"project:32","type":"uses_module","w":0.9996315734292853},{"s":"code_module:11805","t":"project:32","type":"uses_module","w":0.9994900670301526},{"s":"code_module:11935","t":"project:32","type":"uses_module","w":0.9992942104223566},{"s":"code_module:10772","t":"project:32","type":"uses_module","w":0.9990231286122582},{"s":"code_module:10775","t":"project:32","type":"uses_module","w":0.9988507395438331},{"s":"code_module:399","t":"project:32","type":"uses_module","w":0.9984093280883503},{"s":"code_module:10762","t":"project:32","type":"uses_module","w":0.9974098564434769},{"s":"code_module:11812","t":"project:32","type":"uses_module","w":0.9969527722864434},{"s":"code_module:10657","t":"project:32","type":"uses_module","w":0.995782383787465},{"s":"code_module:399","t":"project:1","type":"uses_module","w":0.9931323163646896},{"s":"code_module:10661","t":"project:32","type":"uses_module","w":0.9931323163646896},{"s":"code_module:10996","t":"project:32","type":"uses_module","w":0.9931323163646896},{"s":"code_module:10995","t":"project:32","type":"uses_module","w":0.9919203721937524},{"s":"code_module:10997","t":"project:32","type":"uses_module","w":0.9919203721937524},{"s":"error:1","t":"project:33","type":"co_occurs","w":0.4472875},{"s":"solution:1","t":"error:1","type":"solves","w":0.34975},{"s":"solution:2","t":"error:2","type":"solves","w":0.34975},{"s":"solution:3","t":"error:3","type":"solves","w":0.34975},{"s":"error:2","t":"project:33","type":"co_occurs","w":0.23500000000000001},{"s":"error:3","t":"project:33","type":"co_occurs","w":0.23500000000000001},{"s":"error:4","t":"project:33","type":"co_occurs","w":0.23500000000000001},{"s":"error:5","t":"project:34","type":"co_occurs","w":0.23500000000000001},{"s":"error:6","t":"project:34","type":"co_occurs","w":0.23500000000000001},{"s":"error:7","t":"project:34","type":"co_occurs","w":0.23500000000000001},{"s":"error:8","t":"project:34","type":"co_occurs","w":0.23500000000000001},{"s":"error:9","t":"project:34","type":"co_occurs","w":0.23500000000000001},{"s":"error:10","t":"project:34","type":"co_occurs","w":0.23500000000000001},{"s":"error:11","t":"project:33","type":"co_occurs","w":0.23500000000000001},{"s":"error:12","t":"project:33","type":"co_occurs","w":0.23500000000000001},{"s":"error:13","t":"project:33","type":"co_occurs","w":0.23500000000000001},{"s":"error:14","t":"project:36","type":"co_occurs","w":0.23500000000000001},{"s":"code_module:1","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:2","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:3","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:4","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:5","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:6","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:7","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:8","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:9","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:10","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:11","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:12","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:13","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:14","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:15","t":"project:1","type":"co_occurs","w":0.1},{"s":"code_module:16","t":"project:1","type":"co_occurs","w":0.1},{"s":"solution:5","t":"error:5","type":"solves","w":0.1}];
|
|
453
|
+
const canvas = document.getElementById('synapse-graph');
|
|
454
|
+
if (!canvas || !edges.length) return;
|
|
455
|
+
const ctx = canvas.getContext('2d');
|
|
456
|
+
const container = canvas.parentElement;
|
|
457
|
+
let W, H, dpr;
|
|
458
|
+
let frame = 0;
|
|
459
|
+
|
|
460
|
+
const NODE_COLORS = {
|
|
461
|
+
error: '#ff5577', solution: '#3dffa0', code_module: '#b47aff',
|
|
462
|
+
project: '#ffb347', rule: '#5b9cff', antipattern: '#ff5577'
|
|
463
|
+
};
|
|
464
|
+
const EDGE_COLORS = {
|
|
465
|
+
co_occurs: ['#5b9cff','#47e5ff'], solves: ['#3dffa0','#5bff8a'],
|
|
466
|
+
uses_module: ['#b47aff','#7a5cff'], depends_on: ['#ff5577','#ffb347'],
|
|
467
|
+
caused_by: ['#ff5577','#ff8866']
|
|
468
|
+
};
|
|
469
|
+
const DEFAULT_COLOR = '#47e5ff';
|
|
470
|
+
|
|
471
|
+
// Build graph nodes & edges
|
|
472
|
+
const nodeMap = new Map();
|
|
473
|
+
const graphEdges = [];
|
|
474
|
+
for (const e of edges) {
|
|
475
|
+
if (!nodeMap.has(e.s)) nodeMap.set(e.s, { id: e.s, type: e.s.split(':')[0], x: 0, y: 0, vx: 0, vy: 0, connections: 0 });
|
|
476
|
+
if (!nodeMap.has(e.t)) nodeMap.set(e.t, { id: e.t, type: e.t.split(':')[0], x: 0, y: 0, vx: 0, vy: 0, connections: 0 });
|
|
477
|
+
nodeMap.get(e.s).connections++;
|
|
478
|
+
nodeMap.get(e.t).connections++;
|
|
479
|
+
graphEdges.push({ source: nodeMap.get(e.s), target: nodeMap.get(e.t), type: e.type, weight: e.w });
|
|
480
|
+
}
|
|
481
|
+
const nodes = [...nodeMap.values()];
|
|
482
|
+
|
|
483
|
+
function resize() {
|
|
484
|
+
dpr = window.devicePixelRatio || 1;
|
|
485
|
+
W = container.clientWidth;
|
|
486
|
+
H = 650;
|
|
487
|
+
canvas.width = W * dpr;
|
|
488
|
+
canvas.height = H * dpr;
|
|
489
|
+
canvas.style.width = W + 'px';
|
|
490
|
+
canvas.style.height = H + 'px';
|
|
491
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
492
|
+
}
|
|
493
|
+
resize();
|
|
494
|
+
window.addEventListener('resize', resize);
|
|
495
|
+
|
|
496
|
+
// Cluster initial positions by type for better layout
|
|
497
|
+
const typeGroups = {};
|
|
498
|
+
for (const n of nodes) {
|
|
499
|
+
if (!typeGroups[n.type]) typeGroups[n.type] = [];
|
|
500
|
+
typeGroups[n.type].push(n);
|
|
501
|
+
}
|
|
502
|
+
const types = Object.keys(typeGroups);
|
|
503
|
+
types.forEach((t, i) => {
|
|
504
|
+
const angle = (i / types.length) * Math.PI * 2;
|
|
505
|
+
const cx = W/2 + Math.cos(angle) * W * 0.2;
|
|
506
|
+
const cy = H/2 + Math.sin(angle) * H * 0.2;
|
|
507
|
+
for (const n of typeGroups[t]) {
|
|
508
|
+
n.x = cx + (Math.random() - 0.5) * W * 0.25;
|
|
509
|
+
n.y = cy + (Math.random() - 0.5) * H * 0.25;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
// Force simulation
|
|
514
|
+
const REPULSION = 4000;
|
|
515
|
+
const ATTRACTION = 0.006;
|
|
516
|
+
const DAMPING = 0.88;
|
|
517
|
+
const CENTER_GRAVITY = 0.0015;
|
|
518
|
+
let hovered = null;
|
|
519
|
+
let dragging = null;
|
|
520
|
+
let dragOff = {x:0,y:0};
|
|
521
|
+
|
|
522
|
+
function simulate() {
|
|
523
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
524
|
+
for (let j = i + 1; j < nodes.length; j++) {
|
|
525
|
+
let dx = nodes[i].x - nodes[j].x;
|
|
526
|
+
let dy = nodes[i].y - nodes[j].y;
|
|
527
|
+
let dist = Math.sqrt(dx*dx + dy*dy) || 1;
|
|
528
|
+
let force = REPULSION / (dist * dist);
|
|
529
|
+
let fx = (dx / dist) * force;
|
|
530
|
+
let fy = (dy / dist) * force;
|
|
531
|
+
nodes[i].vx += fx; nodes[i].vy += fy;
|
|
532
|
+
nodes[j].vx -= fx; nodes[j].vy -= fy;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
for (const e of graphEdges) {
|
|
536
|
+
let dx = e.target.x - e.source.x;
|
|
537
|
+
let dy = e.target.y - e.source.y;
|
|
538
|
+
let dist = Math.sqrt(dx*dx + dy*dy) || 1;
|
|
539
|
+
let force = (dist - 120) * ATTRACTION * e.weight;
|
|
540
|
+
let fx = (dx / dist) * force;
|
|
541
|
+
let fy = (dy / dist) * force;
|
|
542
|
+
e.source.vx += fx; e.source.vy += fy;
|
|
543
|
+
e.target.vx -= fx; e.target.vy -= fy;
|
|
544
|
+
}
|
|
545
|
+
for (const n of nodes) {
|
|
546
|
+
n.vx += (W/2 - n.x) * CENTER_GRAVITY;
|
|
547
|
+
n.vy += (H/2 - n.y) * CENTER_GRAVITY;
|
|
548
|
+
}
|
|
549
|
+
for (const n of nodes) {
|
|
550
|
+
if (n === dragging) continue;
|
|
551
|
+
n.vx *= DAMPING; n.vy *= DAMPING;
|
|
552
|
+
n.x += n.vx; n.y += n.vy;
|
|
553
|
+
n.x = Math.max(30, Math.min(W - 30, n.x));
|
|
554
|
+
n.y = Math.max(30, Math.min(H - 30, n.y));
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
function getNodeRadius(n) {
|
|
559
|
+
return Math.min(20, 4 + Math.sqrt(n.connections) * 3.5);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function draw() {
|
|
563
|
+
frame++;
|
|
564
|
+
ctx.clearRect(0, 0, W, H);
|
|
565
|
+
|
|
566
|
+
// Edges with gradient colors per type
|
|
567
|
+
for (const e of graphEdges) {
|
|
568
|
+
const alpha = 0.1 + e.weight * 0.4;
|
|
569
|
+
const colors = EDGE_COLORS[e.type] || ['#5b9cff','#47e5ff'];
|
|
570
|
+
const grad = ctx.createLinearGradient(e.source.x, e.source.y, e.target.x, e.target.y);
|
|
571
|
+
grad.addColorStop(0, colors[0] + Math.round(Math.min(0.7,alpha)*255).toString(16).padStart(2,'0'));
|
|
572
|
+
grad.addColorStop(1, colors[1] + Math.round(Math.min(0.7,alpha)*255).toString(16).padStart(2,'0'));
|
|
573
|
+
ctx.strokeStyle = grad;
|
|
574
|
+
ctx.lineWidth = 0.5 + e.weight * 2.5;
|
|
575
|
+
ctx.beginPath();
|
|
576
|
+
ctx.moveTo(e.source.x, e.source.y);
|
|
577
|
+
ctx.lineTo(e.target.x, e.target.y);
|
|
578
|
+
ctx.stroke();
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Nodes with ambient glow + pulse on hubs
|
|
582
|
+
for (const n of nodes) {
|
|
583
|
+
const r = getNodeRadius(n);
|
|
584
|
+
const color = NODE_COLORS[n.type] || DEFAULT_COLOR;
|
|
585
|
+
const isHover = n === hovered || n === dragging;
|
|
586
|
+
const isHub = n.connections >= 5;
|
|
587
|
+
|
|
588
|
+
// Ambient glow for all nodes
|
|
589
|
+
const glowSize = isHover ? 30 : (isHub ? 15 + Math.sin(frame * 0.03 + n.x) * 5 : 8);
|
|
590
|
+
ctx.shadowColor = color;
|
|
591
|
+
ctx.shadowBlur = glowSize;
|
|
592
|
+
|
|
593
|
+
// Outer ring for hubs
|
|
594
|
+
if (isHub || isHover) {
|
|
595
|
+
const pulseR = r + 3 + (isHub ? Math.sin(frame * 0.04 + n.y) * 2 : 0);
|
|
596
|
+
ctx.strokeStyle = color;
|
|
597
|
+
ctx.globalAlpha = isHover ? 0.6 : 0.25;
|
|
598
|
+
ctx.lineWidth = 1.5;
|
|
599
|
+
ctx.beginPath();
|
|
600
|
+
ctx.arc(n.x, n.y, pulseR, 0, Math.PI * 2);
|
|
601
|
+
ctx.stroke();
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Core node
|
|
605
|
+
ctx.globalAlpha = isHover ? 1 : 0.85;
|
|
606
|
+
ctx.fillStyle = color;
|
|
607
|
+
ctx.beginPath();
|
|
608
|
+
ctx.arc(n.x, n.y, r, 0, Math.PI * 2);
|
|
609
|
+
ctx.fill();
|
|
610
|
+
|
|
611
|
+
// Inner highlight (glossy effect)
|
|
612
|
+
ctx.globalAlpha = 0.3;
|
|
613
|
+
ctx.fillStyle = '#ffffff';
|
|
614
|
+
ctx.beginPath();
|
|
615
|
+
ctx.arc(n.x - r * 0.25, n.y - r * 0.25, r * 0.4, 0, Math.PI * 2);
|
|
616
|
+
ctx.fill();
|
|
617
|
+
|
|
618
|
+
ctx.globalAlpha = 1;
|
|
619
|
+
ctx.shadowBlur = 0;
|
|
620
|
+
|
|
621
|
+
// Labels
|
|
622
|
+
if (isHover || n.connections >= 4) {
|
|
623
|
+
const label = n.type === 'project' ? n.id.replace('project:','P') : n.id.split(':')[0];
|
|
624
|
+
ctx.fillStyle = '#e8eaf6';
|
|
625
|
+
ctx.font = (isHover ? 'bold 12px' : '10px') + ' Inter, system-ui, sans-serif';
|
|
626
|
+
ctx.textAlign = 'center';
|
|
627
|
+
ctx.globalAlpha = isHover ? 1 : 0.7;
|
|
628
|
+
ctx.fillText(isHover ? n.id : label, n.x, n.y - r - 8);
|
|
629
|
+
ctx.globalAlpha = 1;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
simulate();
|
|
633
|
+
requestAnimationFrame(draw);
|
|
634
|
+
}
|
|
635
|
+
draw();
|
|
636
|
+
|
|
637
|
+
// Interaction
|
|
638
|
+
const tooltip = document.getElementById('graph-tooltip');
|
|
639
|
+
function getNodeAt(mx, my) {
|
|
640
|
+
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
641
|
+
const n = nodes[i], r = getNodeRadius(n);
|
|
642
|
+
if (Math.hypot(mx - n.x, my - n.y) <= r + 4) return n;
|
|
643
|
+
}
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
function getPos(e) {
|
|
647
|
+
const rect = canvas.getBoundingClientRect();
|
|
648
|
+
return { x: e.clientX - rect.left, y: e.clientY - rect.top };
|
|
649
|
+
}
|
|
650
|
+
canvas.addEventListener('mousemove', function(e) {
|
|
651
|
+
const p = getPos(e);
|
|
652
|
+
if (dragging) {
|
|
653
|
+
dragging.x = p.x + dragOff.x;
|
|
654
|
+
dragging.y = p.y + dragOff.y;
|
|
655
|
+
dragging.vx = 0; dragging.vy = 0;
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const n = getNodeAt(p.x, p.y);
|
|
659
|
+
hovered = n;
|
|
660
|
+
canvas.style.cursor = n ? 'pointer' : 'grab';
|
|
661
|
+
if (n) {
|
|
662
|
+
const conns = graphEdges.filter(e => e.source === n || e.target === n);
|
|
663
|
+
const types = {};
|
|
664
|
+
conns.forEach(c => { types[c.type] = (types[c.type]||0)+1; });
|
|
665
|
+
const typeStr = Object.entries(types).map(([t,c]) => t+': '+c).join(', ');
|
|
666
|
+
tooltip.innerHTML = '<strong>' + n.id + '</strong><br>' + conns.length + ' connections<br><span style="color:var(--text3);font-size:.75rem">' + typeStr + '</span>';
|
|
667
|
+
tooltip.style.display = 'block';
|
|
668
|
+
tooltip.style.left = (p.x + 15) + 'px';
|
|
669
|
+
tooltip.style.top = (p.y - 10) + 'px';
|
|
670
|
+
} else {
|
|
671
|
+
tooltip.style.display = 'none';
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
canvas.addEventListener('mousedown', function(e) {
|
|
675
|
+
const p = getPos(e);
|
|
676
|
+
const n = getNodeAt(p.x, p.y);
|
|
677
|
+
if (n) {
|
|
678
|
+
dragging = n;
|
|
679
|
+
dragOff = { x: n.x - p.x, y: n.y - p.y };
|
|
680
|
+
canvas.style.cursor = 'grabbing';
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
canvas.addEventListener('mouseup', function() { dragging = null; });
|
|
684
|
+
canvas.addEventListener('mouseleave', function() { dragging = null; hovered = null; tooltip.style.display = 'none'; });
|
|
685
|
+
})();
|
|
686
|
+
</script>
|
|
687
|
+
</body>
|
|
688
|
+
</html>
|