Detect user intent and trigger a callback.
const options = {
mode: 'idle',
events: ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart'],
delay: 10000,
multiple: false,
};
const cb = (mode, opts) => {
console.log(`Callback -> mode is "${mode}" with options of "${JSON.stringify(opts)}"`);
};
new UserIntent(cb, options);
const options = {
mode: 'scroll',
percentDown: 50,
percentUp: 0,
offsetTop: 0,
offsetBottom: 0,
};
const cb = (mode, opts) => {
console.log(`Callback -> mode is "${mode}" with options of "${JSON.stringify(opts)}"`);
};
new UserIntent(cb, options);
const options = {
mode: 'target',
target: '',
offsetTop: 0,
offsetBottom: 0,
multiple: false,
};
const cb = (mode, opts) => {
console.log(`Callback -> mode is "${mode}" with options of "${JSON.stringify(opts)}"`);
};
new UserIntent(cb, options);
const options = {
mode: 'focus',
multiple: false,
};
const cb = (mode, opts) => {
console.log(`Callback -> mode is "${mode}" with options of "${JSON.stringify(opts)}"`);
};
new UserIntent(cb, options);
const options = {
mode: 'out',
multiple: false,
};
const cb = (mode, opts) => {
console.log(`Callback -> mode is "${mode}" with options of "${JSON.stringify(opts)}"`);
};
new UserIntent(cb, options);
Install Node.js and then open the Terminal/CMD and navigate to the project's folder. Run the following command:
npm install
npm start
npm run build
Builds the app for production to the build
folder.\