arturbien / 3D-image

🏄 3D images on your website (just like those on Facebook!)
https://arturbien.github.io/3D-image/
102 stars 10 forks source link

Fallback to scroll-based movement if DeviceOrientation not available #1

Open arturbien opened 5 years ago

arturbien commented 5 years ago

iOS Safari has device sensors disabled by default. In such case (or when DeviceOrientation API is not supported ), fall back to scroll based image movement- when image appears in the viewport, animate vector values X and Y from -0.5 to 0.5 along some kind of bezier curve to achieve smooth parallax effect until image disappears from the viewport