@learn-hunger/visual-gestures
Version:
VisualGestures.js is a package that empowers users to effortlessly control the cursor, including actions such as hover, click, drag, and drop, through precise finger movements in the air.
27 lines • 1.12 kB
JavaScript
import { DefaultConfig } from "../../config/defalut-config";
import { EVgMouseEvents } from "../../utilities/vg-constants";
import { ACommonMouseProps } from "../abstracts/vg-pointer-props-abstract";
/**
* custom Event which is fired when the user do drop action
* it is triggered from AvgPointerEvents class
*/
export class VgPointerDrop extends ACommonMouseProps {
constructor(mouseProp, customProps) {
super(EVgMouseEvents.MOUSE_DROP, mouseProp, customProps);
// this.setCursor();
}
/**
* to set the cursor path or image like hand pointer image etc
* TODO since the fluctations are high between the events ,
* the image is getting fluctuated so currently hold
*/
setCursor() {
const { path, scale, showCursor } = DefaultConfig.instance.cursor.vgpointerdrop;
const { baseURI } = DefaultConfig.instance.cursor;
if (showCursor && this.cursorElement.src != baseURI + path) {
this.cursorElement.src = path;
this.cursorElement.style.scale = scale.toString();
}
}
}
//# sourceMappingURL=vg-pointer-drop.js.map