A React Native component that creates stunning holographic card effects using device gyroscope sensors. Inspired by the famous Pokémon card interaction website and React Native Shader Card, this project brings real-time 3D tilt and hologram effects to mobile apps.
- 🎯 Gyroscope-based 3D tilt effects - Real-time device motion detection
- 💎 Dynamic hologram patterns - Rainbow gradients with custom mask support
- ✨ Light reflection effects - Realistic light movement across card surface
- 🎮 Smooth 60fps animations - Optimized performance with React Native Reanimated
- 📱 Cross-platform support - Works on both iOS and Android
Device gyroscope controls card rotation in 3D space
Dynamic light gradients move with card orientation
Rainbow gradient overlay creates holographic base effect
Custom hologram pattern applied through image masking
Complete hologram effect that responds to light and tilt
- Node.js 18+
- Expo CLI
- iOS/Android development environment
# Clone the repository
git clone https://github.com/your-username/TiltHologramCard.git
cd TiltHologramCard
# Install dependencies
npm install
# Start the development server
npx expo startFor smooth 60fps animations on Android, add the high sampling rate permission:
// app.json
{
"expo": {
"android": {
"permissions": ["android.permission.HIGH_SAMPLING_RATE_SENSORS"]
}
}
}- React Native Reanimated - Smooth 60fps animations
- Expo Sensors - Gyroscope data access
- React Native Skia - High-performance graphics rendering
-
Gyroscope Integration: Device motion data converted to rotation angles
rotateX.value = clamp( rotateX.value + (gyroscopeData.x / 2) * dt * RAD2DEG, -maxAngle, maxAngle );
-
3D Transforms: Perspective and rotation applied to card container
transform: [ { perspective: 500 }, { rotateX: `${rotateX.value}deg` }, { rotateY: `${rotateY.value}deg` } ]
-
Dynamic Gradients: Light effects calculated based on tilt angles
const gradientStart = useDerivedValue(() => ({ x: -width + (width/2 + (width/2) * (rotateY.value/maxAngle)), y: -height + (height/2 + (height/2) * (rotateX.value/maxAngle)) }));
-
Hologram Masking: Luminance-based masking for realistic effects
<Mask mode="luminance" mask={lightGradient}> <Image image={hologramPattern} /> <RainbowGradient /> </Mask>
- Inspired by Pokémon card interaction website for the original holographic card concept
- Heavily based on React Native Shader Card - the main technical foundation for this implementation
- Gyroscope hologram UI tweet for gyroscope-based interaction inspiration
- Special thanks to Claude for the great help with writing the README.
Bring your cards to life with realistic holographic effects! 🌈✨