0.2.1 • Published 5 years ago
js-parallax v0.2.1
js-parallax
0.2.0 (React-Ready)
Demo: https://blanik.me/projects/js-parallax
Install
yarn add js-parallax
or npm add js-parallax
Build
yarn build
Import
import JsParallax from "js-parallax"
Sample
new JsParallax([
{
selector: "div",
values: [{
name: "window",
type: "window", /* default! */
from: 0,
to: 180,
unit: "deg"
}, {
name: "toTop",
type: "toTop",
from: 0,
to: 180,
unit: "deg"
}, {
name: "toBottom",
type: "toBottom",
from: 0,
to: 180,
unit: "deg"
}, {
name: "mouseX",
type: "mouseX",
from: 0,
to: 180,
unit: "deg"
}, {
name: "mouseY",
type: "mouseY",
from: 0,
to: 180,
unit: "deg"
}
]
}
], {react: true/false}, {decimals: 0}).mount();
.box {
position: relative;
left: var(--x);
display: block;
width: 128px;
height: 128px;
margin-top: calc(50vh - 64px);
background: #a00;
transform: rotate(var(--xyz));
transform-origin: center center;
transition: all 150ms linear;
}
0.2.1
5 years ago
0.2.0
5 years ago
0.2.0-pre3
5 years ago
0.2.0-pre2
5 years ago
0.2.0-pre1
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1-x
5 years ago
0.1.1-d
5 years ago
0.1.1-c
5 years ago
0.1.1-b
5 years ago
0.1.1-a
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago