@mangoweb/parallax
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -27,3 +27,3 @@ "use strict"; | ||
var reachDistance = window.innerHeight * PARALLAX_REACH; | ||
var offset = clamp(-1, (_this.getElementYCenter() - (window.scrollY + window.innerHeight / 2)) / reachDistance, 1); | ||
var offset = clamp(-1, -(_this.getElementYCenter() - (window.scrollY + window.innerHeight / 2)) / reachDistance, 1); | ||
_this.el.style.setProperty("--" + _this.getPropOrElse('customProperty', 'parallax'), "" + offset); | ||
@@ -30,0 +30,0 @@ }; |
{ | ||
"name": "@mangoweb/parallax", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Watches elements vertical position in viewport.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -23,3 +23,3 @@ import { Component } from '@mangoweb/scripts-base' | ||
const reachDistance = window.innerHeight * PARALLAX_REACH | ||
const offset = clamp(-1, (this.getElementYCenter() - (window.scrollY + window.innerHeight / 2)) / reachDistance, 1) | ||
const offset = clamp(-1, -(this.getElementYCenter() - (window.scrollY + window.innerHeight / 2)) / reachDistance, 1) | ||
@@ -26,0 +26,0 @@ this.el.style.setProperty(`--${this.getPropOrElse('customProperty', 'parallax')}`, `${offset}`) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6664