Skip to content

useParallax

Create parallax effect easily. It uses useDeviceOrientation and fallback to useMouse if orientation is not supported.

Demo

This is a .md using a custom component

Credit of images to Jarom Vogel

Usage

vue
<script setup>
import { useParallax } from './'

const container = ref(null)
const { tilt, roll, source } = useParallax(container)
</script>

<template>
  <div ref="container" />
</template>