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

@hscmap/inertial-mouse

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hscmap/inertial-mouse - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

example/main.ts

@@ -5,4 +5,6 @@ import { InertialMouse } from "../src"

window.addEventListener('load', e => {
const sandbox = document.querySelector('.sandbox') as HTMLElement
const cursor = document.querySelector('.cursor') as HTMLElement
const sandbox = document.querySelector('.sandbox') as HTMLElement
const dxText = document.querySelector('[name="dx"]') as HTMLInputElement
const dyText = document.querySelector('[name="dy"]') as HTMLInputElement

@@ -16,2 +18,4 @@ const im = new InertialMouse(sandbox, {

cursor.style.top = `${e.r.y}px`
dxText.value = `${e.d.x}`
dyText.value = `${e.d.y}`
},

@@ -18,0 +22,0 @@ stop() {

@@ -5,2 +5,3 @@ export declare class Coord {

constructor(x: number, y: number);
clone(): Coord;
}

@@ -7,0 +8,0 @@ export interface Callbacks {

6

lib/index.js

@@ -8,2 +8,3 @@ "use strict";

}
Coord.prototype.clone = function () { return new Coord(this.x, this.y); };
return Coord;

@@ -81,5 +82,6 @@ }());

}
this.cb.move && this.cb.move(new MoveEvent(this.r, new Coord(this.r.x - this.lastR.x, this.r.y - this.lastR.y)));
var dr = new Coord(this.r.x - this.lastR.x, this.r.y - this.lastR.y);
this.cb.move && this.cb.move(new MoveEvent(this.r, dr));
this.lastT = now;
this.lastR = this.r;
this.lastR = this.r.clone();
};

@@ -86,0 +88,0 @@ InertialMouse.prototype.coord = function (e) {

{
"name": "@hscmap/inertial-mouse",
"version": "1.0.0",
"version": "1.0.1",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

export class Coord {
constructor(public x: number, public y: number) { }
clone() { return new Coord(this.x, this.y) }
}

@@ -99,5 +100,6 @@

this.cb.move && this.cb.move(new MoveEvent(this.r, new Coord(this.r.x - this.lastR.x, this.r.y - this.lastR.y)))
const dr = new Coord(this.r.x - this.lastR.x, this.r.y - this.lastR.y)
this.cb.move && this.cb.move(new MoveEvent(this.r, dr))
this.lastT = now
this.lastR = this.r
this.lastR = this.r.clone()
}

@@ -104,0 +106,0 @@

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