Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoannchb-pro/preshoot.js
Preshoot.js is a library inspired from premonish.js to predict on each object the user is going only with attributes to execute a function or to change the class of the object.
https://github.com/yoannchb-pro/preshoot.js
attributes calculator easy-to-use js prediction premonish preshoot
Last synced: about 1 month ago
JSON representation
Preshoot.js is a library inspired from premonish.js to predict on each object the user is going only with attributes to execute a function or to change the class of the object.
- Host: GitHub
- URL: https://github.com/yoannchb-pro/preshoot.js
- Owner: yoannchb-pro
- License: mit
- Created: 2021-04-24T07:56:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-24T15:09:16.000Z (over 3 years ago)
- Last Synced: 2024-10-24T22:12:40.307Z (3 months ago)
- Topics: attributes, calculator, easy-to-use, js, prediction, premonish, preshoot
- Language: HTML
- Homepage:
- Size: 554 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PreshootJs v1.1
Preshoot.js is a library inspired from premonish to predict on each object the user is going only with attributes to execute a function or to change the class of the object.
## Update
- new option: window.preshootConfig.reset
- new test pages## Demo
- https://yoannchb-pro.github.io/Preshoot.js/
- https://yoannchb-pro.github.io/Preshoot.js/formulaire
- https://yoannchb-pro.github.io/Preshoot.js/test## Import
```html```
## How to use ?
Config preshoot.js
```js
window.preshootConfig = {
debug: false, //Show a line where the cursor is going
detectWithArea: false, //If the cursor is not going on an object preshoot.js will detect the closer object
mouseInterval: 30, //The calcul will be make each 30 mouse move loop
maxDistance: 100, //Execute the function and put the class only if the mouse is between 0% and 100% of the distance
reset: true, //Reset the class of the last matched object if there is no matching anymore
onError: (el, msg) => {
console.warn("Error during executing function ", {
error: true,
element: el,
message: msg
}); //Function to display when there is an error while executing the function of an object
}
}
```
Set the default class when matching
```css
/* Default class when matching */
.preshoot{
border: 5px solid red!important;
}
```
How to use attributes ?
```html
```