8000 GitHub - DongGukMon/TiltHologramCard · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

34 stars

Watchers

0 watching

Forks

Repository files navigation

🃏 TiltHologramCard

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.

✨ Features

  • 🎯 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

🎬 Demo

Step 1: Basic 3D Tilt Effect

Basic Tilt

Device gyroscope controls card rotation in 3D space

Step 2: Light Reflection

Light Effect

Dynamic light gradients move with card orientation

Step 3: Hologram Background

Hologram Background

Rainbow gradient overlay creates holographic base effect

Step 4: Pattern Masking

Pattern Mask

Custom hologram pattern applied through image masking

Step 5: Final Result

Final Result

Complete hologram effect that responds to light and tilt

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Expo CLI
  • iOS/Android development environment

Installation

# Clone the repository
git clone https://github.com/your-username/TiltHologramCard.git
cd TiltHologramCard

# Install dependencies
npm install

# Start the development server
npx expo start

Android Setup

For smooth 60fps animations on Android, add the high sampling rate permission:

// app.json
{
  "expo": {
    "android": {
      "permissions": ["android.permission.HIGH_SAMPLING_RATE_SENSORS"]
    }
  }
}

🛠️ Technical Implementation

Core Technologies

How It Works

  1. Gyroscope Integration: Device motion data converted to rotation angles

    rotateX.value = clamp(
      rotateX.value + (gyroscopeData.x / 2) * dt * RAD2DEG,
      -maxAngle, maxAngle
    );
  2. 3D Transforms: Perspective and rotation applied to card container

    transform: [
      { perspective: 500 },
      { rotateX: `${rotateX.value}deg` },
      { rotateY: `${rotateY.value}deg` }
    ]
  3. 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))
    }));
  4. Hologram Masking: Luminance-based masking for realistic effects

    <Mask mode="luminance" mask={lightGradient}>
      <Image image={hologramPattern} />
      <RainbowGradient />
    </Mask>

🙏 Acknowledgments


Bring your cards to life with realistic holographic effects! 🌈✨

About

No description, website, or topics provided.

Resources

Stars

34 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0