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

@invision-www/smooth-scroll

Package Overview
Dependencies
Maintainers
8
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@invision-www/smooth-scroll - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

12

build/smoothScroll.js

@@ -6,3 +6,3 @@ 'use strict';

function _load_scrollTo() {
return _scrollTo = _interopRequireDefault(require('./scrollTo'));
return _scrollTo = _interopRequireDefault(require('@invision-www/scroll-to'));
}

@@ -13,12 +13,12 @@

var handleMouseWheel = function handleMouseWheel(e) {
e.preventDefault();
e.preventDefault();
var delta = e.wheelDelta / 120 || -e.detail / 3;
var to = window.scrollY - parseInt(delta * 50, 10);
var delta = e.wheelDelta / 120 || -e.detail / 3;
var to = window.scrollY - parseInt(delta * 50, 10);
(0, (_scrollTo || _load_scrollTo()).default)({ to: to, speed: 200 });
(0, (_scrollTo || _load_scrollTo()).default)({ to: to, speed: 200 });
};
['mousewheel', 'DOMMouseScroll'].map(function (evt) {
return document.body.addEventListener(evt, handleMouseWheel);
return document.body.addEventListener(evt, handleMouseWheel);
});
{
"name": "@invision-www/smooth-scroll",
"version": "1.0.3",
"version": "1.0.4",
"description": "",

@@ -15,3 +15,6 @@ "main": "dist/smoothScroll.js",

"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"@invision-www/scroll-to": "^1.0.3"
}
}

@@ -1,12 +0,12 @@

import scrollTo from './scrollTo'
import scrollTo from '@invision-www/scroll-to';
const handleMouseWheel = e => {
e.preventDefault()
e.preventDefault();
const delta = e.wheelDelta / 120 || -e.detail / 3
const to = window.scrollY - parseInt(delta * 50, 10)
const delta = e.wheelDelta / 120 || -e.detail / 3;
const to = window.scrollY - parseInt(delta * 50, 10);
scrollTo({ to, speed: 200 })
}
scrollTo({ to, speed: 200 });
};
['mousewheel', 'DOMMouseScroll'].map(evt => document.body.addEventListener(evt, handleMouseWheel))
['mousewheel', 'DOMMouseScroll'].map(evt => document.body.addEventListener(evt, handleMouseWheel));
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