useParallax

useParallax

簡単にパララックス効果を作成します。useDeviceOrientation を使用し、オリエンテーションがサポートされていない場合は useMouse にフォールバックします。

使用法

<script setup lang="ts">
import { useParallax } from '@vueuse/core'

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

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