Fibonacci Sphere with React Native Skia 🌐
Wednesday, January 10, 2024
demos
fibonacci-shader
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A shader-based animation that creates circular patterns using Fibonacci-like sequences.
What's This About?
This component creates a shader effect that:
Generates circular patterns
Allows pattern customization
Uses performance scaling
Supports interactive controls
Animates continuously
Technical Implementation
The component uses:
Skia for shader rendering
Runtime shader compilation
Performance optimization
Reanimated for timing
Dynamic uniforms
Usage
// Basic usage
<FibonacciShader />;
// Component parameters
const RESCALE_FACTOR = 4; // Performance vs quality
const MAX_CIRCLES_AMOUNT = 350; // Maximum circles to render
// Shader controls
const N = useSharedValue(5.0); // Number of circles
const magicalMul = useSharedValue(2.4); // Pattern multiplier
// Animation timing
iTime.value = withRepeat(
withTiming(15, {
duration: 20000,
easing: Easing.linear,
}),
-1,
true
);
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Fibonacci Shader
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback