Initial commit after recreate
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
import { type GlitchComponentProps } from './types';
|
||||
type ComponentDevUiOverrides = {
|
||||
showNumericDiagnostics?: boolean;
|
||||
compactNumericDiagnostics?: boolean;
|
||||
onOpenHarness?: () => void;
|
||||
onSetParam?: (name: 'complexity' | 'speedup', value: number) => void;
|
||||
maxComplexity?: number;
|
||||
maxSpeedup?: number;
|
||||
};
|
||||
type ComponentProps = GlitchComponentProps & {
|
||||
devUi?: ComponentDevUiOverrides;
|
||||
};
|
||||
export default function Component(props: ComponentProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,10 @@
|
||||
interface DiophantineVectorsProps {
|
||||
complexity: number;
|
||||
lightlanes?: boolean;
|
||||
radius?: number;
|
||||
distance?: number;
|
||||
allSectors?: boolean;
|
||||
cumulative?: boolean;
|
||||
}
|
||||
export declare function DiophantineVectors({ complexity, lightlanes, radius, distance, allSectors, cumulative }: DiophantineVectorsProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { GlitchHostBridge } from '../types';
|
||||
interface FanoSweepPanelProps {
|
||||
radius: number;
|
||||
distance: number;
|
||||
chandraDistance: number;
|
||||
allSectors: boolean;
|
||||
cumulative: boolean;
|
||||
theta: number;
|
||||
phi: number;
|
||||
orbitSpeed: number;
|
||||
thetaDrift: number;
|
||||
thetaJitter: number;
|
||||
phiJitter: number;
|
||||
K: number;
|
||||
speedup: number;
|
||||
usePoisson: boolean;
|
||||
bottomInset?: number;
|
||||
onBack?: () => void;
|
||||
host?: GlitchHostBridge;
|
||||
}
|
||||
export declare function FanoSweepPanel(props: FanoSweepPanelProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,12 @@
|
||||
import { type MutableRefObject } from 'react';
|
||||
interface OrbitingObjectProps {
|
||||
radius: number;
|
||||
theta: number;
|
||||
phi: number;
|
||||
orbitTime: MutableRefObject<number>;
|
||||
simTime?: MutableRefObject<number>;
|
||||
thetaDrift?: number;
|
||||
paused?: boolean;
|
||||
}
|
||||
export declare function OrbitingObject({ radius, theta, phi, orbitTime, simTime, thetaDrift, paused }: OrbitingObjectProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,3 @@
|
||||
export declare function PoissonShell({ radius }: {
|
||||
radius: number;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
@@ -0,0 +1,6 @@
|
||||
interface PulsingSphereProps {
|
||||
radius: number;
|
||||
paused?: boolean;
|
||||
}
|
||||
export declare function PulsingSphere({ radius, paused }: PulsingSphereProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { GlitchHostBridge, SceneViewMode } from '../types';
|
||||
interface SamplingSystemProps {
|
||||
complexity: number;
|
||||
radius: number;
|
||||
distance: number;
|
||||
theta: number;
|
||||
phi: number;
|
||||
observationMode: 'orbit' | 'randomSphere';
|
||||
allSectors: boolean;
|
||||
cumulative: boolean;
|
||||
K: number;
|
||||
orbitRadius: number;
|
||||
orbitVelocity: number;
|
||||
thetaDrift: number;
|
||||
thetaJitter: number;
|
||||
phiJitter: number;
|
||||
usePoisson: boolean;
|
||||
speedup: number;
|
||||
paused: boolean;
|
||||
sceneView: SceneViewMode;
|
||||
bottomInset?: number;
|
||||
showNumericDiagnostics?: boolean;
|
||||
compactNumericDiagnostics?: boolean;
|
||||
host?: GlitchHostBridge;
|
||||
centerDistribution?: boolean;
|
||||
hideFlyingBars?: boolean;
|
||||
}
|
||||
export declare function SamplingSystem({ complexity, radius, distance, theta, phi, observationMode, allSectors, cumulative, K, orbitRadius, orbitVelocity, thetaDrift, thetaJitter, phiJitter, usePoisson, speedup, paused, sceneView, bottomInset, showNumericDiagnostics, compactNumericDiagnostics, host, centerDistribution, hideFlyingBars }: SamplingSystemProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,6 @@
|
||||
interface TargetDiscProps {
|
||||
radius: number;
|
||||
distance: number;
|
||||
}
|
||||
export declare function TargetDisc({ radius, distance }: TargetDiscProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
@@ -0,0 +1,7 @@
|
||||
interface VectorArrowProps {
|
||||
vector: [number, number, number];
|
||||
origin?: [number, number, number];
|
||||
color?: string;
|
||||
}
|
||||
export declare function VectorArrow({ vector, origin, color }: VectorArrowProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import './dev-theme.css';
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { GlitchHostBridge } from './types';
|
||||
export type DevHostBridgeOptions = {
|
||||
isMuted?: () => boolean;
|
||||
onSound?: (id: string, payload?: Record<string, unknown>) => void;
|
||||
onEmit?: (type: string, payload?: unknown) => void;
|
||||
};
|
||||
export declare function createDevHostBridge(options?: DevHostBridgeOptions): GlitchHostBridge;
|
||||
export declare function attachWindowSoundBridge(host: GlitchHostBridge): () => void;
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"componentId": "lightlane",
|
||||
"displayName": "Lightlane Challenge",
|
||||
"version": "0.1.0",
|
||||
"folderName": "glitch_lightlane",
|
||||
"packageName": "@nommo/lightlane",
|
||||
"entry": "dist/lightlane.js",
|
||||
"source": "src/index.tsx",
|
||||
"tags": [
|
||||
"glitch-component",
|
||||
"reference",
|
||||
"3d"
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import type { GlitchHostBridge } from './types';
|
||||
export declare const HOST_SOUND_EVENT = "glitch:play-sound";
|
||||
export declare const HOST_STOP_SOUND_EVENT = "glitch:stop-sound";
|
||||
export declare const HOST_EMIT_PREFIX = "glitch:host:";
|
||||
export declare const SOUND_IDS: {
|
||||
readonly click: "ui.button_click";
|
||||
readonly hover: "ui.button_hover";
|
||||
readonly computeStart: "machine.compute_start";
|
||||
readonly computeStep: "machine.compute_step";
|
||||
readonly computeDone: "machine.compute_done";
|
||||
readonly verdictStable: "machine.verdict_stable";
|
||||
readonly verdictAlert: "machine.verdict_alert";
|
||||
};
|
||||
export type SoundId = (typeof SOUND_IDS)[keyof typeof SOUND_IDS];
|
||||
export declare function safePlaySound(host: GlitchHostBridge | undefined, id: string, payload?: Record<string, unknown>): void;
|
||||
export declare function safeStopSound(host: GlitchHostBridge | undefined, id: string, payload?: Record<string, unknown>): void;
|
||||
export declare function safeEmit(host: GlitchHostBridge | undefined, type: string, payload?: unknown): void;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import Component from './Component';
|
||||
import { type GlitchComponentMetadata } from './types';
|
||||
export default Component;
|
||||
export declare const metadata: GlitchComponentMetadata;
|
||||
export type { GlitchComponentProps, GlitchComponentConfig, GlitchComponentResult, GlitchHostBridge } from './types';
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+94
@@ -0,0 +1,94 @@
|
||||
export interface Config {
|
||||
complexity: number;
|
||||
radius: number;
|
||||
distance: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
orbitSpeed?: number;
|
||||
usePoisson?: boolean;
|
||||
}
|
||||
export interface Preset {
|
||||
name: string;
|
||||
description: string;
|
||||
duration: number;
|
||||
start: Config;
|
||||
end: Config;
|
||||
}
|
||||
export declare const presets: Preset[];
|
||||
export declare const namedPresets: {
|
||||
"Iso: High Complexity": {
|
||||
complexity: number;
|
||||
distance: number;
|
||||
orbitSpeed: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
radius: number;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
usePoisson?: boolean;
|
||||
};
|
||||
"Iso: Fast Orbit": {
|
||||
complexity: number;
|
||||
distance: number;
|
||||
orbitSpeed: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
radius: number;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
usePoisson?: boolean;
|
||||
};
|
||||
"Iso: Optimal": {
|
||||
complexity: number;
|
||||
distance: number;
|
||||
orbitSpeed: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
radius: number;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
usePoisson?: boolean;
|
||||
};
|
||||
"Aniso: Low Complexity": {
|
||||
complexity: number;
|
||||
distance: number;
|
||||
orbitSpeed: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
radius: number;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
usePoisson?: boolean;
|
||||
};
|
||||
"Aniso: Slow Speed": {
|
||||
complexity: number;
|
||||
distance: number;
|
||||
orbitSpeed: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
radius: number;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
usePoisson?: boolean;
|
||||
};
|
||||
"Aniso: High Distance": {
|
||||
complexity: number;
|
||||
distance: number;
|
||||
orbitSpeed: number;
|
||||
lightlanes: boolean;
|
||||
allSectors: boolean;
|
||||
radius: number;
|
||||
cumulative: boolean;
|
||||
phi: number;
|
||||
theta: number;
|
||||
usePoisson?: boolean;
|
||||
};
|
||||
};
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
export type SceneViewMode = 'both' | 'poisson' | 'lightlane';
|
||||
export interface LightlaneProps {
|
||||
complexity?: number;
|
||||
radius?: number;
|
||||
distance?: number;
|
||||
chandraDistance?: number;
|
||||
showAxes?: boolean;
|
||||
lightlanes?: boolean;
|
||||
allSectors?: boolean;
|
||||
cumulative?: boolean;
|
||||
phi?: number;
|
||||
theta?: number;
|
||||
observationMode?: 'orbit' | 'randomSphere';
|
||||
orbitSpeed?: number;
|
||||
thetaDrift?: number;
|
||||
thetaJitter?: number;
|
||||
phiJitter?: number;
|
||||
speedup?: number;
|
||||
K?: number;
|
||||
usePoisson?: boolean;
|
||||
sceneView?: SceneViewMode;
|
||||
hideScenePresentation?: boolean;
|
||||
hideFlyingBars?: boolean;
|
||||
hideDataBoxes?: boolean;
|
||||
}
|
||||
export declare const defaultProps: Required<LightlaneProps>;
|
||||
export interface GlitchComponentConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string;
|
||||
params: Record<string, unknown>;
|
||||
}
|
||||
export interface GlitchHostBridge {
|
||||
playSound?: (id: string, payload?: Record<string, unknown>) => void;
|
||||
stopSound?: (id: string, payload?: Record<string, unknown>) => void;
|
||||
emit?: (type: string, payload?: unknown) => void;
|
||||
}
|
||||
export interface GlitchTheme {
|
||||
primary: string;
|
||||
accent: string;
|
||||
bg: string;
|
||||
bgSecondary: string;
|
||||
text: string;
|
||||
textMuted: string;
|
||||
border: string;
|
||||
}
|
||||
export interface GlitchComponentResult {
|
||||
success: boolean;
|
||||
score?: number;
|
||||
data?: unknown;
|
||||
error?: string;
|
||||
}
|
||||
export interface GlitchComponentProps {
|
||||
config: GlitchComponentConfig;
|
||||
onComplete: (result: GlitchComponentResult) => void;
|
||||
onProgress?: (percent: number) => void;
|
||||
theme?: GlitchTheme;
|
||||
className?: string;
|
||||
host?: GlitchHostBridge;
|
||||
}
|
||||
export interface ParamSchema {
|
||||
[key: string]: {
|
||||
type: 'number' | 'string' | 'boolean' | 'color' | 'select' | 'range';
|
||||
label?: string;
|
||||
description?: string;
|
||||
default: unknown;
|
||||
options?: {
|
||||
value: string | number;
|
||||
label: string;
|
||||
}[];
|
||||
min?: number;
|
||||
max?: number;
|
||||
step?: number;
|
||||
};
|
||||
}
|
||||
export interface GlitchComponentMetadata {
|
||||
name: string;
|
||||
displayName: string;
|
||||
version: string;
|
||||
paramSchema: ParamSchema;
|
||||
defaultParams: Record<string, unknown>;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export type Vector3Tuple = [number, number, number];
|
||||
export declare function getVectors(complexity: number, allSectors?: boolean): Vector3Tuple[];
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
Reference in New Issue
Block a user