NeuralNetworkClassifier: Buttons
The easiest way
npm install @lampix/core @lampix/dom
import lampixDOM from '@lampix/dom';
// Behind the scenes, this will draw a button with a scaling animation
const x = window.innerWidth / 2;
const y = window.innerHeight / 2;
const callback = () => {
console.log('Button activated!');
};
// Minimum necessary
lampixDOM.buttons.generate(x - 100, y, callback)
.then((firstButton) => console.log('Button ready to be used'));
// A little configuration goes a long way
const options = {
label: 'Generic button',
labelPosition: 'top',
scaleFactor: 1.2, // base animation is a simple scale animation to provide action feedback
animationDuration: 350 // enables a circle-filling style loader and syncs the scaling animation to this value as well
};
lampixDOM.buttons.generate(x + 100, y, callback, options)
.then((secondButton) => console.log('Another button ready to be used'));Hooking up your own button using the button preset
npm install @lampix/core
Hooking up your own button creating the watcher data structure yourself
Last updated
Was this helpful?