MouseMove

JavaScript automated mouse cursor

Introduction


MouseMove is a compact JavaScript library that simplifies the implementation of mouse movements and actions, by following an array of user-defined commands or functions. It offers users a user-friendly and efficient way to enhance interactive automation.

let _list =
[
    'node',                              // Elemental Identifier
    'body > ul > li:nth-child(1)',       // CSS Selector
    '//input[@id = "fakebox-input"]'     // XPath
]

This library offers two distinct methods for defining cursor automation.

Implicit Functionality


Provides users with a predefined method for a simplified process; for those who seek a straightforward automation solution.

Each element can be expressed by either an element identifierCSS Selector, or XPath:

Explicit Functionality


Allows users to create customizable cursor movements and actions, through a pre-defined object type.

idelement expressed by either an element identifierCSS Selector, or XPath
actionsets a ( final ) action for each DOM element
binduser-defined anonymous function(s) associated with each element

Example structure

let _object =
{
    id: 'ui-node',    // [REQUIRED] ... type: <string>
    bind:             // [OPTIONAL] ... type: Object.<string, function>
    {
        onmouseover: ( ) =>
        {
            this.style.color           = 'rgb(0, 1, 1)';
            this.style.backgroundColor = 'rgb(2, 3, 5)';

            this.parentElement.nextElementSibling.style.display = 'block';
        },
        onmouseout: ( ) =>
        {
            // code ...
        }
    },
    action: 'click'   // [OPTIONAL] ... type: <string>
}

Note: visit MouseMove's GitHub page for further details.

Conclusion

Incorporating MouseMove into your toolkit can enable you to create dynamic and engaging web interfaces and applications. Its simplicity and customizability make it a valuable asset for anyone seeking to automate a web interface.

Please login or register to comment!