@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.
28 lines • 1.18 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 enter into the new element
* it is triggered from AvgPointerEvents class
* it is fired when the user enters the element
*/
export class VgPointerEnter extends ACommonMouseProps {
constructor(mouseProp, customProps) {
super(EVgMouseEvents.MOUSE_ENTER, 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.vgpointerenter;
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-enter.js.map