All Projects → marrio-h → universal-parallax

marrio-h / universal-parallax

Licence: MIT license
Easy parallax plugin using pure javascript. Also works on mobile platforms. Cross browser support.

Projects that are alternatives of or similar to universal-parallax

Perspective
🖼Parallax scrolling effect. And more.
Stars: ✭ 80 (-25.23%)
Mutual labels:  parallax, vanilla-javascript, parallax-scrolling, parallax-javascript-library
smooth-parallax
Smooth Parallax makes it a lot easier to move objects when the page scroll with ease.
Stars: ✭ 66 (-38.32%)
Mutual labels:  parallax, parallax-scrolling, parallax-javascript-library
react-rellax
React Parallax component using Rellax.js
Stars: ✭ 39 (-63.55%)
Mutual labels:  parallax, parallax-scrolling, parallax-javascript-library
Rallax.js
Dead simple parallax scrolling.
Stars: ✭ 1,441 (+1246.73%)
Mutual labels:  parallax, vanilla-javascript, parallax-scrolling
Parallaxie
Easiest, Responsive and Customizable Parallax jQuery Plugin
Stars: ✭ 65 (-39.25%)
Mutual labels:  parallax, parallax-scrolling, parallax-javascript-library
hongkong
A parallax scroll effect plugin
Stars: ✭ 46 (-57.01%)
Mutual labels:  parallax, parallax-scrolling
React Lazy Hero
⚡️ A hero component for React
Stars: ✭ 134 (+25.23%)
Mutual labels:  parallax
Aksidemenu
Beautiful iOS side menu library with parallax effect. Written in Swift
Stars: ✭ 216 (+101.87%)
Mutual labels:  parallax
Flutter Ui Designs
Just collection of UI designs build with flutter. Can run on any mobile, web & desktop.
Stars: ✭ 131 (+22.43%)
Mutual labels:  parallax
React Scroll Parallax
🔮 React components to create parallax scroll effects for banners, images or any other DOM elements
Stars: ✭ 1,699 (+1487.85%)
Mutual labels:  parallax
js-plugin-starter-kit
VanillaJS (pure JavaScript) plugin starter with Webpack 4 and Babel 7.
Stars: ✭ 100 (-6.54%)
Mutual labels:  vanilla-javascript
Parallaxrecyclerview
Parallax effect on every item of your RecyclerView.
Stars: ✭ 237 (+121.5%)
Mutual labels:  parallax
Flutter parallax scroll
Flutter UI challenge- Parallax scroll effect
Stars: ✭ 172 (+60.75%)
Mutual labels:  parallax
Arsegmentpager
segment tab controller with parallax Header
Stars: ✭ 1,691 (+1480.37%)
Mutual labels:  parallax
Rvparallaximageview
RvParallaxImageView用在recyclerview的item中,它可以随着recyclerview进行视差效果的移动,进而可以在一个小区域的item中展示一个完整的图片。适用于在recyclerview的item中显示大的广告图。
Stars: ✭ 224 (+109.35%)
Mutual labels:  parallax
React Stickyroll
A react implementation of stickyroll (original)
Stars: ✭ 132 (+23.36%)
Mutual labels:  parallax
React Parallax Tilt
👀 Easily apply tilt hover effect on React components - lightweight/zero dependencies
Stars: ✭ 243 (+127.1%)
Mutual labels:  parallax
Universal Tilt.js
🎆 Parallax tilt effect library
Stars: ✭ 117 (+9.35%)
Mutual labels:  parallax
Jztvosparallaxbutton
📺 tvOS Button with Parallax Effect (ObjC)
Stars: ✭ 161 (+50.47%)
Mutual labels:  parallax
Slidemenulayout
🔥An android slide menu that supports left and right swipes and slides with parallax.(一个支持左右滑动并带有视差滑动效果的安卓侧滑菜单控件.仿[QQ/探探侧滑])
Stars: ✭ 235 (+119.63%)
Mutual labels:  parallax

npm version Package Quality

Universal Parallax

Easy parallax plugin using pure javascript. Lightweight (2kb) and cross browser compatibility - including mobile platforms (iOS, Android).

See demo

Features

  • Easy setup
  • Pure JavaScript
  • Adaptive height
  • Works on mobile devices
  • Lightweight (2kb minified)

💾 Install

$ npm i universal-parallax -S

🚀 Setup

#1

Choose between:

  • Include this in your <head> section
<link href="node_modules/universal-parallax/dist/universal-parallax.min.css" rel="stylesheet">
  • Or add this CSS
.parallax__container {
	clip: rect(0, auto, auto, 0);
	height: 100%;
	left: 0;
	overflow: hidden;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: -100;
}

.parallax {
	position: fixed;
	top: 0;
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	width: 100%;

	/* BG behaviour */
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

BG behaviour in seperate class gives more flexibility controlling them SASS version available in /dist folder

#2

If <section> is your container, make the parallax element inside it

<section>
	<div class="parallax" data-parallax-image="path/to/your_image">
</section>

You can also use background-image to define your image instead of using data-parallax-image=""

#3

Include the script to your project

<script src="node_modules/universal-parallax/dist/universal-parallax.min.js"></script>

#4

Initialize the JS function

<script>
	new universalParallax().init();
</script>

That's it! 🏁

Custom speed

You can change the parallax speed; the higher the number, the slower the parallax effect

new universalParallax().init({
	speed: 6.0
});

speed: 1 is the minimum value before the background image is fixed

Tips

Opacity

If you want your backround color to shine through or dampen the image without making it a .png - just add transparency to it

.parallax {
	opacity: 0.5;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].