Pressure.js

Pressure is a JavaScript library that makes dealing with Apple's Force Touch and 3D Touch simple. Force Touch for new Macs and 3D Touch for the new iPhone 6s and 6s Plus, all bundled under one roof with a simple API that makes working with them painless.
Pressure gives you a handle on browsers that do and don't support Force or 3D touch so you can have sensible fallbacks for users that don't support it.
   

 Current Browser/Device Support
  •  iPhone 6s (safari)
  •  iPhone 6s Plus (safari
  •  MacBook 2015 (safari)
  •  13" MacBook Pro 2015 (safari)
  •  15" MacBook Pro 2015 (safari)
  •  Magic Trackpad 2 (safari)
  • (future devices and browser that support force will be added when they come out)
If you are not using one of the devices / browsers listed above, here is a gif to show it in action.
Example:
1. Pressure Change
The best part about Pressure is that is uses a single API that works on both Force Touch and 3D Touch. (note: Apple currently only has support for desktop and mobile safari, but luckily with pressure you can test for that)
2. Unblur Photo
The harder you press on the image the less blurry it will become.
(try pressing with variable amounts of pressure)

3. Text Size
The harder you press on the text, the bigger it gets. This could be useful for accessibility on online articles.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 
4. Rotating Square
The harder you press on the button, the farther the image will spin.
(try pressing with variable amounts of pressure)

5. "Deep" or Force Press
Press hard on the button, a "Deep" or Force press will occur and launch a bootstrap popover.
 
 for more details : http://pressurejs.com/

Comments

Popular posts from this blog

Export data from mysql db to csv file using java

Secure Database Connectivity in node.js with mysql

Java Web Scraping