All Projects → munrocket → parallax-effect

munrocket / parallax-effect

Licence: MIT license
🤹🏻‍♂️ Parallax effect in javascript using face tracking. An immersive view in 3d with webcam.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to parallax-effect

Vue Prlx
🔮 Vue.js parallax directive you were looking for (can animate translate & background-position)
Stars: ✭ 140 (-53.18%)
Mutual labels:  parallax
Backgroundvideo
A lightweight parallax background video solution that behaves like the CSS3 property, background-size: cover
Stars: ✭ 234 (-21.74%)
Mutual labels:  parallax
hongkong
A parallax scroll effect plugin
Stars: ✭ 46 (-84.62%)
Mutual labels:  parallax
React Parallax Component
Easiest way to add scroll parallax effect on the component
Stars: ✭ 143 (-52.17%)
Mutual labels:  parallax
Aksidemenu
Beautiful iOS side menu library with parallax effect. Written in Swift
Stars: ✭ 216 (-27.76%)
Mutual labels:  parallax
Parallaxrecyclerview
Parallax effect on every item of your RecyclerView.
Stars: ✭ 237 (-20.74%)
Mutual labels:  parallax
React Lazy Hero
⚡️ A hero component for React
Stars: ✭ 134 (-55.18%)
Mutual labels:  parallax
BelecoLiveWallpaper
An Android live wallpaper with parallax effect.
Stars: ✭ 74 (-75.25%)
Mutual labels:  parallax
Rvparallaximageview
RvParallaxImageView用在recyclerview的item中,它可以随着recyclerview进行视差效果的移动,进而可以在一个小区域的item中展示一个完整的图片。适用于在recyclerview的item中显示大的广告图。
Stars: ✭ 224 (-25.08%)
Mutual labels:  parallax
newstagram
Simple iOS news feed app where you can customize categories and regions.
Stars: ✭ 16 (-94.65%)
Mutual labels:  parallax
Jztvosparallaxbutton
📺 tvOS Button with Parallax Effect (ObjC)
Stars: ✭ 161 (-46.15%)
Mutual labels:  parallax
React Native Stretchy
🤸‍♀️A ReactNative scrollable stretchy header component
Stars: ✭ 216 (-27.76%)
Mutual labels:  parallax
React Parallax Tilt
👀 Easily apply tilt hover effect on React components - lightweight/zero dependencies
Stars: ✭ 243 (-18.73%)
Mutual labels:  parallax
Mpparallaxview
Apple TV Parallax effect in Swift.
Stars: ✭ 1,727 (+477.59%)
Mutual labels:  parallax
doodle-android
Colorful live wallpapers with auto dark mode and power-efficient animations
Stars: ✭ 440 (+47.16%)
Mutual labels:  parallax
Arsegmentpager
segment tab controller with parallax Header
Stars: ✭ 1,691 (+465.55%)
Mutual labels:  parallax
Slidemenulayout
🔥An android slide menu that supports left and right swipes and slides with parallax.(一个支持左右滑动并带有视差滑动效果的安卓侧滑菜单控件.仿[QQ/探探侧滑])
Stars: ✭ 235 (-21.4%)
Mutual labels:  parallax
DrinksGalleryApp
Xamarin.Forms goodlooking UI sample using the new CarouselView (Parallax).
Stars: ✭ 51 (-82.94%)
Mutual labels:  parallax
smooth-parallax
Smooth Parallax makes it a lot easier to move objects when the page scroll with ease.
Stars: ✭ 66 (-77.93%)
Mutual labels:  parallax
universal-parallax
Easy parallax plugin using pure javascript. Also works on mobile platforms. Cross browser support.
Stars: ✭ 107 (-64.21%)
Mutual labels:  parallax

parallax-effect bundlephobia

Parallax effect in javascript using face tracking, can be a good improvement for 3d scenes. This library uses TFJS with WASM backend on CPU, so your GPU will be free. Supports lazy loading.

Inspired by @lucknknock C# demo

Live examples

Installation

Run npm install parallax-effect and import it as ES module

  import * as Parallax from '../dist/parallax-effect.mjs';
  Parallax.init( view => {
    console.log( view );
  } );

or add it in script tag

  <script src="https://cdn.jsdelivr.net/npm/parallax-effect/dist/parallax-effect.min.js"></script>
  <script>
    Parallax.init( view => {
      console.log( view );
    } );
  </script>

Usage

View in code below is a 3d vector with components similar to spherical coordinates: x/y in range [-1, 1] and proportional to angle, z is proportional to distance from camera to head. Also you can check for successfull init or change default settings: smoothing, default distance between eyes to change z, threshold in blazeface model or change tfjs source links from jsdelivr to unpkg / own server.

Parallax.init(
  view => {
    console.log( view.x, view.y, view.z );
  }, {
    smoothEye: 0.8, // smoothing eye (x, y)
    smoothDist: 0.25, // smoothing distance (z)
    defautDist: 0.12, // parameter for distance estimation
    threshold = 0.85 // blazeface detection probability
  }
).then( rafId => {
  console.log( 'cancelAnimationFrame(' + rafId + ')' );
}).catch( errorMessage => {
  console.log( errorMessage );
} );

Roadmap

  • smoothing head detection with EMA
  • support for iOS/Macs
  • lazy load for tfjs
  • three.js/pixi.js examples
  • mouse fallback
  • fix head rotation but not commit it in main branch yet
  • gyroscope fallback

Contribution

Feel free to make issues or/and contribute.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].