Overview of the border-beam porting strategy
mainThe border-beam project is being ported from Web to iOS (SwiftUI) and React Native to provide high-fidelity, hardware-accelerated visual effects across platforms.
Core Design Principles:
- Platform-neutral specification: All visual data (gradient palettes, pulse geometry, oscillator tables, and mask geometry) is stored in a central
spec/beam-spec.json. Both iOS and React Native ports consume code generated from this spec to ensure visual parity. - Hardware Acceleration:
- iOS: Uses SwiftUI with Metal shaders via
CanvasandShader(layerEffect). - React Native: Uses
@shopify/react-native-skiaandreact-native-reanimatedto run SkSL shaders and UI-thread animation loops.
- iOS: Uses SwiftUI with Metal shaders via
- Visual Fidelity: The goal is pixel-close parity with the web version, using the web demo as the visual reference. This includes reproducing specific CSS filter behaviors (like
hue-rotatematrices) and complex gradient falloffs in shaders.