@jzetlen/pressure
Version:
Pressure is a lightweight JavaScript library for both Force Touch and 3D Touch through a single API.
24 lines (18 loc) • 759 B
JavaScript
//--------------------- Public API Section ---------------------//
// this is the Pressure Object, this is the only object that is accessible to the end user
// only the methods in this object can be called, making it the "public api"
var Pressure = {
// targets any device with Force or 3D Touch
set(selector, closure, options){
loopPressureElements(selector, closure, options);
},
// set configuration options for global config
config(options){
Config.set(options);
},
// the map method allows for interpolating a value from one range of values to another
// example from the Arduino documentation: https://www.arduino.cc/en/Reference/Map
map(x, in_min, in_max, out_min, out_max){
return map.apply(null, arguments);
}
}