Skip to content

apertureless/vue-parallax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

vue-parallax

Is a compontent for fast 60fps parallax scroll effects in vue 2.

Demo

Demo here

Install

npm install vue-parallax or yarn add vue-parallax

Usage

vue-parallax works with slots. So you can pass an image or even srcsets for better mobile experiences.

// Image.vue <template> <parallax> <img src="path/cool-background-image.jpg" alt="very cool bg"> </parallax> </template> <script> import Parallax from 'vue-parallax' export default { components: { Parallax } } </script>

Props

Prop Type Default Value Description
parallax Boolean true Activates parallax effect
speedFactor Number 0.15 factor on how strong the effect is
fixed Boolean false Other parallax effect. Image is fixed in position
sectionHeight Number 70 section height for mobile
breakpoint String '(min-width: 968px)' Media query for mobile deactivation

Build Setup

# install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # run unit tests npm run unit # run all tests npm test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

Contributing

  1. Fork it ( https://github.com/apertureless/vue-parallax/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

This software is distributed under MIT license.

About

๐ŸŒŒ Vue.js component for parallax image scroll effects

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •