Nuxt Parallax

A nuxt module that installs the directive "v-parallax" for a quick and easy parallax effect.
Quick Setup
- Add
nuxt-parallax
dependency to your project
pnpm add -D nuxt-parallax
yarn add --dev nuxt-parallax
npm install --save-dev nuxt-parallax
- Add
nuxt-parallax
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-parallax'
]
})
That's it! You can now use Nuxt Parallax in your Nuxt app ✨
Usage
Please note: If you encounter an issue where elements with the parallax effect overlap other elements, you can fix this by applying position: relative
to the overlapped elements. This adjusts the stacking context and prevents the parallax elements from overlaying other elements, that are rendered later in the markdown. Some elements have position: static
applied to them by default, which won't work.
Add the directive to any element like this: <div v-parallax="{ speed: 0.5 }">Hello World!</div>
Pass in the options as an object.
Options
Currently, the vertical speed is the only option. More may be added in the future.
Those are all of the available options, with their default values:
{
speed: 1
}
Development
npm install
npm run dev:prepare
npm run dev
npm run dev:build
npm run lint
npm run test
npm run test:watch
npm run release