New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adoratorio/hades

Package Overview
Dependencies
Maintainers
4
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adoratorio/hades - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

4

dist/index.d.ts

@@ -26,8 +26,12 @@ import { MODE, DIRECTION, TRACK, HadesOptions, Boundries, Vec2, Easing } from "./declarations";

private scrollbar;
private stopNeedEmission;
private startNeedEmission;
amount: Vec2;
velocity: Vec2;
running: boolean;
still: boolean;
constructor(options: Partial<HadesOptions>);
private frame;
private scroll;
private emitStillChange;
scrollTo(position: Partial<Vec2>, duration: number): void;

@@ -34,0 +38,0 @@ play(): void;

@@ -32,5 +32,8 @@ "use strict";

this.scrollbar = null;
this.stopNeedEmission = false;
this.startNeedEmission = true;
this.amount = { x: 0, y: 0 };
this.velocity = { x: 0, y: 0 };
this.running = false;
this.still = true;
var defaults = {

@@ -172,3 +175,23 @@ mode: declarations_1.MODE.VIRTUAL,

};
// Use 4 digits precision
this.velocity.x = parseFloat(this.velocity.x.toFixed(4));
this.velocity.y = parseFloat(this.velocity.y.toFixed(4));
this.prevAmount = current;
// Check if the scroll is still animating or not
if (this.velocity.y === 0 && this.velocity.x === 0) {
this.still = true;
if (this.stopNeedEmission) {
this.emitStillChange('stop');
this.stopNeedEmission = false;
this.startNeedEmission = true;
}
}
else {
this.still = false;
if (this.startNeedEmission) {
this.emitStillChange('start');
this.startNeedEmission = false;
this.stopNeedEmission = true;
}
}
// Update scrollbar tracks

@@ -231,2 +254,9 @@ if (this.options.scrollbar !== null && this.scrollbar !== null) {

};
Hades.prototype.emitStillChange = function (type) {
if (this.options.emitGlobal) {
var eventInit = {};
var customEvent = new CustomEvent("hades-" + type, eventInit);
window.dispatchEvent(customEvent);
}
};
Hades.prototype.scrollTo = function (position, duration) {

@@ -233,0 +263,0 @@ if (this.virtual) {

2

package.json
{
"name": "@adoratorio/hades",
"version": "0.1.9",
"version": "0.1.10",
"description": "A smooth scrollbar based on Hermes, scroll down 'till hell",

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

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