import type { HexGridBackgroundProps } from '@dangerousthings/hex-background'; import { Section } from '../components/Section'; const DEFAULTS: Required = { opacity: 0.5, hexRadius: 0.5, margin: 0.05, maxHeight: 3, animationInterval: 1500, cameraSpeed: 0.02, cameraRadius: 8, fov: 40, }; interface SliderConfig { key: keyof HexGridBackgroundProps; label: string; min: number; max: number; step: number; } const sliders: SliderConfig[] = [ { key: 'opacity', label: 'Opacity', min: 0, max: 1, step: 0.05 }, { key: 'hexRadius', label: 'Hex Radius', min: 0.1, max: 2, step: 0.1 }, { key: 'margin', label: 'Margin', min: 0, max: 0.5, step: 0.01 }, { key: 'maxHeight', label: 'Max Height', min: 0.5, max: 10, step: 0.5 }, { key: 'animationInterval', label: 'Animation Interval (ms)', min: 200, max: 5000, step: 100 }, { key: 'cameraSpeed', label: 'Camera Speed', min: 0, max: 0.2, step: 0.005 }, { key: 'cameraRadius', label: 'Camera Radius', min: 3, max: 20, step: 0.5 }, { key: 'fov', label: 'Field of View', min: 20, max: 90, step: 1 }, ]; interface HexBackgroundPageProps { hexProps: HexGridBackgroundProps; onHexPropsChange: (props: HexGridBackgroundProps) => void; } export function HexBackgroundPage({ hexProps, onHexPropsChange }: HexBackgroundPageProps) { const handleChange = (key: keyof HexGridBackgroundProps, value: number) => { onHexPropsChange({ ...hexProps, [key]: value }); }; const handleReset = () => { onHexPropsChange({ ...DEFAULTS }); }; return ( <>

Hex Background

3D hexagon grid background powered by Three.js + React Three Fiber. Adjust parameters below — changes apply to the global background in real time.

{sliders.map(({ key, label, min, max, step }) => (
{hexProps[key] ?? DEFAULTS[key]}
))}
{`import { HexGridBackground } from '@dangerousthings/hex-background'; // Full-viewport fixed background (renders behind content) `}
); }