Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mangoweb/parallax

Package Overview
Dependencies
Maintainers
6
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mangoweb/parallax - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

lib/index.d.ts

@@ -8,3 +8,3 @@ import { Component } from '@mangoweb/scripts-base';

init(): void;
onScroll: () => void;
update: () => void;
getElementYCenter: () => number;

@@ -11,0 +11,0 @@ }

@@ -26,3 +26,3 @@ "use strict";

var _this = _super !== null && _super.apply(this, arguments) || this;
_this.onScroll = function () {
_this.update = function () {
var reachDistance = window.innerHeight * PARALLAX_REACH;

@@ -39,4 +39,4 @@ var offset = clamp(-1, (_this.getElementYCenter() - (window.scrollY + window.innerHeight / 2)) / reachDistance, 1);

Parallax.prototype.init = function () {
window.addEventListener('scroll', this.onScroll, { passive: true });
this.onScroll();
light_bounds_1.lightBounds(this.el, this.update);
this.update();
};

@@ -43,0 +43,0 @@ Parallax.componentName = 'Parallax';

{
"name": "@mangoweb/parallax",
"version": "0.0.3",
"version": "0.0.4",
"description": "Watches elements vertical position in viewport.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -18,7 +18,7 @@ import { Component } from '@mangoweb/scripts-base'

init() {
window.addEventListener('scroll', this.onScroll, { passive: true })
this.onScroll()
lightBounds(this.el, this.update)
this.update()
}
onScroll = () => {
update = () => {
const reachDistance = window.innerHeight * PARALLAX_REACH

@@ -25,0 +25,0 @@ const offset = clamp(-1, (this.getElementYCenter() - (window.scrollY + window.innerHeight / 2)) / reachDistance, 1)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc